diff --git a/src/Cmd.cpp b/src/Cmd.cpp index dfb0484..f55ecf6 100644 --- a/src/Cmd.cpp +++ b/src/Cmd.cpp @@ -12,12 +12,12 @@ void Cmd_Action(const uint16_t mod) { switch (mod) { - case LOCK_BUTTONS_MOD: { // Locks/unlocks all buttons + case CMD_LOCK_BUTTONS_MOD: { // Locks/unlocks all buttons System_ToggleLockControls(); break; } - case SLEEP_TIMER_MOD_15: { // Enables/disables sleep after 15 minutes + case CMD_SLEEP_TIMER_MOD_15: { // Enables/disables sleep after 15 minutes System_SetSleepTimer(15u); gPlayProperties.sleepAfterCurrentTrack = false; // deactivate/overwrite if already active @@ -27,7 +27,7 @@ void Cmd_Action(const uint16_t mod) { break; } - case SLEEP_TIMER_MOD_30: { // Enables/disables sleep after 30 minutes + case CMD_SLEEP_TIMER_MOD_30: { // Enables/disables sleep after 30 minutes System_SetSleepTimer(30u); gPlayProperties.sleepAfterCurrentTrack = false; // deactivate/overwrite if already active @@ -37,7 +37,7 @@ void Cmd_Action(const uint16_t mod) { break; } - case SLEEP_TIMER_MOD_60: { // Enables/disables sleep after 60 minutes + case CMD_SLEEP_TIMER_MOD_60: { // Enables/disables sleep after 60 minutes System_SetSleepTimer(60u); gPlayProperties.sleepAfterCurrentTrack = false; // deactivate/overwrite if already active @@ -47,7 +47,7 @@ void Cmd_Action(const uint16_t mod) { break; } - case SLEEP_TIMER_MOD_120: { // Enables/disables sleep after 2 hrs + case CMD_SLEEP_TIMER_MOD_120: { // Enables/disables sleep after 2 hrs System_SetSleepTimer(120u); gPlayProperties.sleepAfterCurrentTrack = false; // deactivate/overwrite if already active @@ -57,7 +57,7 @@ void Cmd_Action(const uint16_t mod) { break; } - case SLEEP_AFTER_END_OF_TRACK: { // Puts uC to sleep after end of current track + case CMD_SLEEP_AFTER_END_OF_TRACK: { // Puts uC to sleep after end of current track if (gPlayProperties.playMode == NO_PLAYLIST) { Log_Println((char *) FPSTR(modificatorNotallowedWhenIdle), LOGLEVEL_NOTICE); System_IndicateError(); @@ -95,7 +95,7 @@ void Cmd_Action(const uint16_t mod) { break; } - case SLEEP_AFTER_END_OF_PLAYLIST: { // Puts uC to sleep after end of whole playlist (can take a while :->) + case CMD_SLEEP_AFTER_END_OF_PLAYLIST: { // Puts uC to sleep after end of whole playlist (can take a while :->) if (gPlayProperties.playMode == NO_PLAYLIST) { Log_Println((char *) FPSTR(modificatorNotallowedWhenIdle), LOGLEVEL_NOTICE); System_IndicateError(); @@ -131,7 +131,7 @@ void Cmd_Action(const uint16_t mod) { break; } - case SLEEP_AFTER_5_TRACKS: { + case CMD_SLEEP_AFTER_5_TRACKS: { if (gPlayProperties.playMode == NO_PLAYLIST) { Log_Println((char *) FPSTR(modificatorNotallowedWhenIdle), LOGLEVEL_NOTICE); System_IndicateError(); @@ -176,7 +176,7 @@ void Cmd_Action(const uint16_t mod) { break; } - case REPEAT_PLAYLIST: { + case CMD_REPEAT_PLAYLIST: { if (gPlayProperties.playMode == NO_PLAYLIST) { Log_Println((char *) FPSTR(modificatorNotallowedWhenIdle), LOGLEVEL_NOTICE); System_IndicateError(); @@ -197,7 +197,7 @@ void Cmd_Action(const uint16_t mod) { break; } - case REPEAT_TRACK: { // Introduces looping for track-mode + case CMD_REPEAT_TRACK: { // Introduces looping for track-mode if (gPlayProperties.playMode == NO_PLAYLIST) { Log_Println((char *) FPSTR(modificatorNotallowedWhenIdle), LOGLEVEL_NOTICE); System_IndicateError(); @@ -218,7 +218,7 @@ void Cmd_Action(const uint16_t mod) { break; } - case DIMM_LEDS_NIGHTMODE: { + case CMD_DIMM_LEDS_NIGHTMODE: { #ifdef MQTT_ENABLE publishMqtt((char *) FPSTR(topicLedBrightnessState), Led_GetBrightness(), false); #endif @@ -230,14 +230,14 @@ void Cmd_Action(const uint16_t mod) { break; } - case TOGGLE_WIFI_STATUS: { + case CMD_TOGGLE_WIFI_STATUS: { Wlan_ToggleEnable(); System_IndicateOk(); break; } #ifdef BLUETOOTH_ENABLE - case TOGGLE_BLUETOOTH_MODE: { + case CMD_TOGGLE_BLUETOOTH_MODE: { if (System_GetOperationModeFromNvs() == OPMODE_NORMAL) { System_IndicateOk(); System_SetOperationMode(OPMODE_BLUETOOTH); @@ -252,7 +252,7 @@ void Cmd_Action(const uint16_t mod) { #endif #ifdef FTP_ENABLE - case ENABLE_FTP_SERVER: { + case CMD_ENABLE_FTP_SERVER: { Ftp_EnableServer(); break; } diff --git a/src/IrReceiver.cpp b/src/IrReceiver.cpp index 039743a..2c3ca87 100644 --- a/src/IrReceiver.cpp +++ b/src/IrReceiver.cpp @@ -97,14 +97,14 @@ void IrReceiver_Cyclic() { } case RC_BLUETOOTH: { if (rcActionOk) { - Cmd_Action(TOGGLE_BLUETOOTH_MODE); + Cmd_Action(CMD_TOGGLE_BLUETOOTH_MODE); Serial.println(F("RC: Bluetooth")); } break; } case RC_FTP: { if (rcActionOk) { - Cmd_Action(ENABLE_FTP_SERVER); + Cmd_Action(CMD_ENABLE_FTP_SERVER); Serial.println(F("RC: FTP")); } break; diff --git a/src/settings.h b/src/settings.h index b640dc0..cd13725 100644 --- a/src/settings.h +++ b/src/settings.h @@ -114,8 +114,8 @@ #define BUTTON_4_LONG CMD_NOTHING #define BUTTON_5_LONG CMD_NOTHING - #define BUTTON_MULTI_01 TOGGLE_WIFI_STATUS - #define BUTTON_MULTI_02 ENABLE_FTP_SERVER + #define BUTTON_MULTI_01 CMD_TOGGLE_WIFI_STATUS + #define BUTTON_MULTI_02 CMD_ENABLE_FTP_SERVER #define BUTTON_MULTI_03 CMD_NOTHING #define BUTTON_MULTI_04 CMD_NOTHING #define BUTTON_MULTI_05 CMD_NOTHING diff --git a/src/values.h b/src/values.h index a84dbe8..591acbb 100644 --- a/src/values.h +++ b/src/values.h @@ -30,20 +30,20 @@ // RFID-modifcation-types #define CMD_NOTHING 0 // Do Nothing - #define LOCK_BUTTONS_MOD 100 // Locks all buttons and rotary encoder - #define SLEEP_TIMER_MOD_15 101 // Puts uC into deepsleep after 15 minutes + LED-DIMM - #define SLEEP_TIMER_MOD_30 102 // Puts uC into deepsleep after 30 minutes + LED-DIMM - #define SLEEP_TIMER_MOD_60 103 // Puts uC into deepsleep after 60 minutes + LED-DIMM - #define SLEEP_TIMER_MOD_120 104 // Puts uC into deepsleep after 120 minutes + LED-DIMM - #define SLEEP_AFTER_END_OF_TRACK 105 // Puts uC into deepsleep after track is finished + LED-DIMM - #define SLEEP_AFTER_END_OF_PLAYLIST 106 // Puts uC into deepsleep after playlist is finished + LED-DIMM - #define SLEEP_AFTER_5_TRACKS 107 // Puts uC into deepsleep after five tracks + LED-DIMM - #define REPEAT_PLAYLIST 110 // Changes active playmode to endless-loop (for a playlist) - #define REPEAT_TRACK 111 // Changes active playmode to endless-loop (for a single track) - #define DIMM_LEDS_NIGHTMODE 120 // Changes LED-brightness - #define TOGGLE_WIFI_STATUS 130 // Toggles WiFi-status - #define TOGGLE_BLUETOOTH_MODE 140 // Toggles Normal/Bluetooth Mode - #define ENABLE_FTP_SERVER 150 // Enables FTP-server + #define CMD_LOCK_BUTTONS_MOD 100 // Locks all buttons and rotary encoder + #define CMD_SLEEP_TIMER_MOD_15 101 // Puts uC into deepsleep after 15 minutes + LED-DIMM + #define CMD_SLEEP_TIMER_MOD_30 102 // Puts uC into deepsleep after 30 minutes + LED-DIMM + #define CMD_SLEEP_TIMER_MOD_60 103 // Puts uC into deepsleep after 60 minutes + LED-DIMM + #define CMD_SLEEP_TIMER_MOD_120 104 // Puts uC into deepsleep after 120 minutes + LED-DIMM + #define CMD_SLEEP_AFTER_END_OF_TRACK 105 // Puts uC into deepsleep after track is finished + LED-DIMM + #define CMD_SLEEP_AFTER_END_OF_PLAYLIST 106 // Puts uC into deepsleep after playlist is finished + LED-DIMM + #define CMD_SLEEP_AFTER_5_TRACKS 107 // Puts uC into deepsleep after five tracks + LED-DIMM + #define CMD_REPEAT_PLAYLIST 110 // Changes active playmode to endless-loop (for a playlist) + #define CMD_REPEAT_TRACK 111 // Changes active playmode to endless-loop (for a single track) + #define CMD_DIMM_LEDS_NIGHTMODE 120 // Changes LED-brightness + #define CMD_TOGGLE_WIFI_STATUS 130 // Toggles WiFi-status + #define CMD_TOGGLE_BLUETOOTH_MODE 140 // Toggles Normal/Bluetooth Mode + #define CMD_ENABLE_FTP_SERVER 150 // Enables FTP-server #define CMD_PLAYPAUSE 170 // Command: play/pause #define CMD_PREVTRACK 171 // Command: previous track