home screen load delete option

This commit is contained in:
leo 2023-09-09 18:04:38 +02:00
parent b2011af18c
commit 654ad8baad
Signed by: leo
GPG Key ID: 0DD993BFB2B307DB
4 changed files with 5 additions and 7 deletions

View File

@ -10,6 +10,6 @@
#include "PSE_unit.h"
void Home_Screen_Gen(pse_unit* units, uint8_t pse_unit_num);
void Home_Screen_Gen(pse_unit* units, uint8_t pse_unit_num, uint8_t delete);
#endif /* INC_HOME_SCREEN_H_ */

View File

@ -34,9 +34,7 @@ static void back_button_handler(lv_event_t * e){
pse_stepper_planer_compute_sps(c_pse_unit);
// go back to the main menu
lv_obj_t* curr_scr = lv_scr_act();
Home_Screen_Gen(c_pse_units, c_pse_units_num);
lv_obj_del(curr_scr);
Home_Screen_Gen(c_pse_units, c_pse_units_num, true);
}
}

View File

@ -179,7 +179,7 @@ static lv_obj_t* PSE_unit_widget(lv_obj_t* parent, pse_unit* pse_unit){
return cont;
}
void Home_Screen_Gen(pse_unit* pse_units, uint8_t pse_unit_num){
void Home_Screen_Gen(pse_unit* pse_units, uint8_t pse_unit_num, uint8_t delete){
// Create a new screen
lv_obj_t* scr = lv_obj_create(NULL);
screen = scr;
@ -250,5 +250,5 @@ void Home_Screen_Gen(pse_unit* pse_units, uint8_t pse_unit_num){
}
// fade in the new screen
lv_scr_load_anim(scr, LV_SCR_LOAD_ANIM_FADE_ON, 0, 0, false);
lv_scr_load_anim(scr, LV_SCR_LOAD_ANIM_FADE_ON, 0, 0, delete);
}

View File

@ -293,7 +293,7 @@ int main(void)
load_units(pse_units, pse_syringes, pse_stepper_confs, pse_home_displays, PSE_UNITS_NUM, 0);
// Load the home screen
Home_Screen_Gen(pse_units, PSE_UNITS_NUM);
Home_Screen_Gen(pse_units, PSE_UNITS_NUM, false);
/* USER CODE END 2 */
/* Infinite loop */