diff options
author | Fulup Ar Foll <fulup@iot.bzh> | 2017-11-02 11:58:32 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-12-13 15:02:54 +0100 |
commit | 5ea27091ffd08d0c9cb9368d274bd0998fd89a77 (patch) | |
tree | fbb15fa89b8a98ba5a43565b98cb91c3253b65f3 /ctl-lib/ctl-timer.c | |
parent | f90b319be45e0fc16b608e2c0639648180d3af76 (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.c | 6 |
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: |