diff --git a/epicardium/ble/ble.c b/epicardium/ble/ble.c index 9a2da1942627e02ca57bbdf518464c59ec3e37b4..a91c381b0653e459a7e6573ca59b3be82e72c7c3 100644 --- a/epicardium/ble/ble.c +++ b/epicardium/ble/ble.c @@ -1,7 +1,6 @@ #include "modules/log.h" #include "fs_util.h" - #include "wsf_types.h" #include "wsf_buf.h" #include "wsf_trace.h" @@ -161,6 +160,13 @@ static void scheduleTimer(void) if (timerRunning) { //printf("time_to_next_expire = %d\n", time_to_next_expire); //printf("change period\n"); + /* We need to make sure not to schedule a 0 ticks timer. + * Maybe it would also be enough to simply call the dispatcher + * in this case... */ + if(time_to_next_expire == 0 ) { + time_to_next_expire = 1; + } + if (timerWakeup != NULL) { xTimerChangePeriod( timerWakeup,