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_LPC11UXX/TOOLCHAIN_GCC_CR/startup_LPC11xx.cpp
- Revision:
- 67:78dfdb5b4d9e
- Parent:
- 13:0645d8841f51
diff -r 64ad953ee6c3 -r 78dfdb5b4d9e targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/TOOLCHAIN_GCC_CR/startup_LPC11xx.cpp
--- a/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/TOOLCHAIN_GCC_CR/startup_LPC11xx.cpp Fri Dec 20 15:00:06 2013 +0000
+++ b/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/TOOLCHAIN_GCC_CR/startup_LPC11xx.cpp Tue Dec 24 21:15:05 2013 +0000
@@ -9,7 +9,7 @@
void ResetISR (void);
WEAK void NMI_Handler (void);
WEAK void HardFault_Handler (void);
-WEAK void SVCall_Handler (void);
+WEAK void SVC_Handler (void);
WEAK void PendSV_Handler (void);
WEAK void SysTick_Handler (void);
WEAK void IntDefaultHandler (void);
@@ -57,7 +57,7 @@
0,
0,
0,
- SVCall_Handler,
+ SVC_Handler,
0,
0,
PendSV_Handler,
@@ -113,6 +113,8 @@
extern unsigned int __data_section_table_end;
extern unsigned int __bss_section_table_end;
+extern "C" void software_init_hook(void) __attribute__((weak));
+
AFTER_VECTORS void ResetISR(void) {
unsigned int LoadAddr, ExeAddr, SectionLen;
unsigned int *SectionTableAddr;
@@ -134,14 +136,18 @@
}
SystemInit();
- __libc_init_array();
- main();
+ if (software_init_hook) // give control to the RTOS
+ software_init_hook(); // this will also call __libc_init_array
+ else {
+ __libc_init_array();
+ main();
+ }
while (1) {;}
}
AFTER_VECTORS void NMI_Handler (void) {while(1){}}
AFTER_VECTORS void HardFault_Handler(void) {while(1){}}
-AFTER_VECTORS void SVCall_Handler (void) {while(1){}}
+AFTER_VECTORS void SVC_Handler (void) {while(1){}}
AFTER_VECTORS void PendSV_Handler (void) {while(1){}}
AFTER_VECTORS void SysTick_Handler (void) {while(1){}}
AFTER_VECTORS void IntDefaultHandler(void) {while(1){}}
