Skip to content

Conversation

@AmarsChandra
Copy link

Changes

Added read_shutdown() to allow querying of the shutdown-sense GPIO (TS_MINUS_SENSE).
Returns true when the shutdown circuit is open (pin low) and false when it is closed (pin high).
Implemented compute_set_fault() using explicit GPIO writes (GPIO_PIN_SET / GPIO_PIN_RESET).

Test Cases

Case A – Shutdown circuit closed (normal): mock HAL_GPIO_ReadPin to return GPIO_PIN_SET. read_shutdown() returns false.

Case B – Shutdown circuit open: mock HAL_GPIO_ReadPin to return GPIO_PIN_RESET. read_shutdown() returns true.

Case C – Fault output set: compute_set_fault(true) drives GPIO_PIN_SET, compute_set_fault(false) drives GPIO_PIN_RESET.

Edge Case – Unexpected pin state: equality check still resolves correctly.

To Do

Nothing

Closes #24

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.

Support shutdown senses in compute.c

3 participants