From 560cd8f6191f497e981639dba69733a9b1603fa9 Mon Sep 17 00:00:00 2001 From: bsongis Date: Tue, 15 Apr 2014 18:02:47 +0200 Subject: [PATCH] Fixes #978 --- radio/src/gui/menu_model.cpp | 8 +++++--- radio/src/opentx.cpp | 7 ++++++- radio/src/translations/de.h.txt | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/radio/src/gui/menu_model.cpp b/radio/src/gui/menu_model.cpp index df270f16a..b0d7b6b1b 100644 --- a/radio/src/gui/menu_model.cpp +++ b/radio/src/gui/menu_model.cpp @@ -770,8 +770,10 @@ void editName(uint8_t x, uint8_t y, char *name, uint8_t size, uint8_t event, uin uint8_t mode = 0; if (active) { - if (s_editMode <= 0) mode = INVERS+FIXEDWIDTH; - else mode = FIXEDWIDTH; + if (s_editMode <= 0) + mode = INVERS + FIXEDWIDTH; + else + mode = FIXEDWIDTH; } lcd_putsnAtt(x, y, name, size, ZCHAR | mode); @@ -783,7 +785,7 @@ void editName(uint8_t x, uint8_t y, char *name, uint8_t size, uint8_t event, uin if (p1valdiff || IS_ROTARY_RIGHT(event) || IS_ROTARY_LEFT(event) || event==EVT_KEY_FIRST(KEY_DOWN) || event==EVT_KEY_FIRST(KEY_UP) || event==EVT_KEY_REPT(KEY_DOWN) || event==EVT_KEY_REPT(KEY_UP)) { - v = checkIncDec(event, abs(v), 0, LEN_STD_CHARS, 0); + v = checkIncDec(event, abs(v), 0, ZCHAR_MAX, 0); if (c <= 0) v = -v; } diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index b6469c351..492763e6e 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -198,7 +198,9 @@ char idx2char(int8_t idx) if (idx < 27) return 'A' + idx - 1; if (idx < 37) return '0' + idx - 27; if (idx <= 40) return pgm_read_byte(s_charTab+idx-37); - // Needed if we want the special chars ... if (idx <= ZCHAR_MAX) return 'z' + 5 + idx - 40; +#if LEN_SPECIAL_CHARS > 0 + if (idx <= ZCHAR_MAX) return 'z' + 5 + idx - 40; +#endif return ' '; } @@ -206,6 +208,9 @@ char idx2char(int8_t idx) int8_t char2idx(char c) { if (c == '_') return 37; +#if LEN_SPECIAL_CHARS > 0 + if (c < 0 && c+128 <= LEN_SPECIAL_CHARS) return 41 + (c+128); +#endif if (c >= 'a') return 'a' - c - 1; if (c >= 'A') return c - 'A' + 1; if (c >= '0') return c - '0' + 27; diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index b19b9aa77..65eea4c2d 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -78,7 +78,7 @@ #define TR_DATETIME "DATE:""ZEIT:" #define LEN_VLCD "\006" -#define TR_VLCD "NormalOptrex" +#define TR_VLCD "Normal""Optrex" #define LEN_COUNTRYCODES TR("\002", "\007") #define TR_COUNTRYCODES TR("US""JP""EU", "Amerika""Japan\0 ""Europa\0")