Files
crosspoint-reader-mod/src/activities/Activity.h
Arthur Tazhitdinov 1caad578fc feat: wakeup target detection (#731)
## Summary

* If going to sleep was from the Reader view, wake up to the same book.
Otherwise, wakeup to the Home view
2026-02-09 05:01:30 +11:00

28 lines
851 B
C++

#pragma once
#include <HardwareSerial.h>
#include <string>
#include <utility>
class MappedInputManager;
class GfxRenderer;
class Activity {
protected:
std::string name;
GfxRenderer& renderer;
MappedInputManager& mappedInput;
public:
explicit Activity(std::string name, GfxRenderer& renderer, MappedInputManager& mappedInput)
: name(std::move(name)), renderer(renderer), mappedInput(mappedInput) {}
virtual ~Activity() = default;
virtual void onEnter() { Serial.printf("[%lu] [ACT] Entering activity: %s\n", millis(), name.c_str()); }
virtual void onExit() { Serial.printf("[%lu] [ACT] Exiting activity: %s\n", millis(), name.c_str()); }
virtual void loop() {}
virtual bool skipLoopDelay() { return false; }
virtual bool preventAutoSleep() { return false; }
virtual bool isReaderActivity() const { return false; }
};