adafruit / Adafruit_NeoPixel

Arduino library for controlling single-wire LED pixels (NeoPixel, WS2812, etc.)
GNU Lesser General Public License v3.0
3.07k stars 1.27k forks source link

esp32: different espShow declarations, use uint16_t #400

Open PBrunot opened 1 month ago

PBrunot commented 1 month ago

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

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)