diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-12-18 09:24:23 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-12-18 09:24:23 +0000 |
commit | 1aad1a508faeeb61b23764e02daa8494c9c61b55 (patch) | |
tree | 79c53be81f416cc14bb828d9c1e2b19120d49fc8 | |
parent | 7aa43aee7029b232c558174bcbdf90e8fbebd57b (diff) | |
download | ChibiOS-1aad1a508faeeb61b23764e02daa8494c9c61b55.tar.gz ChibiOS-1aad1a508faeeb61b23764e02daa8494c9c61b55.tar.bz2 ChibiOS-1aad1a508faeeb61b23764e02daa8494c9c61b55.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2491 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | demos/ARMCM3-STM32F103-IAR/main.c | 3 | ||||
-rw-r--r-- | os/ports/IAR/ARMCMx/cstartup.s | 21 |
2 files changed, 19 insertions, 5 deletions
diff --git a/demos/ARMCM3-STM32F103-IAR/main.c b/demos/ARMCM3-STM32F103-IAR/main.c index fca30c731..a3a5c062e 100644 --- a/demos/ARMCM3-STM32F103-IAR/main.c +++ b/demos/ARMCM3-STM32F103-IAR/main.c @@ -40,13 +40,10 @@ static msg_t Thread1(void *arg) { * Entry point.
*/
int main(int argc, char **argv) {
- void hwinit1(void);
(void)argc;
(void)argv;
- hwinit1();
-
/*
* Activates the serial driver 2 using the driver default configuration.
*/
diff --git a/os/ports/IAR/ARMCMx/cstartup.s b/os/ports/IAR/ARMCMx/cstartup.s index 97757362a..2084ff929 100644 --- a/os/ports/IAR/ARMCMx/cstartup.s +++ b/os/ports/IAR/ARMCMx/cstartup.s @@ -39,10 +39,13 @@ CONTROL_USE_PSP SET 2 SECTION .intvec:CODE:NOROOT(3)
PUBLIC __iar_program_start
- EXTERN __cmain
+ EXTERN main
+ EXTERN _exit
EXTERN __vector_table
EXTWEAK __iar_init_core
EXTWEAK __iar_init_vfp
+ EXTWEAK __low_level_init
+ EXTWEAK __iar_data_init3
SECTION .text:CODE:REORDER(2)
THUMB
@@ -56,12 +59,26 @@ __iar_program_start: bl hwinit0
bl __iar_init_core
bl __iar_init_vfp
- bl __cmain
+
+; Replicated cmain.s here in order to insert the call to hwinit1.
+ bl __low_level_init
+ cmp r0, #0
+ beq.n _call_main
+ bl __iar_data_init3
+_call_main:
+ bl hwinit1
+ bl main
+ bl _exit
PUBWEAK hwinit0
hwinit0
bx lr
+
+ PUBWEAK hwinit1
+hwinit1
+ bx lr
+
REQUIRE __vector_table
END
|