forked from len0rd/rockbox
set/clear port bits with atomic instructions instead of read-modify-write, saves time+space, allows port usage in ISR
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4026 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7c3e9b1fba
commit
7ec1c45d79
1 changed files with 7 additions and 3 deletions
|
@ -72,10 +72,14 @@ static void usb_enable(bool on)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(on)
|
if(on)
|
||||||
PADR &= ~0x400; /* enable USB */
|
{
|
||||||
|
and_b(~0x04, &PADRH); /* enable USB */
|
||||||
|
}
|
||||||
else
|
else
|
||||||
PADR |= 0x400;
|
{
|
||||||
PAIOR |= 0x400;
|
or_b(0x04, &PADRH);
|
||||||
|
}
|
||||||
|
or_b(0x04, &PAIORH);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void usb_slave_mode(bool on)
|
static void usb_slave_mode(bool on)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue