kendryte / kendryte-freertos-sdk

This project is no longer maintained Not recommended for product development.
Apache License 2.0
201 stars 68 forks source link

vApplicationIdleHook() cannot be overridden. #56

Open derekmulcahy opened 4 years ago

derekmulcahy commented 4 years ago

The vApplicationIdleHook() is defined in freertos/lib/osentry.c as

void vApplicationIdleHook(void)
{
}

better code would be

#if ( configUSE_IDLE_HOOK == 1 )
void __attribute__((weak)) vApplicationIdleHook(void)
{
}
#endif /* configUSE_IDLE_HOOK */

as this would allow the application to implement the hook and it would not define the hook unless it is needed. I have tested this and it works well.