You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The usermod BME280 does not compile (with default platformio configuration). Problem is a call to String(..) (constructor) that is ambigious. This affects at least the ESP32-C3 framework.
To Reproduce Bug
Compile wled for ESP32-C3 fails, if USERMOD_BME280 is defined.
Expected Behavior
Compile without errors.
Install Method
Self-Compiled
What version of WLED?
0_15_0 branch of today
Which microcontroller/board are you seeing the problem on?
ESP32-C3
Relevant log/trace output
In file included from wled00/usermods_list.cpp:53:
wled00/../usermods/BME280_v2/usermod_bme280.h: In member function'virtual void UsermodBME280::loop()':wled00/../usermods/BME280_v2/usermod_bme280.h:250:77: error: call of overloaded 'String(float&, uint8_t&)' is ambiguous publishMqtt("temperature", String(temperature, TemperatureDecimals).c_str()); ^In file included from /home/ian/.platformio/packages/[email protected]/cores/esp32/Arduino.h:176, from wled00/wled.h:69, from wled00/usermods_list.cpp:1:/home/ian/.platformio/packages/[email protected]/cores/esp32/WString.h:79:18: note: candidate: 'String::String(long long unsigned int, unsigned char)' explicit String(unsigned long long, unsigned char base = 10); ^~~~~~/home/ian/.platformio/packages/[email protected]/cores/esp32/WString.h:78:18: note: candidate: 'String::String(long long int, unsigned char)' explicit String(long long, unsigned char base = 10); ^~~~~~/home/ian/.platformio/packages/[email protected]/cores/esp32/WString.h:77:18: note: candidate: 'String::String(double, unsigned int)' explicit String(double, unsigned int decimalPlaces = 2); ^~~~~~/home/ian/.platformio/packages/[email protected]/cores/esp32/WString.h:76:18: note: candidate: 'String::String(float, unsigned int)' explicit String(float, unsigned int decimalPlaces = 2); ^~~~~~/home/ian/.platformio/packages/[email protected]/cores/esp32/WString.h:75:18: note: candidate: 'String::String(long unsigned int, unsigned char)' explicit String(unsigned long, unsigned char base = 10); ^~~~~~/home/ian/.platformio/packages/[email protected]/cores/esp32/WString.h:74:18: note: candidate: 'String::String(long int, unsigned char)' explicit String(long, unsigned char base = 10); ^~~~~~/home/ian/.platformio/packages/[email protected]/cores/esp32/WString.h:73:18: note: candidate: 'String::String(unsigned int, unsigned char)' explicit String(unsigned int, unsigned char base = 10); ^~~~~~/home/ian/.platformio/packages/[email protected]/cores/esp32/WString.h:72:18: note: candidate: 'String::String(int, unsigned char)' explicit String(int, unsigned char base = 10); ^~~~~~/home/ian/.platformio/packages/[email protected]/cores/esp32/WString.h:71:18: note: candidate: 'String::String(unsigned char, unsigned char)' explicit String(unsigned char, unsigned char base = 10); ^~~~~~*** [.pio/build/esp32c3dev/src/usermods_list.cpp.o] Error 1
Anything else?
The "decimals" (like TemperatureDecimal etc.) are of typeuint8_t, which is ambigious because there ist also a String(int, unsigned char), so gcc does not know if it should implicitly cast the uint8_t to unsigned char or unsigned int.
Solution is to excplicitly cast the "Decimals" to unsigned int.
PR will follow soon.
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
What happened?
The usermod BME280 does not compile (with default platformio configuration). Problem is a call to
String(..)
(constructor) that is ambigious. This affects at least the ESP32-C3 framework.To Reproduce Bug
Compile wled for ESP32-C3 fails, if
USERMOD_BME280
is defined.Expected Behavior
Compile without errors.
Install Method
Self-Compiled
What version of WLED?
0_15_0 branch of today
Which microcontroller/board are you seeing the problem on?
ESP32-C3
Relevant log/trace output
Anything else?
The "decimals" (like
TemperatureDecimal
etc.) are of typeuint8_t
, which is ambigious because there ist also aString(int, unsigned char)
, so gcc does not know if it should implicitly cast the uint8_t tounsigned char
orunsigned int
.Solution is to excplicitly cast the "Decimals" to
unsigned int
.PR will follow soon.
Code of Conduct
The text was updated successfully, but these errors were encountered: