- platformio.ini with -DESP32_ARDUINO_NO_RGB_BUILTIN, NeoPixelBus ^2.8.0, ArduinoJson ^7.4.0 - config.h defines all pin, LED count, brightness, timing, and FreeRTOS constants
50 lines
2.4 KiB
C++
50 lines
2.4 KiB
C++
#pragma once
|
|
|
|
// GPIO6/GPIO7 for WS2801 SPI — validate on hardware, fallback: GPIO0/GPIO1 if JTAG conflict
|
|
|
|
#include <stdint.h>
|
|
#include <freertos/FreeRTOS.h>
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Pin assignments (ESP32-C3 SuperMini safe GPIOs)
|
|
// ---------------------------------------------------------------------------
|
|
constexpr uint8_t PIN_SK6812 = 3; // RMT channel 0, confirmed safe
|
|
constexpr uint8_t PIN_WS2801_MOSI = 7; // Hardware SPI MOSI
|
|
constexpr uint8_t PIN_WS2801_CLK = 6; // Hardware SPI CLK
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// LED strip lengths
|
|
// ---------------------------------------------------------------------------
|
|
constexpr uint16_t LED_COUNT_SCHRANK = 160; // WS2801 strip (Schrank, U-turn)
|
|
constexpr uint16_t LED_COUNT_WAND = 300; // SK6812 strip (Wand, RGBW)
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Brightness limits (per D-09: peak 27A at full brightness, cap at 40%)
|
|
// ---------------------------------------------------------------------------
|
|
constexpr float BRIGHTNESS_CAP = 0.40f; // 40% hardware max (per D-09)
|
|
constexpr float BRIGHTNESS_MAX = 0.60f; // 60% user-settable ceiling
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Network
|
|
// ---------------------------------------------------------------------------
|
|
constexpr uint16_t UDP_PORT = 4210; // Pi-to-ESP command port
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Animation engine (per D-04: 50fps tick rate)
|
|
// ---------------------------------------------------------------------------
|
|
constexpr uint8_t ANIM_FPS = 50; // 50fps tick rate
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// FreeRTOS task priorities (higher number = higher priority on single core)
|
|
// ---------------------------------------------------------------------------
|
|
constexpr UBaseType_t PRIORITY_LED_OUTPUT = 3;
|
|
constexpr UBaseType_t PRIORITY_ANIM_TICK = 2;
|
|
constexpr UBaseType_t PRIORITY_WIFI_RECV = 1;
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// FreeRTOS stack sizes (bytes)
|
|
// ---------------------------------------------------------------------------
|
|
constexpr uint32_t STACK_WIFI = 8192;
|
|
constexpr uint32_t STACK_ANIM = 4096;
|
|
constexpr uint32_t STACK_LED = 2048;
|