Skip to content

Commit 2b4d83e

Browse files
jeromecoutant0xc0170
authored andcommitted
Run astyle
1 parent ab28a5e commit 2b4d83e

File tree

2 files changed

+22
-31
lines changed

2 files changed

+22
-31
lines changed

targets/TARGET_STM/lp_ticker.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ uint32_t lp_ticker_read(void)
5555
lp_ticker_init();
5656

5757
do {
58-
time = rtc_read();
59-
usecs = rtc_read_subseconds();
58+
time = rtc_read();
59+
usecs = rtc_read_subseconds();
6060
} while (time != rtc_read());
6161

6262
return (time * 1000000) + usecs;

targets/TARGET_STM/rtc_api.c

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,22 @@
3636
static RTC_HandleTypeDef RtcHandle;
3737

3838
#if RTC_LSI
39-
#define RTC_CLOCK LSI_VALUE
39+
#define RTC_CLOCK LSI_VALUE
4040
#else
41-
#define RTC_CLOCK LSE_VALUE
41+
#define RTC_CLOCK LSE_VALUE
4242
#endif
4343

4444
#if DEVICE_LOWPOWERTIMER
45-
#define RTC_ASYNCH_PREDIV ((RTC_CLOCK - 1) / 0x8000)
46-
#define RTC_SYNCH_PREDIV (RTC_CLOCK / (RTC_ASYNCH_PREDIV + 1) - 1)
45+
#define RTC_ASYNCH_PREDIV ((RTC_CLOCK - 1) / 0x8000)
46+
#define RTC_SYNCH_PREDIV (RTC_CLOCK / (RTC_ASYNCH_PREDIV + 1) - 1)
4747
#else
48-
#define RTC_ASYNCH_PREDIV (0x007F)
49-
#define RTC_SYNCH_PREDIV (RTC_CLOCK / (RTC_ASYNCH_PREDIV + 1) - 1)
48+
#define RTC_ASYNCH_PREDIV (0x007F)
49+
#define RTC_SYNCH_PREDIV (RTC_CLOCK / (RTC_ASYNCH_PREDIV + 1) - 1)
5050
#endif
5151

5252
#if DEVICE_LOWPOWERTIMER
53-
static void (*irq_handler)(void);
54-
static void RTC_IRQHandler(void);
53+
static void (*irq_handler)(void);
54+
static void RTC_IRQHandler(void);
5555
#endif
5656

5757
void rtc_init(void)
@@ -70,20 +70,16 @@ void rtc_init(void)
7070
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
7171
RCC_OscInitStruct.LSIState = RCC_LSI_OFF;
7272

73-
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) == HAL_OK)
74-
{
73+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) == HAL_OK) {
7574
__HAL_RCC_RTC_CLKPRESCALER(RCC_RTCCLKSOURCE_LSE);
7675
__HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE);
77-
}
78-
else
79-
{
80-
error("Cannot initialize RTC with LSE\n");
76+
} else {
77+
error("Cannot initialize RTC with LSE\n");
8178
}
8279

8380
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC;
8481
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
85-
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
86-
{
82+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {
8783
error("PeriphClkInitStruct RTC failed with LSE\n");
8884
}
8985

@@ -100,8 +96,7 @@ void rtc_init(void)
10096
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; // Mandatory, otherwise the PLL is reconfigured!
10197
RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
10298
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
103-
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
104-
{
99+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
105100
error("Cannot initialize RTC with LSI\n");
106101
}
107102

@@ -110,8 +105,7 @@ void rtc_init(void)
110105

111106
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC;
112107
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
113-
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
114-
{
108+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {
115109
error("PeriphClkInitStruct RTC failed with LSI\n");
116110
}
117111

@@ -258,16 +252,13 @@ void rtc_write(time_t t)
258252
int rtc_isenabled(void)
259253
{
260254
#if DEVICE_LOWPOWERTIMER
261-
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS)
262-
{
263-
return 1;
264-
}
265-
else
266-
{
267-
return 0;
268-
}
255+
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) {
256+
return 1;
257+
} else {
258+
return 0;
259+
}
269260
#else /* DEVICE_LOWPOWERTIMER */
270-
return 1;
261+
return 1;
271262
#endif /* DEVICE_LOWPOWERTIMER */
272263
}
273264

0 commit comments

Comments
 (0)