From 71f70112b2484e45b332fd7f2da137145aa05e9d Mon Sep 17 00:00:00 2001 From: Richard Quirk Date: Fri, 5 Oct 2012 21:30:13 +0200 Subject: Add set_sleeptimer_duration function in minutes Make set_sleep_timer a static function and only call set_sleeptimer_duration externally, which is always called with minutes values. Change-Id: I985308bf014e354f91c47a0b2bf62f4f5a591919 Reviewed-on: http://gerrit.rockbox.org/327 Reviewed-by: Jonathan Gordon --- apps/menus/settings_menu.c | 4 ++-- apps/settings.c | 2 +- apps/shortcuts.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'apps') diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index f2249e3a57..fbc83fd60d 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c @@ -438,8 +438,8 @@ static int sleep_timer_voice(int selected_item, void*data) /* If a sleep timer is running, cancel it, otherwise start one */ static int toggle_sleeptimer(void) { - set_sleep_timer(get_sleep_timer() ? 0 - : global_settings.sleeptimer_duration * 60); + set_sleeptimer_duration(get_sleep_timer() ? 0 + : global_settings.sleeptimer_duration); return 0; } diff --git a/apps/settings.c b/apps/settings.c index 3bf9c5bf17..e2a6efa3d8 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -842,7 +842,7 @@ void settings_apply(bool read_disk) #endif set_poweroff_timeout(global_settings.poweroff); if (global_settings.sleeptimer_on_startup) - set_sleep_timer(global_settings.sleeptimer_duration * 60); + set_sleeptimer_duration(global_settings.sleeptimer_duration); set_keypress_restarts_sleep_timer( global_settings.keypress_restarts_sleeptimer); diff --git a/apps/shortcuts.c b/apps/shortcuts.c index 50b8decfc6..ee8454485d 100644 --- a/apps/shortcuts.c +++ b/apps/shortcuts.c @@ -528,7 +528,7 @@ int do_shortcut_menu(void *ignored) #endif { char timer_buf[10]; - set_sleep_timer(sc->u.timedata.sleep_timeout * 60); + set_sleeptimer_duration(sc->u.timedata.sleep_timeout); splashf(HZ, "%s (%s)", str(LANG_SLEEP_TIMER), sleep_timer_formatter(timer_buf, sizeof(timer_buf), sc->u.timedata.sleep_timeout, NULL)); -- cgit v1.2.3