diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-04-16 14:25:49 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-04-16 14:36:39 +0100 |
commit | d55dceff371c4080d179fb26e6f175927cc48768 (patch) | |
tree | 65598ecdc8142d4178b1f8b13dce37e871cc7016 /apps/plugins/chessbox | |
parent | 90960adf56d4798a23b8fdc7e6a9bb25dd0bf530 (diff) | |
download | rockbox-d55dceff371c4080d179fb26e6f175927cc48768.tar.gz rockbox-d55dceff371c4080d179fb26e6f175927cc48768.zip |
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
Diffstat (limited to 'apps/plugins/chessbox')
-rw-r--r-- | apps/plugins/chessbox/chessbox.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c index 13df4f177e..089cf7c400 100644 --- a/apps/plugins/chessbox/chessbox.c +++ b/apps/plugins/chessbox/chessbox.c | |||
@@ -222,6 +222,7 @@ static void cb_wt_callback ( void ) { | |||
222 | button = rb->button_get(false); | 222 | button = rb->button_get(false); |
223 | switch (button) { | 223 | switch (button) { |
224 | case SYS_POWEROFF: | 224 | case SYS_POWEROFF: |
225 | case SYS_REBOOT: | ||
225 | cb_sysevent = button; | 226 | cb_sysevent = button; |
226 | #ifdef CB_RC_QUIT | 227 | #ifdef CB_RC_QUIT |
227 | case CB_RC_QUIT: | 228 | case CB_RC_QUIT: |
@@ -585,6 +586,7 @@ static struct cb_command cb_get_viewer_command (void) { | |||
585 | button = rb->button_get(true); | 586 | button = rb->button_get(true); |
586 | switch (button) { | 587 | switch (button) { |
587 | case SYS_POWEROFF: | 588 | case SYS_POWEROFF: |
589 | case SYS_REBOOT: | ||
588 | cb_sysevent = button; | 590 | cb_sysevent = button; |
589 | #ifdef CB_RC_QUIT | 591 | #ifdef CB_RC_QUIT |
590 | case CB_RC_QUIT: | 592 | case CB_RC_QUIT: |
@@ -848,6 +850,7 @@ static struct cb_command cb_getcommand (void) { | |||
848 | button = rb->button_get(true); | 850 | button = rb->button_get(true); |
849 | switch (button) { | 851 | switch (button) { |
850 | case SYS_POWEROFF: | 852 | case SYS_POWEROFF: |
853 | case SYS_REBOOT: | ||
851 | cb_sysevent = button; | 854 | cb_sysevent = button; |
852 | #ifdef CB_RC_QUIT | 855 | #ifdef CB_RC_QUIT |
853 | case CB_RC_QUIT: | 856 | case CB_RC_QUIT: |