mirror of https://github.com/ARMmbed/mbed-os.git
Wrap software_init_hook
Wrap software_init_hook so that it can be used or extended from outside the RTOS. This is desirable so that code can be added to the software_init_hook without making the RTOS depend on new features or libraries.pull/1753/head
parent
61166870ed
commit
43e595aec3
|
|
@ -412,6 +412,18 @@ extern "C" WEAK void __cxa_pure_virtual(void) {
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(TOOLCHAIN_GCC)
|
||||||
|
extern "C" WEAK void software_init_hook_rtos(void)
|
||||||
|
{
|
||||||
|
// Do nothing by default.
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" void software_init_hook(void)
|
||||||
|
{
|
||||||
|
software_init_hook_rtos();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// ****************************************************************************
|
// ****************************************************************************
|
||||||
// mbed_main is a function that is called before main()
|
// mbed_main is a function that is called before main()
|
||||||
// mbed_sdk_init() is also a function that is called before main(), but unlike
|
// mbed_sdk_init() is also a function that is called before main(), but unlike
|
||||||
|
|
|
||||||
|
|
@ -339,7 +339,7 @@ void pre_main(void) {
|
||||||
main(0, NULL);
|
main(0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((naked)) void software_init_hook (void) {
|
__attribute__((naked)) void software_init_hook_rtos (void) {
|
||||||
__asm (
|
__asm (
|
||||||
".syntax unified\n"
|
".syntax unified\n"
|
||||||
".thumb\n"
|
".thumb\n"
|
||||||
|
|
|
||||||
|
|
@ -447,7 +447,7 @@ __asm void __rt_entry (void) {
|
||||||
|
|
||||||
#elif defined (__GNUC__)
|
#elif defined (__GNUC__)
|
||||||
|
|
||||||
__attribute__((naked)) void software_init_hook (void) {
|
__attribute__((naked)) void software_init_hook_rtos (void) {
|
||||||
__asm (
|
__asm (
|
||||||
".syntax unified\n"
|
".syntax unified\n"
|
||||||
".arm\n"
|
".arm\n"
|
||||||
|
|
|
||||||
|
|
@ -655,7 +655,7 @@ void pre_main(void) {
|
||||||
main(0, NULL);
|
main(0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((naked)) void software_init_hook (void) {
|
__attribute__((naked)) void software_init_hook_rtos (void) {
|
||||||
__asm (
|
__asm (
|
||||||
"bl osKernelInitialize\n"
|
"bl osKernelInitialize\n"
|
||||||
#ifdef __MBED_CMSIS_RTOS_CM
|
#ifdef __MBED_CMSIS_RTOS_CM
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue