change signature usbh_isr to add tusb_bus_event_t parameter

change singature of call_isr as well
This commit is contained in:
hathach
2013-03-23 15:00:56 +07:00
parent e6b8166a58
commit 4adfc6a6d8
10 changed files with 17 additions and 17 deletions

View File

@@ -224,7 +224,7 @@ void async_list_process_isr(ehci_qhd_t * const async_head, ehci_registers_t * co
pipe_hdl.xfer_type = TUSB_XFER_BULK;
pipe_hdl.index = qhd_get_index(p_qhd);
}
usbh_isr( pipe_hdl, p_qhd->class_code); // call USBH call back
usbh_isr( pipe_hdl, p_qhd->class_code, BUS_EVENT_XFER_COMPLETE); // call USBH callback
}
p_qhd->p_qtd_list_head->used = 0; // free QTD

View File

@@ -66,11 +66,6 @@ typedef struct {
uint8_t index;
} pipe_handle_t;
typedef enum {
BUS_XFER_COMPLETE,
BUS_XFER_ERROR
}usb_bus_event_t;
//--------------------------------------------------------------------+
// USBH-HCD API
//--------------------------------------------------------------------+

View File

@@ -61,7 +61,7 @@ void tusb_tick_tock(void)
#define ENUM_QUEUE_DEPTH 5
// TODO fix number of class driver
static class_driver_t const usbh_class_drivers[TUSB_CLASS_MAX_CONSEC_NUMBER] =
static host_class_driver_t const usbh_class_drivers[TUSB_CLASS_MAX_CONSEC_NUMBER] =
{
[TUSB_CLASS_HID] = {
.init = hidh_init,
@@ -179,14 +179,14 @@ pipe_status_t usbh_pipe_status_get(pipe_handle_t pipe_hdl)
// USBH-HCD ISR/Callback API
//--------------------------------------------------------------------+
// interrupt caused by a TD (with IOC=1) in pipe of class class_code
void usbh_isr(pipe_handle_t pipe_hdl, uint8_t class_code)
void usbh_isr(pipe_handle_t pipe_hdl, uint8_t class_code, tusb_bus_event_t event)
{
if (class_code == 0) // Control transfer
{
osal_semaphore_post( usbh_device_info_pool[ pipe_hdl.dev_addr ].sem_hdl );
}else if (usbh_class_drivers[class_code].isr)
{
usbh_class_drivers[class_code].isr(pipe_hdl);
usbh_class_drivers[class_code].isr(pipe_hdl, event);
}else
{
ASSERT(false, (void) 0); // something wrong, no one claims the isr's source

View File

@@ -106,9 +106,9 @@ typedef uint8_t tusbh_device_status_t;
typedef struct {
void (* const init) (void);
tusb_error_t (* const open_subtask)(uint8_t, uint8_t const *, uint16_t*);
void (* const isr) (pipe_handle_t);
void (* const isr) (pipe_handle_t, tusb_bus_event_t);
void (* const close) (uint8_t);
} class_driver_t;
} host_class_driver_t;
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+

View File

@@ -101,7 +101,7 @@ typedef struct { // TODO internal structure, re-order members
extern usbh_device_info_t usbh_device_info_pool[TUSB_CFG_HOST_DEVICE_MAX+1]; // including zero-address
void usbh_isr(pipe_handle_t pipe_hdl, uint8_t class_code);
void usbh_isr(pipe_handle_t pipe_hdl, uint8_t class_code, tusb_bus_event_t event);
void usbh_device_plugged_isr(uint8_t hostid, tusb_speed_t speed);
void usbh_device_unplugged_isr(uint8_t hostid);