반응형

 

 

- usbd.c

// This handles the actual request and its response.
// return false will cause its caller to stall control endpoint
static bool process_control_request(uint8_t rhport, tusb_control_request_t const * p_request)
...
	switch ( p_request->bRequest )
      {
        case TUSB_REQ_SET_ADDRESS:
          // Depending on mcu, status phase could be sent either before or after changing device address,
          // or even require stack to not response with status at all
          // Therefore DCD must take full responsibility to response and include zlp status packet if needed.
          usbd_control_set_request(p_request); // set request since DCD has no access to tud_control_status() API
          dcd_set_address(rhport, (uint8_t) p_request->wValue);
          // skip tud_control_status()
          _usbd_dev.addressed = 1;
        break;

이것은 실질적인 요청 그리고 그것의 응답을 처리합니다.

false를 리턴합니다, 그것의 콜러가 control endpoint를 정지를 발생시킬 경우.

 

 MCU에 따라서, status phase는 보내질 수 있습니다, 디바이스 주소가 바뀐 이전 또는 이후 둘다,

혹은 심지어 전혀 상태에 응답하지 않는 요구 스택 

 

 그러므로, DCD (Device Controller Driver)는 응답에 대한 모든 책임 가져야합니다 그리고 만약 필요하면, zlp status packet을 포함해야합니다.

 

 

 

반응형