From 48328a7f8ab87a5933b5a4eca102de8d626ec0c6 Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 2 May 2014 13:11:15 +0200 Subject: [PATCH] Fixes #1013 - ~ and \t added to the mapped chars in notes --- radio/src/gui/view_text.cpp | 11 ++++++++++- radio/src/lcd.cpp | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/radio/src/gui/view_text.cpp b/radio/src/gui/view_text.cpp index 4bd54f97e..8d86623cf 100644 --- a/radio/src/gui/view_text.cpp +++ b/radio/src/gui/view_text.cpp @@ -37,7 +37,7 @@ #include "../opentx.h" #define TEXT_FILENAME_MAXLEN 40 -#define TEXT_FILE_MAXSIZE 1000 +#define TEXT_FILE_MAXSIZE 2048 char s_text_file[TEXT_FILENAME_MAXLEN]; char s_text_screen[LCD_LINES-1][LCD_COLS+1]; @@ -72,15 +72,24 @@ void readTextFile(int & lines_count) escape_chars[escape-1] = c; if (escape == 2 && !strncmp(escape_chars, "up", 2)) { c = '\300'; + escape = 0; } else if (escape == 2 && !strncmp(escape_chars, "dn", 2)) { c = '\301'; + escape = 0; + } + else if (escape == 1 && escape_chars[0] == 't') { + c = 0x09; // tab + escape = 0; } else { escape++; continue; } } + else if (c=='~') { + c = 'z'+1; + } escape = 0; s_text_screen[current_line-s_pgOfs][line_length++] = c; } diff --git a/radio/src/lcd.cpp b/radio/src/lcd.cpp index fd998a50c..24347e956 100644 --- a/radio/src/lcd.cpp +++ b/radio/src/lcd.cpp @@ -368,13 +368,13 @@ void lcd_putsnAtt(xcoord_t x, uint8_t y, const pm_char * s, uint8_t len, LcdFlag if (y >= LCD_H) break; } #if defined(CPUARM) - else if (c == 0x1D) { //TAB + else if (c == 0x1D) { // TAB x |= 0x3F; x += 1; } #endif else { - x += (c*FW/2); //EXTENDED SPACE + x += (c*FW/2); // EXTENDED SPACE } s++; }