more speaker driver updates

This commit is contained in:
2025-03-26 04:56:57 -05:00
parent cc8dcfacb3
commit 41113ccafe
17 changed files with 64 additions and 31 deletions
+6 -2
View File
@@ -263,8 +263,12 @@ static bool play_part(uint32_t time) {
lv_label_set_text(text, "");
xSemaphoreGive(xGuiSemaphore);
}
vTaskDelay(pdMS_TO_TICKS(80));
play_clip_wav(MOUNT_POINT "/correct.wav", true, false, 3, 0);
if (part == 2) {
play_clip_wav(MOUNT_POINT "/stepdone.wav", true, false, 0, 0);
vTaskDelay(pdMS_TO_TICKS(2000));
} else {
play_clip_wav(MOUNT_POINT "/partdone.wav", true, false, 1, 0);
}
return true;
}
+3 -3
View File
@@ -100,14 +100,14 @@ void step2(void) {
char c = char_of_keypad_key(key);
// ESP_LOGI(TAG, "Pressed: %c", c);
if (c == answer_char) {
play_clip_wav(MOUNT_POINT "/correct.wav", true, false, 3, 0);
solved_times++;
if (solved_times < NUM_SOLVES) {
play_clip_wav(MOUNT_POINT "/stepdone.wav", true, false, 0, 0);
clean_bomb();
new_puzzle();
} else {
uint8_t display_tmp[4] = {0b00000000, 0b00000000, 0b00000000, 0b00000000};
set_module_sseg_raw(display_tmp);
play_clip_wav(MOUNT_POINT "/partdone.wav", true, false, 0, 0);
clear_module_sseg();
}
} else {
strike_time = xTaskGetTickCount();
+6 -2
View File
@@ -80,7 +80,7 @@ void step3(void) {
// tone = 2;
while (get_button_pressed(nullptr)) vTaskDelay(pdMS_TO_TICKS(10));
play_clip_wav(MOUNT_POINT "/correct.wav", true, false, 3, 0);
play_clip_wav(MOUNT_POINT "/ready.wav", true, false, 3, 0);
play_clip_wav(TONE_FILES[tone], false, false, 3, 0);
bool correct = false;
@@ -98,7 +98,11 @@ void step3(void) {
if (correct) {
times++;
clean_bomb();
play_clip_wav(MOUNT_POINT "/correct.wav", true, false, 3, 0);
if (times < TIMES_TO_COMPLETE) {
play_clip_wav(MOUNT_POINT "/part-done.wav", true, false, 3, 0);
} else {
play_clip_wav(MOUNT_POINT "/step-done.wav", true, false, 3, 0);
}
} else {
vTaskDelay(pdMS_TO_TICKS(1500));
}
+3 -5
View File
@@ -23,8 +23,7 @@ static const void* BACKGROUND_SRC = (void*)"A:" MOUNT_POINT "/bg.bin";
// LV_IMG_DECLARE(background);
// static const void* BACKGROUND_SRC = (void*)&background;
static QueueHandle_t stop_music;
static bool playing_music = true;
#define MUSIC_FILE MOUNT_POINT "/piano.wav"
static const char* PIECE_IMG_SRC[] = {
NULL,
@@ -162,16 +161,15 @@ static void init_screen() {
xSemaphoreGive(xGuiSemaphore);
play_clip_wav(MOUNT_POINT "/tetris.wav", true, false, 3, 0);
play_clip_wav(MUSIC_FILE, true, true, 4, 0);
}
static void deinit_screen() {
while (xSemaphoreTake(xGuiSemaphore, portMAX_DELAY) == pdFALSE) vTaskDelay(pdMS_TO_TICKS(10));
lv_obj_clean(lv_scr_act());
xSemaphoreGive(xGuiSemaphore);
if (!stop_clip(MOUNT_POINT "/tetris.wav", pdMS_TO_TICKS(1000))) {
if (!stop_clip(MUSIC_FILE, pdMS_TO_TICKS(1000))) {
ESP_LOGW(TAG, "Can't stop, addicted to the shindig.");
}
}