@@ -16,14 +16,14 @@ void Cmd_Action(const uint16_t mod) {
16
16
case CMD_LOCK_BUTTONS_MOD: { // Locks/unlocks all buttons
17
17
System_ToggleLockControls ();
18
18
if (System_AreControlsLocked ()) {
19
- Log_Println (( char *) FPSTR ( modificatorAllButtonsLocked) , LOGLEVEL_NOTICE);
19
+ Log_Println (modificatorAllButtonsLocked, LOGLEVEL_NOTICE);
20
20
#ifdef MQTT_ENABLE
21
- publishMqtt (( char *) FPSTR ( topicLockControlsState) , " ON" , false );
21
+ publishMqtt (topicLockControlsState, " ON" , false );
22
22
#endif
23
23
} else {
24
- Log_Println (( char *) FPSTR ( modificatorAllButtonsUnlocked) , LOGLEVEL_NOTICE);
24
+ Log_Println (modificatorAllButtonsUnlocked, LOGLEVEL_NOTICE);
25
25
#ifdef MQTT_ENABLE
26
- publishMqtt (( char *) FPSTR ( topicLockControlsState) , " OFF" , false );
26
+ publishMqtt (topicLockControlsState, " OFF" , false );
27
27
#endif
28
28
}
29
29
System_IndicateOk ();
@@ -72,7 +72,7 @@ void Cmd_Action(const uint16_t mod) {
72
72
73
73
case CMD_SLEEP_AFTER_END_OF_TRACK: { // Puts uC to sleep after end of current track
74
74
if (gPlayProperties .playMode == NO_PLAYLIST) {
75
- Log_Println (( char *) FPSTR ( modificatorNotallowedWhenIdle) , LOGLEVEL_NOTICE);
75
+ Log_Println (modificatorNotallowedWhenIdle, LOGLEVEL_NOTICE);
76
76
System_IndicateError ();
77
77
return ;
78
78
}
@@ -82,63 +82,63 @@ void Cmd_Action(const uint16_t mod) {
82
82
83
83
if (gPlayProperties .sleepAfterCurrentTrack ) {
84
84
gPlayProperties .sleepAfterCurrentTrack = false ;
85
- Log_Println (( char *) FPSTR ( modificatorSleepAtEOTd) , LOGLEVEL_NOTICE);
85
+ Log_Println (modificatorSleepAtEOTd, LOGLEVEL_NOTICE);
86
86
#ifdef MQTT_ENABLE
87
- publishMqtt (( char *) FPSTR ( topicSleepTimerState) , " 0" , false );
87
+ publishMqtt (topicSleepTimerState, " 0" , false );
88
88
#endif
89
89
Led_ResetToInitialBrightness ();
90
90
} else {
91
91
System_DisableSleepTimer ();
92
92
gPlayProperties .sleepAfterCurrentTrack = true ;
93
- Log_Println (( char *) FPSTR ( modificatorSleepAtEOT) , LOGLEVEL_NOTICE);
93
+ Log_Println (modificatorSleepAtEOT, LOGLEVEL_NOTICE);
94
94
#ifdef MQTT_ENABLE
95
- publishMqtt (( char *) FPSTR ( topicSleepTimerState) , " EOT" , false );
95
+ publishMqtt (topicSleepTimerState, " EOT" , false );
96
96
#endif
97
97
Led_ResetToNightBrightness ();
98
98
}
99
99
100
100
#ifdef MQTT_ENABLE
101
- publishMqtt (( char *) FPSTR ( topicLedBrightnessState) , Led_GetBrightness (), false );
101
+ publishMqtt (topicLedBrightnessState, Led_GetBrightness (), false );
102
102
#endif
103
103
System_IndicateOk ();
104
104
break ;
105
105
}
106
106
107
107
case CMD_SLEEP_AFTER_END_OF_PLAYLIST: { // Puts uC to sleep after end of whole playlist (can take a while :->)
108
108
if (gPlayProperties .playMode == NO_PLAYLIST) {
109
- Log_Println (( char *) FPSTR ( modificatorNotallowedWhenIdle) , LOGLEVEL_NOTICE);
109
+ Log_Println (modificatorNotallowedWhenIdle, LOGLEVEL_NOTICE);
110
110
System_IndicateError ();
111
111
return ;
112
112
}
113
113
if (gPlayProperties .sleepAfterPlaylist ) {
114
114
System_DisableSleepTimer ();
115
115
gPlayProperties .sleepAfterPlaylist = false ;
116
116
#ifdef MQTT_ENABLE
117
- publishMqtt (( char *) FPSTR ( topicSleepTimerState) , " 0" , false );
117
+ publishMqtt (topicSleepTimerState, " 0" , false );
118
118
#endif
119
119
Led_ResetToInitialBrightness ();
120
- Log_Println (( char *) FPSTR ( modificatorSleepAtEOPd) , LOGLEVEL_NOTICE);
120
+ Log_Println (modificatorSleepAtEOPd, LOGLEVEL_NOTICE);
121
121
} else {
122
122
gPlayProperties .sleepAfterPlaylist = true ;
123
123
Led_ResetToNightBrightness ();
124
- Log_Println (( char *) FPSTR ( modificatorSleepAtEOP) , LOGLEVEL_NOTICE);
124
+ Log_Println (modificatorSleepAtEOP, LOGLEVEL_NOTICE);
125
125
#ifdef MQTT_ENABLE
126
- publishMqtt (( char *) FPSTR ( topicSleepTimerState) , " EOP" , false );
126
+ publishMqtt (topicSleepTimerState, " EOP" , false );
127
127
#endif
128
128
}
129
129
130
130
gPlayProperties .sleepAfterCurrentTrack = false ;
131
131
gPlayProperties .playUntilTrackNumber = 0 ;
132
132
#ifdef MQTT_ENABLE
133
- publishMqtt (( char *) FPSTR ( topicLedBrightnessState) , Led_GetBrightness (), false );
133
+ publishMqtt (topicLedBrightnessState, Led_GetBrightness (), false );
134
134
#endif
135
135
System_IndicateOk ();
136
136
break ;
137
137
}
138
138
139
139
case CMD_SLEEP_AFTER_5_TRACKS: {
140
140
if (gPlayProperties .playMode == NO_PLAYLIST) {
141
- Log_Println (( char *) FPSTR ( modificatorNotallowedWhenIdle) , LOGLEVEL_NOTICE);
141
+ Log_Println (modificatorNotallowedWhenIdle, LOGLEVEL_NOTICE);
142
142
System_IndicateError ();
143
143
return ;
144
144
}
@@ -151,47 +151,47 @@ void Cmd_Action(const uint16_t mod) {
151
151
gPlayProperties .sleepAfter5Tracks = false ;
152
152
gPlayProperties .playUntilTrackNumber = 0 ;
153
153
#ifdef MQTT_ENABLE
154
- publishMqtt (( char *) FPSTR ( topicSleepTimerState) , " 0" , false );
154
+ publishMqtt (topicSleepTimerState, " 0" , false );
155
155
#endif
156
156
Led_ResetToInitialBrightness ();
157
- Log_Println (( char *) FPSTR ( modificatorSleepd) , LOGLEVEL_NOTICE);
157
+ Log_Println (modificatorSleepd, LOGLEVEL_NOTICE);
158
158
} else {
159
159
gPlayProperties .sleepAfter5Tracks = true ;
160
160
if (gPlayProperties .currentTrackNumber + 5 > gPlayProperties .numberOfTracks ) { // If currentTrack + 5 exceeds number of tracks in playlist, sleep after end of playlist
161
161
gPlayProperties .sleepAfterPlaylist = true ;
162
162
#ifdef MQTT_ENABLE
163
- publishMqtt (( char *) FPSTR ( topicSleepTimerState) , " EOP" , false );
163
+ publishMqtt (topicSleepTimerState, " EOP" , false );
164
164
#endif
165
165
} else {
166
166
gPlayProperties .playUntilTrackNumber = gPlayProperties .currentTrackNumber + 5 ;
167
167
#ifdef MQTT_ENABLE
168
- publishMqtt (( char *) FPSTR ( topicSleepTimerState) , " EO5T" , false );
168
+ publishMqtt (topicSleepTimerState, " EO5T" , false );
169
169
#endif
170
170
}
171
171
Led_ResetToNightBrightness ();
172
- Log_Println (( char *) FPSTR ( sleepTimerEO5) , LOGLEVEL_NOTICE);
172
+ Log_Println (sleepTimerEO5, LOGLEVEL_NOTICE);
173
173
}
174
174
175
175
#ifdef MQTT_ENABLE
176
- publishMqtt (( char *) FPSTR ( topicLedBrightnessState) , Led_GetBrightness (), false );
176
+ publishMqtt (topicLedBrightnessState, Led_GetBrightness (), false );
177
177
#endif
178
178
System_IndicateOk ();
179
179
break ;
180
180
}
181
181
182
182
case CMD_REPEAT_PLAYLIST: {
183
183
if (gPlayProperties .playMode == NO_PLAYLIST) {
184
- Log_Println (( char *) FPSTR ( modificatorNotallowedWhenIdle) , LOGLEVEL_NOTICE);
184
+ Log_Println (modificatorNotallowedWhenIdle, LOGLEVEL_NOTICE);
185
185
System_IndicateError ();
186
186
} else {
187
187
if (gPlayProperties .repeatPlaylist ) {
188
- Log_Println (( char *) FPSTR ( modificatorPlaylistLoopDeactive) , LOGLEVEL_NOTICE);
188
+ Log_Println (modificatorPlaylistLoopDeactive, LOGLEVEL_NOTICE);
189
189
} else {
190
- Log_Println (( char *) FPSTR ( modificatorPlaylistLoopActive) , LOGLEVEL_NOTICE);
190
+ Log_Println (modificatorPlaylistLoopActive, LOGLEVEL_NOTICE);
191
191
}
192
192
gPlayProperties .repeatPlaylist = !gPlayProperties .repeatPlaylist ;
193
193
#ifdef MQTT_ENABLE
194
- publishMqtt (( char *) FPSTR ( topicRepeatModeState) , AudioPlayer_GetRepeatMode (), false );
194
+ publishMqtt (topicRepeatModeState, AudioPlayer_GetRepeatMode (), false );
195
195
#endif
196
196
System_IndicateOk ();
197
197
}
@@ -200,17 +200,17 @@ void Cmd_Action(const uint16_t mod) {
200
200
201
201
case CMD_REPEAT_TRACK: { // Introduces looping for track-mode
202
202
if (gPlayProperties .playMode == NO_PLAYLIST) {
203
- Log_Println (( char *) FPSTR ( modificatorNotallowedWhenIdle) , LOGLEVEL_NOTICE);
203
+ Log_Println (modificatorNotallowedWhenIdle, LOGLEVEL_NOTICE);
204
204
System_IndicateError ();
205
205
} else {
206
206
if (gPlayProperties .repeatCurrentTrack ) {
207
- Log_Println (( char *) FPSTR ( modificatorTrackDeactive) , LOGLEVEL_NOTICE);
207
+ Log_Println (modificatorTrackDeactive, LOGLEVEL_NOTICE);
208
208
} else {
209
- Log_Println (( char *) FPSTR ( modificatorTrackActive) , LOGLEVEL_NOTICE);
209
+ Log_Println (modificatorTrackActive, LOGLEVEL_NOTICE);
210
210
}
211
211
gPlayProperties .repeatCurrentTrack = !gPlayProperties .repeatCurrentTrack ;
212
212
#ifdef MQTT_ENABLE
213
- publishMqtt (( char *) FPSTR ( topicRepeatModeState) , AudioPlayer_GetRepeatMode (), false );
213
+ publishMqtt (topicRepeatModeState, AudioPlayer_GetRepeatMode (), false );
214
214
#endif
215
215
System_IndicateOk ();
216
216
}
@@ -219,9 +219,9 @@ void Cmd_Action(const uint16_t mod) {
219
219
220
220
case CMD_DIMM_LEDS_NIGHTMODE: {
221
221
#ifdef MQTT_ENABLE
222
- publishMqtt (( char *) FPSTR ( topicLedBrightnessState) , Led_GetBrightness (), false );
222
+ publishMqtt (topicLedBrightnessState, Led_GetBrightness (), false );
223
223
#endif
224
- Log_Println (( char *) FPSTR ( ledsDimmedToNightmode) , LOGLEVEL_INFO);
224
+ Log_Println (ledsDimmedToNightmode, LOGLEVEL_INFO);
225
225
Led_ResetToNightBrightness ();
226
226
System_IndicateOk ();
227
227
break ;
@@ -265,7 +265,7 @@ void Cmd_Action(const uint16_t mod) {
265
265
if (millis () <= 30000 ) { // Only allow to enable FTP within the first 30s after start (to prevent children it mess it up)
266
266
Ftp_EnableServer ();
267
267
} else {
268
- Log_Println (( char *) FPSTR ( ftpEnableTooLate) , LOGLEVEL_ERROR);
268
+ Log_Println (ftpEnableTooLate, LOGLEVEL_ERROR);
269
269
System_IndicateError ();
270
270
}
271
271
break ;
0 commit comments