mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-05 15:17:37 +03:00
## Summary * **What is the goal of this PR?** (e.g., Implements the new feature for file uploading.) - Allows back button to be held to escape boot loops when reader activity crashes and device attempts to boot to previous state - Reduces the need of removing SD card and access to another device to delete the `/.crosspoint/state.bin` * **What changes are included?** - Back button can be held while booting to boot to home screen - Update of User Guide section to include this feature ## Additional Context * Add any other information that might be helpful for the reviewer (e.g., performance implications, potential risks, specific areas to focus on). --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**NO**_ --------- Co-authored-by: Arthur Tazhitdinov <lisnake@gmail.com>
25 lines
495 B
C++
25 lines
495 B
C++
#pragma once
|
|
#include <iosfwd>
|
|
#include <string>
|
|
|
|
class CrossPointState {
|
|
// Static instance
|
|
static CrossPointState instance;
|
|
|
|
public:
|
|
std::string openEpubPath;
|
|
uint8_t lastSleepImage;
|
|
uint8_t readerActivityLoadCount = 0;
|
|
~CrossPointState() = default;
|
|
|
|
// Get singleton instance
|
|
static CrossPointState& getInstance() { return instance; }
|
|
|
|
bool saveToFile() const;
|
|
|
|
bool loadFromFile();
|
|
};
|
|
|
|
// Helper macro to access settings
|
|
#define APP_STATE CrossPointState::getInstance()
|