Skip to content

Conversation

@finger563
Copy link
Contributor

@finger563 finger563 commented Dec 11, 2025

Description

  • Update as5600 to have APIs more consistent with mt6701 to enable better interchangability
  • Update both as5600 and mt6701 encoders to allow either task or timer usage
  • Update both as5600 and mt6701 encoders to allow stopping and restarting their task/timer

Motivation and Context

Allows both encoders to have similar APIs and be interchanged.

How has this been tested?

  • Build and run mt6701/example
  • Build and run as5600/example

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

…t for starting/stopping timer/task. Allow compile-time selection of task vs timer usage
Copilot AI review requested due to automatic review settings December 11, 2025 16:44
@finger563 finger563 self-assigned this Dec 11, 2025
@github-actions
Copy link

github-actions bot commented Dec 11, 2025

✅Static analysis result - no issues found! ✅

Copy link
Contributor

Copilot AI left a 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() and stop() methods to control the update task/timer lifecycle
  • Made MIN_DIFF threshold 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.

@finger563
Copy link
Contributor Author

@rahgirrafi pinging you for visibility into this follow-up PR on the two encoders

@finger563 finger563 merged commit 186ef56 into main Dec 12, 2025
101 of 102 checks passed
@finger563 finger563 deleted the feat/encoder-update branch December 12, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants