Skip to content

Commit

Permalink
STM32: remove F3 spi_api.c warning
Browse files Browse the repository at this point in the history
Solve below warning:

"...\targets\TARGET_STM\TARGET_STM32F3\spi_api.c", line 73:
Warning:  ARMmbed#111-D: statement is unreachable
  • Loading branch information
LMESTM committed Jan 23, 2017
1 parent 04a31f3 commit c6a898d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions targets/TARGET_STM/TARGET_STM32F3/spi_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,22 @@ int spi_get_clock_freq(spi_t *obj) {
#endif
#if defined SPI2_BASE
case SPI_2:
/* SPI_2 and SPI_3. Source CLK is PCKL1 */
spi_hz = HAL_RCC_GetPCLK1Freq();
break;
#endif
#if defined SPI3_BASE
case SPI_3:
/* SPI_2 and SPI_3. Source CLK is PCKL1 */
spi_hz = HAL_RCC_GetPCLK1Freq();
break;
#endif
#if defined SPI4_BASE
case SPI_4:
#endif
/* SPI_2 and SPI_3. Source CLK is PCKL1 */
spi_hz = HAL_RCC_GetPCLK1Freq();
/* SPI_4. Source CLK is PCKL2 */
spi_hz = HAL_RCC_GetPCLK2Freq();
break;
#endif
default:
error("CLK: SPI instance not set");
break;
Expand Down

0 comments on commit c6a898d

Please sign in to comment.