Procházet zdrojové kódy

Fix ESP32 I2S init placement (#21019)

Simon Jouet před 3 roky
rodič
revize
af4e8b171c
No account linked to committer's email address
2 změnil soubory, kde provedl 5 přidání a 3 odebrání
  1. 4
    2
      Marlin/src/HAL/ESP32/HAL.cpp
  2. 1
    1
      Marlin/src/HAL/ESP32/HAL.h

+ 4
- 2
Marlin/src/HAL/ESP32/HAL.cpp Zobrazit soubor

@@ -90,8 +90,6 @@ volatile int numPWMUsed = 0,
90 90
 
91 91
 #endif
92 92
 
93
-void HAL_init() { TERN_(I2S_STEPPER_STREAM, i2s_init()); }
94
-
95 93
 void HAL_init_board() {
96 94
 
97 95
   #if ENABLED(ESP3D_WIFISUPPORT)
@@ -126,6 +124,10 @@ void HAL_init_board() {
126 124
     #endif
127 125
   #endif
128 126
 
127
+  // Initialize the i2s peripheral only if the I2S stepper stream is enabled.
128
+  // The following initialization is performed after Serial1 and Serial2 are defined as
129
+  // their native pins might conflict with the i2s stream even when they are remapped.
130
+  TERN_(I2S_STEPPER_STREAM, i2s_init());
129 131
 }
130 132
 
131 133
 void HAL_idletask() {

+ 1
- 1
Marlin/src/HAL/ESP32/HAL.h Zobrazit soubor

@@ -139,7 +139,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin);
139 139
 #define HAL_IDLETASK 1
140 140
 #define BOARD_INIT() HAL_init_board();
141 141
 void HAL_idletask();
142
-void HAL_init();
142
+inline void HAL_init() {}
143 143
 void HAL_init_board();
144 144
 
145 145
 //

Loading…
Zrušit
Uložit