lcd bug, also removed cc

This commit is contained in:
2026-05-10 19:19:19 +02:00
parent 39193cdc9f
commit f28cd4c31a
2 changed files with 2 additions and 5 deletions

View File

@@ -60,7 +60,7 @@ void lcd_set_cursor(struct lcd_t* lcd, const uint8_t row, const uint8_t col) {
/* reconsider so im not writing every time. prepend custom chars to the write buffer? */
void lcd_set_custom_char(struct lcd_t* lcd, const uint8_t index, const lcd_glyph_t* glyph) {
uint8_t cmdbuf[] = {254, 78, index, 0, 0, 0, 0, 0, 0, 0, 0};
memcpy(&cmdbuf[3], &glyph, sizeof(lcd_glyph_t));
memcpy(&cmdbuf[3], glyph, sizeof(lcd_glyph_t));
lcd_write(lcd, cmdbuf, sizeof(cmdbuf));
}
@@ -121,7 +121,7 @@ inline char lcd_bar(struct lcd_t* lcd, const uint8_t char_id, const double value
for (uint8_t i = 0; i < (1.0 - value) * 8; i++)
b[i] = 0;
lcd_set_custom_char(lcd, char_id, &b);
return cc(char_id);
return (char)char_id;
}
int lcd_init(struct lcd_t* lcd) {