File tree 2 files changed +11
-1
lines changed
Filter options
2 files changed +11
-1
lines changed
Original file line number Diff line number Diff line change @@ -227,7 +227,8 @@ void USBCDC::_onLineState(bool _dtr, bool _rts){
227
227
228
228
void USBCDC::_onLineCoding (uint32_t _bit_rate, uint8_t _stop_bits, uint8_t _parity, uint8_t _data_bits){
229
229
if (bit_rate != _bit_rate || data_bits != _data_bits || stop_bits != _stop_bits || parity != _parity){
230
- if (bit_rate == 9600 && _bit_rate == 1200 ){
230
+ // ArduinoIDE sends LineCoding with 1200bps baud to reset the device
231
+ if (_bit_rate == 1200 ){
231
232
usb_persist_restart (RESTART_BOOTLOADER);
232
233
} else {
233
234
bit_rate = _bit_rate;
Original file line number Diff line number Diff line change @@ -502,6 +502,15 @@ static void tinyusb_apply_device_config(tinyusb_device_config_t *config){
502
502
snprintf (WEBUSB_URL , 126 , "%s" , config -> webusb_url );
503
503
}
504
504
505
+ // Windows 10 will not recognize the CDC device if WebUSB is enabled and USB Class is not 2 (CDC)
506
+ if (
507
+ (tinyusb_loaded_interfaces_mask & BIT (USB_INTERFACE_CDC ))
508
+ && config -> webusb_enabled
509
+ && (config -> usb_class != TUSB_CLASS_CDC )
510
+ ){
511
+ config -> usb_class = TUSB_CLASS_CDC ;
512
+ }
513
+
505
514
WEBUSB_ENABLED = config -> webusb_enabled ;
506
515
USB_DEVICE_ATTRIBUTES = config -> usb_attributes ;
507
516
USB_DEVICE_POWER = config -> usb_power_ma ;
You can’t perform that action at this time.
0 commit comments