Index: packages/devs/usb/at91/current/ChangeLog =================================================================== RCS file: /cvs/ecos/ecos/packages/devs/usb/at91/current/ChangeLog,v retrieving revision 1.3 diff -u -r1.3 ChangeLog --- packages/devs/usb/at91/current/ChangeLog 6 Jun 2006 13:30:11 -0000 1.3 +++ packages/devs/usb/at91/current/ChangeLog 7 Sep 2006 06:52:30 -0000 @@ -1,3 +1,8 @@ +2006-09-07 John Eigelaar + + * cdl/usbs_at91.c: Read actual EP addresses from the EP configuartion + rather than relying on the order in the configuration list. + 2006-06-06 Andrew Lunn * cdl/usbs_at91.cdl: Allow EP0 to be enabled when there are no Index: packages/devs/usb/at91/current/src/usbs_at91.c =================================================================== RCS file: /cvs/ecos/ecos/packages/devs/usb/at91/current/src/usbs_at91.c,v retrieving revision 1.2 diff -u -r1.2 usbs_at91.c --- packages/devs/usb/at91/current/src/usbs_at91.c 2 Jun 2006 18:46:13 -0000 1.2 +++ packages/devs/usb/at91/current/src/usbs_at91.c 7 Sep 2006 06:49:36 -0000 @@ -472,6 +472,8 @@ const usb_endpoint_descriptor *usb_endpoints; cyg_uint8 endpoint_type; + cyg_uint8 endpoint_number; + usbs_end_all_transfers (-EPIPE); HAL_WRITE_UINT32 (AT91_UDP + AT91_UDP_IDR, 0xffffffff); @@ -502,10 +504,14 @@ USB_ENDPOINT_DESCRIPTOR_ENDPOINT_IN ? USB_ENDPOINT_DESCRIPTOR_ENDPOINT_IN : USB_ENDPOINT_DESCRIPTOR_ENDPOINT_OUT)); - usbs_at91_endpoint_init((usbs_rx_endpoint *)usbs_at91_endpoints[epn], - endpoint_type, - true); - } + endpoint_number = usb_endpoints[epn-1].endpoint & ~(USB_ENDPOINT_DESCRIPTOR_ENDPOINT_IN); + if ( endpoint_number < AT91_USB_ENDPOINTS ) + { + usbs_at91_endpoint_init((usbs_rx_endpoint *)usbs_at91_endpoints[endpoint_number], + endpoint_type, + true); + } + } } static void