Skip to content

Commit 20414f1

Browse files
committed
menu now stops/starts audio ampli
1 parent 6d3149e commit 20414f1

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

platform/common/menu_pico.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,9 @@ void run_menu_loop()
699699
memcpy(backup_hw_screen->pixels, (uint16_t*) virtual_hw_screen->pixels,
700700
RES_HW_SCREEN_HORIZONTAL * RES_HW_SCREEN_VERTICAL * sizeof(uint16_t));
701701

702+
/* Stop Ampli */
703+
popen(SHELL_CMD_TURN_AMPLI_OFF, "r");
704+
702705
/// ------ Wait for menu UP key event ------
703706
int actions[IN_BINDTYPE_COUNT] = { 0, };
704707
while(event.type != SDL_KEYUP || event.key.keysym.sym != SDLK_q){
@@ -1077,6 +1080,9 @@ void run_menu_loop()
10771080
if(SDL_EnableKeyRepeat(backup_key_repeat_delay, backup_key_repeat_interval)){
10781081
MENU_ERROR_PRINTF("ERROR with SDL_EnableKeyRepeat: %s\n", SDL_GetError());
10791082
}
1083+
1084+
/* Start Ampli */
1085+
popen(SHELL_CMD_TURN_AMPLI_ON, "r");
10801086
}
10811087

10821088

@@ -1103,6 +1109,9 @@ int launch_resume_menu_loop()
11031109
uint8_t menu_confirmation = 0;
11041110
int option_idx=RESUME_YES;
11051111

1112+
/* Stop Ampli */
1113+
popen(SHELL_CMD_TURN_AMPLI_OFF, "r");
1114+
11061115
/* Save prev key repeat params and set new Key repeat */
11071116
SDL_GetKeyRepeat(&backup_key_repeat_delay, &backup_key_repeat_interval);
11081117
if(SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL)){
@@ -1265,6 +1274,9 @@ int launch_resume_menu_loop()
12651274
MENU_ERROR_PRINTF("ERROR with SDL_EnableKeyRepeat: %s\n", SDL_GetError());
12661275
}
12671276

1277+
/* Start Ampli */
1278+
popen(SHELL_CMD_TURN_AMPLI_ON, "r");
1279+
12681280
return option_idx;
12691281
}
12701282

platform/common/menu_pico.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ typedef enum {RESUME_OPTIONS} ENUM_RESUME_OPTIONS;
5454
#define SHELL_CMD_SCHEDULE_POWERDOWN "sched_shutdown"
5555
#define SHELL_CMD_NOTIF "notif_set"
5656
#define SHELL_CMD_WRITE_QUICK_LOAD_CMD "write_args_quick_load_file"
57+
#define SHELL_CMD_TURN_AMPLI_ON "start_audio_amp 1"
58+
#define SHELL_CMD_TURN_AMPLI_OFF "start_audio_amp 0"
5759

5860
#define MAXPATHLEN 512
5961

0 commit comments

Comments
 (0)