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

esp32: different espShow declarations, use uint16_t #400

Open
PBrunot opened this issue Aug 12, 2024 · 0 comments
Open

esp32: different espShow declarations, use uint16_t #400

PBrunot opened this issue Aug 12, 2024 · 0 comments

Comments

@PBrunot
Copy link

PBrunot commented Aug 12, 2024

When compiling with -flto=auto for esp32-s2 platform, the following mistake comes out (2 different declarations for same function with parameter 1 argument type difference)

.pio/libdeps/wokwi/Adafruit NeoPixel/Adafruit_NeoPixel.cpp:390:17: warning: type of 'espShow' does not match original declaration [-Wlto-type-mismatch]
390 | extern "C" void espShow(uint16_t pin, uint8_t *pixels, uint32_t numBytes,
| ^
.pio/libdeps/wokwi/Adafruit NeoPixel/esp.c:37:6: note: type mismatch in parameter 1
37 | void espShow(uint8_t pin, uint8_t *pixels, uint32_t numBytes, boolean is800KHz) {
| ^
.pio/libdeps/wokwi/Adafruit NeoPixel/esp.c:37:6: note: type 'uint8_t' should match type 'uint16_t'
.pio/libdeps/wokwi/Adafruit NeoPixel/esp.c:37:6: note: 'espShow' was previously declared here

  • Conflicts is between esp.c and Adafruit_NeoPixel.cpp definitions

  • Suggest fix is to change esp.c to accept uint16_t, because it will be anyways promoted to int in rmtInit()/rmtWrite() functions.

void espShow(uint8_t pin, uint8_t *pixels, uint32_t numBytes, boolean is800KHz)
void espShow(uint16_t pin, uint8_t *pixels, uint32_t numBytes, boolean is800KHz)
  • After this change warning disappear. I can send you a PR if you wish.
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