Skip to content

Commit 607c9d1

Browse files
committed
RTX - ARMCC pre_main - pop fix
1 parent 8420e13 commit 607c9d1

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

rtos/rtx/TARGET_CORTEX_M/RTX_CM_lib.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -491,15 +491,13 @@ __asm void pre_main (void)
491491
LDR R1,=armcc_heap_top
492492
LDR R0,[R0]
493493
LDR R1,[R1]
494-
/* Save link register (keep 8 byte alignment with dummy r4) */
495-
push {r4, lr}
494+
/* Save link register (keep 8 byte alignment with dummy R4) */
495+
PUSH {R4, LR}
496496
BL __rt_lib_init
497-
/* Restore link register and branch so when main returns it
498-
* goes to the thread destroy function.
497+
BL main
498+
/* Return to the thread destroy function.
499499
*/
500-
pop {r4, lr}
501-
B main
502-
500+
POP {R4, PC}
503501
ALIGN
504502
}
505503

0 commit comments

Comments
 (0)