From 2b79a3116532b1744a8d6c8936025b2443a74293 Mon Sep 17 00:00:00 2001 From: anschrammh Date: Thu, 30 Mar 2023 13:04:04 +0200 Subject: [PATCH] Fixed an issue when sending commands to the LCD screen while a DMA transfer is in progress causing graphical issues Detail : A DMA transfer may be in progress when trying to send single byte commands to the LCD screen. This could badly configure the display as soon as the data/command select pin was set to command while the DMA was still sending data bytes. The fix : doing a busy wait in the lcd_set_data function to be sure the bus is free to use. --- src/W800_SDK_v1.00.10/app/app_drivers/lcd/lcd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/W800_SDK_v1.00.10/app/app_drivers/lcd/lcd.c b/src/W800_SDK_v1.00.10/app/app_drivers/lcd/lcd.c index cb3cb37..f2394d1 100644 --- a/src/W800_SDK_v1.00.10/app/app_drivers/lcd/lcd.c +++ b/src/W800_SDK_v1.00.10/app/app_drivers/lcd/lcd.c @@ -382,7 +382,6 @@ void lcd_set_backlight(LCDConfig_t * const LCDConfig, uint8_t brightness) tls_gpio_cfg(LCDConfig->LCDPWMBacklightPin, WM_GPIO_DIR_OUTPUT, WM_GPIO_ATTR_FLOATING); tls_gpio_write(LCDConfig->LCDPWMBacklightPin, 0); } - } void lcd_hardware_reset(LCDConfig_t * const LCDConfig) @@ -523,5 +522,8 @@ static void lcd_set_cs(LCDConfig_t * const LCDConfig, LCDSelect_e selected) static void lcd_set_data_command(LCDConfig_t * const LCDConfig, LCDDataCommand_e dataCommand) { + // We wait for the mmc sdio driver to be ready before changing the LCD access mode + mmc_sdio_driver_blocking_wait_bus_free(); + tls_gpio_write(LCDConfig->LCDDataCommandPin, dataCommand); }