mirror of https://github.com/ARMmbed/mbed-os.git
Run astyle
parent
8627204d36
commit
4e83b88257
|
@ -70,20 +70,16 @@ void rtc_init(void)
|
|||
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
||||
RCC_OscInitStruct.LSIState = RCC_LSI_OFF;
|
||||
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) == HAL_OK)
|
||||
{
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) == HAL_OK) {
|
||||
__HAL_RCC_RTC_CLKPRESCALER(RCC_RTCCLKSOURCE_LSE);
|
||||
__HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
error("Cannot initialize RTC with LSE\n");
|
||||
}
|
||||
|
||||
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC;
|
||||
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
|
||||
{
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {
|
||||
error("PeriphClkInitStruct RTC failed with LSE\n");
|
||||
}
|
||||
|
||||
|
@ -100,8 +96,7 @@ void rtc_init(void)
|
|||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; // Mandatory, otherwise the PLL is reconfigured!
|
||||
RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
|
||||
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
|
||||
error("Cannot initialize RTC with LSI\n");
|
||||
}
|
||||
|
||||
|
@ -110,8 +105,7 @@ void rtc_init(void)
|
|||
|
||||
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC;
|
||||
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
|
||||
{
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {
|
||||
error("PeriphClkInitStruct RTC failed with LSI\n");
|
||||
}
|
||||
|
||||
|
@ -258,12 +252,9 @@ void rtc_write(time_t t)
|
|||
int rtc_isenabled(void)
|
||||
{
|
||||
#if DEVICE_LOWPOWERTIMER
|
||||
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS)
|
||||
{
|
||||
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) {
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
#else /* DEVICE_LOWPOWERTIMER */
|
||||
|
|
Loading…
Reference in New Issue