From 9f4bd4d49716d649d4980f22ab62ad371593745f Mon Sep 17 00:00:00 2001 From: Torsten Stauder Date: Fri, 2 Apr 2021 10:37:23 +0200 Subject: [PATCH] Simplifying Neopixel-signalisation --- src/HTMLmanagement.h | 2 +- src/HTMLmanagement_EN.h | 772 ++++++++++++++++++++++++++++------------ src/main.cpp | 272 +++++--------- 3 files changed, 635 insertions(+), 411 deletions(-) diff --git a/src/HTMLmanagement.h b/src/HTMLmanagement.h index a9a180b..2322da5 100644 --- a/src/HTMLmanagement.h +++ b/src/HTMLmanagement.h @@ -527,7 +527,7 @@ static const char management_HTML[] PROGMEM = "\ var lastFolder = cur['id'].split('/').filter(function (el) {\ return el.trim().length > 0;\ }).pop();\ - if ((/\\.(mp3|MP3|ogg|wav|WAV|OGG|wma|WMA|acc|ACC|flac|FLAC|.m4a|.M4A)$/i).test(lastFolder)) {\ + if ((/\\.(mp3|MP3|ogg|wav|WAV|OGG|wma|WMA|acc|ACC|flac|FLAC|m4a|M4A)$/i).test(lastFolder)) {\ data.instance.set_type(data.instance._model.data[key], 'audio');\ } else {\ if (data.instance._model.data[key]['type'] == \"file\") {\ diff --git a/src/HTMLmanagement_EN.h b/src/HTMLmanagement_EN.h index e5f9349..c3febf0 100644 --- a/src/HTMLmanagement_EN.h +++ b/src/HTMLmanagement_EN.h @@ -1,9 +1,10 @@ static const char management_HTML[] PROGMEM = "\ \ \ - ESPuino-configuration\ + ESPuino-Settings\ \ \ + \ \ \ \ @@ -99,18 +100,42 @@ static const char management_HTML[] PROGMEM = "\ display: none;\ width: 100%%;\ }\ +\ + #SubTabContent.tab-content {\ + display: flex;\ + }\ +\ + #SubTabContent.tab-content > .tab-pane {\ + display: block; /* undo \"display: none;\" */\ + visibility: hidden;\ + margin-right: -100%%;\ + width: 100%%;\ + }\ +\ + #SubTabContent.tab-content > .active {\ + visibility: visible;\ + }\ +\ + /* IOS display fix */\ + select {\ + -webkit-appearance: none;\ + -moz-appearance: none;\ + appearance: none;\ + background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAAAAADhgtq/AAAACXBIWXMAAC4jAAAuIwF4pT92AAAAR0lEQVR4nGP5z4ADsOCSGOoyC+NRabjMQqjQQrgUTCYeIrQQyEI3DSyFJIHkApAUkgSy21B0oLo6fiGSBKp/kCUGU4hSRQYAYg0Rw+gGlUQAAAAASUVORK5CYII=') no-repeat;\ + background-position: center right;\ + }\ \ \ \ \
\ @@ -123,6 +148,7 @@ static const char management_HTML[] PROGMEM = "\ %SHOW_FTP_TAB%\ General\ Tools\ + Forum\ \ \
\ @@ -131,14 +157,15 @@ static const char management_HTML[] PROGMEM = "\
\
\
\ - \ + WiFi-settings\ + \ \
\ - Please enter WiFi's SSID.\ + Enter WiFi's SSID.\
\ \ \ - \ + \ \
\ @@ -151,9 +178,9 @@ static const char management_HTML[] PROGMEM = "\
\ \
\ -
\ +
\
\ - Controls\ + Control\
\ \ -
\ +
\
\
\
\ Volume\ \ + data-slider-value=\"%CURRENT_VOLUME%\" value=\"%CURRENT_VOLUME%\" onchange=\"sendVolume(this.value)\"> \
\
\
\
\
\ -
\ +
\
\ - RFID-assignments\ - \ -
\ - \ - \ - \ - \ -
\ -
\ -
\ -
\ - Refresh indexfile\ -
\ -
\ -
\ -
\ -


This could take while...
\ -
\ -
\ + Files\ +
\ +
\ +
\ +
\ +
\ + \ +
\ + \ + \ + Browse\ + Upload\ + \ + \
\ + \ +
\ +
\ +
\
\ - \ - \
\
\ -
\ - \ - \ -
\ - \ +
\
\
\ -\ -
\ -
\ -
\ +
\
\ - RFID-modifications\ -
\ + RFID-Assignments\ + \
\ - \ - \ -
\ - Please enter 12-digits-number.\ + \ + \ +
\ + \ +
\ +
\ +
\ + \ + \ + \ + \ +
\ +
\ + \ + \ +
\
\ - \ - \
\
\
\ @@ -268,6 +303,7 @@ static const char management_HTML[] PROGMEM = "\ \
\
\ +
\
\
\
\ @@ -275,6 +311,7 @@ static const char management_HTML[] PROGMEM = "\
\
\ + MQTT-settings\ \
\
\
\ @@ -304,6 +344,7 @@ static const char management_HTML[] PROGMEM = "\ \ \
\ + FTP-settings\ \ \ @@ -327,36 +368,36 @@ static const char management_HTML[] PROGMEM = "\
\
\ Volume\ - \ + \
\
\
\ - \ + \
\ \
\
\ - \ + \
\ \
\
\
\ -
\ +
\
\
\ - Neopixel (brightness)\ - \ + Neopixel (brightness)\ + \
\ \ \
\ \ - \ + \
\ \
\ @@ -367,7 +408,7 @@ static const char management_HTML[] PROGMEM = "\
\ Deep Sleep\ \ - \ + \
\
\ @@ -377,23 +418,23 @@ static const char management_HTML[] PROGMEM = "\
\
\ Battery\ -
Status via Neopixel
\ +
Show voltage-status via Neopixel
\
\ -
\
\ -
\ -

NVS-Importer

\ +
\ + NVS-Importer\
\
\ - \ + \ \
\ -
\ -
\ \ -
\
\
\
\ +
\ +
\ + Forum\ +

Having problems or aim to discuss about ESPuino?
\ + Join us at ESPuino-Forum! Especially there's a lot of (german)
\ + documentation online!\ +

\ +
\ +
\
\ \ \ -\ -"; \ No newline at end of file +"; \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 06ad9c2..017fe0d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -378,6 +378,8 @@ QueueHandle_t explorerFileUploadStatusQueue; // Prototypes void accessPointStart(const char *SSID, IPAddress ip, IPAddress netmask); +void actionError(void); +void actionOk(void); static int arrSortHelper(const void* a, const void* b); void batteryVoltageTester(void); void buttonHandler(); @@ -468,6 +470,22 @@ void logger(const uint8_t _currentLogLevel, const char *_logBuffer, const uint8_ } +// Indicate if error occured +void actionError(void) { + #ifdef NEOPIXEL_ENABLE + showLedError = true; + #endif +} + + +// Indicate if action was ok +void actionOk(void) { + #ifdef NEOPIXEL_ENABLE + showLedOk = true; + #endif +} + + void IRAM_ATTR onTimer() { xSemaphoreGiveFromISR(timerSemaphore, NULL); } @@ -948,24 +966,18 @@ void callback(const char *topic, const byte *payload, uint32_t length) { if (playProperties.playMode == NO_PLAYLIST) { // Don't allow sleep-modications if no playlist is active loggerNl(serialDebug, (char *) FPSTR(modificatorNotallowedWhenIdle), LOGLEVEL_INFO); publishMqtt((char *) FPSTR(topicSleepState), 0, false); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); return; } if (strcmp(receivedString, "EOP") == 0) { playProperties.sleepAfterPlaylist = true; loggerNl(serialDebug, (char *) FPSTR(sleepTimerEOP), LOGLEVEL_NOTICE); - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); return; } else if (strcmp(receivedString, "EOT") == 0) { playProperties.sleepAfterCurrentTrack = true; loggerNl(serialDebug, (char *) FPSTR(sleepTimerEOT), LOGLEVEL_NOTICE); - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); return; } else if (strcmp(receivedString, "EO5T") == 0) { if ((playProperties.numberOfTracks - 1) >= (playProperties.currentTrackNumber + 5)) { @@ -974,33 +986,25 @@ void callback(const char *topic, const byte *payload, uint32_t length) { playProperties.sleepAfterPlaylist = true; } loggerNl(serialDebug, (char *) FPSTR(sleepTimerEO5), LOGLEVEL_NOTICE); - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); return; } else if (strcmp(receivedString, "0") == 0) { if (sleepTimerStartTimestamp) { sleepTimerStartTimestamp = 0; loggerNl(serialDebug, (char *) FPSTR(sleepTimerStop), LOGLEVEL_NOTICE); - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); publishMqtt((char *) FPSTR(topicSleepState), 0, false); return; } else { loggerNl(serialDebug, (char *) FPSTR(sleepTimerAlreadyStopped), LOGLEVEL_INFO); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); return; } } sleepTimer = strtoul(receivedString, NULL, 10); snprintf(logBuf, serialLoglength, "%s: %u Minute(n)", (char *) FPSTR(sleepTimerSetTo), sleepTimer); loggerNl(serialDebug, logBuf, LOGLEVEL_NOTICE); - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); sleepTimerStartTimestamp = millis(); // Activate timer playProperties.sleepAfterPlaylist = false; @@ -1017,16 +1021,12 @@ void callback(const char *topic, const byte *payload, uint32_t length) { if (strcmp(receivedString, "OFF") == 0) { lockControls = false; loggerNl(serialDebug, (char *) FPSTR(allowButtons), LOGLEVEL_NOTICE); - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); } else if (strcmp(receivedString, "ON") == 0) { lockControls = true; loggerNl(serialDebug, (char *) FPSTR(lockButtons), LOGLEVEL_NOTICE); - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); } } @@ -1040,9 +1040,7 @@ void callback(const char *topic, const byte *payload, uint32_t length) { snprintf(rBuf, 2, "%u", getRepeatMode()); publishMqtt((char *) FPSTR(topicRepeatModeState), rBuf, false); loggerNl(serialDebug, (char *) FPSTR(noPlaylistNotAllowedMqtt), LOGLEVEL_ERROR); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); } else { switch (repeatMode) { case NO_REPEAT: @@ -1051,9 +1049,7 @@ void callback(const char *topic, const byte *payload, uint32_t length) { snprintf(rBuf, 2, "%u", getRepeatMode()); publishMqtt((char *) FPSTR(topicRepeatModeState), rBuf, false); loggerNl(serialDebug, (char *) FPSTR(modeRepeatNone), LOGLEVEL_INFO); - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); break; case TRACK: @@ -1062,9 +1058,7 @@ void callback(const char *topic, const byte *payload, uint32_t length) { snprintf(rBuf, 2, "%u", getRepeatMode()); publishMqtt((char *) FPSTR(topicRepeatModeState), rBuf, false); loggerNl(serialDebug, (char *) FPSTR(modeRepeatTrack), LOGLEVEL_INFO); - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); break; case PLAYLIST: @@ -1073,9 +1067,7 @@ void callback(const char *topic, const byte *payload, uint32_t length) { snprintf(rBuf, 2, "%u", getRepeatMode()); publishMqtt((char *) FPSTR(topicRepeatModeState), rBuf, false); loggerNl(serialDebug, (char *) FPSTR(modeRepeatPlaylist), LOGLEVEL_INFO); - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); break; case TRACK_N_PLAYLIST: @@ -1084,15 +1076,11 @@ void callback(const char *topic, const byte *payload, uint32_t length) { snprintf(rBuf, 2, "%u", getRepeatMode()); publishMqtt((char *) FPSTR(topicRepeatModeState), rBuf, false); loggerNl(serialDebug, (char *) FPSTR(modeRepeatTracknPlaylist), LOGLEVEL_INFO); - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); break; default: - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); snprintf(rBuf, 2, "%u", getRepeatMode()); publishMqtt((char *) FPSTR(topicRepeatModeState), rBuf, false); break; @@ -1110,9 +1098,7 @@ void callback(const char *topic, const byte *payload, uint32_t length) { else { snprintf(logBuf, serialLoglength, "%s: %s", (char *) FPSTR(noValidTopic), topic); loggerNl(serialDebug, logBuf, LOGLEVEL_ERROR); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); } free(receivedString); @@ -1278,9 +1264,7 @@ char ** returnPlaylistFromSD(File _fileOrDirectory) { } if (files == NULL) { loggerNl(serialDebug, (char *) FPSTR(unableToAllocateMemForPlaylist), LOGLEVEL_ERROR); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); return NULL; } loggerNl(serialDebug, (char *) FPSTR(fileModeDetected), LOGLEVEL_INFO); @@ -1330,9 +1314,7 @@ char ** returnPlaylistFromSD(File _fileOrDirectory) { loggerNl(serialDebug, (char *) FPSTR(reallocCalled), LOGLEVEL_DEBUG); if (serializedPlaylist == NULL) { loggerNl(serialDebug, (char *) FPSTR(unableToAllocateMemForLinearPlaylist), LOGLEVEL_ERROR); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); return files; } } @@ -1359,9 +1341,7 @@ char ** returnPlaylistFromSD(File _fileOrDirectory) { if (files == NULL) { loggerNl(serialDebug, (char *) FPSTR(unableToAllocateMemForPlaylist), LOGLEVEL_ERROR); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); free(serializedPlaylist); return NULL; } @@ -1385,9 +1365,7 @@ char ** returnPlaylistFromSD(File _fileOrDirectory) { if (files[0] == NULL) { loggerNl(serialDebug, (char *) FPSTR(unableToAllocateMemForPlaylist), LOGLEVEL_ERROR); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); return NULL; } sprintf(files[0], "%u", cnt); @@ -1520,9 +1498,7 @@ void playAudio(void *parameter) { if (playProperties.playlistFinished && trackCommand != 0) { loggerNl(serialDebug, (char *) FPSTR(noPlaymodeChangeIfIdle), LOGLEVEL_NOTICE); trackCommand = 0; - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); continue; } /* Check if track-control was called @@ -1575,9 +1551,7 @@ void playAudio(void *parameter) { } else { loggerNl(serialDebug, (char *) FPSTR(lastTrackAlreadyActive), LOGLEVEL_NOTICE); trackCommand = 0; - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); continue; } trackCommand = 0; @@ -1613,9 +1587,7 @@ void playAudio(void *parameter) { } else { if (playProperties.playMode == WEBSTREAM) { loggerNl(serialDebug, (char *) FPSTR(trackChangeWebstream), LOGLEVEL_INFO); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); trackCommand = 0; continue; } @@ -1629,9 +1601,7 @@ void playAudio(void *parameter) { audioReturnCode = audio.connecttoFS(FSystem, *(playProperties.playlist + playProperties.currentTrackNumber)); // consider track as finished, when audio lib call was not successful if (!audioReturnCode) { - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); playProperties.trackFinished = true; continue; } @@ -1659,9 +1629,7 @@ void playAudio(void *parameter) { } } else { loggerNl(serialDebug, (char *) FPSTR(firstTrackAlreadyActive), LOGLEVEL_NOTICE); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); trackCommand = 0; continue; } @@ -1685,9 +1653,7 @@ void playAudio(void *parameter) { } } else { loggerNl(serialDebug, (char *) FPSTR(lastTrackAlreadyActive), LOGLEVEL_NOTICE); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); trackCommand = 0; continue; } @@ -1700,9 +1666,7 @@ void playAudio(void *parameter) { default: trackCommand = 0; loggerNl(serialDebug, (char *) FPSTR(cmndDoesNotExist), LOGLEVEL_NOTICE); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); continue; } @@ -1770,9 +1734,7 @@ void playAudio(void *parameter) { audioReturnCode = audio.connecttoFS(FSystem, *(playProperties.playlist + playProperties.currentTrackNumber)); // consider track as finished, when audio lib call was not successful if(!audioReturnCode) { - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); playProperties.trackFinished = true; continue; } @@ -1810,9 +1772,7 @@ void playAudio(void *parameter) { Serial.printf("Jumped %d seconds forwards\n", jumpOffset); #endif } else { - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); } } else if (playProperties.seekmode == SEEK_BACKWARDS) { if (audio.setTimeOffset(-(jumpOffset))) { @@ -1822,9 +1782,7 @@ void playAudio(void *parameter) { Serial.printf("Jumped %d seconds backwards\n", jumpOffset); #endif } else { - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); } } playProperties.seekmode = SEEK_NORMAL; @@ -1912,9 +1870,7 @@ void rfidScanner(void) { if (cardIdString == NULL) { logger(serialDebug, (char *) FPSTR(unableToAllocateMem), LOGLEVEL_ERROR); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); return; } @@ -1982,9 +1938,7 @@ void rfidScanner(void *parameter) { if (cardIdString == NULL) { logger(serialDebug, (char *) FPSTR(unableToAllocateMem), LOGLEVEL_ERROR); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); continue; } for (uint8_t i=0; i) if (playProperties.playMode == NO_PLAYLIST) { loggerNl(serialDebug, (char *) FPSTR(modificatorNotallowedWhenIdle), LOGLEVEL_NOTICE); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); return; } if (playProperties.sleepAfterCurrentTrack) { @@ -3053,18 +2981,14 @@ void doCmdAction(const uint16_t mod) { #ifdef MQTT_ENABLE publishMqtt((char *) FPSTR(topicLedBrightnessState), ledBrightness, false); #endif - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); break; } case SLEEP_AFTER_5_TRACKS:{ if (playProperties.playMode == NO_PLAYLIST) { loggerNl(serialDebug, (char *) FPSTR(modificatorNotallowedWhenIdle), LOGLEVEL_NOTICE); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); return; } @@ -3102,18 +3026,14 @@ void doCmdAction(const uint16_t mod) { #ifdef MQTT_ENABLE publishMqtt((char *) FPSTR(topicLedBrightnessState), ledBrightness, false); #endif - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); break; } case REPEAT_PLAYLIST: { if (playProperties.playMode == NO_PLAYLIST) { loggerNl(serialDebug, (char *) FPSTR(modificatorNotallowedWhenIdle), LOGLEVEL_NOTICE); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); } else { if (playProperties.repeatPlaylist) { loggerNl(serialDebug, (char *) FPSTR(modificatorPlaylistLoopDeactive), LOGLEVEL_NOTICE); @@ -3126,9 +3046,7 @@ void doCmdAction(const uint16_t mod) { #ifdef MQTT_ENABLE publishMqtt((char *) FPSTR(topicRepeatModeState), rBuf, false); #endif - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); } break; } @@ -3136,9 +3054,7 @@ void doCmdAction(const uint16_t mod) { case REPEAT_TRACK: { // Introduces looping for track-mode if (playProperties.playMode == NO_PLAYLIST) { loggerNl(serialDebug, (char *) FPSTR(modificatorNotallowedWhenIdle), LOGLEVEL_NOTICE); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); } else { if (playProperties.repeatCurrentTrack) { loggerNl(serialDebug, (char *) FPSTR(modificatorTrackDeactive), LOGLEVEL_NOTICE); @@ -3151,9 +3067,7 @@ void doCmdAction(const uint16_t mod) { #ifdef MQTT_ENABLE publishMqtt((char *) FPSTR(topicRepeatModeState), rBuf, false); #endif - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); } break; } @@ -3165,39 +3079,29 @@ void doCmdAction(const uint16_t mod) { loggerNl(serialDebug, (char *) FPSTR(ledsDimmedToNightmode), LOGLEVEL_INFO); #ifdef NEOPIXEL_ENABLE ledBrightness = nightLedBrightness; - showLedOk = true; #endif + actionOk(); break; } case TOGGLE_WIFI_STATUS: { if (writeWifiStatusToNVS(!getWifiEnableStatusFromNVS())) { - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); } else { - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); } break; } #ifdef BLUETOOTH_ENABLE case TOGGLE_BLUETOOTH_MODE: { if (readOperationModeFromNVS() == OPMODE_NORMAL) { - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); setOperationMode(OPMODE_BLUETOOTH); } else if (readOperationModeFromNVS() == OPMODE_BLUETOOTH) { - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); setOperationMode(OPMODE_NORMAL); } else { - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); } break; } @@ -3206,14 +3110,10 @@ void doCmdAction(const uint16_t mod) { case ENABLE_FTP_SERVER: { if (wifiManager() == WL_CONNECTED && !ftpEnableLastStatus && !ftpEnableCurrentStatus) { ftpEnableLastStatus = true; - #ifdef NEOPIXEL_ENABLE - showLedOk = true; - #endif + actionOk(); } else { - #ifdef NEOPIXEL_ENABLE - showLedError = true; - loggerNl(serialDebug, (char *) FPSTR(unableToStartFtpServer), LOGLEVEL_ERROR); - #endif + loggerNl(serialDebug, (char *) FPSTR(unableToStartFtpServer), LOGLEVEL_ERROR); + actionError(); } break; } @@ -3281,9 +3181,7 @@ void doCmdAction(const uint16_t mod) { default: { snprintf(logBuf, serialLoglength, "%s %d !", (char *) FPSTR(modificatorDoesNotExist), mod); loggerNl(serialDebug, logBuf, LOGLEVEL_ERROR); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); } } } @@ -3311,9 +3209,7 @@ void rfidPreferenceLookupHandler (void) { String s = prefsRfid.getString(currentRfidTagId, "-1"); // Try to lookup rfidId in NVS if (!s.compareTo("-1")) { loggerNl(serialDebug, (char *) FPSTR(rfidTagUnknownInNvs), LOGLEVEL_ERROR); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); return; } @@ -3336,9 +3232,7 @@ void rfidPreferenceLookupHandler (void) { if (i != 5) { loggerNl(serialDebug, (char *) FPSTR(errorOccuredNvs), LOGLEVEL_ERROR); - #ifdef NEOPIXEL_ENABLE - showLedError = true; - #endif + actionError(); } else { // Only pass file to queue if strtok revealed 3 items if (_playMode >= 100) { @@ -4807,7 +4701,7 @@ void setup() { Serial.println(F(" | |___ ___) | | __/ | |_| | | | | | | | | (_) |")); Serial.println(F(" |_____| |____/ |_| \\__,_| |_| |_| |_| \\___/ ")); Serial.println(F(" Rfid-controlled musicplayer\n")); - Serial.println(F(" Rev 20210402-1\n")); + Serial.println(F(" Rev 20210402-2\n")); // print wake-up reason printWakeUpReason(); #ifdef PN5180_ENABLE_LPCD