From 12c014d79fcf7802678d5c64796e47534c1bca2a Mon Sep 17 00:00:00 2001 From: "mihlit@mihlit.cz" Date: Wed, 9 May 2012 19:43:58 +0000 Subject: [PATCH] different fix for "there are no lines to go on trainer:slave_mode" Perhaps not the best solution from nice code point of view, but from three ways I tried, it adds the least amount of bytes :) --- src/general_menus.cpp | 2 +- src/menus.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/general_menus.cpp b/src/general_menus.cpp index 6f4c971be..7bd7911be 100644 --- a/src/general_menus.cpp +++ b/src/general_menus.cpp @@ -493,7 +493,7 @@ void menuProcTrainer(uint8_t event) uint8_t y; bool slave = SLAVE_MODE; - MENU(STR_MENUTRAINER, menuTabDiag, e_Trainer, slave ? 1 : 7, {0, 2, 2, 2, 2, 0/*, 0*/}); + MENU(STR_MENUTRAINER, menuTabDiag, e_Trainer, slave ? 0 : 7, {0, 2, 2, 2, 2, 0/*, 0*/}); if (slave) { // i am the slave lcd_puts(7*FW, 3*FH, STR_SLAVE); diff --git a/src/menus.h b/src/menus.h index bcd3c0cac..c877320ac 100644 --- a/src/menus.h +++ b/src/menus.h @@ -162,7 +162,7 @@ typedef void (*MenuFuncP_PROGMEM)(uint8_t event); #define MENU(title, tab, menu, lines_count, ...) \ static const pm_uint8_t mstate_tab[] PROGMEM = __VA_ARGS__; \ -if (!check(event,menu,tab,DIM(tab),mstate_tab,DIM(mstate_tab)-1,lines_count-1)) return; \ +if (!check(event,menu,tab,DIM(tab),mstate_tab,lines_count ? DIM(mstate_tab)-1 : 0,lines_count-1)) return; \ TITLE(title) #define SIMPLE_MENU_NOTITLE(tab, menu, lines_count) \