-
Notifications
You must be signed in to change notification settings - Fork 23
feat(mt6701/as5600): Improve encoder interchangability and add support for starting/stopping timer/task. Allow compile-time selection of task vs timer usage #572
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
Conversation
…t for starting/stopping timer/task. Allow compile-time selection of task vs timer usage
|
✅Static analysis result - no issues found! ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the MT6701 and AS5600 magnetic encoder drivers to improve their interchangeability and flexibility. The changes add compile-time configuration options to choose between high-resolution timer and FreeRTOS task implementations for periodic updates, and provide new APIs for starting/stopping the update mechanism.
Key changes:
- Added compile-time selection between timer and task implementations via Kconfig options
- Introduced
start()andstop()methods to control the update task/timer lifecycle - Made
MIN_DIFFthreshold configurable through Kconfig for noise filtering - Improved API consistency between MT6701 and AS5600 implementations
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| components/mt6701/include/mt6701.hpp | Added conditional compilation for timer vs task, new start/stop methods, configurable MIN_DIFF, and improved initialize() overloads |
| components/mt6701/Kconfig | New configuration menu with MIN_DIFF threshold and timer vs task selection options |
| components/mt6701/CMakeLists.txt | Added "task" component dependency to support task-based implementation |
| components/as5600/include/as5600.hpp | Mirrored MT6701 changes: timer support, start/stop methods, configurable MIN_DIFF, and enhanced initialization options |
| components/as5600/Kconfig | New configuration menu matching MT6701's options for consistency |
| components/as5600/CMakeLists.txt | Added "timer" component dependency to support timer-based implementation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@rahgirrafi pinging you for visibility into this follow-up PR on the two encoders |
Description
as5600to have APIs more consistent withmt6701to enable better interchangabilityas5600andmt6701encoders to allow either task or timer usageas5600andmt6701encoders to allow stopping and restarting their task/timerMotivation and Context
Allows both encoders to have similar APIs and be interchanged.
How has this been tested?
mt6701/exampleas5600/exampleScreenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):
Types of changes
Checklist:
Software
.github/workflows/build.ymlfile to add my new test to the automated cloud build github action.