Skip to content

HSS control#12

Open
changxu-liu wants to merge 9 commits into
mainfrom
hss_control
Open

HSS control#12
changxu-liu wants to merge 9 commits into
mainfrom
hss_control

Conversation

@changxu-liu
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a high-side switch (HSS) control system for the Power Distribution Unit, including a generic SPI shift register driver and logic for managing output states and fault handling. The review identified several critical issues: a pin definition conflict in LSOM_S_Pins.h, a missing SPI interrupt callback that would lead to deadlocks, and potential race conditions on the global state variable. Feedback also highlighted endianness concerns during SPI transmission, the non-standard use of emojis in enums, and the need for more precise hardware timing instead of using RTOS task delays.

#define LSOM_13_PIN GPIO_PIN_2
// differs from sheet?
#define LSOM_13_PORT GPIOC
#define LSOM_13_PIN GPIO_PIN_12
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Assigning LSOM_13_PIN to GPIO_PIN_12 on GPIOC creates a conflict, as this pin is already defined for LSOM_15_PIN (line 39). This will lead to hardware contention if both are initialized or used simultaneously.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix this

Comment thread firmware/driver/src/ShiftRegister_SPI.c
Comment thread firmware/PowerDistributionUnit_Mk1/core/src/PDU_Mk1_HSSControl.c
Comment thread firmware/PowerDistributionUnit_Mk1/core/src/PDU_Mk1_HSSControl.c
Comment thread firmware/driver/inc/ShiftRegister_SPI.h
Comment thread firmware/driver/src/ShiftRegister_SPI.c
@changxu-liu changxu-liu requested a review from jolynjiang226 May 11, 2026 22:01
@Rav4s Rav4s requested a review from aaravm4 May 12, 2026 05:06
@Rav4s Rav4s assigned changxu-liu and unassigned aaravm4 May 12, 2026
Copy link
Copy Markdown

@aaravm4 aaravm4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

richard

Comment thread firmware/driver/inc/ShiftRegister_SPI.h Outdated
Comment thread firmware/driver/inc/ShiftRegister_SPI.h
Comment thread firmware/driver/inc/ShiftRegister_SPI.h
Comment thread firmware/driver/src/ShiftRegister_SPI.c
Comment thread firmware/driver/inc/ShiftRegister_SPI.h
Comment thread firmware/PowerDistributionUnit_Mk1/core/src/PDU_Mk1_HSSControl.c Outdated
Comment thread firmware/PowerDistributionUnit_Mk1/core/src/PDU_Mk1_HSSControl.c
Comment thread firmware/PowerDistributionUnit_Mk1/test/src/HSSControl.c
Comment thread firmware/PowerDistributionUnit_Mk1/test/src/HSSControl.c Outdated
Comment thread firmware/PowerDistributionUnit_Mk1/core/src/PDU_Mk1_HSSControl.c Outdated
@changxu-liu changxu-liu requested a review from aaravm4 May 20, 2026 05:19
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