From cdaf455461c5ac5867f5eba2eb8874d1a32f0e82 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 26 Jul 2019 20:14:56 +0700 Subject: fix stall response with SET_INTERFACE/GET_INTERFACE webusb work with linux & macos --- examples/device/webusb/src/main.c | 44 +++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'examples') diff --git a/examples/device/webusb/src/main.c b/examples/device/webusb/src/main.c index e6bfe3802..f844e9506 100644 --- a/examples/device/webusb/src/main.c +++ b/examples/device/webusb/src/main.c @@ -86,6 +86,28 @@ int main(void) return 0; } +// send characters to both CDC and WebUSB +void echo_all(uint8_t buf[], uint32_t count) +{ + // echo to web serial + if ( web_serial_connected ) + { + tud_vendor_write(buf, count); + } + + // echo to cdc + if ( tud_cdc_connected() ) + { + for(uint32_t i=0; i