Add pin lock method to digital out#502
Merged
g0nz4I0 merged 6 commits intodevelopmentfrom Apr 25, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a method to lock a GPIO pin in a specific state until board reset, supporting safety features like preventing contactor reactivation after a fault. Key changes include:
- Addition of a new lock_pin_state method in DigitalOutput and related service classes.
- Consistent header updates and minor formatting improvements across HALAL and HALALMock implementations.
- Adjusted error handling when registering/use of DigitalOutput IDs.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Src/ST-LIB_LOW/DigitalOutput/DigitalOutput.cpp | Added lock_pin_state method and simplified formatting of existing methods. |
| Src/HALALMock/Services/DigitalOutputService/DigitalOutputService.cpp | Reformatted error message and toggle method; mock implementation of lock_pin_state introduced. |
| Src/HALAL/Services/DigitalOutputService/DigitalOutputService.cpp | New implementation for lock_pin_state with proper error handling and use of HAL routines. |
| Inc/ST-LIB_LOW/DigitalOutput/DigitalOutput.hpp | Updated header to include lock_pin_state declaration. |
| Inc/HALALMock/Services/DigitalOutputService/DigitalOutputService.hpp | Declared lock_pin_state in the HALALMock service header. |
| Inc/HALAL/Services/DigitalOutputService/DigitalOutputService.hpp | Declared lock_pin_state in the HALAL service header. |
g0nz4I0
approved these changes
Apr 25, 2025
Member
g0nz4I0
left a comment
There was a problem hiding this comment.
I'm going to shove the linter up *********
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.
The HAL has a method that can lock a GPIO in a certain state until the board resets (using HAL_GPIO_LockPin). This could be useful for the contactors as an example, where once you enter fault you don't want to close them until you reset the board after fixing the fault cause. This is the same for the GD reset and enable, brakes, etc. All driven by a GPIO.
Also I took the chance to run the linter through the digital out code, the logic of this modification is minimal. The interesting methods are named force_lock_state