763: Misc USB improvements r=Dirbaio a=Dirbaio The "simplify control in/out handlng" commit gives a -2kb code size improvement. 766: Make usb_serial examples work on windows r=Dirbaio a=timokroeger Windows shows `error 10` when using CDC ACM on non composite devices. Workaround is to use IADS: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net> Co-authored-by: Timo Kröger <timo.kroeger@hitachienergy.com>
This commit is contained in:
@ -43,12 +43,19 @@ async fn main(_spawner: Spawner, p: Peripherals) {
|
||||
config.max_power = 100;
|
||||
config.max_packet_size_0 = 64;
|
||||
|
||||
// Required for windows compatiblity.
|
||||
// https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_CDC_ACM_IAD.html#help
|
||||
config.device_class = 0xEF;
|
||||
config.device_sub_class = 0x02;
|
||||
config.device_protocol = 0x01;
|
||||
config.composite_with_iads = true;
|
||||
|
||||
// Create embassy-usb DeviceBuilder using the driver and config.
|
||||
// It needs some buffers for building the descriptors.
|
||||
let mut device_descriptor = [0; 256];
|
||||
let mut config_descriptor = [0; 256];
|
||||
let mut bos_descriptor = [0; 256];
|
||||
let mut control_buf = [0; 7];
|
||||
let mut control_buf = [0; 64];
|
||||
|
||||
let mut state = State::new();
|
||||
|
||||
|
Reference in New Issue
Block a user