style fixes

This commit is contained in:
Matias Nitsche 2020-06-15 21:14:43 -03:00 committed by Alan Carvalho de Assis
parent b7d18585dc
commit 67ab8ebb5f
2 changed files with 42 additions and 42 deletions

View File

@ -1460,32 +1460,32 @@ static void stm32l4_i2c_setclock(FAR struct stm32l4_i2c_priv_s *priv,
}
}
else if (i2cclk_mhz == 48)
{
if (frequency == 100000)
{
presc = 2;
scl_delay = 10;
sda_delay = 0;
scl_h_period = 62;
scl_l_period = 85;
}
else if (frequency == 400000)
{
presc = 1;
scl_delay = 8;
sda_delay = 0;
scl_h_period = 12;
scl_l_period = 33;
}
else if (frequency == 1000000)
{
presc = 0;
scl_delay = 5;
sda_delay = 0;
scl_h_period = 8;
scl_l_period = 22;
}
}
{
if (frequency == 100000)
{
presc = 2;
scl_delay = 10;
sda_delay = 0;
scl_h_period = 62;
scl_l_period = 85;
}
else if (frequency == 400000)
{
presc = 1;
scl_delay = 8;
sda_delay = 0;
scl_h_period = 12;
scl_l_period = 33;
}
else if (frequency == 1000000)
{
presc = 0;
scl_delay = 5;
sda_delay = 0;
scl_h_period = 8;
scl_l_period = 22;
}
}
else
{
DEBUGPANIC();

View File

@ -731,26 +731,26 @@ static void stm32l4_stdclockconfig(void)
putreg32(regval, STM32L4_RCC_CR);
if (!(regval & RCC_CR_MSION))
{
/* Enable MSI */
{
/* Enable MSI */
regval = getreg32(STM32L4_RCC_CR);
regval |= RCC_CR_MSION;
putreg32(regval, STM32L4_RCC_CR);
regval = getreg32(STM32L4_RCC_CR);
regval |= RCC_CR_MSION;
putreg32(regval, STM32L4_RCC_CR);
/* Wait until the MSI is ready (or until a timeout elapsed) */
/* Wait until the MSI is ready (or until a timeout elapsed) */
for (timeout = MSIRDY_TIMEOUT; timeout > 0; timeout--)
{
/* Check if the MSIRDY flag is the set in the CR */
for (timeout = MSIRDY_TIMEOUT; timeout > 0; timeout--)
{
/* Check if the MSIRDY flag is the set in the CR */
if ((getreg32(STM32L4_RCC_CR) & RCC_CR_MSIRDY) != 0)
{
/* If so, then break-out with timeout > 0 */
if ((getreg32(STM32L4_RCC_CR) & RCC_CR_MSIRDY) != 0)
{
/* If so, then break-out with timeout > 0 */
break;
}
}
break;
}
}
}
#elif defined(STM32L4_BOARD_USEHSE)
@ -797,7 +797,7 @@ static void stm32l4_stdclockconfig(void)
stm32l4_pwr_enableclk(true);
stm32_pwr_setvos(1);
#endif
}
}
else
{
/* Select regulator voltage output Scale 2 mode for