Browse Source

#ifndef => #if !PIN_EXISTS

Scott Lahteine 7 years ago
parent
commit
c2fc78c3a8

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/HAL_spi_Stm32f1.cpp View File

76
  * @details Only configures SS pin since libmaple creates and initialize the SPI object
76
  * @details Only configures SS pin since libmaple creates and initialize the SPI object
77
  */
77
  */
78
 void spiBegin() {
78
 void spiBegin() {
79
-  #ifndef SS_PIN
79
+  #if !PIN_EXISTS(SS)
80
     #error "SS_PIN not defined!"
80
     #error "SS_PIN not defined!"
81
   #endif
81
   #endif
82
   SET_OUTPUT(SS_PIN);
82
   SET_OUTPUT(SS_PIN);

+ 2
- 2
Marlin/src/HAL/HAL_TEENSY35_36/HAL_spi_Teensy.cpp View File

11
 // Standard SPI functions
11
 // Standard SPI functions
12
 /** Initialise SPI bus */
12
 /** Initialise SPI bus */
13
 void spiBegin(void) {
13
 void spiBegin(void) {
14
-  #ifndef SS_PIN
14
+  #if !PIN_EXISTS(SS)
15
     #error SS_PIN not defined!
15
     #error SS_PIN not defined!
16
   #endif
16
   #endif
17
   SET_OUTPUT(SS_PIN);
17
   SET_OUTPUT(SS_PIN);
21
   SET_OUTPUT(MOSI_PIN);
21
   SET_OUTPUT(MOSI_PIN);
22
 
22
 
23
   //#if DISABLED(SOFTWARE_SPI)
23
   //#if DISABLED(SOFTWARE_SPI)
24
-  #if false
24
+  #if 0
25
     // set SS high - may be chip select for another SPI device
25
     // set SS high - may be chip select for another SPI device
26
     #if SET_SPI_SS_HIGH
26
     #if SET_SPI_SS_HIGH
27
       WRITE(SS_PIN, HIGH);
27
       WRITE(SS_PIN, HIGH);

Loading…
Cancel
Save