str image loader wip

This commit is contained in:
Jakob Meier
2021-11-30 16:01:02 +01:00
parent 1affc1e1d3
commit 8c649b3e70
9 changed files with 195 additions and 45 deletions

View File

@ -455,3 +455,33 @@ void SdCardManager::setPrintCommandOutput(bool print) {
}
bool SdCardManager::isSdCardMounted(sd::SdCard sdCard) {
SdCardManager::SdStatePair active;
ReturnValue_t result = sdcMan->getSdCardActiveStatus(active);
if (result != RETURN_OK) {
sif::debug << "SdCardManager::isSdCardMounted: Failed to get SD card active state";
return false;
}
if (sdCard == sd::SLOT_0) {
if (active.first == sd::MOUNTED) {
return true;
}
else {
return false;
}
}
else if (sdCard == sd::SLOT_1) {
if (active.second == sd::MOUNTED) {
return true;
}
else {
return false;
}
}
else {
sif::debug << "SdCardManager::isSdCardMounted: Unknown SD card specified" << std::endl;
}
return false;
}