Arduino-FreeRTOS-SAMD21 icon indicating copy to clipboard operation
Arduino-FreeRTOS-SAMD21 copied to clipboard

How to use sleep modes?

Open eren-rudy opened this issue 1 year ago • 0 comments

I tried using the Arduino Low Power library to configure an interrupt by calling LowPower.sleep() in the idle task void loop(). I suppose it isn't surprising, given the warning "No rtos blocking functions allowed!" in the example code, that this was unsuccessful.

So, I went to the FreeRTOS documentation (Low power support) to learn more about using low power states. I looked in the FreeRTOSConfig.h file to see if configUSE_TICKLESS_IDLE was set, but didn't find it. I also searched all the source files for an implementation of portSUPPRESS_TICKS_AND_SLEEP() and couldn't find anything.

The RTOS documentation (found at the link above) provides a sample implementation of portSUPPRESS_TICKS_AND_SLEEP(), in the case that the port you are using doesn't provide it. However, I am not sure how I would implement a function such as prvStopTickInterruptTimer() (which is called in the sample implementation of portSUPPRESS_TICKS_AND_SLEEP() because as far as I can tell the timer used by the RTOS Kernel is not exposed the programmer. Apologies if I am missing something obvious, I am new to FreeRTOS. Thanks!

eren-rudy avatar Jun 20 '24 18:06 eren-rudy