Skip to content

Commit dfd3dd4

Browse files
committed
Add Startup beep as a user flash setting ON/OFF
1 parent 0c251ef commit dfd3dd4

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

AxxSolder_firmware/Core/Inc/main.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ typedef struct{
4545
double screen_rotation;
4646
double power_limit;
4747
double current_measurement;
48-
49-
48+
double startup_beep;
5049
}Flash_values;
50+
5151
/* USER CODE END Includes */
5252

5353
/* Exported types ------------------------------------------------------------*/

AxxSolder_firmware/Core/Src/main.c

+10-8
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,11 @@ Flash_values default_flash_values = {.startup_temperature = 330,
230230
.GPIO4_ON_at_run = 0,
231231
.screen_rotation = 2,
232232
.power_limit = 0,
233-
.current_measurement = 1};
233+
.current_measurement = 1,
234+
.startup_beep = 1};
234235

235236
/* List of names for settings menu */
236-
#define menu_length 15
237+
#define menu_length 16
237238
char menu_names[menu_length][22] = { "Startup Temp ",
238239
"Temp Offset ",
239240
"Standby Temp ",
@@ -246,6 +247,7 @@ char menu_names[menu_length][22] = { "Startup Temp ",
246247
"Screen rotation ",
247248
"Limit Power ",
248249
"I measurement ",
250+
"Startup beep ",
249251
"-Load Default- ",
250252
"-Save and Reboot- ",
251253
"-Exit no Save- "};
@@ -458,7 +460,7 @@ void settings_menu(){
458460
((double*)&flash_values)[menu_cursor_position] = (float)old_value + (float)(TIM2->CNT - 1000.0) / 2.0 - (float)menu_cursor_position;
459461
}
460462

461-
if ((menu_cursor_position == 5) || (menu_cursor_position == 8) || (menu_cursor_position == 11)){
463+
if ((menu_cursor_position == 5) || (menu_cursor_position == 8) || (menu_cursor_position == 11) || (menu_cursor_position == 12)){
462464
((double*)&flash_values)[menu_cursor_position] = fmod(round(fmod(fabs(((double*)&flash_values)[menu_cursor_position]), 2)), 2);
463465
}
464466
else if (menu_cursor_position == 9){
@@ -1339,11 +1341,11 @@ int main(void)
13391341
LCD_draw_main_screen();
13401342

13411343
/* Start-up beep */
1342-
#ifndef DEBUG
1343-
beep();
1344-
HAL_Delay(100);
1345-
beep();
1346-
#endif
1344+
if(flash_values.startup_beep == 1){
1345+
beep();
1346+
HAL_Delay(100);
1347+
beep();
1348+
}
13471349

13481350

13491351
while (1){

0 commit comments

Comments
 (0)