remove MAX_MODES

This commit is contained in:
2026-01-06 12:20:27 +01:00
parent d33bda52d0
commit 3ada494d15
3 changed files with 5 additions and 12 deletions

View File

@ -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

View File

@ -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;

View File

@ -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);
}