v1.6.7 - Semantic Naming: Poll Count Refactor (2025-11-20)¶
What Changed?¶
This release improves code clarity by renaming the sample_count parameter to poll_count throughout the codebase. The old name was misleadingβthe detector performs GPIO register polling, not statistical sampling. This refactoring aligns our terminology with embedded systems standards and makes the code more intuitive for developers.
β οΈ PROTOCOL BREAKING CHANGE: Client code must update serial commands. See "Backward Compatibility" section below.
What's New¶
Main Feature: Semantic Naming Clarity¶
What it does:
Renames all references to sample_count β poll_count across the firmware, including:
- Configuration macro:
DETECT_POLL_COUNT(wasDETECT_SAMPLE_COUNT) - Runtime config:
RuntimeConfig.poll_countfield - API functions:
config_get_poll_count(),config_set_poll_count() - Serial command:
SET_POLL_COUNT(wasSET_SAMPLE_COUNT)
How to use it: Use the new command name in serial communication:
SET_POLL_COUNT 200 # β
NEW (polling cycles per detection)
SET_SAMPLE_COUNT 200 # β OLD - will fail
Code example (for client integration):
// OLD (v1.6.6 and earlier)
serialPort.println("SET_SAMPLE_COUNT 100");
// NEW (v1.6.7+)
serialPort.println("SET_POLL_COUNT 100");
Installation¶
Quick Start¶
# Get the release
git checkout v1.6.7
# Build
task build
# Upload to device
task upload
# Test the new command
task monitor
# Try: SET_POLL_COUNT 200 β should respond OK
What's Different from the Last Version?¶
β Added¶
- Improved semantic clarity: "polling" terminology replaces confusing "sampling" language
π§ Changed¶
- Serial Protocol:
SET_SAMPLE_COUNTcommand renamed toSET_POLL_COUNT - Configuration API: Function names updated (
config_get_sample_count()βconfig_get_poll_count()) - Internal Naming: All
sample_countreferences renamed topoll_countin code and documentation - Error Messages: References to "SAMPLE_COUNT" renamed to "POLL_COUNT"
- Documentation: CLAUDE.md and inline comments updated
π No Bug Fixes¶
This is a pure refactoringβno behavioral changes to detection algorithm.
Is It Safe to Upgrade?¶
Backward Compatible: β NO - Protocol Breaking Change
Impact on Existing Users¶
- β Firmware functionality unchanged (pure refactoring)
- β Build profiles unchanged (dev, prod, debug)
- β Serial protocol clients MUST be updated
- Old command
SET_SAMPLE_COUNTwill no longer be recognized - Clients must update to use
SET_POLL_COUNT - All error messages now reference "POLL_COUNT"
Migration Path¶
- Update any client scripts/applications that use
SET_SAMPLE_COUNT - Replace all occurrences with
SET_POLL_COUNT(parameter format unchanged) - Rebuild and redeploy client code
- Test with
task monitorbefore deploying to production
Tests Passed¶
- β
Development build succeeds (
task dev:build) - β
Production build succeeds (
task prod:build) - β No compilation errors or warnings
- β RAM usage stable: 6.9-7.3% (unchanged)
- β Flash usage stable: 22.7-23.0% (unchanged)
- β
New serial command
SET_POLL_COUNTworks correctly - β
Old command
SET_SAMPLE_COUNTproperly rejected as unknown
Release Details¶
- Date: 2025-11-20
- Version: v1.6.7
- Files Changed: 7 (config.h, runtime_config.h, runtime_config.cpp, cosmic_detector.cpp, text_command_handler.cpp, CLAUDE.md, progress entry)
- Total Changes: 42 insertions, 42 deletions (mechanical refactoring)
- Commits:
e152f58: Phase 1 - Core implementation (36 insertions, 36 deletions)40af970: Phase 2 - Documentation (6 insertions, 6 deletions)8b13b9e: Phase 4 - Progress entry (83 insertions)
Next Steps¶
- Phase 2 Planning (v1.7.0): Text Command Parsing Optimization
- Add backward compatibility alias (optional):
SET_SAMPLE_COUNTβSET_POLL_COUNT - Improve error message formatting
- Consider command validation tables
Summary¶
This release prioritizes code clarity and developer experience. The terminology change from "sample_count" to "poll_count" makes the firmware more intuitive and aligns with embedded systems conventions. Users upgrading to v1.6.7 must update their serial protocol clients, but the underlying detection algorithm and hardware behavior remain unchanged.