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:
- cosmic_detector module - Removes 3 getter functions that provided OOP-style encapsulation
-
These were introduced in v1.1.0 modularization but became redundant in v1.7.0
-
adc_sensor module - Removes 2 utility functions
adc_reset_pin()- Replaced byadc_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 readerserial_send_sensor_data()- Duplicate ofsend_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 todetection.signal1/2/3 - Replace
adc_read_pin(pin)withadc_read()(which uses pre-configured pin) - Replace
adc_reset_pin()withadc_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 functions800ad40- docs(refactoring-roadmap): mark Phase H complete
Next Steps¶
Planned for v1.8.0+¶
- Serial Protocol Specification (Phase I)
- Formalize text protocol documentation
- Create usage examples and integration guides
-
Consider legacy binary protocol deprecation path
-
RTC/Absolute Time Support (Phase 3)
- Add Unix timestamp support for event dating
- Enable time synchronization via text commands
-
Support complex event time-series analysis
-
Continued Refactoring
- Review other modules for similar unused patterns
- Systematic API surface documentation
- Performance profiling and optimization
See REFACTORING_ROADMAP.md for complete roadmap.