Skip to content

v2.3.8 - Remove Dead Code from v2_main (2026-02-24)

What Changed?

This release removes unused interrupt dead code from v2_main.cpp. The pushed flag, onPushed() ISR, and attachInterrupt() call were copied from the legacy main.cpp but never used in the v2 loop. No behavior changes; fully backward compatible.


What's New

Main Feature: Remove pushed/onPushed Dead Code

What it does:

Removes three unused symbols from v2_main.cpp:

  • volatile boolean pushed — flag written by ISR but never read in loop()
  • void IRAM_ATTR onPushed() — ISR that set the unused flag
  • attachInterrupt(SWITCH_PIN, onPushed, FALLING) — interrupt registration with no consumer

Why it matters:

  • These were copied from legacy main.cpp during the v1/v2 split but serve no purpose in v2
  • Removes IRAM allocation for an ISR that does nothing useful
  • Clarifies setup() intent: no button interrupt handling in the current v2 design

Installation

Quick Start

# Get the release
git checkout v2.3.8

# Build
task v2:build

# Upload
task v2:upload

# Check it works
task monitor

What's Different from the Last Version?

🔧 Changed

  • v2_main.cpp: removed volatile boolean pushed global variable
  • v2_main.cpp: removed void IRAM_ATTR onPushed() ISR
  • v2_main.cpp: removed attachInterrupt(SWITCH_PIN, onPushed, FALLING) call
  • v2_main.cpp: removed // SHARED STATE section (now empty)

Is It Safe to Upgrade?

Backward Compatible: Yes

  • The removed interrupt was never consumed — no behavior change
  • Slight RAM reduction (8 bytes) from removing the unused pushed variable

Tests Passed

  • ✅ Builds without errors

Release Details

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

Next Steps

Continued code quality improvements (see REFACTORING_ROADMAP.md):

  • Fix GNSS coordinate type floatdouble (P1)
  • Fix @file docstring in v2_main.cpp (says main_next.cpp)