mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
Diff: targets/cmsis/TARGET_NXP/TARGET_LPC408X/TOOLCHAIN_GCC_CR/startup_lpc407x_8x.cpp
- Revision:
- 67:78dfdb5b4d9e
- Parent:
- 15:4892fe388435
--- a/targets/cmsis/TARGET_NXP/TARGET_LPC408X/TOOLCHAIN_GCC_CR/startup_lpc407x_8x.cpp Fri Dec 20 15:00:06 2013 +0000 +++ b/targets/cmsis/TARGET_NXP/TARGET_LPC408X/TOOLCHAIN_GCC_CR/startup_lpc407x_8x.cpp Tue Dec 24 21:15:05 2013 +0000 @@ -259,6 +259,9 @@ // Sets up a simple runtime environment and initializes the C/C++ // library. //***************************************************************************** + +extern "C" void software_init_hook(void) __attribute__((weak)); + __attribute__ ((section(".after_vectors"))) void ResetISR(void) { @@ -319,21 +322,23 @@ //#ifdef __USE_CMSIS SystemInit(); //#endif - + if (software_init_hook) // give control to the RTOS + software_init_hook(); // this will also call __libc_init_array + else { #if defined (__cplusplus) - // - // Call C++ library initialisation - // - __libc_init_array(); + // + // Call C++ library initialisation + // + __libc_init_array(); #endif #if defined (__REDLIB__) - // Call the Redlib library, which in turn calls main() - __main() ; + // Call the Redlib library, which in turn calls main() + __main() ; #else - main(); + main(); #endif - + } // // main() shouldn't return, but if it does, we'll just enter an infinite loop //