diff options
author | William Wilgus <wilgus.william@gmail.com> | 2023-04-08 17:13:07 -0400 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2023-04-08 17:13:07 -0400 |
commit | 78c92c5ca85d275e43bacf0d9948ce9b94605f6e (patch) | |
tree | 4b167c51c68aed322588429e5d625fb4a3247d67 /firmware | |
parent | 3554306617245cf019f024fb0ba80ec2476ec5f9 (diff) | |
download | rockbox-78c92c5ca85d275e43bacf0d9948ce9b94605f6e.tar.gz rockbox-78c92c5ca85d275e43bacf0d9948ce9b94605f6e.zip |
[Feature] Supress voice during sleep timer shutdown
if show_shutdown_message == false and sleep timer is active
talk will be disabled on shutdown
Change-Id: Ia660e753700f3e283691f41797ef7a77a2d9a8d9
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/export/powermgmt.h | 1 | ||||
-rw-r--r-- | firmware/powermgmt.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h index 6ae5ccfd13..41594abe4d 100644 --- a/firmware/export/powermgmt.h +++ b/firmware/export/powermgmt.h | |||
@@ -164,6 +164,7 @@ int get_battery_capacity(void); /* get local battery capacity value */ | |||
164 | void set_battery_type(int type); /* set local battery type */ | 164 | void set_battery_type(int type); /* set local battery type */ |
165 | 165 | ||
166 | void set_sleeptimer_duration(int minutes); | 166 | void set_sleeptimer_duration(int minutes); |
167 | bool get_sleep_timer_active(void); | ||
167 | int get_sleep_timer(void); | 168 | int get_sleep_timer(void); |
168 | void set_keypress_restarts_sleep_timer(bool enable); | 169 | void set_keypress_restarts_sleep_timer(bool enable); |
169 | void handle_auto_poweroff(void); | 170 | void handle_auto_poweroff(void); |
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index c33ad387ae..abcd32f814 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c | |||
@@ -961,6 +961,11 @@ static void set_sleep_timer(int seconds) | |||
961 | sleeptimer_duration = seconds; | 961 | sleeptimer_duration = seconds; |
962 | } | 962 | } |
963 | 963 | ||
964 | bool get_sleep_timer_active(void) | ||
965 | { | ||
966 | return sleeptimer_active; | ||
967 | } | ||
968 | |||
964 | int get_sleep_timer(void) | 969 | int get_sleep_timer(void) |
965 | { | 970 | { |
966 | if (sleeptimer_active && (sleeptimer_endtick >= current_tick)) | 971 | if (sleeptimer_active && (sleeptimer_endtick >= current_tick)) |