diff options
author | Jörg Hohensohn <hohensoh@rockbox.org> | 2003-11-07 21:03:41 +0000 |
---|---|---|
committer | Jörg Hohensohn <hohensoh@rockbox.org> | 2003-11-07 21:03:41 +0000 |
commit | 7ec1c45d7913af6cac32d5150026ceffc6704bf4 (patch) | |
tree | 5f17c9bdc99e02eaf17fe2235a1f87c89af7bacf /firmware/usb.c | |
parent | 7c3e9b1fba28a45fab8b9fa57572974d9a204d96 (diff) | |
download | rockbox-7ec1c45d7913af6cac32d5150026ceffc6704bf4.tar.gz rockbox-7ec1c45d7913af6cac32d5150026ceffc6704bf4.zip |
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.c | 10 |
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) | |||
72 | #endif | 72 | #endif |
73 | 73 | ||
74 | if(on) | 74 | if(on) |
75 | PADR &= ~0x400; /* enable USB */ | 75 | { |
76 | and_b(~0x04, &PADRH); /* enable USB */ | ||
77 | } | ||
76 | else | 78 | else |
77 | PADR |= 0x400; | 79 | { |
78 | PAIOR |= 0x400; | 80 | or_b(0x04, &PADRH); |
81 | } | ||
82 | or_b(0x04, &PAIORH); | ||
79 | } | 83 | } |
80 | 84 | ||
81 | static void usb_slave_mode(bool on) | 85 | static void usb_slave_mode(bool on) |