refractor usbd-dcd callback, add bus event isr
This commit is contained in:
@@ -50,6 +50,8 @@
|
||||
//--------------------------------------------------------------------+
|
||||
// INTERNAL OBJECT & FUNCTION DECLARATION
|
||||
//--------------------------------------------------------------------+
|
||||
OSAL_TASK_DEF(moused_app_task, 128, MOUSED_APP_TASK_PRIO);
|
||||
|
||||
ATTR_USB_MIN_ALIGNMENT hid_mouse_report_t mouse_report TUSB_CFG_ATTR_USBRAM;
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
@@ -62,11 +64,13 @@ void tusbd_hid_mouse_isr(uint8_t coreid, tusb_event_t event, uint32_t xferred_by
|
||||
|
||||
void moused_app_init(void)
|
||||
{
|
||||
|
||||
ASSERT( TUSB_ERROR_NONE == osal_task_create( OSAL_TASK_REF(moused_app_task) ), VOID_RETURN);
|
||||
}
|
||||
|
||||
OSAL_TASK_FUNCTION( moused_app_task ) (void* p_task_para)
|
||||
{
|
||||
OSAL_TASK_LOOP_BEGIN
|
||||
|
||||
if (tusbd_is_configured(0))
|
||||
{
|
||||
static uint32_t count =0;
|
||||
@@ -79,6 +83,10 @@ OSAL_TASK_FUNCTION( moused_app_task ) (void* p_task_para)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
osal_task_delay(1000);
|
||||
|
||||
OSAL_TASK_LOOP_END
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user