updated can.c
This commit is contained in:
parent
863b085d1c
commit
9042ceb02c
@ -1,6 +1,9 @@
|
|||||||
|
|
||||||
#include "stm32f3xx_hal.h"
|
#include "stm32f3xx_hal.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include "AMS_HighLevel.h"
|
||||||
|
#include "can-halal.h"
|
||||||
|
#include "state_machine.h"
|
||||||
|
|
||||||
#define CAN_ID_IN 0x501
|
#define CAN_ID_IN 0x501
|
||||||
#define CAN_ID_OUT 0x502
|
#define CAN_ID_OUT 0x502
|
||||||
@ -9,5 +12,4 @@ void can_init(CAN_HandleTypeDef* hcan);
|
|||||||
|
|
||||||
void can_handle_send_status();
|
void can_handle_send_status();
|
||||||
|
|
||||||
void can_handle_recieve_command(CAN_RxHeaderTypeDef* header, uint8_t* data);
|
void can_handle_recieve_command(const uint8_t *data);
|
||||||
|
|
@ -6,11 +6,8 @@
|
|||||||
|
|
||||||
#include "can.h"
|
#include "can.h"
|
||||||
|
|
||||||
#include "AMS_HighLevel.h"
|
//#define CAN_ID_IN 0x501
|
||||||
//#include "TMP1075.h"
|
//#define CAN_ID_OUT 0x502
|
||||||
#include "can-halal.h"
|
|
||||||
#include "state_machine.h"
|
|
||||||
|
|
||||||
void can_init(CAN_HandleTypeDef* hcan) { ftcan_init(hcan); }
|
void can_init(CAN_HandleTypeDef* hcan) { ftcan_init(hcan); }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -25,3 +22,7 @@ void can_handle_send_status() {
|
|||||||
data[0] = (state.current_state << 5); //save 5 bit since codes are from 0-6
|
data[0] = (state.current_state << 5); //save 5 bit since codes are from 0-6
|
||||||
ftcan_transmit(CAN_ID_OUT, data, sizeof(data));
|
ftcan_transmit(CAN_ID_OUT, data, sizeof(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void can_handle_recieve_command(const uint8_t *data){
|
||||||
|
ftcan_msg_received_cb(0x501, 8, data);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user