summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/usb-s3c6400x.c
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2011-12-14 15:31:27 +0000
committerRafaël Carré <rafael.carre@gmail.com>2011-12-14 15:31:27 +0000
commitb73dd01f2c36abcaddcdeb07ae5b929ba3d7933a (patch)
tree7245cfc1bb2432431eda3eb417bfdfeb434e521a /firmware/target/arm/usb-s3c6400x.c
parent13f1b08388fa2896ebdc0e52920b23a1e9703c40 (diff)
downloadrockbox-b73dd01f2c36abcaddcdeb07ae5b929ba3d7933a.tar.gz
rockbox-b73dd01f2c36abcaddcdeb07ae5b929ba3d7933a.zip
usb-s3c6400: fix confusion between USB_DIR_IN and DIR_IN
usb_drv_request_endpoint() would return an endpoint with the other direction git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31248 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/usb-s3c6400x.c')
-rw-r--r--firmware/target/arm/usb-s3c6400x.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/firmware/target/arm/usb-s3c6400x.c b/firmware/target/arm/usb-s3c6400x.c
index 018694ae12..e65395dfd9 100644
--- a/firmware/target/arm/usb-s3c6400x.c
+++ b/firmware/target/arm/usb-s3c6400x.c
@@ -106,11 +106,12 @@ static void reset_endpoints(int reinit)
int usb_drv_request_endpoint(int type, int dir)
{
- for(size_t ep = (dir == USB_DIR_IN) ? 1 : 2; ep < USB_NUM_ENDPOINTS; ep += 2)
+ bool out = dir == USB_DIR_OUT;
+ for(size_t ep = out ? 2 : 1; ep < USB_NUM_ENDPOINTS; ep += 2)
if (!endpoints[ep].active)
{
endpoints[ep].active = true;
- DEPCTL(ep, !dir) = (DEPCTL(ep, !dir) & ~(DEPCTL_eptype_bits << DEPCTL_eptype_bitp)) |
+ DEPCTL(ep, out) = (DEPCTL(ep, out) & ~(DEPCTL_eptype_bits << DEPCTL_eptype_bitp)) |
(type << DEPCTL_eptype_bitp) | DEPCTL_epena;
return ep | dir;
}