Skip to content

Commit

Permalink
additional checks for #if BOARD_NR_SPI >= 1 and 2
Browse files Browse the repository at this point in the history
Check #if BOARD_NR_SPI >= 1 or >= 2 as is done for >=3 to avoid compiling invalid code on boards that have fewer SPIs
  • Loading branch information
mitchmitchell authored Feb 8, 2019
1 parent ac24ff4 commit 4865add
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions STM32F1/libraries/SPI/src/SPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,12 @@ class SPISettings {
Should move this to within the class once tested out, just for tidyness
*/
static uint8_t ff = 0XFF;
#if BOARD_NR_SPI >= 1
static void (*_spi1_this);
#endif
#if BOARD_NR_SPI >= 2
static void (*_spi2_this);
#endif
#if BOARD_NR_SPI >= 3
static void (*_spi3_this);
#endif
Expand Down Expand Up @@ -411,8 +415,12 @@ class SPIClass {

void EventCallback(void);

#if BOARD_NR_SPI >= 1
static void _spi1EventCallback(void);
#endif
#if BOARD_NR_SPI >= 2
static void _spi2EventCallback(void);
#endif
#if BOARD_NR_SPI >= 3
static void _spi3EventCallback(void);
#endif
Expand Down

0 comments on commit 4865add

Please sign in to comment.