- Added sdcard service: it updates a statusbar icon and it can auto-unmount sdcards that were physically ejected by the user. - Added `is_mounted` check for sdcard drivers - Refactored assets: moved them from `tactility-esp/` to `data/` - Made assets work with sim build - Refactored wifi statusbar icons - Refactored wifi_manage app access point icons - Support not having an initial image icon when registering a new icon in statusbars. When a statusbar icon is added, it is now visible/invisible depending on whether an image was specified. - Keep track of app memory on app start to find memory leaks (needs fine-tuning in the future) - `tt_init()` assigns `config_instance` earlier, so it can be used during service init
39 lines
835 B
C
39 lines
835 B
C
#pragma once
|
|
|
|
#include "tactility_core.h"
|
|
|
|
#define TT_SDCARD_MOUNT_POINT "/sdcard"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef void* (*SdcardMount)(const char* mount_path);
|
|
typedef void (*SdcardUnmount)(void* context);
|
|
typedef bool (*SdcardIsMounted)(void* context);
|
|
|
|
typedef enum {
|
|
SDCARD_STATE_MOUNTED,
|
|
SDCARD_STATE_UNMOUNTED,
|
|
SDCARD_STATE_ERROR,
|
|
} SdcardState;
|
|
|
|
typedef enum {
|
|
SDCARD_MOUNT_BEHAVIOUR_AT_BOOT, /** Only mount at boot */
|
|
SDCARD_MOUNT_BEHAVIOUR_ANYTIME /** Mount/dismount any time */
|
|
} SdcardMountBehaviour;
|
|
|
|
typedef struct {
|
|
SdcardMount mount;
|
|
SdcardUnmount unmount;
|
|
SdcardIsMounted is_mounted;
|
|
SdcardMountBehaviour mount_behaviour;
|
|
} SdCard;
|
|
|
|
bool tt_sdcard_mount(const SdCard* sdcard);
|
|
SdcardState tt_sdcard_get_state();
|
|
bool tt_sdcard_unmount();
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif |