mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-15 06:17:47 +00:00
Use SD card as store&forward memory
This commit is contained in:
@@ -9,6 +9,10 @@
|
||||
#include <functional>
|
||||
#include <unordered_map>
|
||||
|
||||
#ifdef HAS_SDCARD
|
||||
#include <SD.h>
|
||||
#endif
|
||||
|
||||
struct PacketHistoryStruct {
|
||||
uint32_t time;
|
||||
uint32_t to;
|
||||
@@ -18,6 +22,9 @@ struct PacketHistoryStruct {
|
||||
pb_size_t payload_size;
|
||||
};
|
||||
|
||||
// enum for the storage type
|
||||
enum StorageType { PSRAM, SDCARD };
|
||||
|
||||
class StoreForwardModule : private concurrency::OSThread, public ProtobufModule<meshtastic_StoreAndForward>
|
||||
{
|
||||
bool busy = 0;
|
||||
@@ -80,6 +87,10 @@ class StoreForwardModule : private concurrency::OSThread, public ProtobufModule<
|
||||
|
||||
private:
|
||||
void populatePSRAM();
|
||||
void populateSDCard();
|
||||
|
||||
// Storage Type
|
||||
StorageType storageType = PSRAM;
|
||||
|
||||
// S&F Defaults
|
||||
uint32_t historyReturnMax = 25; // Return maximum of 25 records by default.
|
||||
|
||||
Reference in New Issue
Block a user