Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wire.h signature uint8_t requestFrom(uint8_t, uint8_t); (and others) missing in ArduinoCore-megaavr #11820

Open
noiasca opened this issue Sep 18, 2022 · 0 comments
Labels
Library: Wire The Wire Arduino library Type: Bug

Comments

@noiasca
Copy link

noiasca commented Sep 18, 2022

Wire.h in ArduinoCore-megaavr for Arduino Nano Every misses signatures which are used in the ArduinoCore

in megaavr core

    size_t requestFrom(uint8_t, **size_t**);
    size_t requestFrom(uint8_t, **size_t**, bool);
    size_t requestFrom(int, int);
    size_t requestFrom(int, int, int);

in the Arduino Core
from https://github.com/arduino/ArduinoCore-avr/blob/master/libraries/Wire/src/Wire.h

    uint8_t requestFrom(uint8_t, uint8_t);
    uint8_t requestFrom(uint8_t, uint8_t, uint8_t);
    uint8_t requestFrom(uint8_t, uint8_t, uint32_t, uint8_t, uint8_t);
    uint8_t requestFrom(int, int);
    uint8_t requestFrom(int, int, int);

this miss match can throw warnings in libraries using the interface according to the the Arduino-Core - which i consider as "standard" how to do...

example

#include <Wire.h>

void foo()
{
  uint8_t address = 1;
  Wire.requestFrom(address, (uint8_t)1);
}

void setup() {
  Wire.begin();
}

void loop() {
}

brings


C:\Daten\myrepository\Arduino\Forum no SVN\sketch_sep18a\sketch_sep18a.ino: In function 'void foo()':
C:\Daten\myrepository\Arduino\Forum no SVN\sketch_sep18a\sketch_sep18a.ino:7:41: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
     Wire.requestFrom(address, (uint8_t)1);
                                         ^
In file included from C:\Daten\myrepository\Arduino\Forum no SVN\sketch_sep18a\sketch_sep18a.ino:2:0:
C:\Users\werner\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\libraries\Wire\src/Wire.h:63:12: note: candidate 1: size_t TwoWire::requestFrom(int, int)
     size_t requestFrom(int, int);
            ^~~~~~~~~~~
C:\Users\werner\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\libraries\Wire\src/Wire.h:61:12: note: candidate 2: virtual size_t TwoWire::requestFrom(uint8_t, size_t)
     size_t requestFrom(uint8_t, size_t);
            ^~~~~~~~~~~

@noiasca noiasca changed the title Wire.h signature uint8_t requestFrom(uint8_t, uint8_t); (and others) missing Wire.h signature uint8_t requestFrom(uint8_t, uint8_t); (and others) missing in ArduinoCore-megaavr Sep 18, 2022
@per1234 per1234 added Type: Bug Library: Wire The Wire Arduino library labels Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Library: Wire The Wire Arduino library Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants