Skip to content

Commit

Permalink
fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
jr1221 committed Jan 25, 2025
1 parent 7e75f6a commit b9218f2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 253 deletions.
1 change: 0 additions & 1 deletion Core/Inc/datastructs.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ typedef struct {
/* Array of structs containing raw data from and configurations for the ADBMS6830 chips */
cell_asic chips[NUM_CHIPS];

int fault_status;
int fault_status; // FIXME: this field is unused

int16_t pack_current; /* this value is multiplied by 10 to account for decimal precision */
Expand Down
36 changes: 0 additions & 36 deletions Core/Src/compute.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,42 +435,6 @@ void compute_send_cell_voltage_message(acc_data_t *bmsdata)
queue_can_msg(msg);
}

void compute_send_cell_voltage_message(uint8_t cell_id,
uint16_t instant_voltage,
uint16_t internal_Res, uint8_t shunted,
uint16_t open_voltage)
{
struct __attribute__((__packed__)) {
uint8_t cellID;
uint16_t instantVoltage;
uint16_t internalResistance;
uint8_t shunted;
uint16_t openVoltage;
} cell_voltage_msg_data;

cell_voltage_msg_data.cellID = cell_id;
cell_voltage_msg_data.instantVoltage = instant_voltage;
cell_voltage_msg_data.internalResistance = internal_Res;
cell_voltage_msg_data.shunted = shunted;
cell_voltage_msg_data.openVoltage = open_voltage;

/* convert to big endian */
endian_swap(&cell_voltage_msg_data.instantVoltage,
sizeof(cell_voltage_msg_data.instantVoltage));
endian_swap(&cell_voltage_msg_data.internalResistance,
sizeof(cell_voltage_msg_data.internalResistance));
endian_swap(&cell_voltage_msg_data.openVoltage,
sizeof(cell_voltage_msg_data.openVoltage));

can_msg_t msg;
msg.id = CELL_VOLTAGE_CANID;
msg.len = CELL_VOLTAGE_SIZE;

memcpy(msg.data, &cell_voltage_msg_data, sizeof(cell_voltage_msg_data));

queue_can_msg(msg);
}

void compute_send_current_message(acc_data_t *bmsdata)
{
struct __attribute__((__packed__)) {
Expand Down
12 changes: 5 additions & 7 deletions Core/Src/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
#define T_SLEEP 1.8 /* seconds minimum, typ is 2, max is 2.2 */
#define T_REFUP 2.7 /* milliseconds minimum, typ is 3.5, max is 4.4 */

#define THERM_WAIT_TIME 500 /* ms */
#define VOLTAGE_WAIT_TIME 500 /* ms */
#define THERM_AVG 15 /* Number of values to average */
#define MAX_VOLT_DELTA 2500
#define MAX_CONSEC_NOISE 10
#define GPIO_EXPANDER_ADDR 0x40
#define GPIO_REGISTER_ADDR 0x09
#define THERM_WAIT_TIME 500 /* ms */
#define VOLTAGE_WAIT_TIME 500 /* ms */
#define THERM_AVG 15 /* Number of values to average */
#define MAX_VOLT_DELTA 2500
#define MAX_CONSEC_NOISE 10

extern TIM_HandleTypeDef htim2;

Expand Down
209 changes: 0 additions & 209 deletions STM32F405RGTx_FLASH.ld

This file was deleted.

0 comments on commit b9218f2

Please sign in to comment.