Skip to content

Commit 3f9d1a9

Browse files
committed
nanostack eventloop: fix coding style
1 parent eec4e13 commit 3f9d1a9

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

features/nanostack/sal-stack-nanostack-eventloop/source/ns_timeout.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,22 +78,24 @@ static timeout_t *eventOS_timeout_at_(void (*callback)(void *), void *arg, uint3
7878
.data_ptr = timeout
7979
};
8080

81-
if (period)
81+
if (period) {
8282
storage = eventOS_event_timer_request_every(&event, period);
83-
else
83+
} else {
8484
storage = eventOS_event_timer_request_at(&event, at);
85+
}
8586

8687
timeout->event = storage;
87-
if (storage)
88+
if (storage) {
8889
return timeout;
90+
}
8991
FAIL:
9092
ns_dyn_mem_free(timeout);
9193
return NULL;
9294
}
9395

9496
timeout_t *eventOS_timeout_ms(void (*callback)(void *), uint32_t ms, void *arg)
9597
{
96-
return eventOS_timeout_at_(callback, arg, eventOS_event_timer_ms_to_ticks(ms)+eventOS_event_timer_ticks(), 0);
98+
return eventOS_timeout_at_(callback, arg, eventOS_event_timer_ms_to_ticks(ms) + eventOS_event_timer_ticks(), 0);
9799
}
98100

99101
timeout_t *eventOS_timeout_every_ms(void (*callback)(void *), uint32_t every, void *arg)
@@ -103,8 +105,9 @@ timeout_t *eventOS_timeout_every_ms(void (*callback)(void *), uint32_t every, vo
103105

104106
void eventOS_timeout_cancel(timeout_t *t)
105107
{
106-
if (!t)
108+
if (!t) {
107109
return;
110+
}
108111

109112
eventOS_cancel(t->event);
110113

features/nanostack/sal-stack-nanostack-eventloop/source/system_timer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static int8_t platform_tick_timer_start(uint32_t period_ms);
5353
/* Implement platform tick timer using eventOS timer */
5454
// platform tick timer callback function
5555
static void (*tick_timer_callback)(void);
56-
static int8_t tick_timer_id = -1; // eventOS timer id for tick timer
56+
static int8_t tick_timer_id = -1; // eventOS timer id for tick timer
5757

5858
// EventOS timer callback function
5959
static void tick_timer_eventOS_callback(int8_t timer_id, uint16_t slots)
@@ -299,7 +299,7 @@ int8_t eventOS_event_timer_request(uint8_t event_id, uint8_t event_type, int8_t
299299
platform_enter_critical();
300300
arm_event_storage_t *ret = eventOS_event_timer_request_at_(&event, timer_sys_ticks + time, 0);
301301
platform_exit_critical();
302-
return ret?0:-1;
302+
return ret ? 0 : -1;
303303
}
304304

305305
int8_t eventOS_event_timer_cancel(uint8_t event_id, int8_t tasklet_id)

0 commit comments

Comments
 (0)