This commit is contained in:
@ -386,16 +386,21 @@ SdCardManager::OpStatus SdCardManager::checkCurrentOp(Operations ¤tOp) {
|
||||
currentOp = this->currentOp;
|
||||
bool bytesRead = false;
|
||||
|
||||
#if OBSW_ENABLE_TIMERS == 1
|
||||
Timer timer;
|
||||
timer.setTimer(200);
|
||||
timer.setTimer(100);
|
||||
uint32_t remainingTimeMs = 0;
|
||||
#endif
|
||||
while(true) {
|
||||
ReturnValue_t result = cmdExecutor.check(bytesRead);
|
||||
// This timer can prevent deadlocks due to missconfigurations
|
||||
#if OBSW_ENABLE_TIMERS == 1
|
||||
timer.getTimer(&remainingTimeMs);
|
||||
if(remainingTimeMs == 0) {
|
||||
sif::error << "SdCardManager::checkCurrentOp: Timeout!" << std::endl;
|
||||
return OpStatus::FAIL;
|
||||
}
|
||||
#endif
|
||||
switch(result) {
|
||||
case(CommandExecutor::BYTES_READ): {
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user