v2.2.0 - Phase 0: Flag Consolidation & Unified Compilation (2026-01-01)¶
What Changed?¶
This release completes Phase 0 of the v2 development roadmap by consolidating compiler flags and removing conditional compilation from the codebase. All v2 firmware now compiles with a single unified path (ENABLE_DEVICE_RESPONSE=1 and ENABLE_TEXT_COMMAND=1 always enabled), eliminating build complexity and improving maintainability. The refactoring affected 27 files across headers and implementation sources, with zero functional changes to user-facing behavior.
What's New¶
Main Feature: Unified v2 Compilation Path¶
What it does:
v2 firmware now compiles with a single unified code path. The ENABLE_DEVICE_RESPONSE and ENABLE_TEXT_COMMAND flags are permanently enabled in config.h, eliminating the need for conditional compilation (#if directives) throughout the codebase. This improves code clarity, reduces maintenance burden, and ensures consistent behavior across all v2 deployments.
How to use it: No changes needed! The build process remains the same:
task v2:build # Build v2 firmware
task v2:upload # Upload to ESP32
task monitor # Verify functionality
All text commands, unified device responses, and EventQueue/CommandQueue functionality work exactly as before, but now with cleaner code architecture.
Installation¶
Quick Start¶
# Get the release
git checkout v2.2.0
# Build v2 firmware
task v2:build
# Upload to ESP32
task v2:upload
# Verify it works
task monitor
What's Different from the Last Version?¶
â Added¶
- Complete Phase 0 roadmap implementation: flag consolidation and unified compilation path
- Updated CLAUDE.md documentation describing v2 unified protocol architecture
- Updated REFACTORING_ROADMAP.md with Phase 0 completion status and v2 development progress
ð§ Changed¶
- Compiler flags unified:
ENABLE_DEVICE_RESPONSEandENABLE_TEXT_COMMANDpermanently enabled in v2 - Conditional compilation removed: Eliminated 27
#if ENABLE_DEVICE_RESPONSEdirectives across headers and implementation files - Nested conditionals simplified: Converted 3 files (rtc, gnss, wifi) from dual-condition gates to single-feature gates
- Build configuration cleaned: Removed conditional compilation patterns from platformio.ini build flags
ð Fixed¶
- Improved code maintainability by removing build-time complexity
- Eliminated potential for mismatched flag configurations across translation units
- Reduced codebase cognitive overhead for future v2 developers
Is It Safe to Upgrade?¶
Backward Compatible: Yes - 100% compatible with v2.1.3
This is a refactoring release with zero functional changes. All command behavior, response formats, and sensor data streaming remain identical to v2.1.3. Users upgrading from v2.1.3 will see:
- â No changes to command behavior or API
- â No changes to response JSON format
- â No changes to sensor data output
- â Cleaner, more maintainable codebase for developers
- â Same memory footprint: RAM 31.4%, Flash 27.8%
Tests Passed¶
- â
Full v2 build:
task v2:build- SUCCESS - â Memory verification: RAM 31.4% (102,816 / 327,680 bytes), Flash 27.8% (363,773 / 1,310,720 bytes)
- â Conditional compilation removal: 27 files processed and verified
- â Nested conditionals simplified: rtc, gnss, wifi files converted to single-feature gates
- â Pre-commit hooks: All checks passed (formatting, JSON schemas, merge conflicts)
Release Details¶
- Date: 2026-01-01
- Version: v2.2.0
- Commits: 34 (27 refactor + 2 docs + 5 chore)
- Files Changed: 30 total
- 27 files: Conditional compilation removal
- 2 files: Documentation updates (CLAUDE.md, REFACTORING_ROADMAP.md)
- 1 file: Version consistency (config.h, schemas, pyproject.toml)
- Build Status: â Success
- Branch: main (v2 development)
Next Steps¶
Phase 1: Dual-Core Separation (v2.3.0 planned)¶
With the codebase now unified and simplified, the next major phase will implement multi-threading using FreeRTOS:
- Separate detection loop (Core 1) from utility operations (Core 2)
- Eliminate detection loss during serial transmission and command processing
- Improve timestamp precision from ¹1-2ms to ¹100-500Ξs
- Target: 10-20x improvement in detection timestamp accuracy