summaryrefslogtreecommitdiff
path: root/firmware/export/powermgmt.h
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-04-16 14:25:49 +0100
committerAidan MacDonald <amachronic@protonmail.com>2022-04-16 14:36:39 +0100
commitd55dceff371c4080d179fb26e6f175927cc48768 (patch)
tree65598ecdc8142d4178b1f8b13dce37e871cc7016 /firmware/export/powermgmt.h
parent90960adf56d4798a23b8fdc7e6a9bb25dd0bf530 (diff)
downloadrockbox-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 'firmware/export/powermgmt.h')
-rw-r--r--firmware/export/powermgmt.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h
index 3095d2c97b..6ae5ccfd13 100644
--- a/firmware/export/powermgmt.h
+++ b/firmware/export/powermgmt.h
@@ -70,6 +70,12 @@ extern unsigned int power_thread_inputs;
70 70
71#endif /* CONFIG_CHARGING */ 71#endif /* CONFIG_CHARGING */
72 72
73enum shutdown_type
74{
75 SHUTDOWN_POWER_OFF,
76 SHUTDOWN_REBOOT,
77};
78
73#if CONFIG_CHARGING == CHARGING_TARGET 79#if CONFIG_CHARGING == CHARGING_TARGET
74/* Include target-specific definitions */ 80/* Include target-specific definitions */
75#include "powermgmt-target.h" 81#include "powermgmt-target.h"
@@ -164,8 +170,9 @@ void handle_auto_poweroff(void);
164void set_car_adapter_mode(bool setting); 170void set_car_adapter_mode(bool setting);
165void reset_poweroff_timer(void); 171void reset_poweroff_timer(void);
166void cancel_shutdown(void); 172void cancel_shutdown(void);
167void shutdown_hw(void); 173void shutdown_hw(enum shutdown_type sd_type);
168void sys_poweroff(void); 174void sys_poweroff(void);
175void sys_reboot(void);
169/* Returns true if the system should force shutdown for some reason - 176/* Returns true if the system should force shutdown for some reason -
170 * eg. low battery */ 177 * eg. low battery */
171bool query_force_shutdown(void); 178bool query_force_shutdown(void);