Fixed some MISRA violations in new HAL code.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8077 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
75e5e62cd4
commit
0f949bff7e
|
@ -182,7 +182,7 @@ 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 sdcErase(SDCDriver *sdcp, 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
|
||||||
}
|
}
|
||||||
|
|
|
@ -235,7 +235,7 @@ void rtcConvertDateTimeToStructTm(const RTCDateTime *timespec,
|
||||||
timp->tm_hour = tmp / 3600;
|
timp->tm_hour = tmp / 3600;
|
||||||
|
|
||||||
if (NULL != tv_msec) {
|
if (NULL != tv_msec) {
|
||||||
*tv_msec = (uint32_t)timespec->millisecond % 1000;
|
*tv_msec = (uint32_t)timespec->millisecond % 1000U;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -325,7 +325,7 @@ static bool sdc_detect_bus_clk(SDCDriver *sdcp, sdcbusclk_t *clk) {
|
||||||
|
|
||||||
/* Looks like only "high capacity" cards produce meaningful results during
|
/* Looks like only "high capacity" cards produce meaningful results during
|
||||||
this clock detection procedure.*/
|
this clock detection procedure.*/
|
||||||
if (0 == _mmcsd_get_slice(sdcp->csd, MMCSD_CSD_10_CSD_STRUCTURE_SLICE)) {
|
if (0U == _mmcsd_get_slice(sdcp->csd, MMCSD_CSD_10_CSD_STRUCTURE_SLICE)) {
|
||||||
*clk = SDC_CLK_25MHz;
|
*clk = SDC_CLK_25MHz;
|
||||||
return HAL_SUCCESS;
|
return HAL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -956,12 +956,14 @@ bool sdcErase(SDCDriver *sdcp, uint32_t startblk, uint32_t endblk) {
|
||||||
sdcp->state = BLK_WRITING;
|
sdcp->state = BLK_WRITING;
|
||||||
|
|
||||||
/* Handling command differences between HC and normal cards.*/
|
/* Handling command differences between HC and normal cards.*/
|
||||||
if (!(sdcp->cardmode & SDC_MODE_HIGH_CAPACITY)) {
|
if ((sdcp->cardmode & SDC_MODE_HIGH_CAPACITY) != 0U) {
|
||||||
startblk *= MMCSD_BLOCK_SIZE;
|
startblk *= MMCSD_BLOCK_SIZE;
|
||||||
endblk *= MMCSD_BLOCK_SIZE;
|
endblk *= MMCSD_BLOCK_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_sdc_wait_for_transfer_state(sdcp);
|
if (_sdc_wait_for_transfer_state(sdcp)) {
|
||||||
|
goto failed;
|
||||||
|
}
|
||||||
|
|
||||||
if ((sdc_lld_send_cmd_short_crc(sdcp, MMCSD_CMD_ERASE_RW_BLK_START,
|
if ((sdc_lld_send_cmd_short_crc(sdcp, MMCSD_CMD_ERASE_RW_BLK_START,
|
||||||
startblk, resp) != HAL_SUCCESS) ||
|
startblk, resp) != HAL_SUCCESS) ||
|
||||||
|
@ -985,7 +987,9 @@ bool sdcErase(SDCDriver *sdcp, uint32_t startblk, uint32_t endblk) {
|
||||||
/* TODO: ??????????????????????????? */
|
/* TODO: ??????????????????????????? */
|
||||||
|
|
||||||
/* Wait for it to return to transfer state to indicate it has finished erasing */
|
/* Wait for it to return to transfer state to indicate it has finished erasing */
|
||||||
_sdc_wait_for_transfer_state(sdcp);
|
if (_sdc_wait_for_transfer_state(sdcp)) {
|
||||||
|
goto failed;
|
||||||
|
}
|
||||||
|
|
||||||
sdcp->state = BLK_READY;
|
sdcp->state = BLK_READY;
|
||||||
return HAL_SUCCESS;
|
return HAL_SUCCESS;
|
||||||
|
|
Loading…
Reference in New Issue