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:
parent
8fa0e13c9f
commit
befabb2bab
1 changed files with 8 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue