Dozingfiretruck 2 лет назад
Родитель
Сommit
ea4dc7facb
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      luat/freertos/luat_timer_freertos.c

+ 2 - 2
luat/freertos/luat_timer_freertos.c

@@ -59,13 +59,13 @@ static int nextTimerSlot() {
 int luat_timer_start(luat_timer_t* timer) {
     TimerHandle_t os_timer;
     int timerIndex;
-    //LLOGD(">>luat_timer_start timeout=%ld", timer->timeout);
+    // LLOGD(">>luat_timer_start timeout=%ld xTimerPeriodInTicks=%d repeat=%d", timer->timeout,MS2T(timer->timeout),timer->repeat);
     timerIndex = nextTimerSlot();
     if (timerIndex < 0) {
         LLOGE("too many timers");
         return 1; // too many timer!!
     }
-    os_timer = xTimerCreate("luat_timer", MS2T(timer->timeout), timer->repeat, (void*)(timer->id), luat_timer_callback);
+    os_timer = xTimerCreate("luat_timer", MS2T(timer->timeout), timer->repeat==0?pdFALSE:pdTRUE, (void*)(timer->id), luat_timer_callback);
     //LLOGD("timer id=%ld, osTimerNew=%p", timerIndex, os_timer);
     if (!os_timer) {
         LLOGE("xTimerCreate FAIL");