summaryrefslogtreecommitdiff
path: root/firmware/usb.c
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2003-11-07 21:03:41 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2003-11-07 21:03:41 +0000
commit7ec1c45d7913af6cac32d5150026ceffc6704bf4 (patch)
tree5f17c9bdc99e02eaf17fe2235a1f87c89af7bacf /firmware/usb.c
parent7c3e9b1fba28a45fab8b9fa57572974d9a204d96 (diff)
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
Diffstat (limited to 'firmware/usb.c')
-rw-r--r--firmware/usb.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/firmware/usb.c b/firmware/usb.c
index d513d10e55..00fec53afa 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -72,10 +72,14 @@ static void usb_enable(bool on)
#endif
if(on)
- PADR &= ~0x400; /* enable USB */
+ {
+ and_b(~0x04, &PADRH); /* enable USB */
+ }
else
- PADR |= 0x400;
- PAIOR |= 0x400;
+ {
+ or_b(0x04, &PADRH);
+ }
+ or_b(0x04, &PAIORH);
}
static void usb_slave_mode(bool on)