I am trying to define a sleep function with esp_vApplicationIdleHook() but whenever I put it in my sketch there is an error:
Compilation error: ambiguating new declaration of 'bool esp_vApplicationIdleHook()'.
My code is simple like:
Code: Select all
bool esp_vApplicationIdleHook(void)
{
static TickType_t lastFlashTime=0;
if((xTaskGetTickCount()-lastFlashTime) > 1000)
{
Serial.println(F("It is 1 sec elapse in the idle hook."));
lastFlashTime = xTaskGetTickCount();
}
return true;
}
Thanks for any reply in advance.
John