change the tusb_rhport_init_t struct, exclude the rhport to make API more consistent
This commit is contained in:
		@@ -265,9 +265,9 @@ static void process_bus_resume(uint8_t rhport)
 | 
			
		||||
/*------------------------------------------------------------------*/
 | 
			
		||||
/* Device API
 | 
			
		||||
 *------------------------------------------------------------------*/
 | 
			
		||||
void dcd_init(const tusb_rhport_init_t* rh_init) {
 | 
			
		||||
  const uint8_t rhport = rh_init->rhport;
 | 
			
		||||
void dcd_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
 | 
			
		||||
  (void) rhport;
 | 
			
		||||
  (void) rh_init;
 | 
			
		||||
 | 
			
		||||
  // save crystal-less setting (if available)
 | 
			
		||||
  #if defined(FSL_FEATURE_USB_KHCI_IRC48M_MODULE_CLOCK_ENABLED) && FSL_FEATURE_USB_KHCI_IRC48M_MODULE_CLOCK_ENABLED == 1
 | 
			
		||||
 
 | 
			
		||||
@@ -368,7 +368,8 @@ static void process_bus_reset(uint8_t rhport)
 | 
			
		||||
/*------------------------------------------------------------------*/
 | 
			
		||||
/* Host API
 | 
			
		||||
 *------------------------------------------------------------------*/
 | 
			
		||||
bool hcd_init(const tusb_rhport_init_t* rh_init) {
 | 
			
		||||
bool hcd_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
 | 
			
		||||
  (void) rhport;
 | 
			
		||||
  (void) rh_init;
 | 
			
		||||
  KHCI->USBTRC0 |= USB_USBTRC0_USBRESET_MASK;
 | 
			
		||||
  while (KHCI->USBTRC0 & USB_USBTRC0_USBRESET_MASK);
 | 
			
		||||
 
 | 
			
		||||
@@ -167,9 +167,9 @@ static void bus_reset(void)
 | 
			
		||||
  tu_memclr(&_dcd, sizeof(dcd_data_t));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void dcd_init(const tusb_rhport_init_t* rh_init) {
 | 
			
		||||
  const uint8_t rhport = rh_init->rhport;
 | 
			
		||||
void dcd_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
 | 
			
		||||
  (void) rhport;
 | 
			
		||||
  (void) rh_init;
 | 
			
		||||
 | 
			
		||||
  //------------- user manual 11.13 usb device controller initialization -------------//
 | 
			
		||||
  // step 6 : set up control endpoint
 | 
			
		||||
 
 | 
			
		||||
@@ -289,8 +289,8 @@ static void edpt_reset_all(uint8_t rhport)
 | 
			
		||||
  }
 | 
			
		||||
  prepare_setup_packet(rhport);
 | 
			
		||||
}
 | 
			
		||||
void dcd_init(const tusb_rhport_init_t* rh_init) {
 | 
			
		||||
  const uint8_t rhport = rh_init->rhport;
 | 
			
		||||
void dcd_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
 | 
			
		||||
  (void) rh_init;
 | 
			
		||||
  edpt_reset_all(rhport);
 | 
			
		||||
 | 
			
		||||
  dcd_registers_t* dcd_reg = _dcd_controller[rhport].regs;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user