diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/action.c | 8 | ||||
-rw-r--r-- | apps/appevents.h | 2 | ||||
-rw-r--r-- | apps/debug_menu.c | 19 | ||||
-rw-r--r-- | apps/gui/gwps.c | 2 | ||||
-rw-r--r-- | apps/gui/list.c | 3 | ||||
-rw-r--r-- | apps/gui/viewport.c | 4 | ||||
-rw-r--r-- | apps/gui/yesno.c | 3 | ||||
-rw-r--r-- | apps/main.c | 11 | ||||
-rw-r--r-- | apps/menus/eq_menu.c | 10 | ||||
-rw-r--r-- | apps/misc.c | 3 |
10 files changed, 28 insertions, 37 deletions
diff --git a/apps/action.c b/apps/action.c index c2a6e47ebe..d98bf13cf3 100644 --- a/apps/action.c +++ b/apps/action.c @@ -25,6 +25,7 @@ #include "config.h" #include "lang.h" +#include "appevents.h" #include "button.h" #include "action.h" #include "kernel.h" @@ -104,10 +105,6 @@ static inline int get_next_context(const struct button_mapping *items, int i) Timeout can be TIMEOUT_NOBLOCK to return immediatly TIMEOUT_BLOCK to wait for a button press Any number >0 to wait that many ticks for a press - - This function will likely return SYS_FOURHERTZ which should be passed to the - default_event_handler(). If this doesnt happen parts of the GUI may not be - redrawn correctly */ static int get_action_worker(int context, int timeout, const struct button_mapping* (*get_context_map)(int) ) @@ -117,6 +114,9 @@ static int get_action_worker(int context, int timeout, int i=0; int ret = ACTION_UNKNOWN; static int last_context = CONTEXT_STD; + + + send_event(GUI_EVENT_ACTIONUPDATE, NULL); if (timeout == TIMEOUT_NOBLOCK) button = button_get(false); diff --git a/apps/appevents.h b/apps/appevents.h index 48d578de25..8cbc301ed7 100644 --- a/apps/appevents.h +++ b/apps/appevents.h @@ -49,7 +49,7 @@ enum { enum { GUI_EVENT_THEME_CHANGED = (EVENT_CLASS_GUI|1), GUI_EVENT_STATUSBAR_TOGGLE, - GUI_EVENT_FOURHERTZ, + GUI_EVENT_ACTIONUPDATE, }; #endif diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 92eb245249..6f7887abc3 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -272,6 +272,7 @@ static bool dbg_audio_thread(void) lcd_update(); } viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); return false; } #endif /* !SIMULATOR */ @@ -399,6 +400,7 @@ static bool dbg_buffering_thread(void) tick_remove_task(dbg_audio_task); viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); return false; } @@ -693,6 +695,7 @@ static bool dbg_hw_info(void) return __dbg_hw_info(); #endif /* CONFIG_CPU */ viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); return false; } #else /* !HAVE_LCD_BITMAP */ @@ -988,6 +991,7 @@ static bool dbg_spdif(void) #endif viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); return false; } #endif /* CPU_COLDFIRE */ @@ -1072,6 +1076,7 @@ bool dbg_ports(void) if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) { viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); return false; } } @@ -1159,6 +1164,7 @@ bool dbg_ports(void) if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) { viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); return false; } } @@ -1270,6 +1276,7 @@ extern unsigned char serbuf[]; if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) { viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); return false; } } @@ -1313,10 +1320,12 @@ extern unsigned char serbuf[]; if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) { viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); return false; } } viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); #else return __dbg_ports(); #endif /* CPU */ @@ -1397,6 +1406,7 @@ bool dbg_ports(void) } } viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); return false; } #endif /* !HAVE_LCD_BITMAP */ @@ -1449,11 +1459,13 @@ static bool dbg_pcf(void) if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) { viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); return false; } } viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); return false; } #endif @@ -1502,10 +1514,12 @@ static bool dbg_cpufreq(void) case ACTION_STD_CANCEL: viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); return false; } } viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); return false; } #endif /* HAVE_ADJUSTABLE_CPU_FREQ */ @@ -1840,10 +1854,12 @@ static bool view_battery(void) case ACTION_STD_CANCEL: viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); return false; } } viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); return false; } @@ -2505,8 +2521,8 @@ static bool cpu_boost_log(void) } } get_action(CONTEXT_STD,TIMEOUT_BLOCK); - lcd_setfont(FONT_UI); viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); return false; } #endif @@ -2556,6 +2572,7 @@ static bool dbg_scrollwheel(void) lcd_update(); } viewportmanager_set_statusbar(true); + lcd_setfont(FONT_UI); return false; } #endif diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 1f90077baa..c1e7606634 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c @@ -211,8 +211,6 @@ long gui_wps_show(void) if (button != ACTION_NONE) { break; } - else if (button == SYS_FOURHERTZ) - default_event_handler(button); peak_meter_peek(); sleep(0); /* Sleep until end of current tick. */ diff --git a/apps/gui/list.c b/apps/gui/list.c index 662496d40d..04bd7e4c3f 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -643,9 +643,6 @@ bool gui_synclist_do_button(struct gui_synclist * lists, switch (action) { - case SYS_FOURHERTZ: - default_event_handler(action); - return true; case ACTION_REDRAW: gui_synclist_draw(lists); return true; diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c index 9a0657d510..76fb36b940 100644 --- a/apps/gui/viewport.c +++ b/apps/gui/viewport.c @@ -92,12 +92,12 @@ bool viewportmanager_set_statusbar(bool enabled) bool old = statusbar_enabled; if (enabled && global_settings.statusbar) { - add_event(GUI_EVENT_FOURHERTZ, false, viewportmanager_draw_statusbars); + add_event(GUI_EVENT_ACTIONUPDATE, false, viewportmanager_draw_statusbars); gui_syncstatusbar_draw(&statusbars, true); } else { - remove_event(GUI_EVENT_FOURHERTZ, viewportmanager_draw_statusbars); + remove_event(GUI_EVENT_ACTIONUPDATE, viewportmanager_draw_statusbars); } statusbar_enabled = enabled; return old; diff --git a/apps/gui/yesno.c b/apps/gui/yesno.c index 1e597f2fcb..756d267c63 100644 --- a/apps/gui/yesno.c +++ b/apps/gui/yesno.c @@ -167,9 +167,6 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message, case SYS_CHARGER_DISCONNECTED: /* ignore some SYS events that can happen */ continue; - case SYS_FOURHERTZ: /* make sure this one works as expected */ - default_event_handler(button); - break; default: if(default_event_handler(button) == SYS_USB_CONNECTED) return(YESNO_USB); diff --git a/apps/main.c b/apps/main.c index d473e66731..4e66a851f1 100644 --- a/apps/main.c +++ b/apps/main.c @@ -120,16 +120,6 @@ const char appsversion[]=APPSVERSION; static void init(void); - -static void fourhertz_tick_task(void) -{ - static long last_fire = 0; - if (TIME_AFTER(current_tick, last_fire+HZ/4)) - { - queue_post(&button_queue, SYS_FOURHERTZ, 0); - last_fire = current_tick; - } -} #ifdef SIMULATOR void app_main(void) @@ -148,7 +138,6 @@ static void app_main(void) #ifdef HAVE_TOUCHSCREEN touchscreen_set_mode(TOUCHSCREEN_BUTTON); #endif - tick_add_task(fourhertz_tick_task); viewportmanager_set_statusbar(true); add_event(GUI_EVENT_STATUSBAR_TOGGLE, false, viewportmanager_statusbar_changed); diff --git a/apps/menus/eq_menu.c b/apps/menus/eq_menu.c index 77b6e6f07a..28df0836fc 100644 --- a/apps/menus/eq_menu.c +++ b/apps/menus/eq_menu.c @@ -49,6 +49,7 @@ #include "gui/scrollbar.h" #include "eq_menu.h" #include "menu_common.h" +#include "viewport.h" /* * Utility functions @@ -391,6 +392,7 @@ bool eq_menu_graphical(void) enum eq_type current_type; char buf[24]; int i, w, h, height, start_item, nb_eq_sliders[NB_SCREENS]; + bool barsenabled = viewportmanager_set_statusbar(false); FOR_NB_SCREENS(i) { @@ -553,12 +555,6 @@ bool eq_menu_graphical(void) exit_request = true; result = false; break; - case SYS_FOURHERTZ: - /* eat this for the time being. this whole screen needs to be converted - * to viewports, so when that happens this message can be handled - * properly. - */ - break; default: if(default_event_handler(button) == SYS_USB_CONNECTED) { exit_request = true; @@ -580,7 +576,7 @@ bool eq_menu_graphical(void) screens[i].clear_display(); screens[i].set_viewport(NULL); } - + viewportmanager_set_statusbar(barsenabled); return result; } diff --git a/apps/misc.c b/apps/misc.c index 894b0c2cc4..1410d47244 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -906,9 +906,6 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame { switch(event) { - case SYS_FOURHERTZ: - send_event(GUI_EVENT_FOURHERTZ, NULL); - break; case SYS_BATTERY_UPDATE: if(global_settings.talk_battery_level) { |