v1.14.0 #304

Merged
muellerr merged 366 commits from develop into main 2022-10-10 17:46:38 +02:00
5 changed files with 15 additions and 10 deletions
Showing only changes of commit 31b3de784b - Show all commits

View File

@ -384,6 +384,7 @@ ReturnValue_t CoreController::sdStateMachine() {
if (nonBlockingOpChecking(SdStates::DETERMINE_OTHER, 5, "Mounting SD card")) { if (nonBlockingOpChecking(SdStates::DETERMINE_OTHER, 5, "Mounting SD card")) {
sdInfo.prefState = sd::SdState::MOUNTED; sdInfo.prefState = sd::SdState::MOUNTED;
currentStateSetter(sdInfo.pref, sd::SdState::MOUNTED); currentStateSetter(sdInfo.pref, sd::SdState::MOUNTED);
sdcMan->setActiveSdCard(sdInfo.pref);
} }
} }
} }

View File

@ -412,13 +412,9 @@ ReturnValue_t SdCardManager::updateSdCardStateFile() {
return result; return result;
} }
std::string SdCardManager::getCurrentMountPrefix() const { const std::string& SdCardManager::getCurrentMountPrefix() const {
MutexGuard mg(mutex); MutexGuard mg(mutex);
if (sdInfo.active == sd::SdCard::SLOT_0) { return currentPrefix;
return SD_0_MOUNT_POINT;
} else {
return SD_1_MOUNT_POINT;
}
} }
SdCardManager::OpStatus SdCardManager::checkCurrentOp(Operations& currentOp) { SdCardManager::OpStatus SdCardManager::checkCurrentOp(Operations& currentOp) {
@ -552,6 +548,14 @@ ReturnValue_t SdCardManager::performFsck(sd::SdCard sdcard, bool printOutput, in
return result; return result;
} }
void SdCardManager::setActiveSdCard(sd::SdCard sdCard) { sdInfo.active = sdCard; } void SdCardManager::setActiveSdCard(sd::SdCard sdCard) {
sdInfo.active = sdCard;
MutexGuard mg(mutex);
if (sdInfo.active == sd::SdCard::SLOT_0) {
currentPrefix = SD_0_MOUNT_POINT;
} else {
currentPrefix = SD_1_MOUNT_POINT;
}
}
sd::SdCard SdCardManager::getActiveSdCard() const { return sdInfo.active; } sd::SdCard SdCardManager::getActiveSdCard() const { return sdInfo.active; }

View File

@ -188,7 +188,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
* @param prefSdCardPtr * @param prefSdCardPtr
* @return * @return
*/ */
std::string getCurrentMountPrefix() const override; const std::string& getCurrentMountPrefix() const override;
OpStatus checkCurrentOp(Operations& currentOp); OpStatus checkCurrentOp(Operations& currentOp);

2
fsfw

@ -1 +1 @@
Subproject commit cfca27542a3cabf58f9b7cab238c89ab9ad9beea Subproject commit cf8fe7ea728bea077b9936bcf0db96845bc6419e

View File

@ -8,7 +8,7 @@
class SdCardMountedIF { class SdCardMountedIF {
public: public:
virtual ~SdCardMountedIF(){}; virtual ~SdCardMountedIF(){};
virtual std::string getCurrentMountPrefix() const = 0; virtual const std::string& getCurrentMountPrefix() const = 0;
virtual bool isSdCardMounted(sd::SdCard sdCard) = 0; virtual bool isSdCardMounted(sd::SdCard sdCard) = 0;
virtual sd::SdCard getPreferredSdCard() const = 0; virtual sd::SdCard getPreferredSdCard() const = 0;
virtual void setActiveSdCard(sd::SdCard sdCard) = 0; virtual void setActiveSdCard(sd::SdCard sdCard) = 0;