Working version

This commit is contained in:
jazzpi
2022-07-18 16:53:52 +02:00
parent 0fa19004d3
commit 5213a41174
9 changed files with 51 additions and 14 deletions

View File

@ -18,7 +18,7 @@
#define CAN_ID_SLAVE_ERROR 0x001
#define CAN_ID_AMS_SLAVE_HEARTBEAT_BASE 0x600
#define CAN_HEARTBEAT_TX_TIMEOUT 5 /* ms */
#define CAN_HEARTBEAT_TX_TIMEOUT 10 /* ms */
void ams_can_init(CAN_HandleTypeDef* ams, CAN_HandleTypeDef* car);

View File

@ -19,6 +19,8 @@
#define CELL_OV_THRESHOLD 55100 // 4.2V
#define CELL_UV_THRESHOLD 34100 // 2.6V
#define BQ_MEASUREMENT_INTERVAL 250 // ms
extern uint16_t cell_voltages[N_CELLS];
extern uint16_t max_voltage, min_voltage;

View File

@ -54,6 +54,7 @@ extern uint8_t slave_id;
/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */
#define MAIN_LOOP_PERIOD 100 /* ms */
#define ERROR_CHECK_START 1000 /* ms */
#define AMS_ERROR_TX_TIMEOUT 2 /* ms */
#define THRESH_UV 32768 /* 2.5V */
#define THRESH_OV 55050 /* 4.2V */