Skip to content

Commit 9c741fc

Browse files
committed
menu now stops/starts audio ampli
1 parent 12a0245 commit 9c741fc

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/drivers/dingux-sdl/menu.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,9 @@ void run_menu_loop()
644644
}*/
645645
memcpy(backup_hw_screen->pixels, hw_screen->pixels,
646646
RES_HW_SCREEN_HORIZONTAL * RES_HW_SCREEN_VERTICAL * sizeof(u16));
647+
648+
/* Stop Ampli */
649+
popen(SHELL_CMD_TURN_AMPLI_OFF, "r");
647650

648651
/// -------- Main loop ---------
649652
while (!stop_menu_loop)
@@ -993,6 +996,9 @@ void run_menu_loop()
993996
if(SDL_EnableKeyRepeat(backup_key_repeat_delay, backup_key_repeat_interval)){
994997
MENU_ERROR_PRINTF("ERROR with SDL_EnableKeyRepeat: %s\n", SDL_GetError());
995998
}
999+
1000+
/* Start Ampli */
1001+
popen(SHELL_CMD_TURN_AMPLI_ON, "r");
9961002
}
9971003

9981004

@@ -1016,6 +1022,9 @@ int launch_resume_menu_loop()
10161022
uint8_t menu_confirmation = 0;
10171023
int option_idx=RESUME_YES;
10181024

1025+
/* Stop Ampli */
1026+
popen(SHELL_CMD_TURN_AMPLI_OFF, "r");
1027+
10191028
/* Save prev key repeat params and set new Key repeat */
10201029
SDL_GetKeyRepeat(&backup_key_repeat_delay, &backup_key_repeat_interval);
10211030
if(SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL)){
@@ -1178,5 +1187,8 @@ int launch_resume_menu_loop()
11781187
MENU_ERROR_PRINTF("ERROR with SDL_EnableKeyRepeat: %s\n", SDL_GetError());
11791188
}
11801189

1190+
/* Start Ampli */
1191+
popen(SHELL_CMD_TURN_AMPLI_ON, "r");
1192+
11811193
return option_idx;
11821194
}

src/drivers/dingux-sdl/menu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ typedef enum {RESUME_OPTIONS} ENUM_RESUME_OPTIONS;
5050
#define SHELL_CMD_SCHEDULE_POWERDOWN "sched_shutdown"
5151
#define SHELL_CMD_NOTIF "notif_set"
5252
#define SHELL_CMD_WRITE_QUICK_LOAD_CMD "write_args_quick_load_file"
53+
#define SHELL_CMD_TURN_AMPLI_ON "start_audio_amp 1"
54+
#define SHELL_CMD_TURN_AMPLI_OFF "start_audio_amp 0"
5355

5456
////------ Global variables -------
5557
extern int volume_percentage;

0 commit comments

Comments
 (0)