its okay to close the fd even if it isnt properly opened

This commit is contained in:
2026-06-14 11:07:37 +02:00
parent 3d40ebeb84
commit 0cd7520cf4

View File

@@ -31,6 +31,7 @@ void lcd_close(struct lcd_t *lcd) {
void lcd_write(struct lcd_t *lcd, const uint8_t *cmdbuf, const uint8_t len) {
if (write(lcd->fd, cmdbuf, len) <= 0) {
applog(LOG_ERR, "failed to execute write(), lost access to port?");
lcd_close(lcd);
lcd_open(lcd, true);
}
}