From: sjlongland Date: Sat, 24 Oct 2015 23:13:16 +0000 (+0000) Subject: sm1000_main: Clamp warn period to time-out period. X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=2e52a06669691b7b393d7ae7d9b70a8fdd436586;p=freetel-svn-tracking.git sm1000_main: Clamp warn period to time-out period. git-svn-id: https://svn.code.sf.net/p/freetel/code@2473 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/stm32/src/sm1000_main.c b/codec2-dev/stm32/src/sm1000_main.c index 93da72d8..b7dff1d8 100644 --- a/codec2-dev/stm32/src/sm1000_main.c +++ b/codec2-dev/stm32/src/sm1000_main.c @@ -992,7 +992,10 @@ static void menu_tot_warn_cb(struct menu_t* const menu, uint32_t event) case MENU_EVT_ENTERED: sfx_play(&sfx_player, sound_startup); /* Get the current period */ - menu->current = prefs.tot_warn_period; + if (prefs.tot_warn_period < prefs.tot_period) + menu->current = prefs.tot_warn_period; + else + menu->current = prefs.tot_period; case MENU_EVT_RETURNED: /* Shouldn't happen, but we handle it anyway */ announce = 1; @@ -1000,7 +1003,7 @@ static void menu_tot_warn_cb(struct menu_t* const menu, uint32_t event) case MENU_EVT_NEXT: sfx_play(&sfx_player, sound_click); /* Adjust the frequency up by 50 Hz */ - if (prefs.tot_warn_period < 600) + if (prefs.tot_warn_period < prefs.tot_period) prefs.tot_warn_period += 5; announce = 1; break;