- move disconnection handle to enum task --> move tusbh_xxx_unmount is invoked in non-isr context
This commit is contained in:
@@ -266,7 +266,7 @@ void cdch_close(uint8_t dev_addr)
|
||||
|
||||
memclr_(p_cdc, sizeof(cdch_data_t));
|
||||
|
||||
tusbh_cdc_unmounted_isr(dev_addr);
|
||||
tusbh_cdc_unmounted_cb(dev_addr);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ tusb_error_t tusbh_cdc_receive(uint8_t dev_addr, void * p_buffer, uint32_t lengt
|
||||
|
||||
//------------- CDC Application Callback -------------//
|
||||
void tusbh_cdc_mounted_cb(uint8_t dev_addr);
|
||||
void tusbh_cdc_unmounted_isr(uint8_t dev_addr);
|
||||
void tusbh_cdc_unmounted_cb(uint8_t dev_addr);
|
||||
void tusbh_cdc_xfer_isr(uint8_t dev_addr, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes);
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ tusb_error_t tusbh_cdc_rndis_get_mac_addr(uint8_t dev_addr, uint8_t mac_address[
|
||||
|
||||
//------------- RNDIS Application Callback (overshadow CDC callbacks) -------------//
|
||||
void tusbh_cdc_rndis_mounted_cb(uint8_t dev_addr);
|
||||
void tusbh_cdc_rndis_unmounted_isr(uint8_t dev_addr);
|
||||
void tusbh_cdc_rndis_unmounted_cb(uint8_t dev_addr);
|
||||
void tusbh_cdc_rndis_xfer_isr(uint8_t dev_addr, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes);
|
||||
|
||||
|
||||
|
||||
@@ -282,7 +282,7 @@ void hidh_close(uint8_t dev_addr)
|
||||
if ( pipehandle_is_valid( keyboardh_data[dev_addr-1].pipe_hdl ) )
|
||||
{
|
||||
hidh_interface_close(dev_addr, &keyboardh_data[dev_addr-1]);
|
||||
tusbh_hid_keyboard_unmounted_isr(dev_addr);
|
||||
tusbh_hid_keyboard_unmounted_cb(dev_addr);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -290,7 +290,7 @@ void hidh_close(uint8_t dev_addr)
|
||||
if( pipehandle_is_valid( mouseh_data[dev_addr-1].pipe_hdl ) )
|
||||
{
|
||||
hidh_interface_close(dev_addr, &mouseh_data[dev_addr-1]);
|
||||
tusbh_hid_mouse_unmounted_isr( dev_addr );
|
||||
tusbh_hid_mouse_unmounted_cb( dev_addr );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ tusb_error_t tusbh_hid_keyboard_get_report(uint8_t dev_addr, void * report) /*A
|
||||
//------------- Application Callback -------------//
|
||||
void tusbh_hid_keyboard_isr(uint8_t dev_addr, tusb_event_t event);
|
||||
void tusbh_hid_keyboard_mounted_cb(uint8_t dev_addr);
|
||||
void tusbh_hid_keyboard_unmounted_isr(uint8_t dev_addr);
|
||||
void tusbh_hid_keyboard_unmounted_cb(uint8_t dev_addr);
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// MOUSE Application API
|
||||
@@ -78,7 +78,7 @@ tusb_error_t tusbh_hid_mouse_get_report(uint8_t dev_addr, void* report) /*ATTR_
|
||||
//------------- Application Callback -------------//
|
||||
void tusbh_hid_mouse_isr(uint8_t dev_addr, tusb_event_t event);
|
||||
void tusbh_hid_mouse_mounted_cb(uint8_t dev_addr);
|
||||
void tusbh_hid_mouse_unmounted_isr(uint8_t dev_addr);
|
||||
void tusbh_hid_mouse_unmounted_cb(uint8_t dev_addr);
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// GENERIC Application API
|
||||
|
||||
@@ -427,7 +427,7 @@ void msch_close(uint8_t dev_addr)
|
||||
memclr_(&msch_data[dev_addr-1], sizeof(msch_interface_t));
|
||||
osal_semaphore_reset(msch_sem_hdl);
|
||||
|
||||
tusbh_msc_unmounted_isr(dev_addr); // invoke Application Callback
|
||||
tusbh_msc_unmounted_cb(dev_addr); // invoke Application Callback
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
@@ -80,7 +80,7 @@ tusb_error_t tusbh_msc_test_unit_ready(uint8_t dev_addr, uint8_t lun, msc_cmd_st
|
||||
|
||||
//------------- Application Callback -------------//
|
||||
void tusbh_msc_mounted_cb(uint8_t dev_addr);
|
||||
void tusbh_msc_unmounted_isr(uint8_t dev_addr);
|
||||
void tusbh_msc_unmounted_cb(uint8_t dev_addr);
|
||||
void tusbh_msc_isr(uint8_t dev_addr, tusb_event_t event, uint32_t xferred_bytes);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user