You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/11/13 14:35:30 UTC

[incubator-nuttx] 06/18: Fix Error: chip/rp2040_clock.c:148:19: error: invalid instruction

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 9f685435d050e9b3d9d846fa1509e1640066e253
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Nov 13 10:56:42 2022 +0800

    Fix Error: chip/rp2040_clock.c:148:19: error: invalid instruction
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 arch/arm/src/rp2040/rp2040_clock.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/arch/arm/src/rp2040/rp2040_clock.c b/arch/arm/src/rp2040/rp2040_clock.c
index d275d58f24..e874ac543e 100644
--- a/arch/arm/src/rp2040/rp2040_clock.c
+++ b/arch/arm/src/rp2040/rp2040_clock.c
@@ -141,15 +141,12 @@ bool rp2040_clock_configure(int clk_index,
            * necessarily running, nor is timer... so, 3 cycles per loop:
            */
 
-          unsigned int delay_cyc = rp2040_clock_freq[RP2040_CLOCKS_NDX_SYS] /
-                                   rp2040_clock_freq[clk_index] + 1;
-
-          __asm__ volatile (
-            "1: \n\t"
-            "sub %0, #1 \n\t"
-            "bne 1b"
-            : "+r" (delay_cyc)
-          );
+          volatile unsigned int delay_cyc;
+
+          delay_cyc = rp2040_clock_freq[RP2040_CLOCKS_NDX_SYS] /
+                      rp2040_clock_freq[clk_index] + 1;
+
+          while (--delay_cyc > 0);
         }
     }