ソースを参照

🎨 Clean up LPC1768 SPI init

Scott Lahteine 3年前
コミット
fd3f7b3473
1個のファイルの変更6行の追加12行の削除
  1. 6
    12
      Marlin/src/HAL/LPC1768/HAL_SPI.cpp

+ 6
- 12
Marlin/src/HAL/LPC1768/HAL_SPI.cpp ファイルの表示

66
 
66
 
67
   #include <SoftwareSPI.h>
67
   #include <SoftwareSPI.h>
68
 
68
 
69
-  #ifndef HAL_SPI_SPEED
70
-    #define HAL_SPI_SPEED SPI_FULL_SPEED
71
-  #endif
72
-
73
-  static uint8_t SPI_speed = HAL_SPI_SPEED;
69
+  static uint8_t SPI_speed = SPI_FULL_SPEED;
74
 
70
 
75
   static uint8_t spiTransfer(uint8_t b) {
71
   static uint8_t spiTransfer(uint8_t b) {
76
     return swSpiTransfer(b, SPI_speed, SD_SCK_PIN, SD_MISO_PIN, SD_MOSI_PIN);
72
     return swSpiTransfer(b, SPI_speed, SD_SCK_PIN, SD_MISO_PIN, SD_MOSI_PIN);
106
 
102
 
107
 #else
103
 #else
108
 
104
 
109
-  #ifndef HAL_SPI_SPEED
110
-    #ifdef SD_SPI_SPEED
111
-      #define HAL_SPI_SPEED SD_SPI_SPEED
112
-    #else
113
-      #define HAL_SPI_SPEED SPI_FULL_SPEED
114
-    #endif
105
+  #ifdef SD_SPI_SPEED
106
+    #define INIT_SPI_SPEED SD_SPI_SPEED
107
+  #else
108
+    #define INIT_SPI_SPEED SPI_FULL_SPEED
115
   #endif
109
   #endif
116
 
110
 
117
-  void spiBegin() { spiInit(HAL_SPI_SPEED); } // Set up SCK, MOSI & MISO pins for SSP0
111
+  void spiBegin() { spiInit(INIT_SPI_SPEED); } // Set up SCK, MOSI & MISO pins for SSP0
118
 
112
 
119
   void spiInit(uint8_t spiRate) {
113
   void spiInit(uint8_t spiRate) {
120
     #if SD_MISO_PIN == BOARD_SPI1_MISO_PIN
114
     #if SD_MISO_PIN == BOARD_SPI1_MISO_PIN

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