diff options
author | Marc Zyngier <maz@kernel.org> | 2023-04-10 11:33:16 +0100 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2023-04-10 11:33:16 +0100 |
commit | 3fe2608b7e26446564a9bf114636a05f0719c9c7 (patch) | |
tree | 3b8f6c312fa62e85171fb87f9da02dcf2c281d9f | |
parent | 7f5fc806947499ecedea6c79a714116f75af9c74 (diff) | |
parent | db7ee8815f80d3a01e9c6e4cbd72b41be3a687d1 (diff) | |
download | cs-sw-3fe2608b7e26446564a9bf114636a05f0719c9c7.tar.gz |
Merge branch 'cdc-break'
Signed-off-by: Marc Zyngier <maz@kernel.org>
-rw-r--r-- | README.txt | 4 | ||||
-rw-r--r-- | vdmtool.c | 22 |
2 files changed, 16 insertions, 10 deletions
@@ -186,7 +186,6 @@ to the follwing dump: P0: Current port ^_ Escape character ^_ ^_ Raw ^_ - ^_ ^@ Send break ^_ ! DUT reset ^_ ^R Central Scrutinizer reset ^_ ^^ Central Scrutinizer reset to programming mode @@ -200,9 +199,6 @@ which is completely self explainatory, but let's expand on it anyway: - ^_ ^_ sends a raw ^_, just in case you really need it -- ^_ ^@ sends a break, which is useful if interacting with a Linux - console as you get the sysrq functionality. - - ^_ ! resets the Mac without any warning. Yes, this is dangerous, use with caution and only when nothing else will do. @@ -449,7 +449,6 @@ static void help(struct vdm_context *cxt) cprintf(cxt, "Current port\n" "^_ Escape character\n" "^_ ^_ Raw ^_\n" - "^_ ^@ Send break\n" "^_ ! DUT reset\n" "^_ ^R Central Scrutinizer reset\n" "^_ ^^ Central Scrutinizer reset to programming mode\n" @@ -464,6 +463,22 @@ static void help(struct vdm_context *cxt) vdm_contexts[i].hw ? "present" : "absent"); } +/* Break is handled as sideband data via the CDC layer */ +void tud_cdc_send_break_cb(uint8_t itf, uint16_t duration_ms) +{ + struct vdm_context *cxt; + + if (itf > CONFIG_USB_PD_PORT_COUNT) + return; + + cxt = &vdm_contexts[itf]; + + if (!cxt->hw) + return; + + uart_set_break(UART(cxt), !!duration_ms); +} + static bool serial_handler(struct vdm_context *cxt) { bool uart_active = false; @@ -498,11 +513,6 @@ static bool serial_handler(struct vdm_context *cxt) case 4: /* ^D */ cxt->verbose = !cxt->verbose; break; - case 0: /* ^@ */ - uart_set_break(UART(cxt), true); - sleep_ms(1); - uart_set_break(UART(cxt), false); - break; case '\r': /* Enter */ debug_poke(cxt); break; |