|
@@ -35,7 +35,7 @@
|
35
|
35
|
* lcd_put_u8str_ind_P
|
36
|
36
|
* Print a string with an index substituted within it
|
37
|
37
|
*/
|
38
|
|
-lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const uint8_t ind, const lcd_uint_t maxlen/*=LCD_WIDTH*/) {
|
|
38
|
+lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const int8_t ind, const lcd_uint_t maxlen/*=LCD_WIDTH*/) {
|
39
|
39
|
uint8_t *p = (uint8_t*)pstr;
|
40
|
40
|
lcd_uint_t n = maxlen;
|
41
|
41
|
for (; n; n--) {
|
|
@@ -43,15 +43,17 @@ lcd_uint_t lcd_put_u8str_ind_P(PGM_P const pstr, const uint8_t ind, const lcd_ui
|
43
|
43
|
p = get_utf8_value_cb(p, read_byte_rom, &ch);
|
44
|
44
|
if (!ch) break;
|
45
|
45
|
if (ch == '=' || ch == '~' || ch == '*') {
|
46
|
|
- if (ch == '*') { lcd_put_wchar('E'); n--; }
|
47
|
46
|
// lcd_put_int(ind); n--; if (ind >= 10) n--;
|
48
|
|
- // if (ind >= 0)
|
49
|
|
- {
|
50
|
|
- lcd_put_wchar(ind + ((ch == '=') ? '0' : LCD_FIRST_TOOL));
|
51
|
|
- n--;
|
52
|
|
- }
|
53
|
|
- // else if (ind == -1) { PGM_P const b = GET_TEXT(MSG_BED); lcd_put_u8str_P(b); n -= utf8_strlen_P(b); }
|
54
|
|
- // else if (ind == -2) { PGM_P const c = GET_TEXT(MSG_CHAMBER); lcd_put_u8str_P(c); n -= utf8_strlen_P(c); }
|
|
47
|
+ if (ind >= 0) {
|
|
48
|
+ if (ch == '*') { lcd_put_wchar('E'); n--; }
|
|
49
|
+ lcd_put_wchar(ind + ((ch == '=') ? '0' : LCD_FIRST_TOOL));
|
|
50
|
+ n--;
|
|
51
|
+ }
|
|
52
|
+ else {
|
|
53
|
+ PGM_P const b = ind == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED);
|
|
54
|
+ lcd_put_u8str_P(b);
|
|
55
|
+ n -= utf8_strlen_P(b);
|
|
56
|
+ }
|
55
|
57
|
if (n) n -= lcd_put_u8str_max_P((PGM_P)p, n);
|
56
|
58
|
break;
|
57
|
59
|
}
|