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
This commit is contained in:
Guðni Már Gilbert 2023-01-15 20:33:48 +00:00 committed by DRracer
parent 9416310f7e
commit d83c0f6c40
1 changed files with 1 additions and 1 deletions

View File

@ -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)