mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
add note for tud_task() behavior in freertos example
This commit is contained in:
parent
b034c18077
commit
6a022c73db
@ -130,10 +130,10 @@ void usb_device_task(void* param)
|
|||||||
// RTOS forever loop
|
// RTOS forever loop
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
// tinyusb device task
|
// put this thread to waiting state until there is new events
|
||||||
tud_task();
|
tud_task();
|
||||||
|
|
||||||
tud_cdc_write_flush();
|
// following code only run if tud_task() process at least 1 event
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,6 +196,7 @@ void cdc_task(void* params)
|
|||||||
// for throughput test e.g
|
// for throughput test e.g
|
||||||
// $ dd if=/dev/zero of=/dev/ttyACM0 count=10000
|
// $ dd if=/dev/zero of=/dev/ttyACM0 count=10000
|
||||||
tud_cdc_write(buf, count);
|
tud_cdc_write(buf, count);
|
||||||
|
tud_cdc_write_flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,8 +132,10 @@ void usb_device_task(void* param)
|
|||||||
// RTOS forever loop
|
// RTOS forever loop
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
// tinyusb device task
|
// put this thread to waiting state until there is new events
|
||||||
tud_task();
|
tud_task();
|
||||||
|
|
||||||
|
// following code only run if tud_task() process at least 1 event
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ void tud_task_ext(uint32_t timeout_ms, bool in_isr);
|
|||||||
TU_ATTR_ALWAYS_INLINE static inline
|
TU_ATTR_ALWAYS_INLINE static inline
|
||||||
void tud_task (void)
|
void tud_task (void)
|
||||||
{
|
{
|
||||||
tud_task_ext(OSAL_TIMEOUT_WAIT_FOREVER, false);
|
tud_task_ext(UINT32_MAX, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if there is pending events need proccessing by tud_task()
|
// Check if there is pending events need proccessing by tud_task()
|
||||||
|
@ -100,7 +100,7 @@ void tuh_task_ext(uint32_t timeout_ms, bool in_isr);
|
|||||||
TU_ATTR_ALWAYS_INLINE static inline
|
TU_ATTR_ALWAYS_INLINE static inline
|
||||||
void tuh_task(void)
|
void tuh_task(void)
|
||||||
{
|
{
|
||||||
tuh_task_ext(OSAL_TIMEOUT_WAIT_FOREVER, false);
|
tuh_task_ext(UINT32_MAX, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Interrupt handler, name alias to HCD
|
// Interrupt handler, name alias to HCD
|
||||||
|
Loading…
x
Reference in New Issue
Block a user