SDIO. Deleted unused erase function.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7693 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Uladzimir Pylinski 2015-02-19 15:26:42 +00:00
parent 7c1422770e
commit 39592bc15c
2 changed files with 0 additions and 60 deletions

View File

@ -168,7 +168,6 @@ extern "C" {
sdcflags_t sdcGetAndClearErrors(SDCDriver *sdcp); sdcflags_t sdcGetAndClearErrors(SDCDriver *sdcp);
bool sdcSync(SDCDriver *sdcp); bool sdcSync(SDCDriver *sdcp);
bool sdcGetInfo(SDCDriver *sdcp, BlockDeviceInfo *bdip); bool sdcGetInfo(SDCDriver *sdcp, BlockDeviceInfo *bdip);
bool sdcErase(SDCDriver *mmcp, uint32_t startblk, uint32_t endblk);
bool _sdc_wait_for_transfer_state(SDCDriver *sdcp); bool _sdc_wait_for_transfer_state(SDCDriver *sdcp);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -857,65 +857,6 @@ bool sdcGetInfo(SDCDriver *sdcp, BlockDeviceInfo *bdip) {
return HAL_SUCCESS; return HAL_SUCCESS;
} }
/**
* @brief Erases the supplied blocks.
*
* @param[in] sdcp pointer to the @p SDCDriver object
* @param[in] startblk starting block number
* @param[in] endblk ending block number
*
* @return The operation status.
* @retval HAL_SUCCESS the operation succeeded.
* @retval HAL_FAILED the operation failed.
*
* @api
*/
bool sdcErase(SDCDriver *sdcp, uint32_t startblk, uint32_t endblk) {
uint32_t resp[1];
osalDbgCheck((sdcp != NULL));
osalDbgAssert(sdcp->state == BLK_READY, "invalid state");
/* Erase operation in progress.*/
sdcp->state = BLK_WRITING;
/* Handling command differences between HC and normal cards.*/
if (!(sdcp->cardmode & SDC_MODE_HIGH_CAPACITY)) {
startblk *= MMCSD_BLOCK_SIZE;
endblk *= MMCSD_BLOCK_SIZE;
}
_sdc_wait_for_transfer_state(sdcp);
if ((sdc_lld_send_cmd_short_crc(sdcp, MMCSD_CMD_ERASE_RW_BLK_START,
startblk, resp) != HAL_SUCCESS) ||
MMCSD_R1_ERROR(resp[0]))
goto failed;
if ((sdc_lld_send_cmd_short_crc(sdcp, MMCSD_CMD_ERASE_RW_BLK_END,
endblk, resp) != HAL_SUCCESS) ||
MMCSD_R1_ERROR(resp[0]))
goto failed;
if ((sdc_lld_send_cmd_short_crc(sdcp, MMCSD_CMD_ERASE,
0, resp) != HAL_SUCCESS) ||
MMCSD_R1_ERROR(resp[0]))
goto failed;
/* Quick sleep to allow it to transition to programming or receiving state */
/* TODO: ??????????????????????????? */
/* Wait for it to return to transfer state to indicate it has finished erasing */
_sdc_wait_for_transfer_state(sdcp);
sdcp->state = BLK_READY;
return HAL_SUCCESS;
failed:
sdcp->state = BLK_READY;
return HAL_FAILED;
}
#endif /* HAL_USE_SDC */ #endif /* HAL_USE_SDC */
/** @} */ /** @} */