Skip to content

Commit

Permalink
Apr.11 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Mazurov committed Apr 18, 2011
1 parent a23fa87 commit aa6fc58
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 69 deletions.
17 changes: 9 additions & 8 deletions Usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,13 @@
#define USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE 0xD2
#define USB_ERROR_UNABLE_TO_REGISTER_DEVICE_CLASS 0xD3
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL 0xD4
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL 0xD5
#define USB_ERROR_EPINFO_IS_NULL 0xD6
#define USB_ERROR_INVALID_ARGUMENT 0xD7
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE 0xD8
#define USB_ERROR_INVALID_MAX_PKT_SIZE 0xD9
#define USB_ERROR_EP_NOT_FOUND_IN_TBL 0xDA
#define USB_ERROR_HUB_ADDRESS_OVERFLOW 0xD5
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL 0xD6
#define USB_ERROR_EPINFO_IS_NULL 0xD7
#define USB_ERROR_INVALID_ARGUMENT 0xD8
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE 0xD9
#define USB_ERROR_INVALID_MAX_PKT_SIZE 0xDA
#define USB_ERROR_EP_NOT_FOUND_IN_TBL 0xDB

class USBDeviceConfig
{
Expand All @@ -156,8 +157,8 @@ class USBDeviceConfig
#define USB_SETTLE_DELAY 200 //settle delay in milliseconds
#define USB_NAK_NOWAIT 1 //used in Richard's PS2/Wiimote code

#define USB_NUMDEVICES 64 //number of USB devices
#define HUB_MAX_HUBS 7 // maximum number of hubs that can be attached to the host controller
#define USB_NUMDEVICES 16 //number of USB devices
#define HUB_MAX_HUBS 5 // maximum number of hubs that can be attached to the host controller
#define HUB_PORT_RESET_DELAY 20 // hub port reset delay 10 ms recomended, can be up to 20 ms

/* USB state machine states */
Expand Down
3 changes: 3 additions & 0 deletions address.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ class AddressPoolImpl : public AddressPool
if (parent > 127 || port > 7)
return 0;

if (is_hub && hubCounter == 7)
return 0;

// finds first empty address entry starting from one
uint8_t index = FindAddressIndex(0);

Expand Down
1 change: 0 additions & 1 deletion diff.txt

This file was deleted.

59 changes: 0 additions & 59 deletions newusb.pde

This file was deleted.

12 changes: 11 additions & 1 deletion usbhost.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,17 @@ uint16_t MAX3421e< SS, INTR >::reset()
}
return( i );
}

///* initialize MAX3421E. Set Host mode, pullups, and stuff. Returns 0 if success, -1 if not */
//template< typename SS, typename INTR >
//int8_t MAX3421e< SS, INTR >::Init()
//{
// if( reset() == 0 ) { //OSCOKIRQ hasn't asserted in time
// return ( -1 );
// }
// regWr( rMODE, bmDPPULLDN|bmDMPULLDN|bmHOST ); // set pull-downs, Host
//
// return( 0 );
//}
/* initialize MAX3421E. Set Host mode, pullups, and stuff. Returns 0 if success, -1 if not */
template< typename SS, typename INTR >
int8_t MAX3421e< SS, INTR >::Init()
Expand Down

0 comments on commit aa6fc58

Please sign in to comment.