feat(01-01): PlatformIO scaffold + config.h

- 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
This commit is contained in:
Claude
2026-04-03 13:15:06 +02:00
parent ee1f45b076
commit 6fe86bc310
2 changed files with 63 additions and 0 deletions

14
firmware/platformio.ini Normal file
View File

@@ -0,0 +1,14 @@
[env:esp32c3_supermini]
platform = espressif32
board = esp32-c3-devkitm-1
framework = arduino
monitor_speed = 115200
build_flags =
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1
-DESP32_ARDUINO_NO_RGB_BUILTIN
lib_deps =
makuna/NeoPixelBus @ ^2.8.0
bblanchon/ArduinoJson @ ^7.4.0

49
firmware/src/config.h Normal file
View File

@@ -0,0 +1,49 @@
#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;