提交 eef4f77d 编写于 作者: CharlesGuo11's avatar CharlesGuo11

解决了看门狗报错问题,点击reset wii即可重新连接

上级 957f41a5
......@@ -29,7 +29,7 @@ static void (*g_net_config_end_cb)(void) = NULL;
static void nvs_erase(void){
nvs_flash_erase();
// ESP_LOGI("Wifi is reset, please scan the QR to reconnect the wifi again");
// ESP_LOGI(TAG,"Wifi is reset, please scan the QR to reconnect the wifi again");
printf("Wifi is reset, please scan the QR to reconnect the wifi again\n");
}
......@@ -192,25 +192,23 @@ void ui_net_config_update_cb(ui_net_state_t state, void *args)
lv_img_set_src(g_img, &icon_rmaker);
lv_obj_align(g_img, LV_ALIGN_CENTER, 0, -10);
lv_obj_clear_flag(g_hint_lab, LV_OBJ_FLAG_HIDDEN);
// lv_label_set_text_fmt(g_hint_lab, "Device already connected to cloud\n"
// "Wi-Fi is connected to #000000 %s#", ssid);
// lv_obj_align_to(g_hint_lab, g_img, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);
//Create a button to erase the nvs space where the wifi ssid and its password are located
lv_obj_t *wifi_reset=lv_btn_create(g_page);
lv_obj_set_size(wifi_reset, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
lv_obj_add_style(wifi_reset, &ui_button_styles()->style, 0);
lv_obj_add_style(wifi_reset, &ui_button_styles()->style_pr, LV_STATE_PRESSED);
lv_obj_add_style(wifi_reset, &ui_button_styles()->style_focus, LV_STATE_FOCUS_KEY);
lv_obj_add_style(wifi_reset, &ui_button_styles()->style_focus, LV_STATE_FOCUSED);
lv_obj_align_to(wifi_reset, g_img,LV_ALIGN_OUT_BOTTOM_MID, -30, 10);
lv_obj_t *reset_label=lv_label_create(wifi_reset);
lv_label_set_text_static(reset_label,"Reset WiFi");
lv_obj_set_style_text_color(reset_label, lv_color_make(18, 18, 18), LV_STATE_DEFAULT);
lv_obj_align(reset_label, LV_ALIGN_CENTER, 0, 0);
lv_obj_add_event_cb(wifi_reset, nvs_erase, LV_EVENT_CLICKED, NULL);
lv_label_set_text_fmt(g_hint_lab, "Device already connected to cloud\n"
"Wi-Fi is connected to #000000 %s#", ssid);
lv_obj_align_to(g_hint_lab, g_img, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);
// //Create a button to erase the nvs space where the wifi ssid and its password are located
// lv_obj_t *wifi_reset=lv_btn_create(g_page);
// lv_obj_set_size(wifi_reset, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
// lv_obj_add_style(wifi_reset, &ui_button_styles()->style, 0);
// lv_obj_add_style(wifi_reset, &ui_button_styles()->style_pr, LV_STATE_PRESSED);
// lv_obj_add_style(wifi_reset, &ui_button_styles()->style_focus, LV_STATE_FOCUS_KEY);
// lv_obj_add_style(wifi_reset, &ui_button_styles()->style_focus, LV_STATE_FOCUSED);
// lv_obj_align_to(wifi_reset, g_img,LV_ALIGN_OUT_BOTTOM_MID, -30, 10);
// lv_obj_t *reset_label=lv_label_create(wifi_reset);
// lv_label_set_text_static(reset_label,"Reset WiFi");
// lv_obj_set_style_text_color(reset_label, lv_color_make(18, 18, 18), LV_STATE_DEFAULT);
// lv_obj_align(reset_label, LV_ALIGN_CENTER, 0, 0);
// lv_obj_add_event_cb(wifi_reset, nvs_erase, LV_EVENT_CLICKED, NULL);
}
break;
default:
......@@ -269,10 +267,10 @@ void ui_net_config_start(void (*fn)(void))
lv_obj_align(g_btn_app_hint, LV_ALIGN_RIGHT_MID, 0, 0);
lv_obj_t *lab_app_inst = lv_label_create(g_btn_app_hint);
lv_label_set_text_static(lab_app_inst, "To install APP");
lv_label_set_text_static(lab_app_inst, "Reset WiFi");
lv_obj_set_style_text_color(lab_app_inst, lv_color_make(18, 18, 18), LV_STATE_DEFAULT);
lv_obj_align(lab_app_inst, LV_ALIGN_CENTER, 0, 0);
lv_obj_add_event_cb(g_btn_app_hint, ui_net_config_page_app_click_cb, LV_EVENT_CLICKED, NULL);
lv_obj_add_event_cb(g_btn_app_hint, nvs_erase, LV_EVENT_CLICKED, NULL);
if (ui_get_btn_op_group()) {
lv_group_add_obj(ui_get_btn_op_group(), g_btn_app_hint);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册