From 30efacbd0eb8b26af92a96360b39478a50655d08 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Fri, 4 Sep 2020 15:17:38 +0200 Subject: [PATCH 1/2] TFT: restore DMA communication --- Marlin/src/HAL/STM32F1/tft/tft_fsmc.cpp | 10 ++++++++++ Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Marlin/src/HAL/STM32F1/tft/tft_fsmc.cpp b/Marlin/src/HAL/STM32F1/tft/tft_fsmc.cpp index 069be7ad54e3..69d473b909e2 100644 --- a/Marlin/src/HAL/STM32F1/tft/tft_fsmc.cpp +++ b/Marlin/src/HAL/STM32F1/tft/tft_fsmc.cpp @@ -89,6 +89,16 @@ void TFT_FSMC::Init() { uint8_t cs = FSMC_CS_PIN, rs = FSMC_RS_PIN; uint32_t controllerAddress; + #if PIN_EXISTS(TFT_BACKLIGHT) + OUT_WRITE(TFT_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); + #endif + + #ifdef LCD_USE_DMA_FSMC + dma_init(FSMC_DMA_DEV); + dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); + dma_set_priority(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, DMA_PRIORITY_MEDIUM); + #endif + #if PIN_EXISTS(TFT_RESET) OUT_WRITE(TFT_RESET_PIN, HIGH); delay(100); diff --git a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h index 799477ac1023..47d7118b53d1 100644 --- a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h +++ b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h @@ -124,7 +124,7 @@ #define FSMC_CS_PIN PD7 // pin 88 = FSMC_NE1 #define FSMC_RS_PIN PD11 // pin 58 A16 Register. Only one address needed -//#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT (broken) +#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT #define FSMC_DMA_DEV DMA2 #define FSMC_DMA_CHANNEL DMA_CH5 From 1747e3fd8f2360eacef4aea6a19b37398e9da0b2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 27 Sep 2020 21:26:23 -0500 Subject: [PATCH 2/2] Update tft_fsmc.cpp --- Marlin/src/HAL/STM32F1/tft/tft_fsmc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/HAL/STM32F1/tft/tft_fsmc.cpp b/Marlin/src/HAL/STM32F1/tft/tft_fsmc.cpp index 69d473b909e2..008301d9bc0c 100644 --- a/Marlin/src/HAL/STM32F1/tft/tft_fsmc.cpp +++ b/Marlin/src/HAL/STM32F1/tft/tft_fsmc.cpp @@ -93,7 +93,7 @@ void TFT_FSMC::Init() { OUT_WRITE(TFT_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); #endif - #ifdef LCD_USE_DMA_FSMC + #if ENABLED(LCD_USE_DMA_FSMC) dma_init(FSMC_DMA_DEV); dma_disable(FSMC_DMA_DEV, FSMC_DMA_CHANNEL); dma_set_priority(FSMC_DMA_DEV, FSMC_DMA_CHANNEL, DMA_PRIORITY_MEDIUM);