Fixed:sd card format bug.
This commit is contained in:
parent
cb5c52bae8
commit
a56fc1dcdc
|
@ -65,6 +65,12 @@ StatusCode SdCardHal::GetCapacity(unsigned long long &totalSizeMB, unsigned long
|
||||||
LogInfo("Used size: %llu MB\n", usedSizeMB);
|
LogInfo("Used size: %llu MB\n", usedSizeMB);
|
||||||
return CreateStatusCode(STATUS_CODE_OK);
|
return CreateStatusCode(STATUS_CODE_OK);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @brief To format an SD card, you normally need to unmount the SD card before formatting it. However, when the SD card
|
||||||
|
* is abnormal (usually it cannot be mounted or unmounted), you still need to execute the format command operation,
|
||||||
|
* because some cards can be restored to normal by formatting when they are abnormal.
|
||||||
|
* @return StatusCode
|
||||||
|
*/
|
||||||
StatusCode SdCardHal::FormatSDCard(void)
|
StatusCode SdCardHal::FormatSDCard(void)
|
||||||
{
|
{
|
||||||
UnInit();
|
UnInit();
|
||||||
|
@ -221,7 +227,7 @@ void SdCardHal::UnmountSdCard(void)
|
||||||
* card node to be occupied and cannot be loaded. To find problems and optimize them, it is especially important to
|
* card node to be occupied and cannot be loaded. To find problems and optimize them, it is especially important to
|
||||||
* check whether there are any omissions.
|
* check whether there are any omissions.
|
||||||
*/
|
*/
|
||||||
sprintf(command, "umount -fl %s", SD_CARD_MOUNT_PATH);
|
sprintf(command, "umount -fl %s", SD_CARD_DEVICE);
|
||||||
int ret = fx_system(command);
|
int ret = fx_system(command);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
LogError("Format sd card failed [%s].\n", SD_CARD_DEVICE);
|
LogError("Format sd card failed [%s].\n", SD_CARD_DEVICE);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user