🩹 Remove poison wchar_t macro

This commit is contained in:
Scott Lahteine
2022-07-01 04:49:37 -05:00
parent 35dbc286bd
commit cb4a79173b
25 changed files with 214 additions and 217 deletions

View File

@@ -48,7 +48,7 @@
int lcd_glyph_height() { return 1; }
typedef struct _TFTGLCD_charmap_t {
wchar_t uchar; // the unicode char
lchar_t uchar; // the unicode char
uint8_t idx; // the glyph of the char in the ROM
uint8_t idx2; // the char used to be combined with the idx to simulate a single char
} TFTGLCD_charmap_t;
@@ -991,7 +991,7 @@ void lcd_put_int(const int i) {
// return < 0 on error
// return the advanced cols
int lcd_put_wchar_max(const wchar_t c, const pixel_len_t max_length) {
int lcd_put_lchar_max(const lchar_t &c, const pixel_len_t max_length) {
// find the HD44780 internal ROM first
int ret;
@@ -1049,10 +1049,10 @@ static int lcd_put_u8str_max_cb(const char * utf8_str, read_byte_cb_t cb_read_by
pixel_len_t ret = 0;
const uint8_t *p = (uint8_t *)utf8_str;
while (ret < max_length) {
wchar_t ch = 0;
p = get_utf8_value_cb(p, cb_read_byte, &ch);
lchar_t ch;
p = get_utf8_value_cb(p, cb_read_byte, ch);
if (!ch) break;
ret += lcd_put_wchar_max(ch, max_length - ret);
ret += lcd_put_lchar_max(ch, max_length - ret);
}
return (int)ret;
}

View File

@@ -524,16 +524,16 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
UNUSED(blink);
#else
if (!blink && thermalManager.heater_idle[thermalManager.idle_index_for_id(heater_id)].timed_out) {
lcd_put_wchar(' ');
if (t2 >= 10) lcd_put_wchar(' ');
if (t2 >= 100) lcd_put_wchar(' ');
lcd_put_lchar(' ');
if (t2 >= 10) lcd_put_lchar(' ');
if (t2 >= 100) lcd_put_lchar(' ');
}
else
#endif
lcd_put_u8str(i16tostr3left(t2));
lcd_put_wchar(' ');
if (t2 < 10) lcd_put_wchar(' ');
lcd_put_lchar(' ');
if (t2 < 10) lcd_put_lchar(' ');
if (t2) picBits |= ICON_TEMP1;
else picBits &= ~ICON_TEMP1;
@@ -545,7 +545,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
FORCE_INLINE void _draw_flowmeter_status() {
lcd_moveto(5, 5); lcd_put_u8str(F("FLOW"));
lcd_moveto(7, 6); lcd_put_wchar('L');
lcd_moveto(7, 6); lcd_put_lchar('L');
lcd_moveto(6, 7); lcd_put_u8str(ftostr11ns(cooler.flowrate));
if (cooler.flowrate) picBits |= ICON_FAN;
@@ -564,7 +564,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
{
lcd_put_u8str("mA");
lcd_moveto(10, 7);
lcd_put_wchar(' '); lcd_put_u8str(ui16tostr3rj(uint16_t(ammeter.current * 1000 + 0.5f)));
lcd_put_lchar(' '); lcd_put_u8str(ui16tostr3rj(uint16_t(ammeter.current * 1000 + 0.5f)));
}
else {
lcd_put_u8str(" A");
@@ -585,9 +585,9 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
#if CUTTER_UNIT_IS(RPM)
lcd_moveto(16, 6); lcd_put_u8str(F("RPM"));
lcd_moveto(15, 7); lcd_put_u8str(ftostr31ns(float(cutter.unitPower) / 1000));
lcd_put_wchar('K');
lcd_put_lchar('K');
#elif CUTTER_UNIT_IS(PERCENT)
lcd_moveto(17, 6); lcd_put_wchar('%');
lcd_moveto(17, 6); lcd_put_lchar('%');
lcd_moveto(18, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower));
#else
lcd_moveto(17, 7); lcd_put_u8str(cutter_power2str(cutter.unitPower));