Browse Source

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

Tanguy Pruvot 2 years ago
parent
commit
6a8385624f
No account linked to committer's email address
2 changed files with 4 additions and 14 deletions
  1. 0
    10
      Marlin/src/HAL/STM32/tft/tft_fsmc.cpp
  2. 4
    4
      Marlin/src/lcd/tft_io/tft_io.cpp

+ 0
- 10
Marlin/src/HAL/STM32/tft/tft_fsmc.cpp View File

36
 
36
 
37
 void TFT_FSMC::Init() {
37
 void TFT_FSMC::Init() {
38
   uint32_t controllerAddress;
38
   uint32_t controllerAddress;
39
-
40
-  #if PIN_EXISTS(TFT_RESET)
41
-    OUT_WRITE(TFT_RESET_PIN, HIGH);
42
-    HAL_Delay(100);
43
-  #endif
44
-
45
-  #if PIN_EXISTS(TFT_BACKLIGHT)
46
-    OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH);
47
-  #endif
48
-
49
   FSMC_NORSRAM_TimingTypeDef Timing, ExtTiming;
39
   FSMC_NORSRAM_TimingTypeDef Timing, ExtTiming;
50
 
40
 
51
   uint32_t NSBank = (uint32_t)pinmap_peripheral(digitalPinToPinName(TFT_CS_PIN), PinMap_FSMC_CS);
41
   uint32_t NSBank = (uint32_t)pinmap_peripheral(digitalPinToPinName(TFT_CS_PIN), PinMap_FSMC_CS);

+ 4
- 4
Marlin/src/lcd/tft_io/tft_io.cpp View File

65
   #if PIN_EXISTS(TFT_RESET)
65
   #if PIN_EXISTS(TFT_RESET)
66
     OUT_WRITE(TFT_RESET_PIN, HIGH);
66
     OUT_WRITE(TFT_RESET_PIN, HIGH);
67
     delay(10);
67
     delay(10);
68
-    OUT_WRITE(TFT_RESET_PIN, LOW);
68
+    WRITE(TFT_RESET_PIN, LOW);
69
     delay(10);
69
     delay(10);
70
-    OUT_WRITE(TFT_RESET_PIN, HIGH);
70
+    WRITE(TFT_RESET_PIN, HIGH);
71
   #endif
71
   #endif
72
 
72
 
73
   #if PIN_EXISTS(TFT_BACKLIGHT)
73
   #if PIN_EXISTS(TFT_BACKLIGHT)
74
-    OUT_WRITE(TFT_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT));
74
+    WRITE(TFT_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT));
75
   #endif
75
   #endif
76
 
76
 
77
   // io.Init();
77
   // io.Init();
149
   #endif
149
   #endif
150
 
150
 
151
   #if PIN_EXISTS(TFT_BACKLIGHT) && ENABLED(DELAYED_BACKLIGHT_INIT)
151
   #if PIN_EXISTS(TFT_BACKLIGHT) && ENABLED(DELAYED_BACKLIGHT_INIT)
152
-    OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH);
152
+    WRITE(TFT_BACKLIGHT_PIN, HIGH);
153
   #endif
153
   #endif
154
 }
154
 }
155
 
155
 

Loading…
Cancel
Save