aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
Diffstat (limited to 'os')
-rw-r--r--os/hal/include/hal_usb_msd.h5
-rw-r--r--os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c10
-rw-r--r--os/hal/src/hal_usb_hid.c4
-rw-r--r--os/hal/src/hal_usb_msd.c1
4 files changed, 15 insertions, 5 deletions
diff --git a/os/hal/include/hal_usb_msd.h b/os/hal/include/hal_usb_msd.h
index 08241df..fcc2cf2 100644
--- a/os/hal/include/hal_usb_msd.h
+++ b/os/hal/include/hal_usb_msd.h
@@ -34,7 +34,6 @@
/*===========================================================================*/
#define USB_MSD_DATA_EP 0x01
-#define USB_MSD_EP_SIZE 0x40
/*===========================================================================*/
/* Driver pre-compile time settings. */
@@ -48,6 +47,10 @@
#error "Mass storage Driver requires HAL_USE_USB"
#endif
+#if !USB_USE_WAIT
+#error "Mass storage Driver requires USB_USE_WAIT"
+#endif
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
diff --git a/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c b/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c
index 333362f..fbd6f56 100644
--- a/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c
+++ b/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c
@@ -128,9 +128,9 @@ void fsmcSramStart(SRAMDriver *sramp, const SRAMConfig *cfgp) {
"invalid state");
if (sramp->state == SRAM_STOP) {
- sramp->sram->BCR = cfgp->bcr | FSMC_BCR_MBKEN;
sramp->sram->BTR = cfgp->btr;
sramp->sram->BWTR = cfgp->bwtr;
+ sramp->sram->BCR = cfgp->bcr | FSMC_BCR_MBKEN;
sramp->state = SRAM_READY;
}
}
@@ -145,7 +145,13 @@ void fsmcSramStart(SRAMDriver *sramp, const SRAMConfig *cfgp) {
void fsmcSramStop(SRAMDriver *sramp) {
if (sramp->state == SRAM_READY) {
- sramp->sram->BCR &= ~FSMC_BCR_MBKEN;
+ uint32_t mask = FSMC_BCR_MBKEN;
+#if (defined(STM32F427xx) || defined(STM32F437xx) || \
+ defined(STM32F429xx) || defined(STM32F439xx) || \
+ defined(STM32F7))
+ mask |= FSMC_BCR_CCLKEN;
+#endif
+ sramp->sram->BCR &= ~mask;
sramp->state = SRAM_STOP;
}
}
diff --git a/os/hal/src/hal_usb_hid.c b/os/hal/src/hal_usb_hid.c
index 56be9b7..d9d671b 100644
--- a/os/hal/src/hal_usb_hid.c
+++ b/os/hal/src/hal_usb_hid.c
@@ -221,10 +221,10 @@ void hidObjectInit(USBHIDDriver *uhdp) {
uhdp->vmt = &vmt;
osalEventObjectInit(&uhdp->event);
uhdp->state = HID_STOP;
- ibqObjectInit(&uhdp->ibqueue, uhdp->ib,
+ ibqObjectInit(&uhdp->ibqueue, true, uhdp->ib,
USB_HID_BUFFERS_SIZE, USB_HID_BUFFERS_NUMBER,
ibnotify, uhdp);
- obqObjectInit(&uhdp->obqueue, uhdp->ob,
+ obqObjectInit(&uhdp->obqueue, true, uhdp->ob,
USB_HID_BUFFERS_SIZE, USB_HID_BUFFERS_NUMBER,
obnotify, uhdp);
}
diff --git a/os/hal/src/hal_usb_msd.c b/os/hal/src/hal_usb_msd.c
index 068d698..6cc5386 100644
--- a/os/hal/src/hal_usb_msd.c
+++ b/os/hal/src/hal_usb_msd.c
@@ -214,6 +214,7 @@ static void send_csw(USBMassStorageDriver *msdp, uint8_t status,
*/
static THD_FUNCTION(usb_msd_worker, arg) {
USBMassStorageDriver *msdp = arg;
+ chRegSetThreadName("usb_msd_worker");
while(! chThdShouldTerminateX()) {
const msg_t status = usbReceive(msdp->usbp, USB_MSD_DATA_EP,