SD card improvements (#214)
- Implement SD card locking logic and helper functions - Fix issue with running ELF apps from SD card: this would crash when launched from the AppList - Reduce Boot app wait time to 1 second - Speed up boot by about 0.1 second by moving app&service registration to the Boot app - Files app now uses proper SD card mount point name (and multiple SD cards) - Removed `TT_SCREENSHOT_MODE`
This commit is contained in:
committed by
GitHub
parent
fd1e31dec4
commit
a7a3b17ff6
@@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/hal/SdCard.h>
|
||||
#include <Tactility/Mutex.h>
|
||||
#include <memory>
|
||||
|
||||
using namespace tt::hal;
|
||||
|
||||
@@ -9,26 +11,35 @@ class SimulatorSdCard final : public SdCard {
|
||||
private:
|
||||
|
||||
State state;
|
||||
std::shared_ptr<tt::Lockable> lockable;
|
||||
std::string mountPath;
|
||||
|
||||
public:
|
||||
|
||||
SimulatorSdCard() : SdCard(MountBehaviour::AtBoot), state(State::Unmounted) {}
|
||||
SimulatorSdCard() : SdCard(MountBehaviour::AtBoot),
|
||||
state(State::Unmounted),
|
||||
lockable(std::make_shared<tt::Mutex>())
|
||||
{}
|
||||
|
||||
std::string getName() const final { return "Mock SD Card"; }
|
||||
std::string getDescription() const final { return ""; }
|
||||
|
||||
bool mount(const char* mountPath) override {
|
||||
bool mount(const std::string& newMountPath) final {
|
||||
state = State::Mounted;
|
||||
mountPath = newMountPath;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool unmount() override {
|
||||
state = State::Unmounted;
|
||||
mountPath = "";
|
||||
return true;
|
||||
}
|
||||
|
||||
State getState() const override {
|
||||
return state;
|
||||
}
|
||||
std::string getMountPath() const final { return mountPath; };
|
||||
|
||||
std::shared_ptr<tt::Lockable> getLockable() const final { return lockable; }
|
||||
|
||||
State getState() const override { return state; }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user