From 9eef4917a71115fb38adcaa8bc11d00884055917 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 19 Sep 2012 18:00:51 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4699 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/OTGv1/usb_lld.c | 4 +++- os/hal/src/mmc_spi.c | 2 +- os/hal/src/sdc.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'os/hal') diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.c b/os/hal/platforms/STM32/OTGv1/usb_lld.c index 98d0f6d03..1dd7e1b8f 100644 --- a/os/hal/platforms/STM32/OTGv1/usb_lld.c +++ b/os/hal/platforms/STM32/OTGv1/usb_lld.c @@ -705,6 +705,8 @@ static msg_t usb_lld_pump(void *p) { epmask = (1 << ep); if (usbp->txpending & epmask) { + bool_t done; + chSysLock(); /* USB interrupts are globally *suspended* because the peripheral does not allow any interference during the TX FIFO filling @@ -717,7 +719,7 @@ static msg_t usb_lld_pump(void *p) { usbp->txpending &= ~epmask; chSysUnlock(); - bool_t done = otg_txfifo_handler(usbp, ep); + done = otg_txfifo_handler(usbp, ep); chSysLock(); otgp->GAHBCFG |= GAHBCFG_GINTMSK; diff --git a/os/hal/src/mmc_spi.c b/os/hal/src/mmc_spi.c index f8056f392..65d655212 100644 --- a/os/hal/src/mmc_spi.c +++ b/os/hal/src/mmc_spi.c @@ -439,6 +439,7 @@ void mmcStop(MMCDriver *mmcp) { */ bool_t mmcConnect(MMCDriver *mmcp) { unsigned i; + uint8_t r3[4]; chDbgCheck(mmcp != NULL, "mmcConnect"); @@ -466,7 +467,6 @@ bool_t mmcConnect(MMCDriver *mmcp) { addresses if possible. This method is based on "How to support SDC Ver2 and high capacity cards" by ElmChan.*/ - uint8_t r3[4]; if (send_command_R3(mmcp, MMCSD_CMD_SEND_IF_COND, MMCSD_CMD8_PATTERN, r3) != 0x05) { diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index cee9049fd..c8dcbf18f 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -443,13 +443,14 @@ bool_t sdcWrite(SDCDriver *sdcp, uint32_t startblk, * @api */ sdcflags_t sdcGetAndClearErrors(SDCDriver *sdcp) { + sdcflags_t flags; chDbgCheck(sdcp != NULL, "sdcGetAndClearErrors"); chDbgAssert(sdcp->state == BLK_READY, "sdcGetAndClearErrors(), #1", "invalid state"); chSysLock(); - sdcflags_t flags = sdcp->errors; + flags = sdcp->errors; sdcp->errors = SDC_NO_ERROR; chSysUnlock(); return flags; -- cgit v1.2.3