git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5297 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2013-02-22 10:34:57 +00:00
parent 99bd11676f
commit 4149bab2ca
5 changed files with 8 additions and 6 deletions

View File

@ -253,7 +253,7 @@ static void cmd_tree(BaseSequentialStream *chp, int argc, char *argv[]) {
chprintf(chp,
"FS: %lu free clusters, %lu sectors per cluster, %lu bytes free\r\n",
clusters, (uint32_t)MMC_FS.csize,
clusters * (uint32_t)MMC_FS.csize * (uint32_t)MMC_SECTOR_SIZE);
clusters * (uint32_t)MMC_FS.csize * (uint32_t)MMCSD_BLOCK_SIZE);
fbuff[0] = 0;
scan_files(chp, (char *)fbuff);
}

View File

@ -245,7 +245,7 @@ static void cmd_tree(BaseSequentialStream *chp, int argc, char *argv[]) {
chprintf(chp,
"FS: %lu free clusters, %lu sectors per cluster, %lu bytes free\r\n",
clusters, (uint32_t)MMC_FS.csize,
clusters * (uint32_t)MMC_FS.csize * (uint32_t)MMC_SECTOR_SIZE);
clusters * (uint32_t)MMC_FS.csize * (uint32_t)MMCSD_BLOCK_SIZE);
fbuff[0] = 0;
scan_files(chp, (char *)fbuff);
}

View File

@ -9,12 +9,12 @@ PLATFORMSRC = ${CHIBIOS}/os/hal/platforms/STM32F1xx/stm32_dma.c \
${CHIBIOS}/os/hal/platforms/STM32/icu_lld.c \
${CHIBIOS}/os/hal/platforms/STM32/mac_lld.c \
${CHIBIOS}/os/hal/platforms/STM32/pwm_lld.c \
${CHIBIOS}/os/hal/platforms/STM32/serial_lld.c \
${CHIBIOS}/os/hal/platforms/STM32/sdc_lld.c \
${CHIBIOS}/os/hal/platforms/STM32/GPIOv1/pal_lld.c \
${CHIBIOS}/os/hal/platforms/STM32/I2Cv1/i2c_lld.c \
${CHIBIOS}/os/hal/platforms/STM32/RTCv1/rtc_lld.c \
${CHIBIOS}/os/hal/platforms/STM32/SPIv1/spi_lld.c \
${CHIBIOS}/os/hal/platforms/STM32/USARTv1/serial_lld.c \
${CHIBIOS}/os/hal/platforms/STM32/USARTv1/uart_lld.c \
${CHIBIOS}/os/hal/platforms/STM32/OTGv1/usb_lld.c

View File

@ -559,6 +559,7 @@ bool_t mmcDisconnect(MMCDriver *mmcp) {
chSysUnlock();
/* Wait for the pending write operations to complete.*/
spiStart(mmcp->config->spip, mmcp->config->hscfg);
sync(mmcp);
spiStop(mmcp->config->spip);
@ -787,6 +788,7 @@ bool_t mmcSync(MMCDriver *mmcp) {
if (mmcp->state != BLK_READY)
return CH_FAILED;
spiStart(mmcp->config->spip, mmcp->config->hscfg);
sync(mmcp);
return CH_SUCCESS;
}

View File

@ -125,7 +125,7 @@ DRESULT disk_read (
while (count > 0) {
if (mmcSequentialRead(&MMCD1, buff))
return RES_ERROR;
buff += MMC_SECTOR_SIZE;
buff += MMCSD_BLOCK_SIZE;
count--;
}
if (mmcStopSequentialRead(&MMCD1))
@ -168,7 +168,7 @@ DRESULT disk_write (
while (count > 0) {
if (mmcSequentialWrite(&MMCD1, buff))
return RES_ERROR;
buff += MMC_SECTOR_SIZE;
buff += MMCSD_BLOCK_SIZE;
count--;
}
if (mmcStopSequentialWrite(&MMCD1))
@ -205,7 +205,7 @@ DRESULT disk_ioctl (
case CTRL_SYNC:
return RES_OK;
case GET_SECTOR_SIZE:
*((WORD *)buff) = MMC_SECTOR_SIZE;
*((WORD *)buff) = MMCSD_BLOCK_SIZE;
return RES_OK;
#if _USE_ERASE
case CTRL_ERASE_SECTOR: