mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-14 04:18:56 +00:00
initial break request handling
This commit is contained in:
parent
50a0bddd8b
commit
07a04255da
@ -396,6 +396,17 @@ bool cdcd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t
|
||||
if ( tud_cdc_line_state_cb ) tud_cdc_line_state_cb(itf, dtr, rts);
|
||||
}
|
||||
break;
|
||||
case CDC_REQUEST_SEND_BREAK:
|
||||
if (stage == CONTROL_STAGE_SETUP)
|
||||
{
|
||||
tud_control_status(rhport, request);
|
||||
}
|
||||
else if (stage == CONTROL_STAGE_ACK)
|
||||
{
|
||||
TU_LOG2(" Send Break\r\n");
|
||||
if ( tud_cdc_send_break_cb ) tud_cdc_send_break_cb(itf, request->wValue);
|
||||
}
|
||||
break;
|
||||
|
||||
default: return false; // stall unsupported request
|
||||
}
|
||||
|
@ -133,6 +133,9 @@ static inline bool tud_cdc_write_clear (void);
|
||||
// Invoked when received new data
|
||||
TU_ATTR_WEAK void tud_cdc_rx_cb(uint8_t itf);
|
||||
|
||||
// Invoked when received send break
|
||||
TU_ATTR_WEAK void tud_cdc_send_break_cb(uint8_t itf, uint16_t wait_ms);
|
||||
|
||||
// Invoked when received `wanted_char`
|
||||
TU_ATTR_WEAK void tud_cdc_rx_wanted_cb(uint8_t itf, char wanted_char);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user