From 764dd1a4a916041f14c159095fa08b8a8aa7c4c6 Mon Sep 17 00:00:00 2001 From: Drath Date: Thu, 24 Sep 2026 10:36:20 +0200 Subject: [PATCH] consistent w the other thing --- src/lcd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lcd.c b/src/lcd.c index a3ce436..ea924a9 100644 --- a/src/lcd.c +++ b/src/lcd.c @@ -42,24 +42,24 @@ static void lcd_write(struct lcd_t *lcd, const uint8_t *cmdbuf, const uint16_t l } void lcd_clear(struct lcd_t *lcd) { - constexpr uint8_t cmdbuf[] = {254, 88}; + constexpr uint8_t cmdbuf[] = {0xFE, 88}; lcd_write(lcd, cmdbuf, sizeof(cmdbuf)); } void lcd_set_contrast(struct lcd_t *lcd, const uint8_t contrast) { applog(LOG_INF, "Set contrast to %d", contrast); - const uint8_t cmdbuf[] = {254, 80, contrast}; + const uint8_t cmdbuf[] = {0xFE, 80, contrast}; lcd_write(lcd, cmdbuf, sizeof(cmdbuf)); } void lcd_set_backlight(struct lcd_t *lcd, const bool enabled) { applog(LOG_INF, "Set backlight to %s", enabled ? "true" : "false"); - const uint8_t cmdbuf[] = {254, (enabled ? 66 : 70), 255}; + const uint8_t cmdbuf[] = {0xFE, (enabled ? 66 : 70), 255}; lcd_write(lcd, cmdbuf, enabled ? 3 : 2); } void lcd_set_cursor(struct lcd_t *lcd, const uint8_t row, const uint8_t col) { - const uint8_t cmdbuf[] = {254, 71, col + 1, row + 1}; + const uint8_t cmdbuf[] = {0xFE, 71, col + 1, row + 1}; lcd_write(lcd, cmdbuf, sizeof(cmdbuf)); } @@ -99,7 +99,7 @@ inline void lcd_clear_buf(struct lcd_t *lcd) { memset(lcd->writebuf.text, ' ', sizeof(lcd->writebuf.text)); // prepare commands for custom chars for (uint8_t i = 0; i < 8; i++) { - const uint8_t charbuf[] = {254, 78, i}; + const uint8_t charbuf[] = {0xFE, 78, i}; memcpy(lcd->writebuf.cchar[i], charbuf, sizeof(charbuf)); } } @@ -107,7 +107,7 @@ inline void lcd_clear_buf(struct lcd_t *lcd) { /* flushes writebuffer to lcd, hyperoptmized, flushes buffer and commands in a single write operation */ void lcd_flush_buf(struct lcd_t *lcd) { - constexpr uint8_t set_disp[] = {254, 71, 1, 1}; // set cursor to char 1, line 1 + constexpr uint8_t set_disp[] = {0xFE, 71, 1, 1}; // set cursor to char 1, line 1 memcpy(&lcd->writebuf.text[0], set_disp, 4); memcpy(&lcd->writebuf.text[2 * LCD_COLS + 4], set_disp, 4); lcd->writebuf.text[2 * LCD_COLS + 7] = 3; // overwrite set cursor c1 l1 to c1 l3 @@ -133,7 +133,7 @@ int lcd_init(struct lcd_t *lcd) { } lcd_clear_buf(lcd); - constexpr uint8_t cmdbuf[] = {254, 75, 254, 84}; + constexpr uint8_t cmdbuf[] = {0xFE, 75, 0xFE, 84}; lcd_write(lcd, cmdbuf, sizeof(cmdbuf)); lcd_clear(lcd);