[Kernel] Use main function in the Keil MDK
This commit is contained in:
parent
1377022b18
commit
655054b1c5
17
src/init.c
17
src/init.c
@ -122,9 +122,22 @@ void rt_components_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef RT_USING_USER_MAIN
|
#ifdef RT_USING_USER_MAIN
|
||||||
|
|
||||||
void rt_application_init(void);
|
void rt_application_init(void);
|
||||||
void rt_hw_board_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
|
#ifndef RT_USING_HEAP
|
||||||
/* if there is not enble heap, we should use static thread and stack. */
|
/* if there is not enble heap, we should use static thread and stack. */
|
||||||
ALIGN(8)
|
ALIGN(8)
|
||||||
@ -141,7 +154,11 @@ void main_thread_entry(void *parameter)
|
|||||||
rt_components_init();
|
rt_components_init();
|
||||||
|
|
||||||
/* invoke system main function */
|
/* invoke system main function */
|
||||||
|
#ifdef __CC_ARM
|
||||||
|
$Sub$$main();
|
||||||
|
#else
|
||||||
main();
|
main();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void rt_application_init(void)
|
void rt_application_init(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user