Skip to content

Commit 3c51257

Browse files
committed
Change MOV to MOVS for M0+
1 parent 15b573d commit 3c51257

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

platform/mbed_application.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,11 @@ static void powerdown_scb(uint32_t vtor)
161161

162162
__asm static void start_new_application(void *sp, void *pc)
163163
{
164+
#if defined(__CORTEX_M0PLUS)
165+
MOVS R2, #0
166+
#else
164167
MOV R2, #0
168+
#endif
165169
MSR CONTROL, R2 // Switch to main stack
166170
MOV SP, R0
167171
MSR PRIMASK, R2 // Enable interrupts
@@ -174,7 +178,7 @@ void start_new_application(void *sp, void *pc)
174178
{
175179
__asm volatile(
176180
#if defined(__CORTEX_M0PLUS)
177-
"mov r2, #0 \n" // No MOVW instruction on Cortex-M0+
181+
"movs r2, #0 \n" // No MOVW instruction on Cortex-M0+
178182
#else
179183
"movw r2, #0 \n" // Fail to compile "mov r2, #0" with ARMC6. Replace with MOVW.
180184
#endif

0 commit comments

Comments
 (0)