mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-24 10:19:19 +00:00

* chore: todo.txt * chore: comments * fix: no fast refresh on VME290 Reverts a line of code which was accidentally committed * refactor: god class Divide the behavior from the old WindowManager class into several subclasses which each have a clear role. * refactor: cppcheck medium warnings Enough to pass github CI for now * refactor: updateType selection * refactor: don't use a setter for the shared AppletFonts * fix: update prioritization forceUpdate calls weren't being prioritized * refactor: remove unhelpful logging getTimeString is used for parsing our own time, but also the timestamps of messages. The "one time only" log printing will likely fire in unhelpful situations. * fix: " " * refactor: get rid of types.h file for enums * Keep that sneaky todo file out of commits
48 lines
874 B
C++
48 lines
874 B
C++
#ifdef MESHTASTIC_INCLUDE_INKHUD
|
|
|
|
/*
|
|
|
|
We hold a few recent messages, for features like the threaded message applet.
|
|
This class contains a struct for storing those messages,
|
|
and methods for serializing them to flash.
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "configuration.h"
|
|
|
|
#include <deque>
|
|
|
|
#include "mesh/MeshTypes.h"
|
|
|
|
namespace NicheGraphics::InkHUD
|
|
{
|
|
|
|
class MessageStore
|
|
{
|
|
public:
|
|
// A stored message
|
|
struct Message {
|
|
uint32_t timestamp; // Epoch seconds
|
|
NodeNum sender = 0;
|
|
uint8_t channelIndex;
|
|
std::string text;
|
|
};
|
|
|
|
MessageStore() = delete;
|
|
explicit MessageStore(std::string label); // Label determines filename in flash
|
|
|
|
void saveToFlash();
|
|
void loadFromFlash();
|
|
|
|
std::deque<Message> messages; // Interact with this object!
|
|
|
|
private:
|
|
std::string filename;
|
|
};
|
|
|
|
} // namespace NicheGraphics::InkHUD
|
|
|
|
#endif
|