1
0
Fork 0
forked from len0rd/rockbox

AMSv2 USB: Write usb_delay() in assembly

Ensure no changes when we use different versions of gcc (USB used to panic with gcc 4.6.0)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29818 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2011-05-03 17:17:23 +00:00
parent 8fa0e13c9f
commit befabb2bab

View file

@ -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)