diff options
Diffstat (limited to 'src/machine/machine_nrf52840_usb.go')
-rw-r--r-- | src/machine/machine_nrf52840_usb.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/machine/machine_nrf52840_usb.go b/src/machine/machine_nrf52840_usb.go index 26f240c32..fa117b1c4 100644 --- a/src/machine/machine_nrf52840_usb.go +++ b/src/machine/machine_nrf52840_usb.go @@ -445,7 +445,7 @@ func handleStandardSetup(setup usbSetup) bool { func cdcSetup(setup usbSetup) bool { if setup.bmRequestType == usb_REQUEST_DEVICETOHOST_CLASS_INTERFACE { if setup.bRequest == usb_CDC_GET_LINE_CODING { - b := make([]byte, 7) + var b [cdcLineInfoSize]byte b[0] = byte(usbLineInfo.dwDTERate) b[1] = byte(usbLineInfo.dwDTERate >> 8) b[2] = byte(usbLineInfo.dwDTERate >> 16) @@ -454,7 +454,7 @@ func cdcSetup(setup usbSetup) bool { b[5] = byte(usbLineInfo.bParityType) b[6] = byte(usbLineInfo.bDataBits) - sendUSBPacket(0, b) + sendUSBPacket(0, b[:]) return true } } |