rename xfer complete enum

This commit is contained in:
hathach
2018-11-23 15:17:43 +07:00
parent cb8782e5f2
commit a619ff88a3
22 changed files with 66 additions and 64 deletions

View File

@@ -84,17 +84,17 @@ void tuh_cdc_xfer_isr(uint8_t dev_addr, xfer_result_t event, cdc_pipeid_t pipe_i
case CDC_PIPE_DATA_IN:
switch(event)
{
case TUSB_EVENT_XFER_COMPLETE:
case XFER_RESULT_SUCCESS:
received_bytes = xferred_bytes;
osal_semaphore_post(sem_hdl); // notify main task
break;
case TUSB_EVENT_XFER_ERROR:
case XFER_RESULT_FAILED:
received_bytes = 0; // ignore
tuh_cdc_receive(dev_addr, serial_in_buffer, SERIAL_BUFFER_SIZE, true); // waiting for next data
break;
case TUSB_EVENT_XFER_STALLED:
case XFER_RESULT_STALLED:
default :
break;
}

View File

@@ -81,12 +81,12 @@ void tuh_hid_keyboard_isr(uint8_t dev_addr, xfer_result_t event)
{
switch(event)
{
case TUSB_EVENT_XFER_COMPLETE:
case XFER_RESULT_SUCCESS:
osal_queue_send(queue_kbd_hdl, &usb_keyboard_report);
tuh_hid_keyboard_get_report(dev_addr, (uint8_t*) &usb_keyboard_report);
break;
case TUSB_EVENT_XFER_ERROR:
case XFER_RESULT_FAILED:
tuh_hid_keyboard_get_report(dev_addr, (uint8_t*) &usb_keyboard_report); // ignore & continue
break;

View File

@@ -80,12 +80,12 @@ void tuh_hid_mouse_isr(uint8_t dev_addr, xfer_result_t event)
{
switch(event)
{
case TUSB_EVENT_XFER_COMPLETE:
case XFER_RESULT_SUCCESS:
osal_queue_send(queue_mouse_hdl, &usb_mouse_report);
(void) tuh_hid_mouse_get_report(dev_addr, (uint8_t*) &usb_mouse_report);
break;
case TUSB_EVENT_XFER_ERROR:
case XFER_RESULT_FAILED:
(void) tuh_hid_mouse_get_report(dev_addr, (uint8_t*) &usb_mouse_report); // ignore & continue
break;