Skip to content

Conversation

@andre-stefanov
Copy link
Member

No description provided.

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 introduces a comprehensive refactoring of the stepper motor overlay configuration and thread management infrastructure. The main purpose is to modernize the device configuration approach by migrating from Zephyr aliases to chosen nodes, introduce a base Thread class to reduce code duplication, and improve the stepper driver API usage. The changes also establish proper test infrastructure with fake stepper drivers, separating test concerns from the main application.

Key Changes

  • Migrated device configuration from devicetree aliases and zephyr,user properties to chosen nodes (focuser,uart, focuser,stepper, focuser,stepper-drv)
  • Introduced a base Thread class to eliminate duplication in thread creation logic between FocuserThread and UartThread
  • Created dedicated test infrastructure using Zephyr's fake stepper drivers, removing qemu_cortex_m0 support from the main application
  • Updated stepper driver API calls from stepper_enable/stepper_disable to stepper_drv_enable/stepper_drv_disable

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/app/focuser/testcase.yaml Adds test configuration targeting qemu_cortex_m0 with focuser tag
tests/app/focuser/src/main.cpp Implements comprehensive test suite for Focuser initialization, speed control, and stop functionality using fake stepper drivers
tests/app/focuser/prj.conf Configures test environment with ztest, C++20, and fake stepper driver support
tests/app/focuser/boards/qemu_cortex_m0.overlay Defines devicetree overlay with fake stepper controller and driver for testing
tests/app/focuser/boards/qemu_cortex_m0.conf Test-specific board configuration (with outdated comment about H-bridge driver)
tests/app/focuser/CMakeLists.txt Test build configuration linking to application sources
app/src/main.cpp Refactors to use new configuration namespace structure and removes console device check
app/src/ZephyrStepper.cpp Updates to use new stepper driver API (stepper_drv_enable/disable)
app/src/UartThread.hpp Converts to inherit from Thread base class
app/src/UartThread.cpp Refactors to use Thread base class constructor and start_thread() method
app/src/Thread.hpp Introduces new base class for thread management with protected start_thread() method
app/src/Thread.cpp Implements base thread creation logic with validation and naming support
app/src/FocuserThread.hpp Converts to inherit from Thread base class
app/src/FocuserThread.cpp Refactors to use Thread base class constructor and start_thread() method
app/src/Configuration.hpp Major refactor: uses chosen nodes instead of aliases, consolidates thread configuration into nested namespaces
app/sample.yaml Removes qemu_cortex_m0 from integration platforms (now only in tests)
app/prj.conf Reorganizes configuration comments and adds CONFIG_COUNTER support
app/boards/qemu_cortex_m0.overlay Removes qemu_cortex_m0 overlay from app (moved to test infrastructure)
app/boards/esp32s3_devkitc_procpu.overlay Updates to use chosen nodes and separates stepper controller from driver, with incomplete comment documentation
app/CMakeLists.txt Adds Thread.cpp to build sources
.github/workflows/docs.yml Expands workflow trigger syntax from compact to explicit format
Comments suppressed due to low confidence (1)

tests/app/focuser/boards/qemu_cortex_m0.conf:5

  • The comment is outdated. It mentions "swap in Zephyr's GPIO H-bridge stepper driver", but the test now uses the fake stepper driver (zephyr,fake-stepper-controller and zephyr,fake-stepper-driver) as configured in the overlay file, not the H-bridge driver. The comment should be updated to reflect the use of the fake stepper driver for testing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andre-stefanov andre-stefanov force-pushed the feature/stepper-overlay-update branch 14 times, most recently from ab7ac9a to 7e43c41 Compare December 18, 2025 18:43
@andre-stefanov andre-stefanov force-pushed the feature/stepper-overlay-update branch from 7e43c41 to df6dd78 Compare December 18, 2025 18:54
@andre-stefanov andre-stefanov force-pushed the feature/stepper-overlay-update branch from df6dd78 to 6efce72 Compare December 18, 2025 19:10
andre-stefanov and others added 3 commits December 18, 2025 20:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@andre-stefanov andre-stefanov merged commit 3b84911 into main Dec 18, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants