aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2023-04-17 22:18:56 +0100
committerMarc Zyngier <maz@kernel.org>2023-04-17 22:18:56 +0100
commit20205ef94fc3648a9bc003328c9651d440350802 (patch)
tree8a8c5db41b41277161519399a72c40889d928099
parenta2dae2ad3737fd06bcfebee4e24407e21f5948f9 (diff)
downloadcs-sw-20205ef94fc3648a9bc003328c9651d440350802.tar.gz
Fix break handling for host-provided durations
Signed-off-by: Marc Zyngier <maz@kernel.org>
-rw-r--r--vdmtool.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vdmtool.c b/vdmtool.c
index f0dd40e..af3de8d 100644
--- a/vdmtool.c
+++ b/vdmtool.c
@@ -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)