summaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-timer.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-05-14 15:08:31 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-05-14 15:09:19 +0200
commitb5ceb3cca02bd46d2a6296631fe607b3edd38e17 (patch)
tree27bf59f5c7a3663036e0a364033ebc1b87490aa5 /ctl-lib/ctl-timer.c
parent0ff8c30892be48ecba1265276532f94b242f6289 (diff)
Format
Change-Id: Ied901f39cd6814e5afd9811248b0a1fb401f3e76 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-timer.c')
-rw-r--r--ctl-lib/ctl-timer.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/ctl-lib/ctl-timer.c b/ctl-lib/ctl-timer.c
index e1ced46..2139c75 100644
--- a/ctl-lib/ctl-timer.c
+++ b/ctl-lib/ctl-timer.c
@@ -31,13 +31,16 @@ typedef struct {
} AutoTestCtxT;
-STATIC int TimerNext (sd_event_source* source, uint64_t timer, void* handle) {
+static int TimerNext (sd_event_source* source, uint64_t timer, void* handle) {
TimerHandleT *timerHandle = (TimerHandleT*) handle;
int done;
uint64_t usec;
done= timerHandle->callback(timerHandle);
- if (!done) goto OnErrorExit;
+ if (!done) {
+ AFB_ApiWarning(timerHandle->api, "TimerNext Callback Fail Tag=%s", timerHandle->uid);
+ return -1;
+ }
// Rearm timer if needed
timerHandle->count --;
@@ -55,20 +58,16 @@ STATIC int TimerNext (sd_event_source* source, uint64_t timer, void* handle) {
}
return 0;
-
-OnErrorExit:
- AFB_ApiWarning(timerHandle->api, "TimerNext Callback Fail Tag=%s", timerHandle->uid);
- return -1;
}
-PUBLIC void TimerEvtStop(TimerHandleT *timerHandle) {
+void TimerEvtStop(TimerHandleT *timerHandle) {
sd_event_source_unref(timerHandle->evtSource);
free (timerHandle);
}
-PUBLIC void TimerEvtStart(AFB_ApiT apiHandle, TimerHandleT *timerHandle, timerCallbackT callback, void *context) {
+void TimerEvtStart(AFB_ApiT apiHandle, TimerHandleT *timerHandle, timerCallbackT callback, void *context) {
uint64_t usec;
// populate CB handle
@@ -83,7 +82,7 @@ PUBLIC void TimerEvtStart(AFB_ApiT apiHandle, TimerHandleT *timerHandle, timerCa
// Create Binding Event at Init
-PUBLIC int TimerEvtInit (AFB_ApiT apiHandle) {
+int TimerEvtInit (AFB_ApiT apiHandle) {
AFB_ApiDebug (apiHandle, "Timer-Init Done");
return 0;