mirror of https://github.com/ARMmbed/mbed-os.git
nanostack eventloop: fix coding style
parent
eec4e1329a
commit
3f9d1a9271
|
@ -78,14 +78,16 @@ static timeout_t *eventOS_timeout_at_(void (*callback)(void *), void *arg, uint3
|
|||
.data_ptr = timeout
|
||||
};
|
||||
|
||||
if (period)
|
||||
if (period) {
|
||||
storage = eventOS_event_timer_request_every(&event, period);
|
||||
else
|
||||
} else {
|
||||
storage = eventOS_event_timer_request_at(&event, at);
|
||||
}
|
||||
|
||||
timeout->event = storage;
|
||||
if (storage)
|
||||
if (storage) {
|
||||
return timeout;
|
||||
}
|
||||
FAIL:
|
||||
ns_dyn_mem_free(timeout);
|
||||
return NULL;
|
||||
|
@ -93,7 +95,7 @@ FAIL:
|
|||
|
||||
timeout_t *eventOS_timeout_ms(void (*callback)(void *), uint32_t ms, void *arg)
|
||||
{
|
||||
return eventOS_timeout_at_(callback, arg, eventOS_event_timer_ms_to_ticks(ms)+eventOS_event_timer_ticks(), 0);
|
||||
return eventOS_timeout_at_(callback, arg, eventOS_event_timer_ms_to_ticks(ms) + eventOS_event_timer_ticks(), 0);
|
||||
}
|
||||
|
||||
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
|
|||
|
||||
void eventOS_timeout_cancel(timeout_t *t)
|
||||
{
|
||||
if (!t)
|
||||
if (!t) {
|
||||
return;
|
||||
}
|
||||
|
||||
eventOS_cancel(t->event);
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ static int8_t platform_tick_timer_start(uint32_t period_ms);
|
|||
/* Implement platform tick timer using eventOS timer */
|
||||
// platform tick timer callback function
|
||||
static void (*tick_timer_callback)(void);
|
||||
static int8_t tick_timer_id = -1; // eventOS timer id for tick timer
|
||||
static int8_t tick_timer_id = -1; // eventOS timer id for tick timer
|
||||
|
||||
// EventOS timer callback function
|
||||
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
|
|||
platform_enter_critical();
|
||||
arm_event_storage_t *ret = eventOS_event_timer_request_at_(&event, timer_sys_ticks + time, 0);
|
||||
platform_exit_critical();
|
||||
return ret?0:-1;
|
||||
return ret ? 0 : -1;
|
||||
}
|
||||
|
||||
int8_t eventOS_event_timer_cancel(uint8_t event_id, int8_t tasklet_id)
|
||||
|
|
Loading…
Reference in New Issue