Skip to content

Commit f9f5415

Browse files
committed
menu now stops/starts audio ampli
1 parent 3edf32b commit f9f5415

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

sys.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ typedef enum {RESUME_OPTIONS} ENUM_RESUME_OPTIONS;
6767
#define SHELL_CMD_SCHEDULE_POWERDOWN "sched_shutdown"
6868
#define SHELL_CMD_NOTIF "notif_set"
6969
#define SHELL_CMD_WRITE_QUICK_LOAD_CMD "write_args_quick_load_file"
70+
#define SHELL_CMD_TURN_AMPLI_ON "start_audio_amp 1"
71+
#define SHELL_CMD_TURN_AMPLI_OFF "start_audio_amp 0"
7072

7173
////------ Global variables -------
7274
extern int volume_percentage;

sys/sdl/sdl-menu.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,9 @@ void run_menu_loop()
643643
MENU_ERROR_PRINTF("ERROR Could not copy hw_screen: %s\n", SDL_GetError());
644644
}
645645

646+
/* Stop Ampli */
647+
popen(SHELL_CMD_TURN_AMPLI_OFF, "r");
648+
646649
/// -------- Main loop ---------
647650
while (!stop_menu_loop)
648651
{
@@ -991,6 +994,9 @@ void run_menu_loop()
991994
if(SDL_EnableKeyRepeat(backup_key_repeat_delay, backup_key_repeat_interval)){
992995
MENU_ERROR_PRINTF("ERROR with SDL_EnableKeyRepeat: %s\n", SDL_GetError());
993996
}
997+
998+
/* Start Ampli */
999+
popen(SHELL_CMD_TURN_AMPLI_ON, "r");
9941000
}
9951001

9961002

@@ -1014,6 +1020,9 @@ int launch_resume_menu_loop()
10141020
uint8_t menu_confirmation = 0;
10151021
int option_idx=RESUME_YES;
10161022

1023+
/* Stop Ampli */
1024+
popen(SHELL_CMD_TURN_AMPLI_OFF, "r");
1025+
10171026
/* Save prev key repeat params and set new Key repeat */
10181027
SDL_GetKeyRepeat(&backup_key_repeat_delay, &backup_key_repeat_interval);
10191028
if(SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL)){
@@ -1184,5 +1193,8 @@ int launch_resume_menu_loop()
11841193
MENU_ERROR_PRINTF("ERROR with SDL_EnableKeyRepeat: %s\n", SDL_GetError());
11851194
}
11861195

1196+
/* Start Ampli */
1197+
popen(SHELL_CMD_TURN_AMPLI_ON, "r");
1198+
11871199
return option_idx;
11881200
}

0 commit comments

Comments
 (0)