change dcd_init() return from void to bool

This commit is contained in:
hathach
2024-10-14 19:42:22 +07:00
parent 1f18be93db
commit e83e08343a
36 changed files with 103 additions and 49 deletions

View File

@@ -454,7 +454,7 @@ bool tud_rhport_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
}
TU_ASSERT(rh_init);
TU_LOG_USBD("USBD init on controller %u, speed = %s\r\n", rh_init->rhport,
TU_LOG_USBD("USBD init on controller %u, speed = %s\r\n", rhport,
rh_init->speed == TUSB_SPEED_HIGH ? "High" : "Full");
TU_LOG_INT(CFG_TUD_LOG_LEVEL, sizeof(usbd_device_t));
TU_LOG_INT(CFG_TUD_LOG_LEVEL, sizeof(dcd_event_t));
@@ -490,15 +490,16 @@ bool tud_rhport_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
_usbd_rhport = rhport;
// Init device controller driver
dcd_init(rhport, rh_init);
TU_ASSERT(dcd_init(rhport, rh_init));
dcd_int_enable(rhport);
return true;
}
bool tud_deinit(uint8_t rhport) {
// skip if not initialized
if (!tud_inited()) return true;
if (!tud_inited()) {
return true; // skip if not initialized
}
TU_LOG_USBD("USBD deinit on controller %u\r\n", rhport);