From aa84a2c03bdfe811017f74ae5f1d42dd03e636bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Proch=C3=A1zka?= Date: Sun, 21 Sep 2025 10:51:08 +0200 Subject: [PATCH] Massively sped up lcd_putchar's handling of '\n' --- example.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/example.c b/example.c index 64f9b84..183fd8f 100644 --- a/example.c +++ b/example.c @@ -163,11 +163,8 @@ void lcd_init(void) { // Puts a character to the LCD. Correctly handles '\n'. void lcd_putchar(char c) { if(c == 10) { - while((lcd_pos != 0) && (lcd_pos != 40)) { - lcd_send_data(32); - lcd_pos++; - if(lcd_pos == 80) lcd_pos=0; - } + if(lcd_pos < 40) lcd_pos = 40; + else lcd_pos = 0; } else { lcd_send_data(c); lcd_pos++;