From 3ada494d15bb5429d9b11cea5a9e30aec3b26830 Mon Sep 17 00:00:00 2001 From: localhorst Date: Tue, 6 Jan 2026 12:20:27 +0100 Subject: [PATCH] remove MAX_MODES --- README.md | 11 ++++------- main/animation.c | 1 - main/control.c | 5 +---- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 40f94e9..7083504 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,8 @@ Professional LED controller firmware for ESP32. Designed for model aircraft with led-controller-firmware/ ├── main/ │ ├── main.c # Application entry point -│ ├── control.c/h # NVS, initialization +│ ├── control.c/h # initialization +│ ├── config.c/h # NVS │ ├── led.c/h # WS2812B control (RMT driver) │ ├── rcsignal.c/h # PWM signal reading │ ├── localbtn.c/h # Local btn reading @@ -69,7 +70,7 @@ idf.py build idf.py -p /dev/ttyUSB0 flash monitor ``` -Replace `/dev/ttyUSB0` with your serial port (COM3 on Windows). +Replace `/dev/ttyUSB0` with your serial port. ## Hardware Setup @@ -80,6 +81,7 @@ ESP32 Pin -> Component GPIO XX -> WS2812B Strip A Data GPIO XX -> WS2812B Strip B Data GPIO XX -> RC PWM Signal +GPIO XX -> Local button Signal GND -> Common Ground 5V -> LED Strip Power (if current < 500mA) ``` @@ -103,11 +105,6 @@ GND -> Common Ground 1. Add mode to `animation_mode_t` enum in `animation.h` 2. Implement animation function in `animation.c` 3. Add case to `animation_update()` switch statement -4. Update `MODE_NAMES` array in `webapp/app/app.js` - -### Modifying LED Count - -Edit `DEFAULT_NUM_LEDS_A` and `DEFAULT_NUM_LEDS_B` in `control.c`. TODO: ### Testing diff --git a/main/animation.c b/main/animation.c index 0d25c80..d93c1cd 100644 --- a/main/animation.c +++ b/main/animation.c @@ -15,7 +15,6 @@ static const char *TAG = "ANIMATION"; #define FRAMES_PER_SECOND 60 -#define NUM_LEDS_DEFAULT 44 // TODO: Default from proof-of-concept static animation_mode_t current_mode = ANIM_BLACK; static uint8_t global_hue = 0; diff --git a/main/control.c b/main/control.c index e10e02c..ec40635 100644 --- a/main/control.c +++ b/main/control.c @@ -14,10 +14,7 @@ #include "freertos/task.h" #include "esp_log.h" -#define MAX_MODES 14 // TODO - static const char *TAG = "CONTROL"; - static uint8_t current_animation_mode = 0; // Forward declarations @@ -26,7 +23,7 @@ static void on_mode_change(); // Animation mode change callback static void on_mode_change() { - current_animation_mode = (current_animation_mode + 1) % MAX_MODES; + current_animation_mode = (current_animation_mode + 1) % ANIM_MODE_COUNT; animation_set_mode((animation_mode_t)current_animation_mode); }