@@ -33,7 +33,7 @@ uint8_t const SPI_HALF_SPEED = 1;
33
33
uint8_t const SPI_QUARTER_SPEED = 2 ;
34
34
/* *
35
35
* USE_SPI_LIB: if set, use the SPI library bundled with Arduino IDE, otherwise
36
- * run with a standalone driver for AVR.
36
+ * run with a standalone driver for AVR.
37
37
*/
38
38
#define USE_SPI_LIB
39
39
/* *
@@ -54,6 +54,10 @@ uint8_t const SPI_QUARTER_SPEED = 2;
54
54
//
55
55
#ifndef SOFTWARE_SPI
56
56
// hardware pin defs
57
+
58
+ // include pins_arduino.h or variant.h depending on architecture, via Arduino.h
59
+ #include < Arduino.h>
60
+
57
61
/* *
58
62
* SD Chip Select pin
59
63
*
@@ -62,14 +66,17 @@ uint8_t const SPI_QUARTER_SPEED = 2;
62
66
* master unless SS is set to output mode.
63
67
*/
64
68
/* * The default chip select pin for the SD card is SS. */
65
- uint8_t const SD_CHIP_SELECT_PIN = SS_PIN;
66
- // The following three pins must not be redefined for hardware SPI.
69
+ uint8_t const SD_CHIP_SELECT_PIN = SS;
70
+
71
+ // The following three pins must not be redefined for hardware SPI,
72
+ // so ensure that they are taken from pins_arduino.h or variant.h, depending on architecture.
67
73
/* * SPI Master Out Slave In pin */
68
- uint8_t const SPI_MOSI_PIN = MOSI_PIN ;
74
+ uint8_t const SPI_MOSI_PIN = MOSI ;
69
75
/* * SPI Master In Slave Out pin */
70
- uint8_t const SPI_MISO_PIN = MISO_PIN ;
76
+ uint8_t const SPI_MISO_PIN = MISO ;
71
77
/* * SPI Clock pin */
72
- uint8_t const SPI_SCK_PIN = SCK_PIN;
78
+ uint8_t const SPI_SCK_PIN = SCK;
79
+
73
80
/* * optimize loops for hardware SPI */
74
81
#ifndef USE_SPI_LIB
75
82
#define OPTIMIZE_HARDWARE_SPI
0 commit comments