🐛 Fix STM32 delay, double reset in FSMC TFT init (#22584)

This commit is contained in:
Tanguy Pruvot 2021-08-18 05:39:08 +02:00 committed by Scott Lahteine
parent 2e14bf15dd
commit bb12ebcca6
2 changed files with 4 additions and 14 deletions

View File

@ -36,16 +36,6 @@ LCD_CONTROLLER_TypeDef *TFT_FSMC::LCD;
void TFT_FSMC::Init() { void TFT_FSMC::Init() {
uint32_t controllerAddress; uint32_t controllerAddress;
#if PIN_EXISTS(TFT_RESET)
OUT_WRITE(TFT_RESET_PIN, HIGH);
HAL_Delay(100);
#endif
#if PIN_EXISTS(TFT_BACKLIGHT)
OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH);
#endif
FSMC_NORSRAM_TimingTypeDef Timing, ExtTiming; FSMC_NORSRAM_TimingTypeDef Timing, ExtTiming;
uint32_t NSBank = (uint32_t)pinmap_peripheral(digitalPinToPinName(TFT_CS_PIN), PinMap_FSMC_CS); uint32_t NSBank = (uint32_t)pinmap_peripheral(digitalPinToPinName(TFT_CS_PIN), PinMap_FSMC_CS);

View File

@ -65,13 +65,13 @@ if (lcd_id != 0xFFFFFFFF) return;
#if PIN_EXISTS(TFT_RESET) #if PIN_EXISTS(TFT_RESET)
OUT_WRITE(TFT_RESET_PIN, HIGH); OUT_WRITE(TFT_RESET_PIN, HIGH);
delay(10); delay(10);
OUT_WRITE(TFT_RESET_PIN, LOW); WRITE(TFT_RESET_PIN, LOW);
delay(10); delay(10);
OUT_WRITE(TFT_RESET_PIN, HIGH); WRITE(TFT_RESET_PIN, HIGH);
#endif #endif
#if PIN_EXISTS(TFT_BACKLIGHT) #if PIN_EXISTS(TFT_BACKLIGHT)
OUT_WRITE(TFT_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); WRITE(TFT_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT));
#endif #endif
// io.Init(); // io.Init();
@ -149,7 +149,7 @@ if (lcd_id != 0xFFFFFFFF) return;
#endif #endif
#if PIN_EXISTS(TFT_BACKLIGHT) && ENABLED(DELAYED_BACKLIGHT_INIT) #if PIN_EXISTS(TFT_BACKLIGHT) && ENABLED(DELAYED_BACKLIGHT_INIT)
OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH); WRITE(TFT_BACKLIGHT_PIN, HIGH);
#endif #endif
} }