Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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
diff -r 64ad953ee6c3 -r 78dfdb5b4d9e targets/cmsis/TARGET_NXP/TARGET_LPC408X/TOOLCHAIN_GCC_CR/startup_lpc407x_8x.cpp
--- 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
//
