Skip to content

Commit e6fcc14

Browse files
committed
Fix build issue if SPI2 is not defined.
Signed-off-by: Frederic Pillon <[email protected]>
1 parent 21985ca commit e6fcc14

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: cores/arduino/stm32/spi_com.c

+4
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,17 @@ uint32_t spi_getClkFreqInst(SPI_TypeDef * spi_inst)
131131
/* SPI1, SPI4, SPI5 and SPI6. Source CLK is PCKL2 */
132132
spi_freq = HAL_RCC_GetPCLK2Freq();
133133
break;
134+
#if defined(SPI2_BASE) || defined (SPI3_BASE)
135+
#if defined SPI2_BASE
134136
case (uint32_t)SPI2:
137+
#endif
135138
#if defined SPI3_BASE
136139
case (uint32_t)SPI3:
137140
#endif
138141
/* SPI_2 and SPI_3. Source CLK is PCKL1 */
139142
spi_freq = HAL_RCC_GetPCLK1Freq();
140143
break;
144+
#endif
141145
default:
142146
printf("CLK: SPI instance not set");
143147
break;

0 commit comments

Comments
 (0)