@@ -33,7 +33,7 @@ uint8_t const SPI_HALF_SPEED = 1;
3333uint8_t const SPI_QUARTER_SPEED = 2 ;
3434/* *
3535 * 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.
3737 */
3838#define USE_SPI_LIB
3939/* *
@@ -54,6 +54,10 @@ uint8_t const SPI_QUARTER_SPEED = 2;
5454//
5555#ifndef SOFTWARE_SPI
5656// hardware pin defs
57+
58+ // include pins_arduino.h or variant.h depending on architecture, via Arduino.h
59+ #include < Arduino.h>
60+
5761/* *
5862 * SD Chip Select pin
5963 *
@@ -62,14 +66,17 @@ uint8_t const SPI_QUARTER_SPEED = 2;
6266 * master unless SS is set to output mode.
6367 */
6468/* * 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.
6773/* * SPI Master Out Slave In pin */
68- uint8_t const SPI_MOSI_PIN = MOSI_PIN ;
74+ uint8_t const SPI_MOSI_PIN = MOSI ;
6975/* * SPI Master In Slave Out pin */
70- uint8_t const SPI_MISO_PIN = MISO_PIN ;
76+ uint8_t const SPI_MISO_PIN = MISO ;
7177/* * SPI Clock pin */
72- uint8_t const SPI_SCK_PIN = SCK_PIN;
78+ uint8_t const SPI_SCK_PIN = SCK;
79+
7380/* * optimize loops for hardware SPI */
7481#ifndef USE_SPI_LIB
7582#define OPTIMIZE_HARDWARE_SPI
0 commit comments