From e11b7d5d6df88b90efa9d53ebca80cf1cb3676dd Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Wed, 29 Jul 2015 12:46:12 +0000 Subject: [PATCH] usb: fx07: correctly REBASE for both usb cores. Regression from 0cc0134f21b387a3a813feca1973c77587900ee2 When operating on registers in code that is common for both usb cores, make sure to use the REBASE macros to operate on the correct peripheral. Reported by: kuldeep Fixes github issue: #495 --- lib/usb/usb_fx07_common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/usb/usb_fx07_common.c b/lib/usb/usb_fx07_common.c index 234c9c1e..82d8a5a4 100644 --- a/lib/usb/usb_fx07_common.c +++ b/lib/usb/usb_fx07_common.c @@ -326,11 +326,11 @@ 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; + REBASE(OTG_GINTMSK) |= OTG_FS_GINTMSK_SOFM; } else { - BBIO_PERIPH(OTG_FS_GINTMSK, OTG_FS_GINTMSK_SOFM) = 0; + REBASE(OTG_GINTMSK) &= ~OTG_FS_GINTMSK_SOFM; } }