From be7a655824e55ae85117607b4ecbe3f393a52a09 Mon Sep 17 00:00:00 2001 From: foopub <45460217+foopub@users.noreply.github.com> Date: Fri, 26 Feb 2021 01:42:11 +0000 Subject: [PATCH] Replace unavailable flag-preserving instruction It seems sub requires thumb2 instructions which are unavailable. This is in line with the rest of the sdk code base which uses subs. --- src/rp2_common/hardware_clocks/clocks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rp2_common/hardware_clocks/clocks.c b/src/rp2_common/hardware_clocks/clocks.c index 6195dcd..dc78bfa 100644 --- a/src/rp2_common/hardware_clocks/clocks.c +++ b/src/rp2_common/hardware_clocks/clocks.c @@ -79,7 +79,7 @@ bool clock_configure(enum clock_index clk_index, uint32_t src, uint32_t auxsrc, uint delay_cyc = configured_freq[clk_sys] / configured_freq[clk_index] + 1; asm volatile ( "1: \n\t" - "sub %0, #1 \n\t" + "subs %0, #1 \n\t" "bne 1b" : "+r" (delay_cyc) ); @@ -386,4 +386,4 @@ bool clock_configure_gpin(enum clock_index clk_index, uint gpio, uint32_t src_fr // Now we have the src, auxsrc, and configured the gpio input // call clock configure to run the clock from a gpio return clock_configure(clk_index, src, auxsrc, src_freq, freq); -} \ No newline at end of file +}