Skip to content

Commit 8f34877

Browse files
committed
nrf/mphalport: Remove need for "syntax unified" in mp_hal_delay_us.
Because it can confuse older versions of gcc. Instead use the correct instruction for Thumb vs Thumb-2 (sub vs subs) so the assembler emits the 2-byte instruction. Related to commit 1aa9ff9.
1 parent eb5e9c0 commit 8f34877

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ports/nrf/mphalport.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,12 @@ void mp_hal_delay_us(mp_uint_t us) {
9999
}
100100
register uint32_t delay __ASM("r0") = us;
101101
__ASM volatile (
102-
#ifdef NRF51
103-
".syntax unified\n"
104-
#endif
105102
"1:\n"
103+
#ifdef NRF51
104+
" SUB %0, %0, #1\n"
105+
#else
106106
" SUBS %0, %0, #1\n"
107+
#endif
107108
" NOP\n"
108109
" NOP\n"
109110
" NOP\n"

0 commit comments

Comments
 (0)