Skip to content

Commit 2006e45

Browse files
committed
Typo corrections (functions declaration)
1 parent 777692c commit 2006e45

File tree

4 files changed

+41
-21
lines changed

4 files changed

+41
-21
lines changed

targets/TARGET_STM/hal_tick_16b.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ void set_compare(uint16_t count);
4848
#if defined(TARGET_STM32F0)
4949
void timer_update_irq_handler(void) {
5050
#else
51-
void timer_irq_handler(void) {
51+
void timer_irq_handler(void)
52+
{
5253
#endif
5354
uint16_t cnt_val = TIM_MST->CNT;
5455
TimMasterHandle.Instance = TIM_MST;
@@ -66,7 +67,8 @@ void timer_irq_handler(void) {
6667
#if defined(TARGET_STM32F0)
6768
} // end timer_update_irq_handler function
6869
// Used for mbed timeout (channel 1) and HAL tick (channel 2)
69-
void timer_oc_irq_handler(void) {
70+
void timer_oc_irq_handler(void)
71+
{
7072
uint16_t cnt_val = TIM_MST->CNT;
7173
TimMasterHandle.Instance = TIM_MST;
7274
#endif
@@ -110,7 +112,8 @@ void timer_oc_irq_handler(void) {
110112
}
111113

112114
// Reconfigure the HAL tick using a standard timer instead of systick.
113-
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) {
115+
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
116+
{
114117
// Enable timer clock
115118
TIM_MST_RCC;
116119

@@ -173,13 +176,15 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) {
173176
return HAL_OK;
174177
}
175178

176-
void HAL_SuspendTick(void) {
179+
void HAL_SuspendTick(void)
180+
{
177181
TimMasterHandle.Instance = TIM_MST;
178182
// Disable HAL tick and us_ticker update interrupts (used for 32 bit counter)
179183
__HAL_TIM_DISABLE_IT(&TimMasterHandle, (TIM_IT_CC2 | TIM_IT_UPDATE));
180184
}
181185

182-
void HAL_ResumeTick(void) {
186+
void HAL_ResumeTick(void)
187+
{
183188
TimMasterHandle.Instance = TIM_MST;
184189
// Enable HAL tick and us_ticker update interrupts (used for 32 bit counter)
185190
__HAL_TIM_ENABLE_IT(&TimMasterHandle, (TIM_IT_CC2 | TIM_IT_UPDATE));

targets/TARGET_STM/hal_tick_32b.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ volatile uint32_t PreviousVal = 0;
3838

3939
void us_ticker_irq_handler(void);
4040

41-
void timer_irq_handler(void) {
41+
void timer_irq_handler(void)
42+
{
4243
// Channel 1 for mbed timeout
4344
if (__HAL_TIM_GET_FLAG(&TimMasterHandle, TIM_FLAG_CC1) == SET) {
4445
if (__HAL_TIM_GET_IT_SOURCE(&TimMasterHandle, TIM_IT_CC1) == SET) {
@@ -67,7 +68,8 @@ void timer_irq_handler(void) {
6768
}
6869

6970
// Reconfigure the HAL tick using a standard timer instead of systick.
70-
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) {
71+
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
72+
{
7173
RCC_ClkInitTypeDef RCC_ClkInitStruct;
7274
uint32_t PclkFreq;
7375

@@ -137,13 +139,15 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) {
137139
return HAL_OK;
138140
}
139141

140-
void HAL_SuspendTick(void) {
142+
void HAL_SuspendTick(void)
143+
{
141144
TimMasterHandle.Instance = TIM_MST;
142145
// Disable HAL tick and us_ticker update interrupts (used for 32 bit counter)
143146
__HAL_TIM_DISABLE_IT(&TimMasterHandle, (TIM_IT_CC2 | TIM_IT_UPDATE));
144147
}
145148

146-
void HAL_ResumeTick(void) {
149+
void HAL_ResumeTick(void)
150+
{
147151
TimMasterHandle.Instance = TIM_MST;
148152
// Enable HAL tick and us_ticker update interrupts (used for 32 bit counter)
149153
__HAL_TIM_ENABLE_IT(&TimMasterHandle, (TIM_IT_CC2 | TIM_IT_UPDATE));

targets/TARGET_STM/us_ticker_16b.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,17 @@ volatile uint32_t tim_it_counter = 0; // Time stamp to be updated by timer_irq_h
4343

4444
static int us_ticker_inited = 0;
4545

46-
void set_compare(uint16_t count) {
46+
void set_compare(uint16_t count)
47+
{
4748
TimMasterHandle.Instance = TIM_MST;
4849
// Set new output compare value
4950
__HAL_TIM_SetCompare(&TimMasterHandle, TIM_CHANNEL_1, count);
5051
// Enable IT
5152
__HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_CC1);
5253
}
5354

54-
void us_ticker_init(void) {
55+
void us_ticker_init(void)
56+
{
5557
if (us_ticker_inited) return;
5658
us_ticker_inited = 1;
5759

@@ -60,7 +62,8 @@ void us_ticker_init(void) {
6062
HAL_InitTick(0); // The passed value is not used
6163
}
6264

63-
uint32_t us_ticker_read() {
65+
uint32_t us_ticker_read()
66+
{
6467
uint32_t counter;
6568

6669
TimMasterHandle.Instance = TIM_MST;
@@ -70,7 +73,7 @@ uint32_t us_ticker_read() {
7073
#if defined(TARGET_STM32L0)
7174
uint16_t cntH_old, cntH, cntL;
7275
do {
73-
// For some reason on L0xx series we need to read and clear the
76+
// For some reason on L0xx series we need to read and clear the
7477
// overflow flag which give extra time to propelry handle possible
7578
// hiccup after ~60s
7679
if (__HAL_TIM_GET_FLAG(&TimMasterHandle, TIM_FLAG_CC1OF) == SET) {
@@ -100,7 +103,8 @@ uint32_t us_ticker_read() {
100103
#endif
101104
}
102105

103-
void us_ticker_set_interrupt(timestamp_t timestamp) {
106+
void us_ticker_set_interrupt(timestamp_t timestamp)
107+
{
104108
int delta = (int)((uint32_t)timestamp - us_ticker_read());
105109

106110
uint16_t cval = TIM_MST->CNT;
@@ -120,12 +124,14 @@ void us_ticker_set_interrupt(timestamp_t timestamp) {
120124
}
121125
}
122126

123-
void us_ticker_disable_interrupt(void) {
127+
void us_ticker_disable_interrupt(void)
128+
{
124129
TimMasterHandle.Instance = TIM_MST;
125130
__HAL_TIM_DISABLE_IT(&TimMasterHandle, TIM_IT_CC1);
126131
}
127132

128-
void us_ticker_clear_interrupt(void) {
133+
void us_ticker_clear_interrupt(void)
134+
{
129135
TimMasterHandle.Instance = TIM_MST;
130136
if (__HAL_TIM_GET_FLAG(&TimMasterHandle, TIM_FLAG_CC1) == SET) {
131137
__HAL_TIM_CLEAR_FLAG(&TimMasterHandle, TIM_FLAG_CC1);

targets/TARGET_STM/us_ticker_32b.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ TIM_HandleTypeDef TimMasterHandle;
3737

3838
static int us_ticker_inited = 0;
3939

40-
void us_ticker_init(void) {
40+
void us_ticker_init(void)
41+
{
4142
if (us_ticker_inited) return;
4243
us_ticker_inited = 1;
4344

@@ -46,25 +47,29 @@ void us_ticker_init(void) {
4647
HAL_InitTick(0); // The passed value is not used
4748
}
4849

49-
uint32_t us_ticker_read() {
50+
uint32_t us_ticker_read()
51+
{
5052
if (!us_ticker_inited) us_ticker_init();
5153
return TIM_MST->CNT;
5254
}
5355

54-
void us_ticker_set_interrupt(timestamp_t timestamp) {
56+
void us_ticker_set_interrupt(timestamp_t timestamp)
57+
{
5558
TimMasterHandle.Instance = TIM_MST;
5659
// Set new output compare value
5760
__HAL_TIM_SET_COMPARE(&TimMasterHandle, TIM_CHANNEL_1, (uint32_t)timestamp);
5861
// Enable IT
5962
__HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_CC1);
6063
}
6164

62-
void us_ticker_disable_interrupt(void) {
65+
void us_ticker_disable_interrupt(void)
66+
{
6367
TimMasterHandle.Instance = TIM_MST;
6468
__HAL_TIM_DISABLE_IT(&TimMasterHandle, TIM_IT_CC1);
6569
}
6670

67-
void us_ticker_clear_interrupt(void) {
71+
void us_ticker_clear_interrupt(void)
72+
{
6873
TimMasterHandle.Instance = TIM_MST;
6974
__HAL_TIM_CLEAR_IT(&TimMasterHandle, TIM_IT_CC1);
7075
}

0 commit comments

Comments
 (0)