arduino-libraries / ArduinoECCX08

76 stars 49 forks source link

Support for ESP32 #25

Open fabltd opened 4 years ago

fabltd commented 4 years ago

Hi

This will not compile on the ESP32 due to differences in the wire lib.

Please fix.

Bach-Danielsson commented 4 years ago

Hi In the ECCX08.cpp file change from:

while (_wire->requestFrom((uint8_t)_address, (size_t)responseSize, (bool)true) != responseSize && retries--);

to:

while (_wire->requestFrom((uint8_t)_address, (uint8_t)responseSize, (bool)true) != responseSize && retries--);

then you dont get the comment from your compiler regarding differences in the wire lib,

fabltd commented 4 years ago

Hi

Still a lot of warnings:

lib/ATECCx08/src/ECCX08.cpp: In member function 'int ECCX08Class::receiveResponse(void*, size_t)':
lib/ATECCx08/src/ECCX08.cpp:724:81: 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:
   while (_wire->requestFrom((uint8_t)_address, (uint8_t)responseSize, (bool)true) != responseSize && retries--);
                                                                                 ^
In file included from lib/ATECCx08/src/ECCX08.h:24:0,
                 from lib/ATECCx08/src/ECCX08.cpp:22:

/Users/.platformio/packages/framework-arduinoespressif32/libraries/Wire/src/Wire.h:98:13: note: candidate 1: uint8_t TwoWire::requestFrom(int, int, int)
     uint8_t requestFrom(int address, int size, int sendStop);
             ^
/Users/jeremy/.platformio/packages/framework-arduinoespressif32/libraries/Wire/src/Wire.h:96:13: note: candidate 2: uint8_t TwoWire::requestFrom(uint8_t, uint8_t, uint8_t)
     uint8_t requestFrom(uint8_t address, uint8_t size, uint8_t sendStop);
             ^
lib/ATECCx08/src/ECCX08.cpp:724:81: 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:
   while (_wire->requestFrom((uint8_t)_address, (uint8_t)responseSize, (bool)true) != responseSize && retries--);
                                                                                 ^
In file included from lib/ATECCx08/src/ECCX08.h:24:0,
                 from lib/ATECCx08/src/ECCX08.cpp:22:

/Users/.platformio/packages/framework-arduinoespressif32/libraries/Wire/src/Wire.h:98:13: note: candidate 1: uint8_t TwoWire::requestFrom(int, int, int)
     uint8_t requestFrom(int address, int size, int sendStop);
             ^
/Users/.platformio/packages/framework-arduinoespressif32/libraries/Wire/src/Wire.h:94:13: note: candidate 2: uint8_t TwoWire::requestFrom(uint16_t, uint8_t, uint8_t)
     uint8_t requestFrom(uint16_t address, uint8_t size, uint8_t sendStop);
             ^
lib/ATECCx08/src/ECCX08.cpp:724:81: 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:
   while (_wire->requestFrom((uint8_t)_address, (uint8_t)responseSize, (bool)true) != responseSize && retries--);
                                                                                 ^
In file included from lib/ATECCx08/src/ECCX08.h:24:0,
                 from lib/ATECCx08/src/ECCX08.cpp:22:
/Users/.platformio/packages/framework-arduinoespressif32/libraries/Wire/src/Wire.h:98:13: note: candidate 1: uint8_t TwoWire::requestFrom(int, int, int)
     uint8_t requestFrom(int address, int size, int sendStop);
             ^
/Users/.platformio/packages/framework-arduinoespressif32/libraries/Wire/src/Wire.h:93:13: note: candidate 2: uint8_t TwoWire::requestFrom(uint16_t, uint8_t, bool)
     uint8_t requestFrom(uint16_t address, uint8_t size, bool sendStop);
torntrousers commented 3 years ago

That change suggested by @Bach-Danielsson works for me on an M5Stack IoT EduKit. Would be great to get it out in a release of the library.

torntrousers commented 2 years ago

Also see https://github.com/arduino-libraries/ArduinoECCX08/issues/36 for the same issue with this lib but with a Teensy instead of ESP32