ソースを参照

🚑️ Init FastIO before anything else (#22508)

Tanguy Pruvot 3年前
コミット
ae846c2cb2
コミッターのメールアドレスに関連付けられたアカウントが存在しません

+ 0
- 2
Marlin/src/HAL/STM32/HAL.cpp ファイルの表示

63
 
63
 
64
 // HAL initialization task
64
 // HAL initialization task
65
 void HAL_init() {
65
 void HAL_init() {
66
-  FastIO_init();
67
-
68
   // Ensure F_CPU is a constant expression.
66
   // Ensure F_CPU is a constant expression.
69
   // If the compiler breaks here, it means that delay code that should compute at compile time will not work.
67
   // If the compiler breaks here, it means that delay code that should compute at compile time will not work.
70
   // So better safe than sorry here.
68
   // So better safe than sorry here.

+ 1
- 1
Marlin/src/HAL/STM32/fastio.cpp ファイルの表示

26
 
26
 
27
 #include "../../inc/MarlinConfig.h"
27
 #include "../../inc/MarlinConfig.h"
28
 
28
 
29
-GPIO_TypeDef* FastIOPortMap[LastPort + 1];
29
+GPIO_TypeDef* FastIOPortMap[LastPort + 1] = { 0 };
30
 
30
 
31
 void FastIO_init() {
31
 void FastIO_init() {
32
   LOOP_L_N(i, NUM_DIGITAL_PINS)
32
   LOOP_L_N(i, NUM_DIGITAL_PINS)

+ 1
- 0
Marlin/src/HAL/STM32/fastio.h ファイルの表示

38
 // ------------------------
38
 // ------------------------
39
 
39
 
40
 void FastIO_init(); // Must be called before using fast io macros
40
 void FastIO_init(); // Must be called before using fast io macros
41
+#define FASTIO_INIT() FastIO_init()
41
 
42
 
42
 // ------------------------
43
 // ------------------------
43
 // Defines
44
 // Defines

+ 3
- 3
Marlin/src/HAL/STM32F1/pinsDebug.h ファイルの表示

19
 #pragma once
19
 #pragma once
20
 
20
 
21
 /**
21
 /**
22
- * Support routines for STM32GENERIC (Maple)
22
+ * Support routines for MAPLE_STM32F1
23
  */
23
  */
24
 
24
 
25
 /**
25
 /**
26
  * Translation of routines & variables used by pinsDebug.h
26
  * Translation of routines & variables used by pinsDebug.h
27
  */
27
  */
28
 
28
 
29
-#ifndef BOARD_NR_GPIO_PINS  // Only in STM32GENERIC (Maple)
30
-   #error "Expected BOARD_NR_GPIO_PINS not found"
29
+#ifndef BOARD_NR_GPIO_PINS // Only in MAPLE_STM32F1
30
+  #error "Expected BOARD_NR_GPIO_PINS not found"
31
 #endif
31
 #endif
32
 
32
 
33
 #include "fastio.h"
33
 #include "fastio.h"

+ 4
- 0
Marlin/src/MarlinCore.cpp ファイルの表示

1131
  *  - Set Marlin to RUNNING State
1131
  *  - Set Marlin to RUNNING State
1132
  */
1132
  */
1133
 void setup() {
1133
 void setup() {
1134
+  #ifdef FASTIO_INIT
1135
+    FASTIO_INIT();
1136
+  #endif
1137
+
1134
   #ifdef BOARD_PREINIT
1138
   #ifdef BOARD_PREINIT
1135
     BOARD_PREINIT(); // Low-level init (before serial init)
1139
     BOARD_PREINIT(); // Low-level init (before serial init)
1136
   #endif
1140
   #endif

+ 1
- 8
Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h ファイルの表示

99
 // Avoid nozzle heat and fan start before serial init
99
 // Avoid nozzle heat and fan start before serial init
100
 #define BOARD_OPENDRAIN_MOSFETS
100
 #define BOARD_OPENDRAIN_MOSFETS
101
 
101
 
102
-#define BOARD_INIT_OD_PINS() { \
102
+#define BOARD_PREINIT() { \
103
   OUT_WRITE_OD(HEATER_0_PIN, 0); \
103
   OUT_WRITE_OD(HEATER_0_PIN, 0); \
104
   OUT_WRITE_OD(HEATER_BED_PIN, 0); \
104
   OUT_WRITE_OD(HEATER_BED_PIN, 0); \
105
   OUT_WRITE_OD(FAN_PIN, 0); \
105
   OUT_WRITE_OD(FAN_PIN, 0); \
106
 }
106
 }
107
 
107
 
108
-#ifdef MAPLE_STM32F1
109
-  // Only Maple Framework allow that early
110
-  #define BOARD_PREINIT BOARD_INIT_OD_PINS
111
-#else
112
-  #define BOARD_INIT BOARD_INIT_OD_PINS
113
-#endif
114
-
115
 //
108
 //
116
 // PWM for a servo probe
109
 // PWM for a servo probe
117
 // Other servo devices are not supported on this board!
110
 // Other servo devices are not supported on this board!

読み込み中…
キャンセル
保存