Feature/phase4 dynamic sampling#4
Merged
karangandhi-projects merged 5 commits intomainfrom Dec 2, 2025
Merged
Conversation
…cs, and task logic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Phase 4 – Dynamic Sensor Sampling Based on Power Mode
This PR implements dynamic, power-aware sensor sampling across the entire STM32 Smart Sensor Hub system. Sensor sampling intervals now automatically adjust depending on the current PowerMode_t (ACTIVE / IDLE / SLEEP / STOP), significantly reducing energy usage and making the hub behave like a real-world smart IoT node.
✅ Key Features Added
Sensor sampling interval now selected from:
#define SENSOR_PERIOD_ACTIVE_MS (1000U)
#define SENSOR_PERIOD_IDLE_MS (5000U)
#define SENSOR_PERIOD_SLEEP_MS (30000U)
#define SENSOR_PERIOD_STOP_MS (0U) // sampling disabled
STOP mode explicitly disables sampling (0 ms).
Task scheduling updated to compute sampling period dynamically.
CLI status command now reports:
Current power mode
Current sampling interval
CLI pmode <0|1|2|3> updates sampling in real time.
Docs fully updated to reflect Phase 4 behavior.
🧪 Testing Performed
Verified ACTIVE → IDLE → SLEEP → STOP transitions.
Confirmed sampling stops in STOP.
Confirmed sampling resumes when transitioning out of STOP.
Verified CLI overrides and live sampling updates.
Logged timestamps confirm dynamic period changes.
📁 Updated Docs
README.md (root level)
docs/ARCHITECTURE.md
docs/CLI_COMMANDS.md
docs/RELEASE_NOTES.md (v0.4.0 added)
docs/README.md
📦 Version
v0.4.0