This commit is contained in:
hathach committed 2017-04-10 17:54:56 +07:00
1 parent e9c6fc4a37
commit dd19b14261
3 files changed
+15 -19

No files matched your search

@@ -97,7 +97,6 @@ void loop()
}
// Request CPU to enter low-power mode until an event/interrupt occurs
// Note: This will turn off hardware PWM and potentially other peripherals!
waitForEvent();
}
@@ -212,13 +212,13 @@ void loop()
/**
* RTOS Idle callback is automatically invoked by FreeRTOS
* when there is no active threads. E.g loop() call delay() and
* there is no bluetooth or hw event. This is a greate place to handle
* when there are no active threads. E.g when loop() calls delay() and
* there is no bluetooth or hw event. This is the ideal place to handle
* background data.
*
* NOTE: After this callback returns, MCU will enter low-power mode
* by waitForEvent() internally. THerefore user SHOULD NOT call
* waitForEvent() in this callback.
* via waitForEvent() internally. Therefore you SHOULD NOT call
* waitForEvent() in this callback!
*
* WARNING: This function MUST NOT call any blocking FreeRTOS API
* such as delay(), xSemaphoreTake() etc ... for more information
@@ -226,9 +226,8 @@ void loop()
*/
void rtos_idle_callback(void)
{
// Background task here
// Perform background task(s) here
// waitForEvent() will be invoked by internal code when this callback return.
// Don't call waitForEvent() in this function nor any other blocking API()
// waitForEvent() will be invoked internally when this callback returns.
// Don't call waitForEvent() in this function nor any other blocking API()!
}
@@ -104,20 +104,19 @@ void loop()
delay(5);
}
// Instruct CPU to enter low-power state until an event/interrupt occured
// Note: This will turn off hardware PWM and maybe other peripherlas !!
// Request CPU to enter low-power mode until an event/interrupt occurs
waitForEvent();
}
/**
* RTOS Idle callback is automatically invoked by FreeRTOS
* when there is no active threads. E.g loop() call delay() and
* there is no bluetooth or hw event. This is a greate place to handle
* when there are no active threads. E.g when loop() calls delay() and
* there is no bluetooth or hw event. This is the ideal place to handle
* background data.
*
* NOTE: After this callback returns, MCU will enter low-power mode
* by waitForEvent() internally. THerefore user SHOULD NOT call
* waitForEvent() in this callback.
* via waitForEvent() internally. Therefore you SHOULD NOT call
* waitForEvent() in this callback!
*
* WARNING: This function MUST NOT call any blocking FreeRTOS API
* such as delay(), xSemaphoreTake() etc ... for more information
@@ -125,9 +124,8 @@ void loop()
*/
void rtos_idle_callback(void)
{
// Background task here
// Perform background task(s) here
// waitForEvent() will be invoked by internal code when this callback return.
// Don't call waitForEvent() in this function nor any other blocking API()
// waitForEvent() will be invoked internally when this callback returns.
// Don't call waitForEvent() in this function nor any other blocking API()!
}