Skip to content

Commit 55ab171

Browse files
committed
Implement long-press SW_2 and SW_3 to set current set temp to new preset temperature
1 parent c2e808c commit 55ab171

File tree

1 file changed

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

1 file changed

+18
-0
lines changed

AxxSolder_firmware/Core/Src/main.c

+18
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,15 @@ void handle_button_status(){
11921192
TIM2->CNT = flash_values.preset_temp_1;
11931193
}
11941194
}
1195+
if(SW_2_pressed_long == 1){
1196+
SW_2_pressed_long = 0;
1197+
if(flash_values.three_button_mode == 0){
1198+
flash_values.preset_temp_1 = TIM2->CNT;
1199+
FlashWrite(&flash_values);
1200+
LCD_draw_main_screen();
1201+
sleep_state_written_to_LCD = 0;
1202+
}
1203+
}
11951204
/* Set "set temp" to preset temp 2 */
11961205
if(SW_3_pressed == 1){
11971206
SW_3_pressed = 0;
@@ -1205,6 +1214,15 @@ void handle_button_status(){
12051214
TIM2->CNT = flash_values.preset_temp_2;
12061215
}
12071216
}
1217+
if(SW_3_pressed_long == 1){
1218+
SW_3_pressed_long = 0;
1219+
if(flash_values.three_button_mode == 0){
1220+
flash_values.preset_temp_2 = TIM2->CNT;
1221+
FlashWrite(&flash_values);
1222+
LCD_draw_main_screen();
1223+
sleep_state_written_to_LCD = 0;
1224+
}
1225+
}
12081226
}
12091227

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

0 commit comments

Comments
 (0)