diff options
author | Marc Zyngier <maz@kernel.org> | 2023-04-17 22:18:56 +0100 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2023-04-17 22:18:56 +0100 |
commit | 20205ef94fc3648a9bc003328c9651d440350802 (patch) | |
tree | 8a8c5db41b41277161519399a72c40889d928099 | |
parent | a2dae2ad3737fd06bcfebee4e24407e21f5948f9 (diff) | |
download | cs-sw-20205ef94fc3648a9bc003328c9651d440350802.tar.gz |
Fix break handling for host-provided durations
Signed-off-by: Marc Zyngier <maz@kernel.org>
-rw-r--r-- | vdmtool.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -475,7 +475,12 @@ void tud_cdc_send_break_cb(uint8_t itf, uint16_t duration_ms) if (!cxt->hw) return; + /* Section 6.2.15 of the spec has the recipe */ uart_set_break(UART(cxt), !!duration_ms); + if (duration_ms && duration_ms != (uint16_t)~0) { + sleep_ms(duration_ms); + uart_set_break(UART(cxt), 0); + } } static bool serial_handler(struct vdm_context *cxt) |