diff --git a/src/hal/hal.cpp b/src/hal/hal.cpp index 53bf359d..327b3ce0 100644 --- a/src/hal/hal.cpp +++ b/src/hal/hal.cpp @@ -74,7 +74,7 @@ static void hal_io_check() { // ----------------------------------------------------------------------------- // SPI -static const SPISettings settings(10E6, MSBFIRST, SPI_MODE0); +static const SPISettings settings(LMIC_SPI_FREQ, MSBFIRST, SPI_MODE0); static void hal_spi_init () { SPI.begin(); diff --git a/src/lmic/config.h b/src/lmic/config.h index e3e4487d..1572e37e 100644 --- a/src/lmic/config.h +++ b/src/lmic/config.h @@ -20,6 +20,11 @@ #define US_PER_OSTICK (1 << US_PER_OSTICK_EXPONENT) #define OSTICKS_PER_SEC (1000000 / US_PER_OSTICK) +// Change the SPI clock speed if you encounter errors +// communicating with the radio. +// The standard range is 125kHz-8MHz, but some boards can go faster. +#define LMIC_SPI_FREQ 1E6 + // Enable this to allow using printf() to print to the given serial port // (or any other Print object). This can be easy for debugging. The // current implementation only works on AVR, though.