git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5297 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
99bd11676f
commit
4149bab2ca
|
@ -253,7 +253,7 @@ static void cmd_tree(BaseSequentialStream *chp, int argc, char *argv[]) {
|
||||||
chprintf(chp,
|
chprintf(chp,
|
||||||
"FS: %lu free clusters, %lu sectors per cluster, %lu bytes free\r\n",
|
"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,
|
||||||
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;
|
fbuff[0] = 0;
|
||||||
scan_files(chp, (char *)fbuff);
|
scan_files(chp, (char *)fbuff);
|
||||||
}
|
}
|
||||||
|
|
|
@ -245,7 +245,7 @@ static void cmd_tree(BaseSequentialStream *chp, int argc, char *argv[]) {
|
||||||
chprintf(chp,
|
chprintf(chp,
|
||||||
"FS: %lu free clusters, %lu sectors per cluster, %lu bytes free\r\n",
|
"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,
|
||||||
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;
|
fbuff[0] = 0;
|
||||||
scan_files(chp, (char *)fbuff);
|
scan_files(chp, (char *)fbuff);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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/icu_lld.c \
|
||||||
${CHIBIOS}/os/hal/platforms/STM32/mac_lld.c \
|
${CHIBIOS}/os/hal/platforms/STM32/mac_lld.c \
|
||||||
${CHIBIOS}/os/hal/platforms/STM32/pwm_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/sdc_lld.c \
|
||||||
${CHIBIOS}/os/hal/platforms/STM32/GPIOv1/pal_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/I2Cv1/i2c_lld.c \
|
||||||
${CHIBIOS}/os/hal/platforms/STM32/RTCv1/rtc_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/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/USARTv1/uart_lld.c \
|
||||||
${CHIBIOS}/os/hal/platforms/STM32/OTGv1/usb_lld.c
|
${CHIBIOS}/os/hal/platforms/STM32/OTGv1/usb_lld.c
|
||||||
|
|
||||||
|
|
|
@ -559,6 +559,7 @@ bool_t mmcDisconnect(MMCDriver *mmcp) {
|
||||||
chSysUnlock();
|
chSysUnlock();
|
||||||
|
|
||||||
/* Wait for the pending write operations to complete.*/
|
/* Wait for the pending write operations to complete.*/
|
||||||
|
spiStart(mmcp->config->spip, mmcp->config->hscfg);
|
||||||
sync(mmcp);
|
sync(mmcp);
|
||||||
|
|
||||||
spiStop(mmcp->config->spip);
|
spiStop(mmcp->config->spip);
|
||||||
|
@ -787,6 +788,7 @@ bool_t mmcSync(MMCDriver *mmcp) {
|
||||||
if (mmcp->state != BLK_READY)
|
if (mmcp->state != BLK_READY)
|
||||||
return CH_FAILED;
|
return CH_FAILED;
|
||||||
|
|
||||||
|
spiStart(mmcp->config->spip, mmcp->config->hscfg);
|
||||||
sync(mmcp);
|
sync(mmcp);
|
||||||
return CH_SUCCESS;
|
return CH_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,7 @@ DRESULT disk_read (
|
||||||
while (count > 0) {
|
while (count > 0) {
|
||||||
if (mmcSequentialRead(&MMCD1, buff))
|
if (mmcSequentialRead(&MMCD1, buff))
|
||||||
return RES_ERROR;
|
return RES_ERROR;
|
||||||
buff += MMC_SECTOR_SIZE;
|
buff += MMCSD_BLOCK_SIZE;
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
if (mmcStopSequentialRead(&MMCD1))
|
if (mmcStopSequentialRead(&MMCD1))
|
||||||
|
@ -168,7 +168,7 @@ DRESULT disk_write (
|
||||||
while (count > 0) {
|
while (count > 0) {
|
||||||
if (mmcSequentialWrite(&MMCD1, buff))
|
if (mmcSequentialWrite(&MMCD1, buff))
|
||||||
return RES_ERROR;
|
return RES_ERROR;
|
||||||
buff += MMC_SECTOR_SIZE;
|
buff += MMCSD_BLOCK_SIZE;
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
if (mmcStopSequentialWrite(&MMCD1))
|
if (mmcStopSequentialWrite(&MMCD1))
|
||||||
|
@ -205,7 +205,7 @@ DRESULT disk_ioctl (
|
||||||
case CTRL_SYNC:
|
case CTRL_SYNC:
|
||||||
return RES_OK;
|
return RES_OK;
|
||||||
case GET_SECTOR_SIZE:
|
case GET_SECTOR_SIZE:
|
||||||
*((WORD *)buff) = MMC_SECTOR_SIZE;
|
*((WORD *)buff) = MMCSD_BLOCK_SIZE;
|
||||||
return RES_OK;
|
return RES_OK;
|
||||||
#if _USE_ERASE
|
#if _USE_ERASE
|
||||||
case CTRL_ERASE_SECTOR:
|
case CTRL_ERASE_SECTOR:
|
||||||
|
|
Loading…
Reference in New Issue