From cdc2beb2022749c6747bffc93b85a3967ee5a95b Mon Sep 17 00:00:00 2001 From: bsongis Date: Tue, 21 Feb 2012 21:47:46 +0000 Subject: [PATCH] Bug when editing phase names with Rotary Encoder --- src/menus.cpp | 8 ++------ src/model_menus.cpp | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/menus.cpp b/src/menus.cpp index 040c892a3..688217e48 100644 --- a/src/menus.cpp +++ b/src/menus.cpp @@ -171,7 +171,7 @@ void check_rotary_encoder() #define SCROLL_POT1_TH 32 #ifdef NAVIGATION_RE1 -#define MAXCOL(row) ((horTab && row > 0) ? pgm_read_byte(horTab+min(row, (int8_t)horTabMax)) : (const uint8_t)0) +#define MAXCOL(row) ((horTab && row >= 0) ? pgm_read_byte(horTab+min(row, (int8_t)horTabMax)) : (const uint8_t)0) #else #define MAXCOL(row) (horTab ? pgm_read_byte(horTab+min(row, horTabMax)) : (const uint8_t)0) #endif @@ -313,17 +313,13 @@ bool check(uint8_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTa ++scrollRE; if (m_posHorz-- == 0) { if (m_posVert-- <= 0) { -#ifdef NAVIGATION_RE1 m_posVert = menuTab ? 0 : -1; -#else - m_posVert = 0; -#endif m_posHorz = 0; scrollRE = 0; } else { maxcol = MAXCOL(m_posVert); - if (maxcol < 0) maxcol = MAXCOL(--m_posVert); + if (maxcol < 0) { --m_posVert; maxcol = MAXCOL(m_posVert); } m_posHorz = maxcol; } } diff --git a/src/model_menus.cpp b/src/model_menus.cpp index 7025dd109..d0b22396f 100644 --- a/src/model_menus.cpp +++ b/src/model_menus.cpp @@ -421,7 +421,7 @@ void menuProcModel(uint8_t event) lcd_outdezNAtt(7*FW,0,g_eeGeneral.currModel+1,INVERS+LEADING0,2); MENU(STR_MENUSETUP, menuTabModel, e_Model, (g_model.protocol==PROTO_PPM||g_model.protocol==PROTO_DSM2||g_model.protocol==PROTO_PXX ? 12 : 11), {0,ZCHAR|(sizeof(g_model.name)-1),2,2,0,0,0,0,0,6,2,1}); - uint8_t sub = m_posVert; + uint8_t sub = m_posVert; uint8_t y = 1*FH; uint8_t subN = 1;