Skip to content

Commit

Permalink
Merge pull request #6 from Vanperdung/fix-lcd-issue
Browse files Browse the repository at this point in the history
fix lcd issue
  • Loading branch information
Vanperdung authored May 1, 2024
2 parents 1489672 + c259b09 commit 9ac91c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lcd/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,11 @@ void lcd_clear_screen(lcd_frame frame, uint16_t color)
}

lcd_set_frame(frame);
lcd_write_data((uint8_t *)row_pixels, LCD_WIDTH * 2);

for (uint32_t j = 0; j < LCD_HEIGHT; j++)
{
lcd_write_data((uint8_t *)row_pixels, LCD_WIDTH * 2);
}
}

void lcd_display_fullscreen(lcd_frame frame, uint16_t *image)
Expand Down
6 changes: 3 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ int main(void)
lcd_func_cfg lcd_func_cfg = SET_LCD_FUNC(sw_gpio_set_bl, sw_gpio_set_reset,
sw_gpio_set_dc, sw_gpio_set_cs, sleep_ms,
sw_spi_write_bytes, NULL);
lcd_frame frame = {{0, 0}, {LCD_WIDTH, LCD_HEIGHT}};
lcd_frame frame = {{0, 0}, {LCD_WIDTH - 1, LCD_HEIGHT - 1}};

// Hardware configurations
sw_set_sys_clock();
stdio_init_all();
sw_uart_init();
sw_measure_freqs();
sw_spi_init(270000 * 1000);
sw_spi_dma_init(270000 * 1000);
sw_lcd_gpio_init(&lcd_io);
sw_lcd_init(&lcd_func_cfg, HORIZONTAL);

// Software configurations;
sw_repeating_timer_init(-5, repeating_lvgl_timer_callback, NULL, &lvgl_timer);
lv_init();

sw_lcd_clear_screen(frame, BLUE);
sw_lcd_clear_screen(frame, RED);
while (1)
{
lv_timer_handler();
Expand Down

0 comments on commit 9ac91c7

Please sign in to comment.