From d55dceff371c4080d179fb26e6f175927cc48768 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sat, 16 Apr 2022 14:25:49 +0100 Subject: 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 --- apps/plugins/chessbox/chessbox.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apps/plugins/chessbox/chessbox.c') 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 ) { button = rb->button_get(false); switch (button) { case SYS_POWEROFF: + case SYS_REBOOT: cb_sysevent = button; #ifdef CB_RC_QUIT case CB_RC_QUIT: @@ -585,6 +586,7 @@ static struct cb_command cb_get_viewer_command (void) { button = rb->button_get(true); switch (button) { case SYS_POWEROFF: + case SYS_REBOOT: cb_sysevent = button; #ifdef CB_RC_QUIT case CB_RC_QUIT: @@ -848,6 +850,7 @@ static struct cb_command cb_getcommand (void) { button = rb->button_get(true); switch (button) { case SYS_POWEROFF: + case SYS_REBOOT: cb_sysevent = button; #ifdef CB_RC_QUIT case CB_RC_QUIT: -- cgit v1.2.3