From 7ec1c45d7913af6cac32d5150026ceffc6704bf4 Mon Sep 17 00:00:00 2001 From: Jörg Hohensohn Date: Fri, 7 Nov 2003 21:03:41 +0000 Subject: 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 --- firmware/usb.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'firmware') 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) -- cgit v1.2.3