Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bms relay fsm (4/4 fault checks done) #261

Closed
wants to merge 48 commits into from
Closed

Bms relay fsm (4/4 fault checks done) #261

wants to merge 48 commits into from

Conversation

Akashem06
Copy link
Member

@Akashem06 Akashem06 commented Feb 4, 2024

Done Needs testing

@Akashem06 Akashem06 changed the title Bms relay fsm Bms relay fsm (1/4 fault checks done) Feb 4, 2024
@Akashem06 Akashem06 changed the title Bms relay fsm (1/4 fault checks done) Bms relay fsm (3/4 fault checks done) Feb 5, 2024
@Akashem06 Akashem06 changed the title Bms relay fsm (3/4 fault checks done) Bms relay fsm (4/4 fault checks done) Feb 5, 2024
@@ -251,6 +258,10 @@ StatusCode ltc_afe_impl_init(LtcAfeStorage *afe, const LtcAfeSettings *settings)
return prv_write_config(afe, gpio_bits);
}

StatusCode ltc_afe_impl_fault_check() {
return STATUS_CODE_OK | fault_bitset;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Review this

void close_relays();
void open_relays();

DECLARE_FSM(relays);
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: bms_relays

StatusCode fault_bitset = STATUS_CODE_OK;

StatusCode current_sense_fault_check() {
return STATUS_CODE_OK | fault_bitset;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe use the global variable or juts return the variable

.scl = BMS_PERIPH_I2C_SCL_PIN,
};

GpioAddress const POS_RELAY_EN = { .port = GPIO_PORT_B, .pin = 8 };
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: I think we usually have const first before the type, and usually use all caps for macros or definitions

status |= current_sense_fault_check();

status |= ltc_afe_impl_trigger_cell_conv(&s_ltc_store);
// delay_ms(10);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should still be there

LOG_DEBUG("Bms fault check \n");
StatusCode status = STATUS_CODE_OK;

status |= current_sense_fault_check();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Fault immideatyle ehre


status |= ltc_afe_impl_read_cells(&s_ltc_store);
for (int cell = 0; cell < 12; cell++) {
LOG_DEBUG("CELL %d: %d\n\r", cell,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a todo because this only logs we dont do anything with the readings here

@Akashem06 Akashem06 closed this Mar 28, 2024
@Akashem06 Akashem06 deleted the BMS_Relay_FSM branch September 5, 2024 23:27
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