diff --git a/epicardium/ble/ble.c b/epicardium/ble/ble.c index a2cdf9e41a99e654a2ff1aa61b180531dd467d2e..ddaf6f4e199de79ec6244f4b8a6193ea0dc4a32b 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" @@ -162,6 +161,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,