diff --git a/examples/UnitTest/UnitTest.ino b/examples/UnitTest/UnitTest.ino index b69e96a..efacc9f 100644 --- a/examples/UnitTest/UnitTest.ino +++ b/examples/UnitTest/UnitTest.ino @@ -120,9 +120,7 @@ uint8_t status; TaskHandle_t playHandle = NULL; TaskHandle_t radioHandle = NULL; -static lv_obj_t *vad_btn_label; -static uint32_t vad_detected_counter = 0; -static TaskHandle_t vadTaskHandler; + bool kbDetected = false; bool touchDetected = false; bool transmissionFlag = true; @@ -419,9 +417,9 @@ bool setupSD() uint32_t cardSize = SD.cardSize() / (1024 * 1024); uint32_t cardTotal = SD.totalBytes() / (1024 * 1024); uint32_t cardUsed = SD.usedBytes() / (1024 * 1024); - Serial.printf("SD Card Size: %lu MB\n", cardSize); - Serial.printf("Total space: %lu MB\n", cardTotal); - Serial.printf("Used space: %lu MB\n", cardUsed); + Serial.printf("SD Card Size: %u MB\n", cardSize); + Serial.printf("Total space: %u MB\n", cardTotal); + Serial.printf("Used space: %u MB\n", cardUsed); return true; } } @@ -666,6 +664,8 @@ bool checkKb() } #ifdef USE_ESP_VAD +static uint32_t vad_detected_counter = 0; +static TaskHandle_t vadTaskHandler; void vadTask(void *params) { Serial.println("vadTask(void *params)"); @@ -1302,17 +1302,11 @@ static void setupLvgl() } - - - - - uint8_t buffer[256]; int getAck(uint8_t *buffer, uint16_t size, uint8_t requestedClass, uint8_t requestedID) { uint16_t ubxFrameCounter = 0; - bool ubxFrame = 0; uint32_t startTime = millis(); uint16_t needRead; diff --git a/examples/UnitTest/ui.cpp b/examples/UnitTest/ui.cpp index 63d5890..07555fb 100644 --- a/examples/UnitTest/ui.cpp +++ b/examples/UnitTest/ui.cpp @@ -45,8 +45,10 @@ enum { }; typedef uint8_t lv_menu_builder_variant_t; -static void back_event_handler(lv_event_t *e); -static void switch_handler(lv_event_t *e); + +// static void back_event_handler(lv_event_t *e); +// static void switch_handler(lv_event_t *e); + lv_obj_t *root_page; static lv_obj_t *create_text(lv_obj_t *parent, const char *icon, const char *txt, lv_menu_builder_variant_t builder_variant); @@ -507,6 +509,7 @@ void setupUI(void) lv_timer_handler(); } +#if 0 static void back_event_handler(lv_event_t *e) { lv_obj_t *obj = lv_event_get_target(e); @@ -535,6 +538,7 @@ static void switch_handler(lv_event_t *e) } } } +#endif static lv_obj_t *create_text(lv_obj_t *parent, const char *icon, const char *txt, lv_menu_builder_variant_t builder_variant) diff --git a/examples/lvgl_example/lvgl_example.ino b/examples/lvgl_example/lvgl_example.ino index 89d6474..9207260 100644 --- a/examples/lvgl_example/lvgl_example.ino +++ b/examples/lvgl_example/lvgl_example.ino @@ -4,9 +4,6 @@ #include "TouchDrvGT911.hpp" #include "utilities.h" -static void slider_event_cb(lv_event_t *e); -static lv_obj_t *slider_label; - TFT_eSPI tft; TouchDrvGT911 touch; @@ -134,21 +131,6 @@ void setupLvgl() lv_indev_drv_register( &indev_touchpad ); } -static void slider_event_cb(lv_event_t *e) -{ - lv_obj_t *slider = lv_event_get_target(e); - char buf[8]; - lv_snprintf(buf, sizeof(buf), "%d%%", (int)lv_slider_get_value(slider)); - lv_label_set_text(slider_label, buf); - lv_obj_align_to(slider_label, slider, LV_ALIGN_OUT_BOTTOM_MID, 0, 10); -} - -static void set_angle(void *obj, int32_t v) -{ - lv_arc_set_value((lv_obj_t *)obj, v); -} - - void setup() { Serial.begin(115200); @@ -213,66 +195,6 @@ void setup() setupLvgl(); -#if 0 - lv_obj_t *tv = lv_tileview_create(lv_scr_act()); - - /*Tile1: just a label*/ - lv_obj_t *tile1 = lv_tileview_add_tile(tv, 0, 0, LV_DIR_BOTTOM | LV_DIR_HOR); - lv_obj_t *label = lv_label_create(tile1); - lv_label_set_text(label, "Scroll down"); - lv_obj_center(label); - - - /*Tile2: a slider*/ - lv_obj_t *tile2 = lv_tileview_add_tile(tv, 0, 1, LV_DIR_TOP | LV_DIR_RIGHT); - - /*Create a slider in the center of the display*/ - lv_obj_t *slider = lv_slider_create(tile2); - lv_obj_center(slider); - lv_obj_add_event_cb(slider, slider_event_cb, LV_EVENT_VALUE_CHANGED, NULL); - /*Create a label below the slider*/ - slider_label = lv_label_create(tile2); - lv_label_set_text(slider_label, "0%"); - lv_obj_align_to(slider_label, slider, LV_ALIGN_OUT_BOTTOM_MID, 0, 10); - - /*Tile3: a list*/ - lv_obj_t *tile3 = lv_tileview_add_tile(tv, 1, 1, LV_DIR_LEFT); - lv_obj_t *list = lv_list_create(tile3); - lv_obj_set_size(list, LV_PCT(100), LV_PCT(100)); - - lv_list_add_btn(list, NULL, "One"); - lv_list_add_btn(list, NULL, "Two"); - lv_list_add_btn(list, NULL, "Three"); - lv_list_add_btn(list, NULL, "Four"); - lv_list_add_btn(list, NULL, "Five"); - lv_list_add_btn(list, NULL, "Six"); - lv_list_add_btn(list, NULL, "Seven"); - lv_list_add_btn(list, NULL, "Eight"); - lv_list_add_btn(list, NULL, "Nine"); - lv_list_add_btn(list, NULL, "Ten"); - - /*Tile4: a arc*/ - lv_obj_t *tile4 = lv_tileview_add_tile(tv, 1, 0, LV_DIR_HOR); - - /*Create an Arc*/ - lv_obj_t *arc = lv_arc_create(tile4); - lv_arc_set_rotation(arc, 270); - lv_arc_set_bg_angles(arc, 0, 360); - lv_obj_remove_style(arc, NULL, LV_PART_KNOB); /*Be sure the knob is not displayed*/ - lv_obj_clear_flag(arc, LV_OBJ_FLAG_CLICKABLE); /*To not allow adjusting by click*/ - lv_obj_center(arc); - - lv_anim_t a; - lv_anim_init(&a); - lv_anim_set_var(&a, arc); - lv_anim_set_exec_cb(&a, set_angle); - lv_anim_set_time(&a, 1000); - lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE); /*Just for the demo*/ - lv_anim_set_repeat_delay(&a, 500); - lv_anim_set_values(&a, 0, 100); - lv_anim_start(&a); -#else - const int offset = 0; struct align_str { @@ -315,7 +237,7 @@ void setup() lv_label_set_text_fmt(label, "%d", i); lv_obj_center(label); } -#endif + // Adjust backlight pinMode(BOARD_BL_PIN, OUTPUT); setBrightness(16); diff --git a/lib/es7210/src/es7210.cpp b/lib/es7210/src/es7210.cpp index 65b2c0c..4a44a6e 100644 --- a/lib/es7210/src/es7210.cpp +++ b/lib/es7210/src/es7210.cpp @@ -40,7 +40,6 @@ static TwoWire *es7210wire; -static es7210_gain_value_t gain; /* * Clock coefficient structer @@ -58,7 +57,7 @@ struct _coeff_div_es7210 { uint32_t lrck_l; /* The low 8 bits of lrck */ }; -static const char *TAG = "ES7210"; +#define TAG "ES7210" static es7210_input_mics_t mic_select = (es7210_input_mics_t)(ES7210_INPUT_MIC1 | ES7210_INPUT_MIC2 | ES7210_INPUT_MIC3 | ES7210_INPUT_MIC4);