Skip to content

Commit 4587fc5

Browse files
authored
Merge pull request #509 from sameer/master
Set USB SRAM QoS to sensitive latency
2 parents 703b87e + d96b9b3 commit 4587fc5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

cores/arduino/USB/SAMD21_USBDevice.h

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ class USBDevice_SAMD21G18x {
5050
inline void noRunInStandby() { usb.CTRLA.bit.RUNSTDBY = 0; }
5151
inline void wakeupHost() { usb.CTRLB.bit.UPRSM = 1; }
5252

53+
// USB QoS
54+
inline void setDataSensitiveQoS() { usb.QOSCTRL.bit.DQOS = 2; }
55+
inline void setConfigSensitiveQoS() { usb.QOSCTRL.bit.CQOS = 2; }
56+
5357
// USB speed
5458
inline void setFullSpeed() { usb.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_FS_Val; }
5559
inline void setLowSpeed() { usb.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_LS_Val; }

cores/arduino/USB/USBCore.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ void USBDeviceClass::init()
295295
usbd.reset();
296296

297297
usbd.calibrate();
298+
usbd.setDataSensitiveQoS();
299+
usbd.setConfigSensitiveQoS();
298300
usbd.setUSBDeviceMode();
299301
usbd.runInStandby();
300302
usbd.setFullSpeed();

0 commit comments

Comments
 (0)