summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/as3525
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r--firmware/target/arm/as3525/usb-drv-as3525v2.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/firmware/target/arm/as3525/usb-drv-as3525v2.c b/firmware/target/arm/as3525/usb-drv-as3525v2.c
index 24548f30c5..35b50d21cf 100644
--- a/firmware/target/arm/as3525/usb-drv-as3525v2.c
+++ b/firmware/target/arm/as3525/usb-drv-as3525v2.c
@@ -101,12 +101,14 @@ void usb_attach(void)
static inline void usb_delay(void)
{
- int i = 0;
- while(i < 0x300)
- {
- asm volatile("nop");
- i++;
- }
+ register int i = 0;
+ asm volatile(
+ "1: nop \n"
+ " add %0, %0, #1 \n"
+ " cmp %0, #0x300 \n"
+ " bne 1b \n"
+ : "+r"(i)
+ );
}
static void as3525v2_connect(void)