store/load run status on edit
This commit is contained in:
parent
e017cb8a9d
commit
11446b5de7
@ -23,6 +23,8 @@ static lv_obj_t* ws_label;
|
||||
|
||||
static lv_timer_t* volume_readout_update_timer = NULL;
|
||||
|
||||
static uint8_t run_status = 0;
|
||||
|
||||
static void delete_timer(lv_timer_t** timer){
|
||||
if(*timer == NULL) return;
|
||||
lv_timer_del(*timer);
|
||||
@ -51,6 +53,7 @@ static void run_handler(lv_event_t * e){
|
||||
lv_label_set_text(label, LV_SYMBOL_PAUSE);
|
||||
pse_sp_set_dir_all(units, units_num, 1);
|
||||
pse_sp_start_all(units, units_num);
|
||||
run_status = 1;
|
||||
|
||||
volume_readout_update_timer = lv_timer_create(volume_readout_update, 100, NULL);
|
||||
}
|
||||
@ -58,6 +61,7 @@ static void run_handler(lv_event_t * e){
|
||||
lv_label_set_text(label, LV_SYMBOL_PLAY);
|
||||
pse_sp_stop_all(units, units_num);
|
||||
delete_timer(&volume_readout_update_timer);
|
||||
run_status = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -232,6 +236,11 @@ void Home_Screen_Gen(pse_unit* pse_units, uint8_t pse_unit_num, uint8_t delete){
|
||||
lv_obj_t* run_label = lv_label_create(run_button);
|
||||
lv_label_set_text(run_label, LV_SYMBOL_PLAY);
|
||||
lv_obj_center(run_label);
|
||||
if(run_status){
|
||||
lv_obj_add_state(run_button, LV_STATE_CHECKED);
|
||||
lv_label_set_text(run_label, LV_SYMBOL_PAUSE);
|
||||
volume_readout_update_timer = lv_timer_create(volume_readout_update, 100, NULL);
|
||||
}
|
||||
|
||||
// add workspace switcher
|
||||
lv_obj_t* ws_left = lv_btn_create(top_menu);
|
||||
|
Loading…
x
Reference in New Issue
Block a user