usb: Only enable the SOF interrupt if user_callback_sof is given.
Otherwise we get 1 kHz of SOF interrupts even if we don't need them. Originally reported by Uwe in https://github.com/libopencm3/libopencm3/pull/274 but BuFran provided a reworked implementation.
This commit is contained in:
committed by
Karl Palsson
parent
13004f81ee
commit
0cc0134f21
@@ -326,6 +326,12 @@ void stm32fx07_poll(usbd_device *usbd_dev)
|
||||
}
|
||||
REBASE(OTG_GINTSTS) = OTG_FS_GINTSTS_SOF;
|
||||
}
|
||||
|
||||
if (usbd_dev->user_callback_sof) {
|
||||
BBIO_PERIPH(OTG_FS_GINTMSK, OTG_FS_GINTMSK_SOFM) = 1;
|
||||
} else {
|
||||
BBIO_PERIPH(OTG_FS_GINTMSK, OTG_FS_GINTMSK_SOFM) = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void stm32fx07_disconnect(usbd_device *usbd_dev, bool disconnected)
|
||||
|
||||
Reference in New Issue
Block a user