File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,11 @@ uint32_t spi_getClkFreqInst(SPI_TypeDef * spi_inst)
118
118
if (spi_inst != NP ) {
119
119
/* Get source clock depending on SPI instance */
120
120
switch ((uint32_t )spi_inst ) {
121
+ #if defined(SPI1_BASE ) || defined(SPI4_BASE ) || defined(SPI5_BASE ) || defined(SPI16_BASE )
122
+ /* Some STM32's (eg. STM32F302x8) have no SPI1, but do have SPI2/3. */
123
+ #if defined SPI1_BASE
121
124
case (uint32_t )SPI1 :
125
+ #endif
122
126
#if defined SPI4_BASE
123
127
case (uint32_t )SPI4 :
124
128
#endif
@@ -131,6 +135,8 @@ uint32_t spi_getClkFreqInst(SPI_TypeDef * spi_inst)
131
135
/* SPI1, SPI4, SPI5 and SPI6. Source CLK is PCKL2 */
132
136
spi_freq = HAL_RCC_GetPCLK2Freq ();
133
137
break ;
138
+ #endif /* SPI[1456]_BASE */
139
+
134
140
#if defined(SPI2_BASE ) || defined (SPI3_BASE )
135
141
#if defined SPI2_BASE
136
142
case (uint32_t )SPI2 :
You can’t perform that action at this time.
0 commit comments