Skip to content

Commit c669a67

Browse files
authored
Merge pull request #2 from biologist79/master
merge back master
2 parents ddea7bf + 6f865f1 commit c669a67

29 files changed

+414
-110
lines changed

html/management_DE.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,13 +443,13 @@
443443
<label for="initBrightness">Nach dem Einschalten:</label>
444444
<div class="text-center">
445445
<i class="far fa-sun fa-2x .icon-pos"></i>
446-
<input data-provide="slider" type="number" data-slider-min="0" data-slider-max="255" min="0" max="255" class="form-control" id="initBrightness" name="initBrightness"
446+
<input data-provide="slider" type="number" data-slider-min="1" data-slider-max="255" min="1" max="255" class="form-control" id="initBrightness" name="initBrightness"
447447
data-slider-value="%INIT_LED_BRIGHTNESS%" value="%INIT_LED_BRIGHTNESS%" required><i class="fas fa-sun fa-2x .icon-pos"></i>
448448
</div>
449449

450450
<label for="nightBrightness">Im Nachtmodus</label>
451451
<div class="text-center">
452-
<i class="far fa-sun fa-2x .icon-pos"></i><input data-provide="slider" type="number" data-slider-min="0" data-slider-max="255" min="0" max="255" class="form-control" id="nightBrightness" name="nightBrightness" data-slider-value="%NIGHT_LED_BRIGHTNESS%" value="%NIGHT_LED_BRIGHTNESS%" required><i class="fas fa-sun fa-2x .icon-pos"></i>
452+
<i class="far fa-sun fa-2x .icon-pos"></i><input data-provide="slider" type="number" data-slider-min="0" data-slider-max="254" min="0" max="254" class="form-control" id="nightBrightness" name="nightBrightness" data-slider-value="%NIGHT_LED_BRIGHTNESS%" value="%NIGHT_LED_BRIGHTNESS%" required><i class="fas fa-sun fa-2x .icon-pos"></i>
453453
</div>
454454
</fieldset>
455455
</div>

html/management_EN.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@
442442
<label for="initBrightness">After restart:</label>
443443
<div class="text-center">
444444
<i class="far fa-sun fa-2x .icon-pos"></i>
445-
<input data-provide="slider" type="number" data-slider-min="0" data-slider-max="255" min="0" max="255" class="form-control" id="initBrightness" name="initBrightness"
445+
<input data-provide="slider" type="number" data-slider-min="0" data-slider-max="254" min="0" max="254" class="form-control" id="initBrightness" name="initBrightness"
446446
data-slider-value="%INIT_LED_BRIGHTNESS%" value="%INIT_LED_BRIGHTNESS%" required><i class="fas fa-sun fa-2x .icon-pos"></i>
447447
</div>
448448

platformio.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,14 @@ board_upload.flash_size = 8MB
193193
;WINDOWS: COM3
194194
;LINUX: /dev/ttyUSB0 (if it's the first USB-device attached, otherwise increase number)
195195

196+
[env:museluxe]
197+
board = esp-wrover-kit
198+
board_build.partitions = custom_4mb_noota.csv
199+
build_flags = -DHAL=10
200+
-DBOARD_HAS_PSRAM
201+
-mfix-esp32-psram-cache-issue
202+
-DLOG_BUFFER_SIZE=10240
203+
196204
;[env:esp32-s3-devkitc-1]
197205
;platform = espressif32
198206
;board = esp32-s3-devkitc-1

src/AudioPlayer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,9 @@ void AudioPlayer_Task(void *parameter) {
753753

754754
audio->loop();
755755
if (gPlayProperties.playlistFinished || gPlayProperties.pausePlay) {
756-
vTaskDelay(portTICK_PERIOD_MS * 10); // Waste some time if playlist is not active
756+
if (!gPlayProperties.currentSpeechActive) {
757+
vTaskDelay(portTICK_PERIOD_MS * 10); // Waste some time if playlist is not active
758+
}
757759
} else {
758760
System_UpdateActivityTimer(); // Refresh if playlist is active so uC will not fall asleep due to reaching inactivity-time
759761
}

src/AudioPlayer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ typedef struct { // Bit field
1212
double currentRelPos; // Current relative playPosition (in %)
1313
bool sleepAfterCurrentTrack: 1; // If uC should go to sleep after current track
1414
bool sleepAfterPlaylist: 1; // If uC should go to sleep after whole playlist
15+
bool sleepAfter5Tracks: 1; // If uC should go to sleep after 5 tracks
1516
bool saveLastPlayPosition: 1; // If playposition/current track should be saved (for AUDIOBOOK)
1617
char playRfidTag[13]; // ID of RFID-tag that started playlist
1718
bool pausePlay: 1; // If pause is active

src/Button.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ void Button_Init() {
128128
// If timer-semaphore is set, read buttons (unless controls are locked)
129129
void Button_Cyclic() {
130130
if (xSemaphoreTake(Button_TimerSemaphore, 0) == pdTRUE) {
131-
if (System_AreControlsLocked()) {
132-
return;
133-
}
134-
135131
unsigned long currentTimestamp = millis();
136132
#ifdef PORT_EXPANDER_ENABLE
137133
Port_Cyclic();
138134
#endif
139135

136+
if (System_AreControlsLocked()) {
137+
return;
138+
}
139+
140140
// Buttons can be mixed between GPIO and port-expander.
141141
// But at the same time only one of them can be for example NEXT_BUTTON
142142
#if defined(BUTTON_0_ENABLE) || defined(EXPANDER_0_ENABLE)

src/Cmd.cpp

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -76,28 +76,26 @@ void Cmd_Action(const uint16_t mod) {
7676
System_IndicateError();
7777
return;
7878
}
79+
80+
gPlayProperties.sleepAfterPlaylist = false;
81+
gPlayProperties.playUntilTrackNumber = 0;
82+
7983
if (gPlayProperties.sleepAfterCurrentTrack) {
84+
gPlayProperties.sleepAfterCurrentTrack = false;
8085
Log_Println((char *) FPSTR(modificatorSleepAtEOTd), LOGLEVEL_NOTICE);
8186
#ifdef MQTT_ENABLE
8287
publishMqtt((char *) FPSTR(topicSleepTimerState), "0", false);
8388
#endif
84-
#ifdef NEOPIXEL_ENABLE
85-
Led_ResetToInitialBrightness();
86-
#endif
89+
Led_ResetToInitialBrightness();
8790
} else {
91+
System_DisableSleepTimer();
92+
gPlayProperties.sleepAfterCurrentTrack = true;
8893
Log_Println((char *) FPSTR(modificatorSleepAtEOT), LOGLEVEL_NOTICE);
8994
#ifdef MQTT_ENABLE
9095
publishMqtt((char *) FPSTR(topicSleepTimerState), "EOT", false);
9196
#endif
92-
#ifdef NEOPIXEL_ENABLE
93-
Led_ResetToNightBrightness();
94-
Log_Println((char *) FPSTR(ledsDimmedToNightmode), LOGLEVEL_INFO);
95-
#endif
97+
Led_ResetToNightBrightness();
9698
}
97-
gPlayProperties.sleepAfterCurrentTrack = !gPlayProperties.sleepAfterCurrentTrack;
98-
gPlayProperties.sleepAfterPlaylist = false;
99-
System_DisableSleepTimer();
100-
gPlayProperties.playUntilTrackNumber = 0;
10199

102100
#ifdef MQTT_ENABLE
103101
publishMqtt((char *) FPSTR(topicLedBrightnessState), Led_GetBrightness(), false);
@@ -112,28 +110,24 @@ void Cmd_Action(const uint16_t mod) {
112110
System_IndicateError();
113111
return;
114112
}
115-
if (gPlayProperties.sleepAfterCurrentTrack) {
113+
if (gPlayProperties.sleepAfterPlaylist) {
114+
System_DisableSleepTimer();
115+
gPlayProperties.sleepAfterPlaylist = false;
116116
#ifdef MQTT_ENABLE
117117
publishMqtt((char *) FPSTR(topicSleepTimerState), "0", false);
118118
#endif
119-
#ifdef NEOPIXEL_ENABLE
120-
Led_ResetToInitialBrightness();
121-
#endif
119+
Led_ResetToInitialBrightness();
122120
Log_Println((char *) FPSTR(modificatorSleepAtEOPd), LOGLEVEL_NOTICE);
123121
} else {
124-
#ifdef NEOPIXEL_ENABLE
125-
Led_ResetToNightBrightness();
126-
Log_Println((char *) FPSTR(ledsDimmedToNightmode), LOGLEVEL_INFO);
127-
#endif
128-
Log_Println((char *) FPSTR(modificatorSleepAtEOP), LOGLEVEL_NOTICE);
122+
gPlayProperties.sleepAfterPlaylist = true;
123+
Led_ResetToNightBrightness();
124+
Log_Println((char *) FPSTR(modificatorSleepAtEOP), LOGLEVEL_NOTICE);
129125
#ifdef MQTT_ENABLE
130126
publishMqtt((char *) FPSTR(topicSleepTimerState), "EOP", false);
131127
#endif
132128
}
133129

134130
gPlayProperties.sleepAfterCurrentTrack = false;
135-
gPlayProperties.sleepAfterPlaylist = !gPlayProperties.sleepAfterPlaylist;
136-
System_DisableSleepTimer();
137131
gPlayProperties.playUntilTrackNumber = 0;
138132
#ifdef MQTT_ENABLE
139133
publishMqtt((char *) FPSTR(topicLedBrightnessState), Led_GetBrightness(), false);
@@ -153,16 +147,16 @@ void Cmd_Action(const uint16_t mod) {
153147
gPlayProperties.sleepAfterPlaylist = false;
154148
System_DisableSleepTimer();
155149

156-
if (gPlayProperties.playUntilTrackNumber > 0) {
150+
if (gPlayProperties.sleepAfter5Tracks) {
151+
gPlayProperties.sleepAfter5Tracks = false;
157152
gPlayProperties.playUntilTrackNumber = 0;
158153
#ifdef MQTT_ENABLE
159154
publishMqtt((char *) FPSTR(topicSleepTimerState), "0", false);
160155
#endif
161-
#ifdef NEOPIXEL_ENABLE
162-
Led_ResetToInitialBrightness();
163-
#endif
156+
Led_ResetToInitialBrightness();
164157
Log_Println((char *) FPSTR(modificatorSleepd), LOGLEVEL_NOTICE);
165158
} else {
159+
gPlayProperties.sleepAfter5Tracks = true;
166160
if (gPlayProperties.currentTrackNumber + 5 > gPlayProperties.numberOfTracks) { // If currentTrack + 5 exceeds number of tracks in playlist, sleep after end of playlist
167161
gPlayProperties.sleepAfterPlaylist = true;
168162
#ifdef MQTT_ENABLE
@@ -174,9 +168,7 @@ void Cmd_Action(const uint16_t mod) {
174168
publishMqtt((char *) FPSTR(topicSleepTimerState), "EO5T", false);
175169
#endif
176170
}
177-
#ifdef NEOPIXEL_ENABLE
178-
Led_ResetToNightBrightness();
179-
#endif
171+
Led_ResetToNightBrightness();
180172
Log_Println((char *) FPSTR(sleepTimerEO5), LOGLEVEL_NOTICE);
181173
}
182174

@@ -230,9 +222,7 @@ void Cmd_Action(const uint16_t mod) {
230222
publishMqtt((char *) FPSTR(topicLedBrightnessState), Led_GetBrightness(), false);
231223
#endif
232224
Log_Println((char *) FPSTR(ledsDimmedToNightmode), LOGLEVEL_INFO);
233-
#ifdef NEOPIXEL_ENABLE
234-
Led_ResetToNightBrightness();
235-
#endif
225+
Led_ResetToNightBrightness();
236226
System_IndicateOk();
237227
break;
238228
}

0 commit comments

Comments
 (0)