-
Looking at the examples they seem to all use The commit that made that change to seemingly allow configurable port numbers (with That should have been possible with the The newer style of config.h does no longer use the combined Except Would it not make sense to just also set #ifndef TUD_OPT_RHPORT
#define TUD_OPT_RHPORT BOARD_TUD_RHPORT
#endif Then could also again use the generic OR is So is the recommended way no longer using the combined config Background: I'm trying to fix/update tinyusb examples in Chibios_Contrib, these are really old and use the old style of config. EDIT: Just saw that the getting_started reference doc (still) advises to use an example config and use of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
the old CFG_TUSB_RHPORT0_MODE style requires the port must be hard coded to host/device. tud_init()/tuh_init() allow user to dynamically init an roothub port as device/host as needed, and deinit() it if want to (save/power/switch role, configuration etc..). deinit() is not implemented for device, but is added for host #2530. In summary, it make it easier to switch role dynamically on multiple roothub port controller. If you don't need it, you don't have to use it. tusb_init() can still be invoked to initialize both host + device |
Beta Was this translation helpful? Give feedback.
the old CFG_TUSB_RHPORT0_MODE style requires the port must be hard coded to host/device. tud_init()/tuh_init() allow user to dynamically init an roothub port as device/host as needed, and deinit() it if want to (save/power/switch role, configuration etc..). deinit() is not implemented for device, but is added for host #2530.
In summary, it make it easier to switch role dynamically on multiple roothub port controller. If you don't need it, you don't have to use it. tusb_init() can still be invoked to initialize both host + device