1
0
mirror of https://github.com/skot/ESP-Miner.git synced 2025-03-18 22:02:03 +01:00

added separate scrolling messages for selftest pass and fail

This commit is contained in:
Skot 2025-01-17 17:38:07 -05:00
parent 06be7f5ddb
commit 9859629034

@ -30,7 +30,8 @@ static lv_obj_t *wifi_status_label;
static lv_obj_t *self_test_message_label;
static lv_obj_t *self_test_result_label;
static lv_obj_t *self_test_finished_label;
static lv_obj_t *self_test_finished_pass_label;
static lv_obj_t *self_test_finished_fail_label;
static double current_hashrate;
static float current_power;
@ -55,11 +56,17 @@ static lv_obj_t * create_scr_self_test() {
self_test_result_label = lv_label_create(scr);
self_test_finished_label = lv_label_create(scr);
lv_obj_set_width(self_test_finished_label, LV_HOR_RES);
lv_obj_add_flag(self_test_finished_label, LV_OBJ_FLAG_HIDDEN);
lv_label_set_long_mode(self_test_finished_label, LV_LABEL_LONG_SCROLL_CIRCULAR);
lv_label_set_text(self_test_finished_label, "Hold BOOT button for 2 seconds to cancel self test, or press RESET to run again.");
self_test_finished_pass_label = lv_label_create(scr);
lv_obj_set_width(self_test_finished_pass_label, LV_HOR_RES);
lv_obj_add_flag(self_test_finished_pass_label, LV_OBJ_FLAG_HIDDEN);
lv_label_set_long_mode(self_test_finished_pass_label, LV_LABEL_LONG_SCROLL_CIRCULAR);
lv_label_set_text(self_test_finished_pass_label, "Press RESET to exit selftest.");
self_test_finished_fail_label = lv_label_create(scr);
lv_obj_set_width(self_test_finished_fail_label, LV_HOR_RES);
lv_obj_add_flag(self_test_finished_fail_label, LV_OBJ_FLAG_HIDDEN);
lv_label_set_long_mode(self_test_finished_fail_label, LV_LABEL_LONG_SCROLL_CIRCULAR);
lv_label_set_text(self_test_finished_fail_label, "Hold BOOT button for 2 seconds to cancel self test, or press RESET to run again.");
return scr;
}
@ -228,9 +235,13 @@ static void screen_update_cb(lv_timer_t * timer)
lv_label_set_text(self_test_message_label, self_test->message);
if (self_test->finished) {
lv_label_set_text(self_test_result_label, self_test->result ? "TESTS PASS!" : "TESTS FAIL!");
lv_obj_remove_flag(self_test_finished_label, LV_OBJ_FLAG_HIDDEN);
if (self_test->result) {
lv_label_set_text(self_test_result_label, "TESTS PASS!");
lv_obj_remove_flag(self_test_finished_pass_label, LV_OBJ_FLAG_HIDDEN);
} else {
lv_label_set_text(self_test_result_label, "TESTS FAIL!");
lv_obj_remove_flag(self_test_finished_fail_label, LV_OBJ_FLAG_HIDDEN);
}
}
return;