Skip to content

Commit

Permalink
Changed format of fault timer CAN
Browse files Browse the repository at this point in the history
  • Loading branch information
bjackson312006 committed Nov 30, 2024
1 parent c55fc7b commit 925ccc8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Core/Inc/compute.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void compute_send_segment_temp_message(acc_data_t *bmsdata);

void compute_send_fault_message(uint8_t status, int16_t curr, int16_t in_dcl);

void compute_send_fault_timer_message(uint8_t start_stop, uint16_t fault_code,
void compute_send_fault_timer_message(uint8_t start_stop, int fault_code,
uint16_t data_1);

/**
Expand Down
2 changes: 1 addition & 1 deletion Core/Src/can_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void init_can_msg_config()

can_msg_t fault_timer_msg;
fault_timer_msg.id = FAULT_TIMER_CANID;
fault_timer_msg.len = 5;
fault_timer_msg.len = 4;

// rl_data_t rl_discharge_data = { .msg_rate = 5000 };
// rl_data_t rl_charge_data = { .msg_rate = 0 };
Expand Down
6 changes: 3 additions & 3 deletions Core/Src/compute.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,17 +535,17 @@ void compute_send_fault_message(uint8_t status, int16_t curr, int16_t in_dcl)
queue_can_msg(bms_can_msgs[FAULT]);
}

void compute_send_fault_timer_message(uint8_t start_stop, uint16_t fault_code,
void compute_send_fault_timer_message(uint8_t start_stop, int fault_code,
uint16_t data_1)
{
struct __attribute__((__packed__)) {
uint8_t start_stop;
uint16_t fault_code;
uint8_t fault_code;
int16_t data_1;
} fault_timer_msg_data;

fault_timer_msg_data.start_stop = start_stop;
fault_timer_msg_data.fault_code = fault_code;
fault_timer_msg_data.fault_code = log2(fault_code);
fault_timer_msg_data.data_1 = data_1;

endian_swap(&fault_timer_msg_data.fault_code,
Expand Down

0 comments on commit 925ccc8

Please sign in to comment.