File tree Expand file tree Collapse file tree 4 files changed +8
-5
lines changed
hid_composite_freertos/src Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -130,10 +130,10 @@ void usb_device_task(void* param)
130
130
// RTOS forever loop
131
131
while (1 )
132
132
{
133
- // tinyusb device task
133
+ // put this thread to waiting state until there is new events
134
134
tud_task ();
135
135
136
- tud_cdc_write_flush ();
136
+ // following code only run if tud_task() process at least 1 event
137
137
}
138
138
}
139
139
@@ -196,6 +196,7 @@ void cdc_task(void* params)
196
196
// for throughput test e.g
197
197
// $ dd if=/dev/zero of=/dev/ttyACM0 count=10000
198
198
tud_cdc_write (buf , count );
199
+ tud_cdc_write_flush ();
199
200
}
200
201
}
201
202
Original file line number Diff line number Diff line change @@ -132,8 +132,10 @@ void usb_device_task(void* param)
132
132
// RTOS forever loop
133
133
while (1 )
134
134
{
135
- // tinyusb device task
135
+ // put this thread to waiting state until there is new events
136
136
tud_task ();
137
+
138
+ // following code only run if tud_task() process at least 1 event
137
139
}
138
140
}
139
141
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ void tud_task_ext(uint32_t timeout_ms, bool in_isr);
52
52
TU_ATTR_ALWAYS_INLINE static inline
53
53
void tud_task (void )
54
54
{
55
- tud_task_ext (OSAL_TIMEOUT_WAIT_FOREVER , false);
55
+ tud_task_ext (UINT32_MAX , false);
56
56
}
57
57
58
58
// Check if there is pending events need proccessing by tud_task()
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ void tuh_task_ext(uint32_t timeout_ms, bool in_isr);
100
100
TU_ATTR_ALWAYS_INLINE static inline
101
101
void tuh_task (void )
102
102
{
103
- tuh_task_ext (OSAL_TIMEOUT_WAIT_FOREVER , false);
103
+ tuh_task_ext (UINT32_MAX , false);
104
104
}
105
105
106
106
// Interrupt handler, name alias to HCD
You can’t perform that action at this time.
0 commit comments