From d83c0f6c40f56ae86fc96d366530f4c452ef8064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sun, 15 Jan 2023 20:33:48 +0000 Subject: [PATCH] Fix an issue with indexing PROGMEM pointer Using array index 'pointer[index]' doesn't work properly. Instead using "pointer + index" works fine. No change in memory footprint --- Firmware/lcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/lcd.cpp b/Firmware/lcd.cpp index de0c4904f..98f967d48 100644 --- a/Firmware/lcd.cpp +++ b/Firmware/lcd.cpp @@ -343,7 +343,7 @@ static void FORCE_INLINE lcd_set_current_row(uint8_t row) /// @return row offset which the LCD register understands static uint8_t __attribute__((noinline)) lcd_get_row_offset(uint8_t row) { - return pgm_read_byte(row_offsets[min(row, LCD_HEIGHT - 1)]); + return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); } void lcd_set_cursor(uint8_t col, uint8_t row)