summaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-timer.c
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2017-11-02 11:58:32 +0100
committerRonan Le Martret <ronan.lemartret@iot.bzh>2017-11-24 10:37:52 +0100
commit3e6dbb17336cade4abf270193c164ea60b7b8389 (patch)
treefbb15fa89b8a98ba5a43565b98cb91c3253b65f3 /ctl-lib/ctl-timer.c
parent12dc78f18e54b92332ddd33c785b0d1e0352410b (diff)
Modifiy timer to supper DynAPI
th Please enter the commit message for your changes. Lines starting Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-timer.c')
-rw-r--r--ctl-lib/ctl-timer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ctl-lib/ctl-timer.c b/ctl-lib/ctl-timer.c
index 9cab0b2..e1ced46 100644
--- a/ctl-lib/ctl-timer.c
+++ b/ctl-lib/ctl-timer.c
@@ -36,6 +36,9 @@ STATIC int TimerNext (sd_event_source* source, uint64_t timer, void* handle) {
int done;
uint64_t usec;
+ done= timerHandle->callback(timerHandle);
+ if (!done) goto OnErrorExit;
+
// Rearm timer if needed
timerHandle->count --;
if (timerHandle->count == 0) {
@@ -51,9 +54,6 @@ STATIC int TimerNext (sd_event_source* source, uint64_t timer, void* handle) {
sd_event_source_set_time(source, usec + timerHandle->delay*1000);
}
- done= timerHandle->callback(timerHandle->context);
- if (!done) goto OnErrorExit;
-
return 0;
OnErrorExit: