Skip to content

Commit d6b2e20

Browse files
committed
menu now stops/starts audio ampli
1 parent 6e6b78a commit d6b2e20

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/drivers/menu.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,9 @@ void run_menu_loop()
706706
memcpy(backup_hw_screen->pixels, dst_virtual,
707707
RES_HW_SCREEN_HORIZONTAL * RES_HW_SCREEN_VERTICAL * sizeof(uint16_t));*/
708708

709+
/* Stop Ampli */
710+
popen(SHELL_CMD_TURN_AMPLI_OFF, "r");
711+
709712
/// -------- Main loop ---------
710713
while (!stop_menu_loop)
711714
{
@@ -1063,6 +1066,9 @@ void run_menu_loop()
10631066
if(SDL_EnableKeyRepeat(backup_key_repeat_delay, backup_key_repeat_interval)){
10641067
MENU_ERROR_PRINTF("ERROR with SDL_EnableKeyRepeat: %s\n", SDL_GetError());
10651068
}
1069+
1070+
/* Start Ampli */
1071+
popen(SHELL_CMD_TURN_AMPLI_ON, "r");
10661072
}
10671073

10681074

@@ -1087,6 +1093,9 @@ int launch_resume_menu_loop()
10871093
int option_idx=RESUME_YES;
10881094
pumpWrap_disabled = 1;
10891095

1096+
/* Stop Ampli */
1097+
popen(SHELL_CMD_TURN_AMPLI_OFF, "r");
1098+
10901099
/* Save prev key repeat params and set new Key repeat */
10911100
SDL_GetKeyRepeat(&backup_key_repeat_delay, &backup_key_repeat_interval);
10921101
if(SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL)){
@@ -1254,5 +1263,8 @@ int launch_resume_menu_loop()
12541263
/* re-enable pumpwrap if exiting menu */
12551264
pumpWrap_disabled = 0;
12561265

1266+
/* Start Ampli */
1267+
popen(SHELL_CMD_TURN_AMPLI_ON, "r");
1268+
12571269
return option_idx;
12581270
}

src/drivers/menu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ typedef enum {RESUME_OPTIONS} ENUM_RESUME_OPTIONS;
6464
#define SHELL_CMD_SCHEDULE_POWERDOWN "sched_shutdown"
6565
#define SHELL_CMD_NOTIF "notif_set"
6666
#define SHELL_CMD_WRITE_QUICK_LOAD_CMD "write_args_quick_load_file"
67+
#define SHELL_CMD_TURN_AMPLI_ON "start_audio_amp 1"
68+
#define SHELL_CMD_TURN_AMPLI_OFF "start_audio_amp 0"
6769

6870
////------ Global variables -------
6971
extern int volume_percentage;

0 commit comments

Comments
 (0)