V1.8
This commit is contained in:
@ -6,15 +6,18 @@
|
||||
*/
|
||||
|
||||
#include "state_machine.h"
|
||||
#include "ADBMS_Abstraction.h"
|
||||
#include "AMS_HighLevel.h"
|
||||
#include "PWM_control.h"
|
||||
#include "TMP1075.h"
|
||||
#include "errors.h"
|
||||
#include "main.h"
|
||||
#include "stm32f302xc.h"
|
||||
#include "stm32f3xx_hal.h"
|
||||
#include <stdint.h>
|
||||
|
||||
// Time to wait after reaching 95% of battery voltage before exiting precharge
|
||||
// Set this to 1000 in scruti to demonstrate the voltage on the multimeter
|
||||
#define PRECHARGE_DURATION 5000 // ms
|
||||
// Time to wait for discharge
|
||||
#define DISCHARGE_DURATION 5000 // ms
|
||||
// Time to wait for charger voltage before going to TS_ERROR
|
||||
#define MAX_CHARGING_CHECK_DURATION 2000 // ms
|
||||
// Time to wait between closing relays
|
||||
#define RELAY_CLOSE_WAIT 10 // ms
|
||||
// Max time to wait for CAN messages. If we reach it then we emergency shutdown.
|
||||
#define CAN_TIMEOUT 100000
|
||||
|
||||
StateHandle state;
|
||||
int32_t RELAY_BAT_SIDE_VOLTAGE;
|
||||
@ -155,7 +158,7 @@ void sm_precharge_discharge_manager(){
|
||||
}
|
||||
|
||||
void sm_calibrate_powerground(){
|
||||
if (powerground_calibration_stage != 4 && state.current_state == STATE_READY){
|
||||
if (powerground_calibration_stage != 4 && state.current_state == STATE_PRECHARGE){
|
||||
switch (powerground_calibration_stage) {
|
||||
case 0:
|
||||
powerground_calibration_timer = HAL_GetTick() + 0;
|
||||
|
||||
Reference in New Issue
Block a user