Atomic GPIO access

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7114 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2005-07-12 07:25:01 +00:00
parent d2ca7fc5de
commit 192a604cd4
4 changed files with 43 additions and 42 deletions

View file

@ -134,13 +134,13 @@ static void usb_enable(bool on)
if(on)
{
/* Power on the Cypress chip */
GPIO_OUT |= 0x01000000;
or_l(0x01000000, &GPIO_OUT);
sleep(2);
}
else
{
/* Power off the Cypress chip */
GPIO_OUT &= ~0x01000000;
and_l(~0x01000000, &GPIO_OUT);
}
#else
@ -429,11 +429,11 @@ void usb_init(void)
countdown = -1;
#ifdef USB_IRIVERSTYLE
GPIO_OUT &= ~0x01000000; /* GPIO24 is the Cypress chip power */
GPIO_ENABLE |= 0x01000000;
GPIO_FUNCTION |= 0x01000000;
and_l(~0x01000000, &GPIO_OUT); /* GPIO24 is the Cypress chip power */
or_l(0x01000000, &GPIO_ENABLE);
or_l(0x01000000, &GPIO_FUNCTION);
GPIO1_FUNCTION |= 0x00000080; /* GPIO39 is the USB detect input */
or_l(0x00000080, &GPIO1_FUNCTION); /* GPIO39 is the USB detect input */
#endif
usb_enable(false);