Commit 0524008c authored by Nishanth Samala's avatar Nishanth Samala Committed by Sandeep Mistry

update compatibility mode for different F_CPU values

parent 9c8d0577
......@@ -145,14 +145,13 @@ extern SPIClass SPI1;
// For compatibility with sketches designed for AVR @ 16 MHz
// New programs should use SPI.beginTransaction to set the SPI clock
#if F_CPU == 16000000
#define SPI_CLOCK_DIV2 2
#define SPI_CLOCK_DIV4 4
#define SPI_CLOCK_DIV8 8
#define SPI_CLOCK_DIV16 16
#define SPI_CLOCK_DIV32 32
#define SPI_CLOCK_DIV64 64
#define SPI_CLOCK_DIV128 128
#endif
#ifdef F_CPU
#define DIVISOR F_CPU / 16000000
#define SPI_CLOCK_DIV2 2 * DIVISOR
#define SPI_CLOCK_DIV4 4 * DIVISOR
#define SPI_CLOCK_DIV8 8 * DIVISOR
#define SPI_CLOCK_DIV16 16 * DIVISOR
#define SPI_CLOCK_DIV32 32 * DIVISOR
#define SPI_CLOCK_DIV64 64 * DIVISOR
#define SPI_CLOCK_DIV128 128 * DIVISOR
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment