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-12 12:29:52 +00:00
|
|
|
#include "price_fetch.hpp"
|
2023-11-10 18:52:06 +00:00
|
|
|
#include "shared.hpp"
|
2023-11-07 00:11:12 +00:00
|
|
|
#include "lib/epd.hpp"
|
|
|
|
|
2023-11-12 11:38:28 +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;
|
|
|
|
|
2023-11-10 22:18:14 +00:00
|
|
|
extern esp_timer_handle_t screenRotateTimer;
|
|
|
|
extern esp_timer_handle_t minuteTimer;
|
|
|
|
|
2023-11-12 11:38:28 +00:00
|
|
|
extern QueueHandle_t workQueue;
|
2023-11-10 22:18:14 +00:00
|
|
|
|
2023-11-12 11:38:28 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
TASK_PRICE_UPDATE,
|
|
|
|
TASK_BLOCK_UPDATE,
|
|
|
|
TASK_TIME_UPDATE
|
|
|
|
} TaskType;
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
void setupTimeUpdateTimer(void *pvParameters);
|
|
|
|
void setupScreenRotateTimer(void *pvParameters);
|
|
|
|
|
|
|
|
void IRAM_ATTR minuteTimerISR(void* arg);
|
|
|
|
void IRAM_ATTR screenRotateTimerISR(void* arg);
|
2023-11-07 00:11:12 +00:00
|
|
|
|
2023-11-12 11:38:28 +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);
|
|
|
|
|
|
|
|
uint getTimerSeconds();
|
|
|
|
bool isTimerActive();
|
|
|
|
void setTimerActive(bool status);
|
2023-11-08 11:18:59 +00:00
|
|
|
void toggleTimerActive();
|
2023-11-07 00:11:12 +00:00
|
|
|
|
2023-11-07 20:26:15 +00:00
|
|
|
void setupTasks();
|