be more clever about custom chars

This commit is contained in:
2026-07-02 15:30:59 +02:00
parent 13e658087b
commit 7f6ef12201

View File

@@ -68,9 +68,7 @@ void lcd_set_cursor(struct lcd_t *lcd, const uint8_t row, const uint8_t col) {
}
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(lcd->writebuf.cchar[index], cmdbuf, sizeof(cmdbuf));
memcpy(lcd->writebuf.cchar[index] + 3, glyph, sizeof(lcd_glyph_t)); // we prepare the command in init, so we can just copy the glyph after the command
}
/* writes string to write buffer at calculated pos, we trust it to be null terminated */