mbed
Fork of mbed-dev by
Diff: targets/TARGET_STM/TARGET_STM32F3/spi_api.c
- Revision:
- 158:b23ee177fd68
- Parent:
- 149:156823d33999
--- a/targets/TARGET_STM/TARGET_STM32F3/spi_api.c Thu Feb 02 17:01:33 2017 +0000 +++ b/targets/TARGET_STM/TARGET_STM32F3/spi_api.c Tue Feb 14 14:44:10 2017 +0000 @@ -55,25 +55,31 @@ /* Get source clock depending on SPI instance */ switch ((int)spiobj->spi) { #if defined SPI1_BASE - case SPI_1: - /* SPI_1. Source CLK is PCKL2 */ - spi_hz = HAL_RCC_GetPCLK2Freq(); - break; + case SPI_1: + /* SPI_1. Source CLK is PCKL2 */ + spi_hz = HAL_RCC_GetPCLK2Freq(); + break; #endif #if defined SPI2_BASE - case SPI_2: + 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: + 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: + case SPI_4: + /* SPI_4. Source CLK is PCKL2 */ + spi_hz = HAL_RCC_GetPCLK2Freq(); + break; #endif - /* SPI_2 and SPI_3. Source CLK is PCKL1 */ - spi_hz = HAL_RCC_GetPCLK1Freq(); - break; - default: - error("CLK: SPI instance not set"); + default: + error("CLK: SPI instance not set"); break; } return spi_hz;