Skip to content

Commit 9042682

Browse files
LMESTM0xc0170
authored andcommitted
STM32: remove F3 spi_api.c warning
Solve below warning: "...\targets\TARGET_STM\TARGET_STM32F3\spi_api.c", line 73: Warning: #111-D: statement is unreachable
1 parent d8ee528 commit 9042682

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

targets/TARGET_STM/TARGET_STM32F3/spi_api.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,22 @@ int spi_get_clock_freq(spi_t *obj) {
6262
#endif
6363
#if defined SPI2_BASE
6464
case SPI_2:
65+
/* SPI_2 and SPI_3. Source CLK is PCKL1 */
66+
spi_hz = HAL_RCC_GetPCLK1Freq();
67+
break;
6568
#endif
6669
#if defined SPI3_BASE
6770
case SPI_3:
71+
/* SPI_2 and SPI_3. Source CLK is PCKL1 */
72+
spi_hz = HAL_RCC_GetPCLK1Freq();
73+
break;
6874
#endif
6975
#if defined SPI4_BASE
7076
case SPI_4:
71-
#endif
72-
/* SPI_2 and SPI_3. Source CLK is PCKL1 */
73-
spi_hz = HAL_RCC_GetPCLK1Freq();
77+
/* SPI_4. Source CLK is PCKL2 */
78+
spi_hz = HAL_RCC_GetPCLK2Freq();
7479
break;
80+
#endif
7581
default:
7682
error("CLK: SPI instance not set");
7783
break;

0 commit comments

Comments
 (0)