2023-11-07 20:26:15 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
#include <freertos/FreeRTOS.h>
|
|
|
|
#include <freertos/task.h>
|
|
|
|
#include <Adafruit_NeoPixel.h>
|
|
|
|
#include "shared.hpp"
|
|
|
|
|
2023-11-08 11:18:59 +00:00
|
|
|
#ifndef NEOPIXEL_PIN
|
|
|
|
#define NEOPIXEL_PIN 34
|
|
|
|
#endif
|
|
|
|
#ifndef NEOPIXEL_COUNT
|
|
|
|
#define NEOPIXEL_COUNT 4
|
|
|
|
#endif
|
|
|
|
|
|
|
|
const int LED_FLASH_ERROR = 0;
|
|
|
|
const int LED_FLASH_SUCCESS = 1;
|
|
|
|
const int LED_FLASH_UPDATE = 2;
|
|
|
|
const int LED_FLASH_BLOCK_NOTIFY = 3;
|
|
|
|
const int LED_EFFECT_START_TIMER = 4;
|
|
|
|
const int LED_EFFECT_PAUSE_TIMER = 5;
|
2023-11-10 12:02:05 +00:00
|
|
|
const int LED_EFFECT_WIFI_WAIT_FOR_CONFIG = 100;
|
|
|
|
const int LED_EFFECT_WIFI_CONNECTING = 101;
|
|
|
|
const int LED_EFFECT_WIFI_CONNECT_ERROR = 102;
|
|
|
|
const int LED_EFFECT_WIFI_CONNECT_SUCCESS = 103;
|
2023-11-08 11:18:59 +00:00
|
|
|
|
2023-11-07 20:26:15 +00:00
|
|
|
extern TaskHandle_t ledTaskHandle;
|
|
|
|
|
|
|
|
void ledTask(void *pvParameters);
|
2023-11-08 11:18:59 +00:00
|
|
|
void setupLeds();
|
2023-11-07 20:26:15 +00:00
|
|
|
void setupLedTask();
|
2023-11-08 11:18:59 +00:00
|
|
|
void blinkDelay(int d, int times);
|
|
|
|
void blinkDelayColor(int d, int times, uint r, uint g, uint b);
|
|
|
|
void blinkDelayTwoColor(int d, int times, uint32_t c1, uint32_t c2);
|
|
|
|
void clearLeds();
|
|
|
|
QueueHandle_t getLedTaskQueue();
|
|
|
|
bool queueLedEffect(uint effect);
|
2023-11-08 14:27:22 +00:00
|
|
|
void setLights(int r, int g, int b);
|
|
|
|
void setLights(uint32_t color);
|