Ver código fonte

repair-software-spi

AnHardt 8 anos atrás
pai
commit
60ad365e21
2 arquivos alterados com 12 adições e 12 exclusões
  1. 8
    8
      Marlin/Sd2Card.h
  2. 4
    4
      Marlin/SdFatConfig.h

+ 8
- 8
Marlin/Sd2Card.h Ver arquivo

136
 #if DISABLED(SOFTWARE_SPI)
136
 #if DISABLED(SOFTWARE_SPI)
137
   // hardware pin defs
137
   // hardware pin defs
138
   /** The default chip select pin for the SD card is SS. */
138
   /** The default chip select pin for the SD card is SS. */
139
-  uint8_t const  SD_CHIP_SELECT_PIN = SS_PIN;
139
+  #define SD_CHIP_SELECT_PIN SS_PIN
140
   // The following three pins must not be redefined for hardware SPI.
140
   // The following three pins must not be redefined for hardware SPI.
141
   /** SPI Master Out Slave In pin */
141
   /** SPI Master Out Slave In pin */
142
-  uint8_t const  SPI_MOSI_PIN = MOSI_PIN;
142
+  #define SPI_MOSI_PIN MOSI_PIN
143
   /** SPI Master In Slave Out pin */
143
   /** SPI Master In Slave Out pin */
144
-  uint8_t const  SPI_MISO_PIN = MISO_PIN;
144
+  #define SPI_MISO_PIN MISO_PIN
145
   /** SPI Clock pin */
145
   /** SPI Clock pin */
146
-  uint8_t const  SPI_SCK_PIN = SCK_PIN;
146
+  #define SPI_SCK_PIN SCK_PIN
147
 
147
 
148
 #else  // SOFTWARE_SPI
148
 #else  // SOFTWARE_SPI
149
 
149
 
150
   /** SPI chip select pin */
150
   /** SPI chip select pin */
151
-  uint8_t const SD_CHIP_SELECT_PIN = SOFT_SPI_CS_PIN;
151
+  #define SD_CHIP_SELECT_PIN SOFT_SPI_CS_PIN
152
   /** SPI Master Out Slave In pin */
152
   /** SPI Master Out Slave In pin */
153
-  uint8_t const SPI_MOSI_PIN = SOFT_SPI_MOSI_PIN;
153
+  #define SPI_MOSI_PIN SOFT_SPI_MOSI_PIN
154
   /** SPI Master In Slave Out pin */
154
   /** SPI Master In Slave Out pin */
155
-  uint8_t const SPI_MISO_PIN = SOFT_SPI_MISO_PIN;
155
+  #define SPI_MISO_PIN SOFT_SPI_MISO_PIN
156
   /** SPI Clock pin */
156
   /** SPI Clock pin */
157
-  uint8_t const SPI_SCK_PIN = SOFT_SPI_SCK_PIN;
157
+  #define SPI_SCK_PIN SOFT_SPI_SCK_PIN
158
 #endif  // SOFTWARE_SPI
158
 #endif  // SOFTWARE_SPI
159
 //------------------------------------------------------------------------------
159
 //------------------------------------------------------------------------------
160
 /**
160
 /**

+ 4
- 4
Marlin/SdFatConfig.h Ver arquivo

104
   #define USE_SOFTWARE_SPI 0
104
   #define USE_SOFTWARE_SPI 0
105
   // define software SPI pins so Mega can use unmodified 168/328 shields
105
   // define software SPI pins so Mega can use unmodified 168/328 shields
106
   /** Software SPI chip select pin for the SD */
106
   /** Software SPI chip select pin for the SD */
107
-  uint8_t const SOFT_SPI_CS_PIN = 10;
107
+  #define SOFT_SPI_CS_PIN 10
108
   /** Software SPI Master Out Slave In pin */
108
   /** Software SPI Master Out Slave In pin */
109
-  uint8_t const SOFT_SPI_MOSI_PIN = 11;
109
+  #define SOFT_SPI_MOSI_PIN 11
110
   /** Software SPI Master In Slave Out pin */
110
   /** Software SPI Master In Slave Out pin */
111
-  uint8_t const SOFT_SPI_MISO_PIN = 12;
111
+  #define SOFT_SPI_MISO_PIN 12
112
   /** Software SPI Clock pin */
112
   /** Software SPI Clock pin */
113
-  uint8_t const SOFT_SPI_SCK_PIN = 13;
113
+  #define SOFT_SPI_SCK_PIN 13
114
   //------------------------------------------------------------------------------
114
   //------------------------------------------------------------------------------
115
   /**
115
   /**
116
   * The __cxa_pure_virtual function is an error handler that is invoked when
116
   * The __cxa_pure_virtual function is an error handler that is invoked when

Carregando…
Cancelar
Salvar