Fix warnings misc fixes

This commit is contained in:
cschwinne 2021-02-27 01:16:06 +01:00
parent b460d0f533
commit cfc346abad
6 changed files with 14 additions and 6 deletions

View File

@ -33,7 +33,10 @@ File f;
//wrapper to find out how long closing takes //wrapper to find out how long closing takes
void closeFile() { void closeFile() {
#ifdef WLED_DEBUG_FS
DEBUGFS_PRINT(F("Close -> ")); DEBUGFS_PRINT(F("Close -> "));
uint32_t s = millis();
#endif
f.close(); f.close();
DEBUGFS_PRINTF("took %d ms\n", millis() - s); DEBUGFS_PRINTF("took %d ms\n", millis() - s);
doCloseFile = false; doCloseFile = false;

View File

@ -134,6 +134,7 @@ void deserializeSegment(JsonObject elem, byte it)
if (sz == 0 && sz > 4) break; if (sz == 0 && sz > 4) break;
int rgbw[] = {0,0,0,0}; int rgbw[] = {0,0,0,0};
copyArray(icol, rgbw);
if (set < 2) stop = start + 1; if (set < 2) stop = start + 1;
for (uint16_t i = start; i < stop; i++) { for (uint16_t i = start; i < stop; i++) {

View File

@ -25,7 +25,7 @@ bool parseLx(int lxValue, byte rgbw[4])
uint16_t ct = (lxValue - 200000000) - (((uint8_t)tmpBri) * 10000); uint16_t ct = (lxValue - 200000000) - (((uint8_t)tmpBri) * 10000);
tmpBri *= 2.55; tmpBri *= 2.55;
constrain(tmpBri, 0, 255); tmpBri = constrain(tmpBri, 0, 255);
colorKtoRGB(ct, rgbw); colorKtoRGB(ct, rgbw);
lxRed = rgbw[0]; lxGreen = rgbw[1]; lxBlue = rgbw[2]; lxRed = rgbw[0]; lxGreen = rgbw[1]; lxBlue = rgbw[2];

View File

@ -144,7 +144,7 @@ public:
virtual void handleBody(AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total) override final { virtual void handleBody(AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total) override final {
if (_onRequest) { if (_onRequest) {
_contentLength = total; _contentLength = total;
if (total > 0 && request->_tempObject == NULL && total < _maxContentLength) { if (total > 0 && request->_tempObject == NULL && (int)total < _maxContentLength) {
request->_tempObject = malloc(total); request->_tempObject = malloc(total);
} }
if (request->_tempObject != NULL) { if (request->_tempObject != NULL) {

View File

@ -136,6 +136,10 @@ void prepareHostname(char* hostname)
//handle Ethernet connection event //handle Ethernet connection event
void WiFiEvent(WiFiEvent_t event) void WiFiEvent(WiFiEvent_t event)
{ {
#ifdef WLED_USE_ETHERNET
char hostname[25] = "wled-";
#endif
switch (event) { switch (event) {
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_ETHERNET) #if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_ETHERNET)
case SYSTEM_EVENT_ETH_START: case SYSTEM_EVENT_ETH_START:

View File

@ -481,8 +481,8 @@ WLED_GLOBAL uint8_t tpmPacketCount _INIT(0);
WLED_GLOBAL uint16_t tpmPayloadFrameSize _INIT(0); WLED_GLOBAL uint16_t tpmPayloadFrameSize _INIT(0);
// mqtt // mqtt
WLED_GLOBAL long lastMqttReconnectAttempt _INIT(0); WLED_GLOBAL unsigned long lastMqttReconnectAttempt _INIT(0);
WLED_GLOBAL long lastInterfaceUpdate _INIT(0); WLED_GLOBAL unsigned long lastInterfaceUpdate _INIT(0);
WLED_GLOBAL byte interfaceUpdateCallMode _INIT(NOTIFIER_CALL_MODE_INIT); WLED_GLOBAL byte interfaceUpdateCallMode _INIT(NOTIFIER_CALL_MODE_INIT);
WLED_GLOBAL char mqttStatusTopic[40] _INIT(""); // this must be global because of async handlers WLED_GLOBAL char mqttStatusTopic[40] _INIT(""); // this must be global because of async handlers