mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-22 15:40:06 +00:00
clean up
This commit is contained in:
parent
3a37dd66cc
commit
c760c69d51
@ -168,8 +168,7 @@ void usbd_setup_received_isr(uint8_t coreid, tusb_control_request_t * p_request)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TUSB_REQUEST_SET_ADDRESS:
|
case TUSB_REQUEST_SET_ADDRESS:
|
||||||
p_device->address = (uint8_t) p_request->wValue;
|
dcd_controller_set_address(coreid, (uint8_t) p_request->wValue);
|
||||||
dcd_controller_set_address(coreid, p_device->address);
|
|
||||||
usbd_devices[coreid].state = TUSB_DEVICE_STATE_ADDRESSED;
|
usbd_devices[coreid].state = TUSB_DEVICE_STATE_ADDRESSED;
|
||||||
|
|
||||||
dcd_pipe_control_xfer(coreid, TUSB_DIR_HOST_TO_DEV, NULL, 0); // zero length
|
dcd_pipe_control_xfer(coreid, TUSB_DIR_HOST_TO_DEV, NULL, 0); // zero length
|
||||||
|
@ -55,13 +55,11 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define USBD_MAX_INTERFACE 10 // TODO refractor later
|
#define USBD_MAX_INTERFACE 16 // TODO refractor later
|
||||||
#define USBD_MAX_ENDPOINT 32 // TODO refractor later
|
#define USBD_MAX_ENDPOINT 32 // TODO refractor later
|
||||||
typedef struct {
|
typedef struct {
|
||||||
volatile uint8_t state;
|
volatile uint8_t state;
|
||||||
uint8_t address;
|
|
||||||
uint8_t interface2class[USBD_MAX_INTERFACE]; // determine interface number belongs to which class
|
uint8_t interface2class[USBD_MAX_INTERFACE]; // determine interface number belongs to which class
|
||||||
uint8_t endpoint_idx2class[USBD_MAX_ENDPOINT]; // determine endpoint index belongs to which class
|
|
||||||
}usbd_device_info_t;
|
}usbd_device_info_t;
|
||||||
|
|
||||||
extern usbd_device_info_t usbd_devices[CONTROLLER_DEVICE_NUMBER];
|
extern usbd_device_info_t usbd_devices[CONTROLLER_DEVICE_NUMBER];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user