浏览代码

Use board-specific or platform SPI pins in HAL_STM32 (#12323)

Karl Andersson 6 年前
父节点
当前提交
176654791e
共有 3 个文件被更改,包括 5 次插入17 次删除
  1. 1
    5
      Marlin/src/HAL/HAL_STM32/HAL_spi_STM32.cpp
  2. 4
    4
      Marlin/src/HAL/HAL_STM32/spi_pins.h
  3. 0
    8
      Marlin/src/pins/pins_ARMED.h

+ 1
- 5
Marlin/src/HAL/HAL_STM32/HAL_spi_STM32.cpp 查看文件

26
 // Includes
26
 // Includes
27
 // --------------------------------------------------------------------------
27
 // --------------------------------------------------------------------------
28
 
28
 
29
-#include "HAL.h"
30
-#include "../shared/HAL_SPI.h"
31
-#include "pins_arduino.h"
32
-#include "spi_pins.h"
33
-#include "../../core/macros.h"
29
+#include "../../inc/MarlinConfig.h"
34
 
30
 
35
 #include <SPI.h>
31
 #include <SPI.h>
36
 
32
 

+ 4
- 4
Marlin/src/HAL/HAL_STM32/spi_pins.h 查看文件

22
  * Define SPI Pins: SCK, MISO, MOSI, SS
22
  * Define SPI Pins: SCK, MISO, MOSI, SS
23
  */
23
  */
24
 #ifndef SCK_PIN
24
 #ifndef SCK_PIN
25
-  #define SCK_PIN   13
25
+  #define SCK_PIN   PIN_SPI_SCK
26
 #endif
26
 #endif
27
 #ifndef MISO_PIN
27
 #ifndef MISO_PIN
28
-  #define MISO_PIN  12
28
+  #define MISO_PIN  PIN_SPI_MISO
29
 #endif
29
 #endif
30
 #ifndef MOSI_PIN
30
 #ifndef MOSI_PIN
31
-  #define MOSI_PIN  11
31
+  #define MOSI_PIN  PIN_SPI_MOSI
32
 #endif
32
 #endif
33
 #ifndef SS_PIN
33
 #ifndef SS_PIN
34
-  #define SS_PIN    14
34
+  #define SS_PIN    PIN_SPI_SS
35
 #endif
35
 #endif

+ 0
- 8
Marlin/src/pins/pins_ARMED.h 查看文件

105
 #endif
105
 #endif
106
 
106
 
107
 //
107
 //
108
-// SPI
109
-//
110
-#define SCK_PIN            PA5
111
-#define MISO_PIN           PA6
112
-#define MOSI_PIN           PA7
113
-
114
-//
115
 // Temperature Sensors
108
 // Temperature Sensors
116
 //
109
 //
117
 #define TEMP_0_PIN         PC0   // Analog Input
110
 #define TEMP_0_PIN         PC0   // Analog Input
133
 // Misc functions
126
 // Misc functions
134
 //
127
 //
135
 #define SDSS               PE7
128
 #define SDSS               PE7
136
-#define SS_PIN             PE7
137
 #define LED_PIN            PB7   // Heart beat
129
 #define LED_PIN            PB7   // Heart beat
138
 #define PS_ON_PIN          PA10
130
 #define PS_ON_PIN          PA10
139
 #define KILL_PIN           PA8
131
 #define KILL_PIN           PA8

正在加载...
取消
保存