summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-05-15 00:44:25 +1000
committerDamien George <damien.p.george@gmail.com>2020-05-15 15:04:49 +1000
commit8f348778e12d3c8a55c6fe4c4475bb9ab07aa978 (patch)
tree85e3b95f717756cfebf7c4fe2d7ea8f182e69a92
parenteb5e9c00f8119e8a69dea7590dbbe25a67a38e38 (diff)
downloadmicropython-8f348778e12d3c8a55c6fe4c4475bb9ab07aa978.tar.gz
micropython-8f348778e12d3c8a55c6fe4c4475bb9ab07aa978.zip
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 1aa9ff914194824a78a8b010572ad7083c1bb4ec.
-rw-r--r--ports/nrf/mphalport.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ports/nrf/mphalport.c b/ports/nrf/mphalport.c
index bdedea9d01..4469adc80d 100644
--- a/ports/nrf/mphalport.c
+++ b/ports/nrf/mphalport.c
@@ -99,11 +99,12 @@ void mp_hal_delay_us(mp_uint_t us) {
}
register uint32_t delay __ASM("r0") = us;
__ASM volatile (
- #ifdef NRF51
- ".syntax unified\n"
- #endif
"1:\n"
+ #ifdef NRF51
+ " SUB %0, %0, #1\n"
+ #else
" SUBS %0, %0, #1\n"
+ #endif
" NOP\n"
" NOP\n"
" NOP\n"