|
@@ -66,11 +66,7 @@
|
66
|
66
|
|
67
|
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
|
71
|
static uint8_t spiTransfer(uint8_t b) {
|
76
|
72
|
return swSpiTransfer(b, SPI_speed, SD_SCK_PIN, SD_MISO_PIN, SD_MOSI_PIN);
|
|
@@ -106,15 +102,13 @@
|
106
|
102
|
|
107
|
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
|
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
|
113
|
void spiInit(uint8_t spiRate) {
|
120
|
114
|
#if SD_MISO_PIN == BOARD_SPI1_MISO_PIN
|