always update sd state file in blocking manner
This commit is contained in:
@ -405,14 +405,14 @@ ReturnValue_t SdCardManager::setPreferredSdCard(sd::SdCard sdCard) {
|
||||
return scratch::writeNumber(scratch::PREFERED_SDC_KEY, static_cast<uint8_t>(sdCard));
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::updateSdCardStateFile(bool blocking) {
|
||||
ReturnValue_t SdCardManager::updateSdCardStateFile() {
|
||||
if (cmdExecutor.getCurrentState() == CommandExecutor::States::PENDING) {
|
||||
return CommandExecutor::COMMAND_PENDING;
|
||||
}
|
||||
MutexGuard mg(sdLock, LOCK_TYPE, SD_LOCK_TIMEOUT, LOCK_CTX);
|
||||
// Use q7hw utility and pipe the command output into the state file
|
||||
std::string updateCmd = "q7hw sd info all > " + std::string(SD_STATE_FILE);
|
||||
cmdExecutor.load(updateCmd, blocking, printCmdOutput);
|
||||
cmdExecutor.load(updateCmd, true, printCmdOutput);
|
||||
ReturnValue_t result = cmdExecutor.execute();
|
||||
if (blocking and result != returnvalue::OK) {
|
||||
utility::handleSystemError(cmdExecutor.getLastError(), "SdCardManager::mountSdCard");
|
||||
|
@ -125,7 +125,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
* - CommandExecutor::COMMAND_PENDING: Non-blocking command is pending
|
||||
* - returnvalue::FAILED: blocking command failed
|
||||
*/
|
||||
ReturnValue_t updateSdCardStateFile(bool blocking);
|
||||
ReturnValue_t updateSdCardStateFile();
|
||||
|
||||
/**
|
||||
* Get the state of the SD cards. If the state file does not exist, this function will
|
||||
|
Reference in New Issue
Block a user