fix(components): validate RT_MAIN_THREAD_PRIORITY range at build time

This commit is contained in:
wdfk-prog
2026-01-06 16:10:27 +08:00
committed by R b b666
parent 3d8114bcfe
commit 3a2d67e965

View File

@@ -28,6 +28,11 @@
#ifndef RT_MAIN_THREAD_PRIORITY
#define RT_MAIN_THREAD_PRIORITY (RT_THREAD_PRIORITY_MAX / 3)
#endif /* RT_MAIN_THREAD_PRIORITY */
#if (RT_MAIN_THREAD_PRIORITY >= RT_THREAD_PRIORITY_MAX)
#error "RT_MAIN_THREAD_PRIORITY must be < RT_THREAD_PRIORITY_MAX"
#elif (RT_MAIN_THREAD_PRIORITY < 0)
#error "RT_MAIN_THREAD_PRIORITY must be non-negative"
#endif /* RT_MAIN_THREAD_PRIORITY range check */
#endif /* RT_USING_USER_MAIN */
#ifdef RT_USING_COMPONENTS_INIT