Give activities names and log when entering and exiting them (#92)

## Summary

* Give activities name and log when entering and exiting them
* Clearer logs when attempting to debug, knowing where users are coming
from/going to helps
This commit is contained in:
Dave Allie
2025-12-21 21:17:00 +11:00
committed by GitHub
parent 246afae6ef
commit 77c655fcf5
27 changed files with 123 additions and 104 deletions

View File

@@ -5,14 +5,13 @@
#include <freertos/semphr.h>
#include <freertos/task.h>
#include "../Activity.h"
#include "activities/ActivityWithSubactivity.h"
class EpubReaderActivity final : public Activity {
class EpubReaderActivity final : public ActivityWithSubactivity {
std::shared_ptr<Epub> epub;
std::unique_ptr<Section> section = nullptr;
TaskHandle_t displayTaskHandle = nullptr;
SemaphoreHandle_t renderingMutex = nullptr;
std::unique_ptr<Activity> subAcitivity = nullptr;
int currentSpineIndex = 0;
int nextPageNumber = 0;
int pagesUntilFullRefresh = 0;
@@ -28,7 +27,7 @@ class EpubReaderActivity final : public Activity {
public:
explicit EpubReaderActivity(GfxRenderer& renderer, InputManager& inputManager, std::unique_ptr<Epub> epub,
const std::function<void()>& onGoBack)
: Activity(renderer, inputManager), epub(std::move(epub)), onGoBack(onGoBack) {}
: ActivityWithSubactivity("EpubReader", renderer, inputManager), epub(std::move(epub)), onGoBack(onGoBack) {}
void onEnter() override;
void onExit() override;
void loop() override;