Add a compile time check that emits a helpful error message if the user attempts to create a daemon task startup hook without also creating the timer/daemon task.

The timer/daemon task startup hook runs in the context of the timer/daemon task.  Therefore, it won't run even if configUSE_DAEMON_TASK_STARTUP_HOOK is set to 1 if the timer task isn't created.  The timer task is only created if configUSE_TIMERS is not equal to 0.
This commit is contained in:
none 2024-03-06 08:37:39 -08:00
parent d95451d924
commit 684f075c4d

View file

@ -298,10 +298,6 @@
#endif #endif
#endif #endif
#ifndef configUSE_DAEMON_TASK_STARTUP_HOOK
#define configUSE_DAEMON_TASK_STARTUP_HOOK 0
#endif
#ifndef configUSE_APPLICATION_TASK_TAG #ifndef configUSE_APPLICATION_TASK_TAG
#define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_APPLICATION_TASK_TAG 0
#endif #endif
@ -322,6 +318,16 @@
#define configUSE_TIMERS 0 #define configUSE_TIMERS 0
#endif #endif
#ifndef configUSE_DAEMON_TASK_STARTUP_HOOK
#define configUSE_DAEMON_TASK_STARTUP_HOOK 0
#endif
#if ( configUSE_DAEMON_TASK_STARTUP_HOOK != 0 )
#if( configUSE_TIMERS == 0 )
#error configUSE_DAEMON_TASK_STARTUP_HOOK is set, but the daemon task isn't created because configUSE_TIMERS is 0.
#endif
#endif
#ifndef configUSE_COUNTING_SEMAPHORES #ifndef configUSE_COUNTING_SEMAPHORES
#define configUSE_COUNTING_SEMAPHORES 0 #define configUSE_COUNTING_SEMAPHORES 0
#endif #endif