24 lines
640 B
C
24 lines
640 B
C
|
#include <optional>
|
||
|
|
||
|
#include "bsp_q7s/fs/SdCardManager.h"
|
||
|
#include "mission/acs/str/strHelpers.h"
|
||
|
|
||
|
class StrConfigPathGetter : public startracker::SdCardConfigPathGetter {
|
||
|
public:
|
||
|
StrConfigPathGetter(SdCardManager& sdcMan) : sdcMan(sdcMan) {}
|
||
|
|
||
|
std::optional<std::string> getCfgPath() override {
|
||
|
if (!sdcMan.isSdCardUsable(std::nullopt)) {
|
||
|
return std::nullopt;
|
||
|
}
|
||
|
if (sdcMan.getActiveSdCard() == sd::SdCard::SLOT_1) {
|
||
|
return std::string("/mnt/sd1/startracker/flight-config.json");
|
||
|
} else {
|
||
|
return std::string("/mnt/sd0/startracker/flight-config.json");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private:
|
||
|
SdCardManager& sdcMan;
|
||
|
};
|