init
This commit is contained in:
commit
1d7af0615e
15 files changed
+942
No files matched your search
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/queue.h>
|
||||
#include <freertos/semphr.h>
|
||||
|
||||
enum class CmdType : uint8_t {
|
||||
VolumeDelta, // value: signed change in %
|
||||
VolumeSet, // value: absolute 0..100
|
||||
RelayToggle,
|
||||
RelaySet, // value: 0 / 1
|
||||
};
|
||||
|
||||
struct Command {
|
||||
CmdType type;
|
||||
int16_t value;
|
||||
};
|
||||
|
||||
struct AppState {
|
||||
uint8_t volume; // 0..100
|
||||
bool relay;
|
||||
};
|
||||
|
||||
// Created in main.cpp
|
||||
extern QueueHandle_t cmdQueue;
|
||||
|
||||
bool sendCommand(CmdType type, int16_t value = 0);
|
||||
AppState getState();
|
||||
void setState(const AppState &s);
|
||||
|
||||
void controlTask(void *arg);
|
||||
void encoderTask(void *arg);
|
||||
void webTask(void *arg);
|
||||
void displayTask(void *arg);
|
||||
Reference in new issue
Block a user