Skip to content

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

Open
@noiasca

Description

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);
            ^~~~~~~~~~~

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions