Skip to content

Commit cfc346a

Browse files
committed
Fix warnings misc fixes
1 parent b460d0f commit cfc346a

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed

wled00/file.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ File f;
3333

3434
//wrapper to find out how long closing takes
3535
void closeFile() {
36-
DEBUGFS_PRINT(F("Close -> "));
36+
#ifdef WLED_DEBUG_FS
37+
DEBUGFS_PRINT(F("Close -> "));
38+
uint32_t s = millis();
39+
#endif
3740
f.close();
3841
DEBUGFS_PRINTF("took %d ms\n", millis() - s);
3942
doCloseFile = false;

wled00/json.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ void deserializeSegment(JsonObject elem, byte it)
134134
if (sz == 0 && sz > 4) break;
135135

136136
int rgbw[] = {0,0,0,0};
137+
copyArray(icol, rgbw);
137138

138139
if (set < 2) stop = start + 1;
139140
for (uint16_t i = start; i < stop; i++) {

wled00/lx_parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ bool parseLx(int lxValue, byte rgbw[4])
2525
uint16_t ct = (lxValue - 200000000) - (((uint8_t)tmpBri) * 10000);
2626

2727
tmpBri *= 2.55;
28-
constrain(tmpBri, 0, 255);
28+
tmpBri = constrain(tmpBri, 0, 255);
2929

3030
colorKtoRGB(ct, rgbw);
3131
lxRed = rgbw[0]; lxGreen = rgbw[1]; lxBlue = rgbw[2];

wled00/src/dependencies/json/AsyncJson-v6.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class AsyncCallbackJsonWebHandler: public AsyncWebHandler {
144144
virtual void handleBody(AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total) override final {
145145
if (_onRequest) {
146146
_contentLength = total;
147-
if (total > 0 && request->_tempObject == NULL && total < _maxContentLength) {
147+
if (total > 0 && request->_tempObject == NULL && (int)total < _maxContentLength) {
148148
request->_tempObject = malloc(total);
149149
}
150150
if (request->_tempObject != NULL) {

wled00/wled.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ void prepareHostname(char* hostname)
136136
//handle Ethernet connection event
137137
void WiFiEvent(WiFiEvent_t event)
138138
{
139+
#ifdef WLED_USE_ETHERNET
140+
char hostname[25] = "wled-";
141+
#endif
142+
139143
switch (event) {
140144
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_ETHERNET)
141145
case SYSTEM_EVENT_ETH_START:

wled00/wled.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ WLED_GLOBAL bool huePollingEnabled _INIT(false); // poll hue bridge fo
312312
WLED_GLOBAL uint16_t huePollIntervalMs _INIT(2500); // low values (< 1sec) may cause lag but offer quicker response
313313
WLED_GLOBAL char hueApiKey[47] _INIT("api"); // key token will be obtained from bridge
314314
WLED_GLOBAL byte huePollLightId _INIT(1); // ID of hue lamp to sync to. Find the ID in the hue app ("about" section)
315-
WLED_GLOBAL IPAddress hueIP _INIT_N((( 0, 0, 0, 0))); // IP address of the bridge
315+
WLED_GLOBAL IPAddress hueIP _INIT_N(((0, 0, 0, 0))); // IP address of the bridge
316316
WLED_GLOBAL bool hueApplyOnOff _INIT(true);
317317
WLED_GLOBAL bool hueApplyBri _INIT(true);
318318
WLED_GLOBAL bool hueApplyColor _INIT(true);
@@ -481,8 +481,8 @@ WLED_GLOBAL uint8_t tpmPacketCount _INIT(0);
481481
WLED_GLOBAL uint16_t tpmPayloadFrameSize _INIT(0);
482482

483483
// mqtt
484-
WLED_GLOBAL long lastMqttReconnectAttempt _INIT(0);
485-
WLED_GLOBAL long lastInterfaceUpdate _INIT(0);
484+
WLED_GLOBAL unsigned long lastMqttReconnectAttempt _INIT(0);
485+
WLED_GLOBAL unsigned long lastInterfaceUpdate _INIT(0);
486486
WLED_GLOBAL byte interfaceUpdateCallMode _INIT(NOTIFIER_CALL_MODE_INIT);
487487
WLED_GLOBAL char mqttStatusTopic[40] _INIT(""); // this must be global because of async handlers
488488

0 commit comments

Comments
 (0)