Skip to content

v2.3.4 - LED Pin Config Cleanup (2026-02-24)

What Changed?

This release unifies LED pin constants in led_manager.cpp to use LED_PIN1/2/3 from config.h. Build-flag overrides (e.g., -DLED_PIN1=xx) now work correctly. No behavior changes; fully backward compatible.


What's New

Main Feature: LED Pin SSOT Unification

What it does:

Replaces hardcoded GPIO_NUM_14/26/33 (IDF enum type) in led_manager.cpp with the int constants LED_PIN1/2/3 defined in config.h. The intermediate #define LED_PIN_CH1/2/3 aliases are also removed so the file uses LED_PIN1/2/3 directly throughout.

Why it matters:

  • Build-flag overrides (-DLED_PIN1=xx) now take effect in led_manager.cpp
  • Resolves the type mismatch between GPIO_NUM_* (IDF enum) and Arduino API (int)
  • config.h is now the true single source of truth for LED pin numbers

Installation

Quick Start

# Get the release
git checkout v2.3.4

# Build
task v2:build

# Upload
task v2:upload

# Check it works
task monitor

What's Different from the Last Version?

🔧 Changed

  • led_manager.cpp: replaced GPIO_NUM_14/26/33 with LED_PIN1/2/3 from config.h
  • led_manager.cpp: removed intermediate #define LED_PIN_CH1/2/3 aliases

Is It Safe to Upgrade?

Backward Compatible: Yes

  • Default LED pin numbers are unchanged (GPIO14, GPIO26, GPIO33)
  • No change in runtime behavior
  • Users overriding pins via build flags will now see their values applied correctly

Tests Passed

  • ✅ Builds without errors

Release Details

  • Date: 2026-02-24
  • Version: v2.3.4
  • Files Changed: 1 (src/led_manager.cpp)

Next Steps

Continued code quality improvements (see REFACTORING_ROADMAP.md):

  • Remove duplicate GPIO init calls in CosmicDetector::init() (P1)
  • Remove led_init() call from CosmicDetector::init() (P1)
  • Fix swich_pin typo in v2_main.cpp (P1)