ArduinoECCX08 icon indicating copy to clipboard operation
ArduinoECCX08 copied to clipboard

Support for ESP32

Open fabltd opened this issue 4 years ago • 4 comments

Hi

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

Please fix.

fabltd avatar Jul 10 '20 11:07 fabltd

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,

Bach-Danielsson avatar Aug 10 '20 13:08 Bach-Danielsson

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

fabltd avatar Aug 10 '20 15:08 fabltd

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 avatar Feb 16 '21 07:02 torntrousers

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

torntrousers avatar Oct 16 '21 12:10 torntrousers