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

Compilation errors with ESP32-C3 and ESP8266 #7

Open
EUA opened this issue Sep 19, 2023 · 1 comment
Open

Compilation errors with ESP32-C3 and ESP8266 #7

EUA opened this issue Sep 19, 2023 · 1 comment
Assignees

Comments

@EUA
Copy link

EUA commented Sep 19, 2023

I think it has some issues.
Tried to compile with Arduino-IDE 2.2,1

Here is the compilation errors when I try to compile for ESP32C3.
Also there are some compilation errors with ESP8266..

/home/death/Arduino/libraries/CST816S/CST816S.cpp: In member function 'uint8_t CST816S::i2c_read(uint16_t, uint8_t, uint8_t*, uint32_t)':
/home/death/Arduino/libraries/CST816S/CST816S.cpp:173:38: error: call of overloaded 'requestFrom(uint16_t&, uint32_t&, bool)' is ambiguous
   Wire.requestFrom(addr, length, true);
                                      ^
In file included from /home/death/Arduino/libraries/CST816S/CST816S.cpp:26:
/home/death/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/Wire/src/Wire.h:119:12: note: candidate: 'size_t TwoWire::requestFrom(uint16_t, size_t, bool)'
     size_t requestFrom(uint16_t address, size_t size, bool sendStop);
            ^~~~~~~~~~~
/home/death/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/Wire/src/Wire.h:120:13: note: candidate: 'uint8_t TwoWire::requestFrom(uint16_t, uint8_t, bool)'
     uint8_t requestFrom(uint16_t address, uint8_t size, bool sendStop);
             ^~~~~~~~~~~
/home/death/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/Wire/src/Wire.h:121:13: note: candidate: 'uint8_t TwoWire::requestFrom(uint16_t, uint8_t, uint8_t)'
     uint8_t requestFrom(uint16_t address, uint8_t size, uint8_t sendStop);
             ^~~~~~~~~~~
/home/death/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/Wire/src/Wire.h:122:12: note: candidate: 'size_t TwoWire::requestFrom(uint8_t, size_t, bool)'
     size_t requestFrom(uint8_t address, size_t len, bool stopBit);
            ^~~~~~~~~~~
/home/death/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/Wire/src/Wire.h:124:13: note: candidate: 'uint8_t TwoWire::requestFrom(uint8_t, uint8_t, uint8_t)'
     uint8_t requestFrom(uint8_t address, uint8_t size, uint8_t sendStop);
             ^~~~~~~~~~~
/home/death/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/Wire/src/Wire.h:126:13: note: candidate: 'uint8_t TwoWire::requestFrom(int, int, int)'
     uint8_t requestFrom(int address, int size, int sendStop);
             ^~~~~~~~~~~

exit status 1

Compilation error: exit status 1

For fixing it, you should use size_t at wire definitions...

    uint8_t i2c_read(uint16_t addr, uint8_t reg_addr, uint8_t * reg_data, size_t length);
    uint8_t i2c_write(uint8_t addr, uint8_t reg_addr, const uint8_t * reg_data, size_t length);
@georgemclaughlin
Copy link
Contributor

This appears to be fixed with the 1.2.0 release.

https://github.com/fbiego/CST816S/releases/tag/1.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants