C++ refactoring (#91)

This commit is contained in:
Ken Van Hoeylandt
2024-11-26 17:51:05 +01:00
committed by GitHub
parent d06137ba76
commit ca5d4b8226
159 changed files with 904 additions and 1086 deletions
@@ -0,0 +1,35 @@
#pragma once
#include "TactilityCore.h"
namespace tt::hal::sdcard {
#define TT_SDCARD_MOUNT_POINT "/sdcard"
typedef void* (*Mount)(const char* mount_path);
typedef void (*Unmount)(void* context);
typedef bool (*IsMounted)(void* context);
typedef enum {
StateMounted,
StateUnmounted,
StateError,
} State;
typedef enum {
MountBehaviourAtBoot, /** Only mount at boot */
MountBehaviourAnytime /** Mount/dismount any time */
} MountBehaviour;
typedef struct {
Mount mount;
Unmount unmount;
IsMounted is_mounted;
MountBehaviour mount_behaviour;
} SdCard;
bool mount(const SdCard* sdcard);
State getState();
bool unmount(uint32_t timeout_ticks);
} // namespace