btclock_v3/src/lib/screen_handler.hpp

40 lines
942 B
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>
#include "shared.hpp"
2023-11-07 00:11:12 +00:00
#include "lib/epd.hpp"
extern TaskHandle_t priceUpdateTaskHandle;
extern TaskHandle_t blockUpdateTaskHandle;
2023-11-07 20:26:15 +00:00
extern TaskHandle_t timeUpdateTaskHandle;
extern TaskHandle_t taskScreenRotateTaskHandle;
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
void taskPriceUpdate(void *pvParameters);
void taskBlockUpdate(void *pvParameters);
2023-11-07 20:26:15 +00:00
void taskTimeUpdate(void *pvParameters);
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();