mbed library sources. Supersedes mbed-src.
Dependents: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
Diff: targets/TARGET_STM/TARGET_STM32L0/device/stm32l0xx_ll_spi.c
- Revision:
- 186:707f6e361f3e
- Parent:
- 158:b23ee177fd68
--- a/targets/TARGET_STM/TARGET_STM32L0/device/stm32l0xx_ll_spi.c Thu Apr 19 17:12:19 2018 +0100 +++ b/targets/TARGET_STM/TARGET_STM32L0/device/stm32l0xx_ll_spi.c Fri Jun 22 16:45:37 2018 +0100 @@ -2,8 +2,6 @@ ****************************************************************************** * @file stm32l0xx_ll_spi.c * @author MCD Application Team - * @version V1.7.0 - * @date 31-May-2016 * @brief SPI LL module driver. ****************************************************************************** * @attention @@ -410,22 +408,15 @@ * - AudioFreq: SPI_I2SPR_I2SDIV[7:0] and SPI_I2SPR_ODD bits */ - /* If the default value has to be written, reinitialize i2sdiv and i2sodd*/ - if (I2S_InitStruct->AudioFreq == LL_I2S_AUDIOFREQ_DEFAULT) + /* If the requested audio frequency is not the default, compute the prescaler (i2sodd, i2sdiv) + * else, default values are used: i2sodd = 0U, i2sdiv = 2U. + */ + if (I2S_InitStruct->AudioFreq != LL_I2S_AUDIOFREQ_DEFAULT) { - i2sodd = 0U; - i2sdiv = 2U; - } - /* If the requested audio frequency is not the default, compute the prescaler */ - else - { - /* Check the frame length (For the Prescaler computing) */ - if (I2S_InitStruct->DataFormat == LL_I2S_DATAFORMAT_16B) - { - /* Packet length is 16 bits */ - packetlength = 1U; - } - else + /* Check the frame length (For the Prescaler computing) + * Default value: LL_I2S_DATAFORMAT_16B (packetlength = 1U). + */ + if (I2S_InitStruct->DataFormat != LL_I2S_DATAFORMAT_16B) { /* Packet length is 32 bits */ packetlength = 2U;