X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fgui%2Fmenu.c;h=432927895e28e03f63bf4243259378877cb50969;hb=39e200e1f43474a96888f97e2271728c9605ccbe;hp=dabc9210e25a403c0452f645300633721da3177b;hpb=5ad7e5ee1a5a243c05ee9a5ab690e48006caad86;p=bertos.git diff --git a/bertos/gui/menu.c b/bertos/gui/menu.c index dabc9210..43292789 100644 --- a/bertos/gui/menu.c +++ b/bertos/gui/menu.c @@ -39,9 +39,9 @@ #include "menu.h" -#include "cfg/cfg_gfx.h" #include "cfg/cfg_menu.h" #include "cfg/cfg_arch.h" + #include #include @@ -49,6 +49,8 @@ #include #include +#include + #include #include /* strcpy() */ @@ -57,19 +59,6 @@ #include /* strncpy_P() */ #endif -#if CONFIG_MENU_SMOOTH -#include -/** - * With this you can choose, at compile time, which backend to use. - * - * $WIZ$ menu_backend_lcd = "LCD_RIT128X96_DRV", "LCD_32122A_DRV" - */ -#define LCD_RIT128X96_DRV 0 ///< -#define LCD_32122A_DRV 1 ///< - - -#endif - #if (CONFIG_MENU_TIMEOUT != 0) #include #endif @@ -205,13 +194,11 @@ static void menu_layout( ypos = bm->cr.ymin; -#if 1 if (redraw) { /* Clear screen */ text_clear(menu->bitmap); } -#endif if (title) { @@ -284,10 +271,7 @@ static void menu_layout( /* Only print visible items */ if (!(item->flags & MIF_HIDDEN)) { - /* Check if a special render function is supplied, otherwise use defaults */ - #if (ARCH & ARCH_NIGHTTEST) - #warning __FILTER_NEXT_WARNING__ - #endif + #warning __FILTER_NEXT_WARNING__ RenderHook renderhook = (item->flags & MIF_RENDERHOOK) ? (RenderHook)item->label : menu_defaultRenderHook; /* Render menuitem */ @@ -303,7 +287,7 @@ static void menu_layout( /* Clear rest of area */ gfx_rectClear(bm, bm->cr.xmin, ypos, bm->cr.xmax, bm->cr.ymax); - lcd_blitBitmap(bm); + menu->lcd_blitBitmap(bm); } /* Restore old cliprect */ @@ -482,6 +466,7 @@ iptr_t menu_handle(const struct Menu *menu) #if CONFIG_MENU_SMOOTH || (CONFIG_MENU_TIMEOUT != 0) key = kbd_peek(); + cpu_relax(); #else key = kbd_get(); #endif @@ -550,9 +535,7 @@ iptr_t menu_handle(const struct Menu *menu) /* Store currently selected item before leaving. */ if (menu->flags & MF_SAVESEL) - #if (ARCH & ARCH_NIGHTTEST) - #warning __FILTER_NEXT_WARNING__ - #endif + #warning __FILTER_NEXT_WARNING__ CONST_CAST(struct Menu *, menu)->selected = selected; return result;