seperate tusb_task() to tud_task() and tuh_task()

tusb_task() still exists for backward compatible
This commit is contained in:
hathach
2018-12-13 14:51:37 +07:00
parent af1ffe4675
commit 1c49c479ca
13 changed files with 64 additions and 49 deletions

View File

@@ -208,8 +208,24 @@ static void usbd_reset(uint8_t rhport)
/* USB Device Driver task
* This top level thread manages all device controller event and delegates events to class-specific drivers.
* This should be called periodically within the mainloop or rtos thread.
*
@code
int main(void)
{
application_init();
tusb_init();
while(1) // the mainloop
{
application_code();
tud_task(); // tinyusb device task
}
}
@endcode
*/
void usbd_task (void)
void tud_task (void)
{
// Loop until there is no more events in the queue
while (1)

View File

@@ -81,6 +81,7 @@ extern tud_desc_set_t tud_desc_set;
// APPLICATION API
//--------------------------------------------------------------------+
bool tud_mounted(void);
void tud_task (void);
//--------------------------------------------------------------------+
// APPLICATION CALLBACK (WEAK is optional)

View File

@@ -52,8 +52,6 @@ extern tud_desc_set_t const* usbd_desc_set;
// INTERNAL API for stack management
//--------------------------------------------------------------------+
bool usbd_init (void);
void usbd_task (void);
// Carry out Data and Status stage of control transfer
// - If len = 0, it is equivalent to sending status only