btclock_v3/src/lib/screen_handler.hpp

54 lines
1.1 KiB
C++
Raw Normal View History

2023-11-07 00:11:12 +00:00
#pragma once
2023-11-07 20:26:15 +00:00
#include <esp_timer.h>
2023-11-07 00:11:12 +00:00
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
2023-11-30 21:56:50 +00:00
#include <data_handler.hpp>
2024-07-29 18:49:46 +00:00
#include <bitaxe_handler.hpp>
2023-11-30 21:56:50 +00:00
2023-11-07 00:11:12 +00:00
#include "lib/epd.hpp"
2023-11-30 21:38:01 +00:00
#include "lib/shared.hpp"
2023-11-07 00:11:12 +00:00
// extern TaskHandle_t priceUpdateTaskHandle;
// extern TaskHandle_t blockUpdateTaskHandle;
// extern TaskHandle_t timeUpdateTaskHandle;
extern TaskHandle_t workerTaskHandle;
2023-11-07 20:26:15 +00:00
extern TaskHandle_t taskScreenRotateTaskHandle;
extern QueueHandle_t workQueue;
2023-11-30 21:38:01 +00:00
typedef enum {
TASK_PRICE_UPDATE,
TASK_BLOCK_UPDATE,
TASK_FEE_UPDATE,
2024-07-29 18:49:46 +00:00
TASK_TIME_UPDATE,
TASK_BITAXE_UPDATE
} TaskType;
2023-11-30 21:38:01 +00:00
typedef struct {
TaskType type;
char data;
} WorkItem;
void workerTask(void *pvParameters);
2023-11-07 20:26:15 +00:00
uint getCurrentScreen();
void setCurrentScreen(uint newScreen);
2023-11-08 11:18:59 +00:00
void nextScreen();
void previousScreen();
void showSystemStatusScreen();
2023-11-07 20:26:15 +00:00
2023-11-07 00:11:12 +00:00
// void taskPriceUpdate(void *pvParameters);
// void taskBlockUpdate(void *pvParameters);
// void taskTimeUpdate(void *pvParameters);
2023-11-07 20:26:15 +00:00
void taskScreenRotate(void *pvParameters);
2023-11-07 00:11:12 +00:00
2023-11-07 20:26:15 +00:00
void setupTasks();
void setCurrentCurrency(char currency);
uint getCurrentCurrency();