Rename char2idx to char2zchar

This commit is contained in:
Bertrand Songis
2019-02-21 10:35:48 +01:00
parent 61af68caf8
commit e4fa31be28
10 changed files with 21 additions and 21 deletions
+2 -2
View File
@@ -292,7 +292,7 @@ uint8_t getTextWidth(const char * s, uint8_t len, LcdFlags flags)
{
uint8_t width = 0;
for (int i=0; len==0 || i<len; ++i) {
unsigned char c = (flags & ZCHAR) ? idx2char(*s) : *s;
unsigned char c = (flags & ZCHAR) ? zchar2char(*s) : *s;
if (!c) {
break;
}
@@ -327,7 +327,7 @@ void lcdDrawSizedText(coord_t x, coord_t y, const char * s, uint8_t len, LcdFlag
break;
#if !defined(BOOT)
case ZCHAR:
c = idx2char(*s);
c = zchar2char(*s);
break;
#endif
default:
+3 -3
View File
@@ -82,7 +82,7 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, event_t event, ui
if (s_editMode > 0) {
int8_t c = name[editNameCursorPos];
if (!(flags & ZCHAR)) {
c = char2idx(c);
c = char2zchar(c);
}
int8_t v = c;
@@ -132,7 +132,7 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, event_t event, ui
if (c != v) {
if (!(flags & ZCHAR)) {
if (v != '\0' || name[editNameCursorPos+1] != '\0')
v = idx2char(v);
v = zchar2char(v);
}
name[editNameCursorPos] = v;
storageDirty(menuVerticalPositions[0] == 0 ? EE_MODEL : EE_GENERAL);
@@ -140,7 +140,7 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, event_t event, ui
lcdDrawSizedText(x, y, name, size, flags);
coord_t left = (editNameCursorPos == 0 ? 0 : getTextWidth(name, editNameCursorPos, flags));
char s[] = { (flags & ZCHAR) ? idx2char(name[editNameCursorPos]) : name[editNameCursorPos], '\0' };
char s[] = { (flags & ZCHAR) ? zchar2char(name[editNameCursorPos]) : name[editNameCursorPos], '\0' };
lcdDrawSolidFilledRect(x+left-1, y, getTextWidth(s, 1)+1, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
lcdDrawText(x+left, y, s, TEXT_INVERTED_COLOR);
}
+1 -1
View File
@@ -160,7 +160,7 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, event_t event, ui
}
if (attr == ZCHAR) {
lcdDrawChar(x+editNameCursorPos*FW, y, idx2char(v), ERASEBG|INVERS|FIXEDWIDTH);
lcdDrawChar(x+editNameCursorPos*FW, y, zchar2char(v), ERASEBG|INVERS|FIXEDWIDTH);
}
else {
lcdDrawChar(x+editNameCursorPos*FW, y, v, ERASEBG|INVERS|FIXEDWIDTH);