Fixing a strange bug due to tusb_inited().
Interesting things happen when TinyUSB is used both for host and device. bool tusb_inited(void) { bool ret = false; ret = ret || tud_inited(); ret = ret || tuh_inited(); return ret; } -> This is effectively tud_inited() || tuh_inited(), which is great but tuh_task() should check tuh_inited() not tusb_inited(). This way, tusb_inited() returns true when tinyusb device gets inited correctly and tuh_task gets stuck in an endless loop with watchdog rebooting the device.
This commit is contained in:
parent
e2be2e13e0
commit
a49505c465
|
@ -58,6 +58,7 @@ void core1_main() {
|
|||
global_state.core1_last_loop_pass = time_us_64();
|
||||
|
||||
// USB host task, needs to run as often as possible
|
||||
if (tuh_inited())
|
||||
tuh_task();
|
||||
|
||||
// Receives data over serial from the other board
|
||||
|
|
Loading…
Reference in New Issue