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

uint32_t type mismatch for ESP32 #79

Open
SFrijters opened this issue Feb 23, 2024 · 0 comments
Open

uint32_t type mismatch for ESP32 #79

SFrijters opened this issue Feb 23, 2024 · 0 comments

Comments

@SFrijters
Copy link

When trying to compile the TrainHub example for esp32:esp32:XIAO_ESP32C3 I ran into the following error

/<ARDUINO_DIRECTORIES_USER>/internal/Legoino_1.1.0_f5d0c9dbfa55ee37/Legoino/src/LegoinoCommon.cpp:101:10: error: no declaration matches 'uint32_t LegoinoCommon::ReadUInt32LE(uint8_t*, int)'
 uint32_t LegoinoCommon::ReadUInt32LE(uint8_t *data, int offset = 0)
          ^~~~~~~~~~~~~
In file included from /<ARDUINO_DIRECTORIES_USER>/internal/Legoino_1.1.0_f5d0c9dbfa55ee37/Legoino/src/LegoinoCommon.cpp:11:
/<ARDUINO_DIRECTORIES_USER>/internal/Legoino_1.1.0_f5d0c9dbfa55ee37/Legoino/src/LegoinoCommon.h:27:23: note: candidate is: 'static unsigned int LegoinoCommon::ReadUInt32LE(uint8_t*, int)'
   static unsigned int ReadUInt32LE(uint8_t *data, int offset);
                       ^~~~~~~~~~~~
/<ARDUINO_DIRECTORIES_USER>/internal/Legoino_1.1.0_f5d0c9dbfa55ee37/Legoino/src/LegoinoCommon.h:17:7: note: 'class LegoinoCommon' defined here
 class LegoinoCommon
       ^~~~~~~~~~~~~
/<ARDUINO_DIRECTORIES_USER>/internal/Legoino_1.1.0_f5d0c9dbfa55ee37/Legoino/src/LegoinoCommon.cpp:107:9: error: no declaration matches 'int32_t LegoinoCommon::ReadInt32LE(uint8_t*, int)'
 int32_t LegoinoCommon::ReadInt32LE(uint8_t *data, int offset = 0)
         ^~~~~~~~~~~~~
In file included from /<ARDUINO_DIRECTORIES_USER>/internal/Legoino_1.1.0_f5d0c9dbfa55ee37/Legoino/src/LegoinoCommon.cpp:11:
/<ARDUINO_DIRECTORIES_USER>/internal/Legoino_1.1.0_f5d0c9dbfa55ee37/Legoino/src/LegoinoCommon.h:28:21: note: candidate is: 'static int LegoinoCommon::ReadInt32LE(uint8_t*, int)'
   static signed int ReadInt32LE(uint8_t *data, int offset);
                     ^~~~~~~~~~~
/<ARDUINO_DIRECTORIES_USER>/internal/Legoino_1.1.0_f5d0c9dbfa55ee37/Legoino/src/LegoinoCommon.h:17:7: note: 'class LegoinoCommon' defined here
 class LegoinoCommon
       ^~~~~~~~~~~~~

I think this may be related to espressif/esp-idf#6906 (comment) , assuming it used to work?

For me, replacing unsigned int -> unsigned long and signed int -> signed long in https://github.com/corneliusmunz/legoino/blob/master/src/LegoinoCommon.h solved the issue, but I'm not sure why the function prototypes don't use uint32_t in the first place, like their implementations?

@SFrijters SFrijters changed the title uint32_t type for ESP mismatch uint32_t type for ESP32 mismatch Feb 23, 2024
@SFrijters SFrijters changed the title uint32_t type for ESP32 mismatch uint32_t type mismatch for ESP32 Feb 23, 2024
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

1 participant