From e144f12cd787c41a66754dd12e62d4abe8ec4941 Mon Sep 17 00:00:00 2001 From: bsongis Date: Wed, 24 Oct 2012 21:52:50 +0000 Subject: [PATCH] [stock / M128 / gruvin9x] Problem when displaying GVx on AVR --- src/lcd.h | 6 ++++-- src/menus.cpp | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lcd.h b/src/lcd.h index 1700e11b9..7bc9c7262 100644 --- a/src/lcd.h +++ b/src/lcd.h @@ -64,8 +64,10 @@ #define CONDENSED 0x08 /* lcd puts flags */ -#define BSS 0x80 /* no 0x10 here to save flash as it is possible to have LEADING0 (putsStrIdx) */ -#define ZCHAR 0x20 +/* no 0x80 here because of "GV"1 which is aligned LEFT */ +/* no 0x10 here because of "MODEL"01 which uses LEADING0 */ +#define BSS 0x20 +#define ZCHAR 0x80 /* lcd outdez flags */ #define UNSIGN 0x08 diff --git a/src/menus.cpp b/src/menus.cpp index 661cf5fa8..0b8b9591a 100644 --- a/src/menus.cpp +++ b/src/menus.cpp @@ -627,7 +627,11 @@ int8_t gvarMenuItem(uint8_t x, uint8_t y, int8_t value, int8_t min, int8_t max, eeDirty(EE_MODEL); } if (value >= 126 || value <= -126) { - putsStrIdx(attr&LEFT?x:x-2*FW-FWNUM, y, STR_GV, (uint8_t)value - 125, attr); + if (attr & LEFT) { + attr -= LEFT; /* because of ZCHAR */ + x -= 2*FW+FWNUM; + } + putsStrIdx(x, y, STR_GV, (uint8_t)value - 125, attr); if (invers) value = checkIncDec(event, (uint8_t)value, 126, 130, EE_MODEL); } else {