mirror of
https://github.com/espressif/esp-idf.git
synced 2026-05-05 12:25:03 +02:00
rgb_lcd: support restart dma transmission manually
When doing Flash operations (e.g. OTA), LCD's DMA bandwidth will be not sufficient, causing the desync between the LCD controller and DMA. Added a restart function to help the user to make them sync again.
This commit is contained in:
@@ -214,6 +214,31 @@ TEST_CASE("lcd_rgb_panel_update_pclk", "[lcd]")
|
||||
free(img);
|
||||
}
|
||||
|
||||
TEST_CASE("lcd_rgb_panel_restart", "[lcd]")
|
||||
{
|
||||
uint8_t *img = malloc(TEST_IMG_SIZE);
|
||||
TEST_ASSERT_NOT_NULL(img);
|
||||
|
||||
printf("initialize RGB panel with stream mode\r\n");
|
||||
esp_lcd_panel_handle_t panel_handle = test_rgb_panel_initialization(16, 16, 0, false, NULL, NULL);
|
||||
printf("flush one clock block to the LCD\r\n");
|
||||
uint8_t color_byte = esp_random() & 0xFF;
|
||||
int x_start = esp_random() % (TEST_LCD_H_RES - 100);
|
||||
int y_start = esp_random() % (TEST_LCD_V_RES - 100);
|
||||
memset(img, color_byte, TEST_IMG_SIZE);
|
||||
esp_lcd_panel_draw_bitmap(panel_handle, x_start, y_start, x_start + 100, y_start + 100, img);
|
||||
printf("The LCD driver should keep flushing the color block in the background (as it's in stream mode)\r\n");
|
||||
vTaskDelay(pdMS_TO_TICKS(1000));
|
||||
|
||||
printf("Restart the DMA transmission in the background\r\n");
|
||||
TEST_ESP_OK(esp_lcd_rgb_panel_restart(panel_handle));
|
||||
vTaskDelay(pdMS_TO_TICKS(1000));
|
||||
|
||||
printf("delete RGB panel\r\n");
|
||||
TEST_ESP_OK(esp_lcd_panel_del(panel_handle));
|
||||
free(img);
|
||||
}
|
||||
|
||||
TEST_CASE("lcd_rgb_panel_rotate", "[lcd]")
|
||||
{
|
||||
const int w = 200;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
CONFIG_COMPILER_DUMP_RTL_FILES=y
|
||||
CONFIG_LCD_RGB_ISR_IRAM_SAFE=y
|
||||
CONFIG_GDMA_CTRL_FUNC_IN_IRAM=y
|
||||
CONFIG_COMPILER_OPTIMIZATION_NONE=y
|
||||
# silent the error check, as the error string are stored in rodata, causing RTL check failure
|
||||
CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT=y
|
||||
|
||||
Reference in New Issue
Block a user