diff --git a/examples/factory_test/factory_test.ino b/examples/factory_test/factory_test.ino index 69dc477..515b78e 100644 --- a/examples/factory_test/factory_test.ino +++ b/examples/factory_test/factory_test.ino @@ -182,7 +182,6 @@ void multi_thread_create(void) xTaskCreate(ws2812_task, "ws2812_task", 1024 * 2, NULL, WS2812_PRIORITY, &ws2812_handle); xTaskCreate(battery_task, "battery_task", 1024 * 2, NULL, BATTERY_PRIORITY, &battery_handle); // xTaskCreate(infared_task, "infared_task", 1024 * 2, NULL, INFARED_PRIORITY, &infared_handle); - } void wifi_init(void) @@ -432,28 +431,33 @@ void setup(void) } int file_cnt = 0; +extern bool music_is_running; void loop(void) { - lv_timer_handler(); audio.loop(); - if (irrecv.decode(&results)) { - // print() & println() can't handle printing long longs. (uint64_t) - serialPrintUint64(results.value, HEX); - IR_recv_value = results.value; - Serial.println(""); - irrecv.resume(); // Receive the next value - } + lv_timer_handler(); - i2s_read((i2s_port_t)EXAMPLE_I2S_CH, (char *)i2s_readraw_buff, SAMPLE_SIZE, &bytes_read, 100); - for(int i = 0; i < 10; i++) { - // Serial.printf("%d ", i2s_readraw_buff[i]); - // if(i == 9) { - // Serial.println(" "); - // } - if(i2s_readraw_buff[i] > 0) i2s_mic_cnt++; + if(music_is_running == false) { + if (irrecv.decode(&results)) { + // print() & println() can't handle printing long longs. (uint64_t) + serialPrintUint64(results.value, HEX); + IR_recv_value = results.value; + Serial.println(""); + irrecv.resume(); // Receive the next value + } + + i2s_read((i2s_port_t)EXAMPLE_I2S_CH, (char *)i2s_readraw_buff, SAMPLE_SIZE, &bytes_read, 100); + for(int i = 0; i < 10; i++) { + // Serial.printf("%d ", i2s_readraw_buff[i]); + // if(i == 9) { + // Serial.println(" "); + // } + if(i2s_readraw_buff[i] > 0) i2s_mic_cnt++; + } } + delay(1); } diff --git a/examples/factory_test/ui.cpp b/examples/factory_test/ui.cpp index 2f94ff9..2d9b07e 100644 --- a/examples/factory_test/ui.cpp +++ b/examples/factory_test/ui.cpp @@ -2116,7 +2116,7 @@ static lv_obj_t *pause_btn; static lv_obj_t *next_btn; static lv_obj_t *prev_btn; static lv_obj_t *mic_led; -static bool music_is_running = false; +bool music_is_running = false; static lv_timer_t *mic_chk_timer = NULL; int music_idx = 0; char *music_list[20] = {0}; diff --git a/examples/factory_test/utilities.h b/examples/factory_test/utilities.h index 31e1db6..3327643 100644 --- a/examples/factory_test/utilities.h +++ b/examples/factory_test/utilities.h @@ -18,7 +18,6 @@ #define BOARD_MIC_CLK 39 // VOICE -// #define BOARD_VOICE_MODE 4 #define BOARD_VOICE_BCLK 46 #define BOARD_VOICE_LRCLK 40 #define BOARD_VOICE_DIN 7 diff --git a/firmware/firmware_factory_test_20240819.bin b/firmware/firmware_factory_test_20241014.bin similarity index 96% rename from firmware/firmware_factory_test_20240819.bin rename to firmware/firmware_factory_test_20241014.bin index e62b7fc..745098e 100644 Binary files a/firmware/firmware_factory_test_20240819.bin and b/firmware/firmware_factory_test_20241014.bin differ