Skip to content

Commit

Permalink
fix:Update test firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
ShallowGreen123 committed Oct 16, 2024
1 parent ba0ad44 commit fb6b360
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
36 changes: 20 additions & 16 deletions examples/factory_test/factory_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion examples/factory_test/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
1 change: 0 additions & 1 deletion examples/factory_test/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file not shown.

0 comments on commit fb6b360

Please sign in to comment.