Skip to content

Commit baa0d7b

Browse files
sameerturmary
authored andcommitted
Set USB SRAM QoS to sensitive latency
1 parent 49a29a9 commit baa0d7b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

cores/arduino/USB/SAMD21_USBDevice.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ class USBDevice_SAMD21G18x {
6161
inline void noRunInStandby() { usb.CTRLA.bit.RUNSTDBY = 0; }
6262
inline void wakeupHost() { usb.CTRLB.bit.UPRSM = 1; }
6363

64+
// USB QoS
65+
inline void setDataSensitiveQoS() { usb.QOSCTRL.bit.DQOS = 2; }
66+
inline void setConfigSensitiveQoS() { usb.QOSCTRL.bit.CQOS = 2; }
67+
6468
// USB speed
6569
inline void setFullSpeed() { usb.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_FS_Val; }
6670
inline void setLowSpeed() { usb.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_LS_Val; }

cores/arduino/USB/USBCore.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,8 @@ void USBDeviceClass::init()
370370
usbd.reset();
371371

372372
usbd.calibrate();
373+
usbd.setDataSensitiveQoS();
374+
usbd.setConfigSensitiveQoS();
373375
usbd.setUSBDeviceMode();
374376
usbd.runInStandby();
375377
usbd.setFullSpeed();

0 commit comments

Comments
 (0)