mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-06 15:47:39 +03:00
Some checks are pending
CI / build (push) Waiting to run
## 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
34 lines
1.1 KiB
C++
34 lines
1.1 KiB
C++
#pragma once
|
|
#include <freertos/FreeRTOS.h>
|
|
#include <freertos/semphr.h>
|
|
#include <freertos/task.h>
|
|
|
|
#include <functional>
|
|
|
|
#include "../Activity.h"
|
|
|
|
class HomeActivity final : public Activity {
|
|
TaskHandle_t displayTaskHandle = nullptr;
|
|
SemaphoreHandle_t renderingMutex = nullptr;
|
|
int selectorIndex = 0;
|
|
bool updateRequired = false;
|
|
const std::function<void()> onReaderOpen;
|
|
const std::function<void()> onSettingsOpen;
|
|
const std::function<void()> onFileTransferOpen;
|
|
|
|
static void taskTrampoline(void* param);
|
|
[[noreturn]] void displayTaskLoop();
|
|
void render() const;
|
|
|
|
public:
|
|
explicit HomeActivity(GfxRenderer& renderer, InputManager& inputManager, const std::function<void()>& onReaderOpen,
|
|
const std::function<void()>& onSettingsOpen, const std::function<void()>& onFileTransferOpen)
|
|
: Activity("Home", renderer, inputManager),
|
|
onReaderOpen(onReaderOpen),
|
|
onSettingsOpen(onSettingsOpen),
|
|
onFileTransferOpen(onFileTransferOpen) {}
|
|
void onEnter() override;
|
|
void onExit() override;
|
|
void loop() override;
|
|
};
|