Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main: Rework sub states in STATE_TRIGGERING #126

Merged
merged 1 commit into from
Mar 21, 2025
Merged

Conversation

jtguggedal
Copy link
Contributor

The sub states in STATE_TRIGGERING have been updated to allow for a dedicated wait state, and to make it easier to have accurate intervals between samples.

Tests are updated, and we now also test that the correct interval is maintained over time.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Core Changes

  • The code refactors the state machine in the main.c file, specifically the sub-states within STATE_TRIGGERING. The changes introduce a dedicated wait state (STATE_WAIT_FOR_TRIGGER) and a more structured approach to sampling intervals, improving the accuracy and management of these intervals.
  • The test files have been updated to reflect these changes, including adjustments to the state transitions and the addition of new test cases to ensure the correct interval is maintained over time.

⚠️ Concerns

  • No critical concerns identified. The changes seem to be well-structured and aim to improve the functionality and accuracy of the state machine.
  1. Verdict:
    • Approve: The changes are well-implemented and improve the existing functionality. The refactoring of the state machine is clear and the tests have been updated accordingly to ensure the new logic is validated.

Code review performed by OPENAI - gpt-4o.

@jtguggedal jtguggedal force-pushed the main-sample-state branch 3 times, most recently from 2c380bb to 4aa8d46 Compare March 21, 2025 11:44
The sub states in STATE_TRIGGERING have been updated to allow
for a dedicated wait state, and to make it easier to have
accurate intervals between samples.

Tests are updated, and we now also test that the correct interval
is maintained over time.

Signed-off-by: Jan Tore Guggedal <jantore.guggedal@nordicsemi.no>
@jtguggedal jtguggedal merged commit fc93fd6 into main Mar 21, 2025
4 checks passed
@jtguggedal jtguggedal deleted the main-sample-state branch March 21, 2025 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant