- Rename `assets` and `config` partitions to `system` and `data` - Change partition type from `spiffs` to `fat`, so we can have sub-directories - Fix crash when doing WiFi scan: Increased system event task size to 3kB. - Free up IRAM on ESP32 (it was required for the Core2, but I also freed up the same amount for Yellow Board) - Introduced `Paths` objects that can be retrieved by `AppContext` and `ServiceContext`. Apps and services now have their own relative paths. Assets were re-arranged into the correct paths. - Rename simulator window title to "Tactility" - Refactored statusbar widget so it persists icon paths properly (it kept a const char* reference, but didn't copy it, so it crashed when the related std::string was destroyed) - Created `Partitions.h` to expose some useful variables - Moved USB config in various `sdkconfig` (it was part of the "default" section, but it shouldn't be) - Updated domain name
40 lines
891 B
C++
40 lines
891 B
C++
#pragma once
|
|
|
|
#include "TactilityCore.h"
|
|
|
|
namespace tt::hal {
|
|
|
|
#define TT_SDCARD_MOUNT_NAME "sdcard"
|
|
#define TT_SDCARD_MOUNT_POINT "/sdcard"
|
|
|
|
class SdCard {
|
|
public:
|
|
enum State {
|
|
StateMounted,
|
|
StateUnmounted,
|
|
StateError,
|
|
StateUnknown
|
|
};
|
|
|
|
enum MountBehaviour {
|
|
MountBehaviourAtBoot, /** Only mount at boot */
|
|
MountBehaviourAnytime /** Mount/dismount any time */
|
|
};
|
|
|
|
private:
|
|
MountBehaviour mountBehaviour;
|
|
|
|
public:
|
|
explicit SdCard(MountBehaviour mountBehaviour) : mountBehaviour(mountBehaviour) {}
|
|
virtual ~SdCard() = default;
|
|
|
|
virtual bool mount(const char* mountPath) = 0;
|
|
virtual bool unmount() = 0;
|
|
virtual State getState() const = 0;
|
|
|
|
virtual MountBehaviour getMountBehaviour() const { return mountBehaviour; }
|
|
bool isMounted() const { return getState() == StateMounted; }
|
|
};
|
|
|
|
} // namespace
|