Skip to content

v1.7.2 - Code Cleanup & Unused Function Removal (2025-11-21)

What Changed?

This release removes 5 unused functions identified through exhaustive code analysis. These were legacy API designs from v1.1.0 modularization that became redundant after v1.7.0 data structure unification. The cleanup improves code maintainability and reduces the public API surface without affecting any functionality.


What's New

Code Quality Improvement: Unused Function Removal

What it does:

Removes legacy and unused utility functions that accumulated during API evolution:

  1. cosmic_detector module - Removes 3 getter functions that provided OOP-style encapsulation
  2. These were introduced in v1.1.0 modularization but became redundant in v1.7.0

  3. adc_sensor module - Removes 2 utility functions

  4. adc_reset_pin() - Replaced by adc_reset_pin_mode() which provides more complete initialization

Why this matters:

  • Reduces API surface complexity
  • Eliminates confusion between multiple similar functions
  • Demonstrates systematic code quality maintenance
  • Flash memory savings (~70-110 bytes)

How it was done:

Systematic cleanup process:
1. Exhaustive grep-based search for all function calls
2. Cross-validation across all .cpp and .h files
3. Build verification on all 3 profiles (release/debug/dev)
4. Documentation of design history and evolution

Installation

Quick Start

# Get the release
git checkout v1.7.2

# Build
task build

# Upload
task upload

# Check it works
task monitor

What's Different from the Last Version?

๐Ÿงน Removed (Cleanup Only)

  • cosmic_detector_get_signal2() - Legacy OOP-style getter (v1.1.0)
  • adc_read_pin(int pin) - Unused generic ADC reader
  • serial_send_sensor_data() - Duplicate of send_sensor_data() from sensor_output module

๐Ÿ“Š Code Changes Summary

Metric Value
Files Modified 6
Functions Removed 5
Lines Removed ~100
Flash Savings ~70-110 bytes
Commits 3

Is It Safe to Upgrade?

Backward Compatible: โœ… Yes

  • Impact: None. These functions were not used by any code in the repository.
  • User-facing: No changes to any features, output formats, or user interfaces.
  • Hardware: No changes to hardware communication or timing.

If you have custom code that calls these removed functions, you should:

  • Replace cosmic_detector_get_signal*() calls with direct access to detection.signal1/2/3
  • Replace adc_read_pin(pin) with adc_read() (which uses pre-configured pin)
  • Replace adc_reset_pin() with adc_reset_pin_mode() for complete reset

Tests Passed

All profiles built successfully:

  • โœ… esp32dev-release: Flash 22.7% (298,105 bytes), RAM 6.9% (22,608 bytes)
  • โœ… esp32dev-debug: Flash 22.8% (298,833 bytes), RAM 6.9% (22,616 bytes)
  • โœ… esp32dev-dev: Flash 23.9% (312,725 bytes), RAM 7.3% (23,912 bytes)

No functional changes - all detection, sensing, and communication remain unchanged.


Release Details

  • Date: 2025-11-21
  • Version: v1.7.2
  • Release Type: Code Cleanup & Refactoring
  • Files Changed: 6 files (cosmic_detector, adc_sensor, serial_communication, roadmap, progress log)
  • Commits:
  • 4d7911f - refactor(cosmic-detector): remove signal getter functions
  • 800ad40 - docs(refactoring-roadmap): mark Phase H complete

Next Steps

Planned for v1.8.0+

  1. Serial Protocol Specification (Phase I)
  2. Formalize text protocol documentation
  3. Create usage examples and integration guides
  4. Consider legacy binary protocol deprecation path

  5. RTC/Absolute Time Support (Phase 3)

  6. Add Unix timestamp support for event dating
  7. Enable time synchronization via text commands
  8. Support complex event time-series analysis

  9. Continued Refactoring

  10. Review other modules for similar unused patterns
  11. Systematic API surface documentation
  12. Performance profiling and optimization

See REFACTORING_ROADMAP.md for complete roadmap.