implemented can_hanlde_recieve_command correctly
changed can_handle_send_status
This commit is contained in:
@ -4,7 +4,6 @@
|
||||
#include "stm32f3xx_hal.h"
|
||||
#include <stdint.h>
|
||||
#include "main.h"
|
||||
#include "AMS_HighLevel.h"
|
||||
#include "state_machine.h"
|
||||
#include "can-halal.h"
|
||||
|
||||
@ -17,4 +16,6 @@ void can_handle_send_status();
|
||||
|
||||
void can_handle_recieve_command(const uint8_t *data);
|
||||
|
||||
void ftcan_msg_received_cb(uint16_t id, size_t datalen, const uint8_t *data);
|
||||
|
||||
#endif /* "INC_CAN_H" */
|
||||
@ -3,14 +3,8 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "ADBMS_LL_Driver.h"
|
||||
#include "AMS_HighLevel.h"
|
||||
#include "PWM_control.h"
|
||||
#include "stm32f3xx_hal.h"
|
||||
#include "ADBMS_Abstraction.h"
|
||||
#include "main.h"
|
||||
#include "can.h"
|
||||
|
||||
// Minimum vehicle side voltage to exit precharge
|
||||
#define MIN_VEHICLE_SIDE_VOLTAGE 150000 // mV
|
||||
@ -65,6 +59,11 @@ typedef struct {
|
||||
} StateHandle;
|
||||
|
||||
extern StateHandle state;
|
||||
static bool relay_closed = 0;
|
||||
static bool precharge_closed = 0;
|
||||
static int16_t RELAY_BAT_SIDE_VOLTAGE = 0;
|
||||
static int16_t RELAY_ESC_SIDE_VOLTAGE = 0;
|
||||
static int16_t CURRENT_MEASUREMENT = 0;
|
||||
|
||||
void sm_init();
|
||||
void sm_update();
|
||||
@ -81,9 +80,10 @@ State sm_update_error();
|
||||
typedef enum { RELAY_MAIN, RELAY_PRECHARGE } Relay;
|
||||
void sm_set_relay_positions(State state);
|
||||
void sm_set_relay(Relay relay, bool closed);
|
||||
void sm_charging_check();
|
||||
void sm_check_charging();
|
||||
void sm_check_cell_temps(int8_t* id, int16_t* temp);
|
||||
|
||||
void sm_handle_ams_in();
|
||||
void sm_handle_ams_in(const uint8 *data);
|
||||
void sm_check_errors();
|
||||
void sm_set_error(ErrorKind error_kind, bool is_errored);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user