Skip to content

Commit d2db616

Browse files
committed
Implement long-press SW_1 to go to main menu
1 parent c2e808c commit d2db616

File tree

1 file changed

+8
-0
lines changed
  • AxxSolder_firmware/Core/Src

1 file changed

+8
-0
lines changed

AxxSolder_firmware/Core/Src/main.c

+8
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@ void settings_menu(){
606606
if (HAL_GPIO_ReadPin (GPIOB, SW_1_Pin) == 1){
607607
settings_menu_active = 1;
608608

609+
UG_FillScreen(RGB_to_BRG(C_BLACK));
609610
char str[32];
610611
memset(&str, '\0', strlen(str));
611612
if((flash_values.screen_rotation == 0) || (flash_values.screen_rotation == 2)){
@@ -696,6 +697,7 @@ void settings_menu(){
696697
}
697698
else if((HAL_GPIO_ReadPin (GPIOB, SW_1_Pin) == 1) && (menu_cursor_position == menu_length-1)){
698699
menu_active = 0;
700+
HAL_NVIC_SystemReset();
699701
}
700702
else if((HAL_GPIO_ReadPin (GPIOB, SW_1_Pin) == 1) && (menu_cursor_position == menu_length-2)){
701703
menu_active = 0;
@@ -1205,6 +1207,12 @@ void handle_button_status(){
12051207
TIM2->CNT = flash_values.preset_temp_2;
12061208
}
12071209
}
1210+
if(SW_1_pressed_long == 1){
1211+
SW_1_pressed_long = 0;
1212+
change_state(EMERGENCY_SLEEP);
1213+
/* start settings menu */
1214+
settings_menu();
1215+
}
12081216
}
12091217

12101218
/* Get the status of handle in/on stand to trigger SLEEP */

0 commit comments

Comments
 (0)