summaryrefslogtreecommitdiffstats
path: root/afb-source/ctl-timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'afb-source/ctl-timer.c')
-rw-r--r--afb-source/ctl-timer.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/afb-source/ctl-timer.c b/afb-source/ctl-timer.c
index a826f9f..50e181b 100644
--- a/afb-source/ctl-timer.c
+++ b/afb-source/ctl-timer.c
@@ -45,7 +45,7 @@ STATIC int TimerNext (sd_event_source* source, uint64_t timer, void* handle) {
return 0;
}
else {
- // otherwise validate timer for a new run
+ // otherwise validate timer for a new run
sd_event_now(afb_daemon_get_event_loop(), CLOCK_MONOTONIC, &usec);
sd_event_source_set_enabled(source, SD_EVENT_ONESHOT);
sd_event_source_set_time(source, usec + timerHandle->delay*1000);
@@ -53,12 +53,12 @@ STATIC int TimerNext (sd_event_source* source, uint64_t timer, void* handle) {
done= timerHandle->callback(timerHandle->context);
if (!done) goto OnErrorExit;
-
+
return 0;
OnErrorExit:
AFB_WARNING("TimerNext Callback Fail Tag=%s", timerHandle->label);
- return -1;
+ return -1;
}
PUBLIC void TimerEvtStop(TimerHandleT *timerHandle) {
@@ -70,12 +70,12 @@ PUBLIC void TimerEvtStop(TimerHandleT *timerHandle) {
PUBLIC void TimerEvtStart(TimerHandleT *timerHandle, timerCallbackT callback, void *context) {
uint64_t usec;
-
+
// populate CB handle
timerHandle->callback=callback;
timerHandle->context=context;
-
- // set a timer with ~250us accuracy
+
+ // set a timer with ~250us accuracy
sd_event_now(afb_daemon_get_event_loop(), CLOCK_MONOTONIC, &usec);
sd_event_add_time(afb_daemon_get_event_loop(), &timerHandle->evtSource, CLOCK_MONOTONIC, usec+timerHandle->delay*1000, 250, TimerNext, timerHandle);
}
@@ -87,15 +87,15 @@ PUBLIC afb_event TimerEvtGet(void) {
// Create Binding Event at Init
PUBLIC int TimerEvtInit () {
-
+
// create binder event to send test pause/resume
afbevt = afb_daemon_make_event("control");
if (!afb_event_is_valid(afbevt)) {
AFB_ERROR ("POLCTL_INIT: Cannot register ctl-events");
return 1;
}
-
+
AFB_DEBUG ("Audio Control-Events Init Done");
return 0;
}
-
+