Skip to content

Commit e6dbbde

Browse files
committed
[NRF5] coding style format.
1 parent 53c6f85 commit e6dbbde

File tree

2 files changed

+36
-28
lines changed

2 files changed

+36
-28
lines changed

targets/TARGET_NORDIC/TARGET_NRF5/i2c_api.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,18 @@ void SPI1_TWI1_IRQHandler(void);
103103

104104
static const peripheral_handler_desc_t twi_handlers[TWI_COUNT] =
105105
{
106-
#if TWI0_ENABLED
106+
#if TWI0_ENABLED
107107
{
108108
SPI0_TWI0_IRQn,
109109
(uint32_t) SPI0_TWI0_IRQHandler
110110
},
111-
#endif
112-
#if TWI1_ENABLED
111+
#endif
112+
#if TWI1_ENABLED
113113
{
114114
SPI1_TWI1_IRQn,
115115
(uint32_t) SPI1_TWI1_IRQHandler
116116
}
117-
#endif
117+
#endif
118118
};
119119
#ifdef NRF51
120120
#define TWI_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW

targets/TARGET_NORDIC/TARGET_NRF5/us_ticker.c

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -138,32 +138,32 @@ void common_rtc_init(void)
138138
// events will be enabled or disabled as needed (such approach is more
139139
// energy efficient).
140140
nrf_rtc_int_enable(COMMON_RTC_INSTANCE,
141-
#if DEVICE_LOWPOWERTIMER
142-
LP_TICKER_INT_MASK |
143-
#endif
144-
US_TICKER_INT_MASK |
145-
NRF_RTC_INT_OVERFLOW_MASK);
141+
#if DEVICE_LOWPOWERTIMER
142+
LP_TICKER_INT_MASK |
143+
#endif
144+
US_TICKER_INT_MASK |
145+
NRF_RTC_INT_OVERFLOW_MASK);
146146

147147
// This event is enabled permanently, since overflow indications are needed
148148
// continuously.
149149
nrf_rtc_event_enable(COMMON_RTC_INSTANCE, NRF_RTC_INT_OVERFLOW_MASK);
150150
// All other relevant events are initially disabled.
151151
nrf_rtc_event_disable(COMMON_RTC_INSTANCE,
152-
#if defined(TARGET_MCU_NRF51822)
153-
OS_TICK_INT_MASK |
154-
#endif
155-
#if DEVICE_LOWPOWERTIMER
156-
LP_TICKER_INT_MASK |
157-
#endif
158-
US_TICKER_INT_MASK);
152+
#if defined(TARGET_MCU_NRF51822)
153+
OS_TICK_INT_MASK |
154+
#endif
155+
#if DEVICE_LOWPOWERTIMER
156+
LP_TICKER_INT_MASK |
157+
#endif
158+
US_TICKER_INT_MASK);
159159

160160
nrf_drv_common_irq_enable(nrf_drv_get_IRQn(COMMON_RTC_INSTANCE),
161161
#ifdef NRF51
162-
APP_IRQ_PRIORITY_LOW
162+
APP_IRQ_PRIORITY_LOW
163163
#elif defined(NRF52) || defined(NRF52840_XXAA)
164-
APP_IRQ_PRIORITY_LOWEST
164+
APP_IRQ_PRIORITY_LOWEST
165165
#endif
166-
);
166+
);
167167

168168
nrf_rtc_task_trigger(COMMON_RTC_INSTANCE, NRF_RTC_TASK_START);
169169

@@ -311,7 +311,9 @@ static uint32_t previous_tick_cc_value = 0;
311311
*/
312312
MBED_WEAK uint32_t const os_trv;
313313
MBED_WEAK uint32_t const os_clockrate;
314-
MBED_WEAK void OS_Tick_Handler() { }
314+
MBED_WEAK void OS_Tick_Handler(void)
315+
{
316+
}
315317

316318

317319
#if defined (__CC_ARM) /* ARMCC Compiler */
@@ -452,7 +454,8 @@ __stackless __task void COMMON_RTC_IRQ_HANDLER(void)
452454
* Return the next number of clock cycle needed for the next tick.
453455
* @note This function has been carrefuly optimized for a systick occuring every 1000us.
454456
*/
455-
static uint32_t get_next_tick_cc_delta() {
457+
static uint32_t get_next_tick_cc_delta()
458+
{
456459
uint32_t delta = 0;
457460

458461
if (os_clockrate != 1000) {
@@ -488,7 +491,8 @@ static uint32_t get_next_tick_cc_delta() {
488491
return delta;
489492
}
490493

491-
static inline void clear_tick_interrupt() {
494+
static inline void clear_tick_interrupt()
495+
{
492496
nrf_rtc_event_clear(COMMON_RTC_INSTANCE, OS_TICK_EVENT);
493497
nrf_rtc_event_disable(COMMON_RTC_INSTANCE, OS_TICK_INT_MASK);
494498
}
@@ -500,7 +504,8 @@ static inline void clear_tick_interrupt() {
500504
* @param val value to check
501505
* @return true if the value is included in the range and false otherwise.
502506
*/
503-
static inline bool is_in_wrapped_range(uint32_t begin, uint32_t end, uint32_t val) {
507+
static inline bool is_in_wrapped_range(uint32_t begin, uint32_t end, uint32_t val)
508+
{
504509
// regular case, begin < end
505510
// return true if begin <= val < end
506511
if (begin < end) {
@@ -524,7 +529,8 @@ static inline bool is_in_wrapped_range(uint32_t begin, uint32_t end, uint32_t va
524529
/**
525530
* Register the next tick.
526531
*/
527-
static void register_next_tick() {
532+
static void register_next_tick()
533+
{
528534
previous_tick_cc_value = nrf_rtc_cc_get(COMMON_RTC_INSTANCE, OS_TICK_CC_CHANNEL);
529535
uint32_t delta = get_next_tick_cc_delta();
530536
uint32_t new_compare_value = (previous_tick_cc_value + delta) & MAX_RTC_COUNTER_VAL;
@@ -583,8 +589,9 @@ void os_tick_irqack(void)
583589
* @note This function is exposed by RTX kernel.
584590
* @return 1 if the timer has overflowed and 0 otherwise.
585591
*/
586-
uint32_t os_tick_ovf(void) {
587-
uint32_t current_counter = nrf_rtc_counter_get(COMMON_RTC_INSTANCE);
592+
uint32_t os_tick_ovf(void)
593+
{
594+
uint32_t current_counter = nrf_rtc_counter_get(COMMON_RTC_INSTANCE);
588595
uint32_t next_tick_cc_value = nrf_rtc_cc_get(COMMON_RTC_INSTANCE, OS_TICK_CC_CHANNEL);
589596

590597
return is_in_wrapped_range(previous_tick_cc_value, next_tick_cc_value, current_counter) ? 0 : 1;
@@ -599,8 +606,9 @@ uint32_t os_tick_ovf(void) {
599606
* descending order, even if the internal counter used is an ascending one.
600607
* @return the value of the alternative hardware timer.
601608
*/
602-
uint32_t os_tick_val(void) {
603-
uint32_t current_counter = nrf_rtc_counter_get(COMMON_RTC_INSTANCE);
609+
uint32_t os_tick_val(void)
610+
{
611+
uint32_t current_counter = nrf_rtc_counter_get(COMMON_RTC_INSTANCE);
604612
uint32_t next_tick_cc_value = nrf_rtc_cc_get(COMMON_RTC_INSTANCE, OS_TICK_CC_CHANNEL);
605613

606614
// do not use os_tick_ovf because its counter value can be different

0 commit comments

Comments
 (0)