Fixes #1013 - ~ and \t added to the mapped chars in notes

This commit is contained in:
bsongis
2014-05-02 13:11:15 +02:00
parent 72d0f2e6f6
commit 48328a7f8a
2 changed files with 12 additions and 3 deletions
+10 -1
View File
@@ -37,7 +37,7 @@
#include "../opentx.h" #include "../opentx.h"
#define TEXT_FILENAME_MAXLEN 40 #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_file[TEXT_FILENAME_MAXLEN];
char s_text_screen[LCD_LINES-1][LCD_COLS+1]; char s_text_screen[LCD_LINES-1][LCD_COLS+1];
@@ -72,15 +72,24 @@ void readTextFile(int & lines_count)
escape_chars[escape-1] = c; escape_chars[escape-1] = c;
if (escape == 2 && !strncmp(escape_chars, "up", 2)) { if (escape == 2 && !strncmp(escape_chars, "up", 2)) {
c = '\300'; c = '\300';
escape = 0;
} }
else if (escape == 2 && !strncmp(escape_chars, "dn", 2)) { else if (escape == 2 && !strncmp(escape_chars, "dn", 2)) {
c = '\301'; c = '\301';
escape = 0;
}
else if (escape == 1 && escape_chars[0] == 't') {
c = 0x09; // tab
escape = 0;
} }
else { else {
escape++; escape++;
continue; continue;
} }
} }
else if (c=='~') {
c = 'z'+1;
}
escape = 0; escape = 0;
s_text_screen[current_line-s_pgOfs][line_length++] = c; s_text_screen[current_line-s_pgOfs][line_length++] = c;
} }
+2 -2
View File
@@ -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 (y >= LCD_H) break;
} }
#if defined(CPUARM) #if defined(CPUARM)
else if (c == 0x1D) { //TAB else if (c == 0x1D) { // TAB
x |= 0x3F; x |= 0x3F;
x += 1; x += 1;
} }
#endif #endif
else { else {
x += (c*FW/2); //EXTENDED SPACE x += (c*FW/2); // EXTENDED SPACE
} }
s++; s++;
} }