Only call sleep function if we want to sleep
authorNathael Pajani <nathael.pajani@ed3l.fr>
Thu, 21 Sep 2023 22:24:38 +0000 (00:24 +0200)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Thu, 21 Sep 2023 22:24:38 +0000 (00:24 +0200)
extdrv/status_led.c

index 2823b8e..f3a919a 100644 (file)
@@ -132,5 +132,7 @@ void chenillard(uint32_t ms)
 {
        static int n;
        status_led(steps[n++ % (sizeof steps / sizeof *steps)]);
-       msleep(ms);
+       if (ms > 0) {
+               msleep(ms);
+       }
 }