summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2015-04-03 14:27:56 +0000
committerBernard Xiong <[email protected]>2015-04-03 14:27:56 +0000
commit655054b1c52c103afb5c815eea408e112da26c7d (patch)
treeb8c46ac40ced5cdfadfc6ff311c21c9fcc2555a2
parent1377022b1873b9befb2b0819b6e6d1e3718b2b43 (diff)
[Kernel] Use main function in the Keil MDK
-rw-r--r--src/init.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/init.c b/src/init.c
index 3b95ea3a57..56b7e0bf8d 100644
--- a/src/init.c
+++ b/src/init.c
@@ -122,9 +122,22 @@ void rt_components_init(void)
}
#ifdef RT_USING_USER_MAIN
+
void rt_application_init(void);
void rt_hw_board_init(void);
+#ifdef __CC_ARM
+extern int $Super$$main(void);
+/* re-define main function */
+int $Sub$$main(void)
+{
+ rt_hw_interrupt_disable();
+ rtthread_startup();
+
+ return 0;
+}
+#endif
+
#ifndef RT_USING_HEAP
/* if there is not enble heap, we should use static thread and stack. */
ALIGN(8)
@@ -141,7 +154,11 @@ void main_thread_entry(void *parameter)
rt_components_init();
/* invoke system main function */
+#ifdef __CC_ARM
+ $Sub$$main();
+#else
main();
+#endif
}
void rt_application_init(void)