1
0
Fork 0
forked from len0rd/rockbox

rgnano: Sleep timer and idle poweroff support

Actually power off the handheld with the sleep timer and idle poweroff functions instead of closing rockbox.

This commit also moves setting system volume to max from the launch script to system-sdl.c so it works when running rockbox via instant play.

Change-Id: I174b67c6abef451faa05f4a8f52b8d9eeed98a22
This commit is contained in:
Hairo R. Carela 2025-08-12 21:34:17 -04:00 committed by Solomon Peachy
parent 5ecb5832e1
commit c9e16e4888
6 changed files with 38 additions and 28 deletions

View file

@ -202,6 +202,7 @@ void power_off(void)
#if defined(RG_NANO) && !defined(SIMULATOR)
/* Reset volume/brightness to the values before launching rockbox */
ip_reset_values();
ip_power_off();
#endif
#ifdef HAVE_SDL_THREADS
@ -252,6 +253,9 @@ void system_init(void)
#endif
#if defined(RG_NANO) && !defined(SIMULATOR)
/* Set system volume to max with amixer */
system("amixer -q sset 'Headphone' 63 unmute");
/* Instant play handling */
struct sigaction ip_sa;
ip_sa.sa_handler = ip_handle_sigusr1;
@ -305,6 +309,8 @@ void system_reboot(void)
#if defined(RG_NANO) && !defined(SIMULATOR)
/* Reset volume/brightness to the values before launching rockbox */
ip_reset_values();
SDL_Quit();
exit(EXIT_SUCCESS);
#endif
#ifdef HAVE_SDL_THREADS