summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/components.c b/src/components.c
index 9a1db27617..7d47683dd0 100644
--- a/src/components.c
+++ b/src/components.c
@@ -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