forked from len0rd/rockbox
apps: Add ability to do a clean reboot
Allow a clean shutdown to end in either power off or reboot. Add a new event SYS_REBOOT to signal it and sys_reboot() to trigger the event. SYS_REBOOT signals a reboot request and should be listened for alongside SYS_POWEROFF events. Change-Id: I99ba7fb5feed2bb5a0a40a274e8466ad74fe3a43
This commit is contained in:
parent
90960adf56
commit
d55dceff37
15 changed files with 72 additions and 14 deletions
|
@ -141,6 +141,7 @@ void exit_on_usb(int button)
|
|||
long result = rb->default_event_handler_ex(button, cleanup_wrapper, NULL);
|
||||
if (result == SYS_USB_CONNECTED)
|
||||
_exit(PLUGIN_USB_CONNECTED);
|
||||
else if (result == SYS_POWEROFF)
|
||||
else if (result == SYS_POWEROFF || result == SYS_REBOOT)
|
||||
/* note: nobody actually pays attention to this exit code */
|
||||
_exit(PLUGIN_POWEROFF);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue