diff --git a/Core/Inc/can.h b/Core/Inc/can.h index aecdb06..c355b19 100644 --- a/Core/Inc/can.h +++ b/Core/Inc/can.h @@ -1,6 +1,9 @@ #include "stm32f3xx_hal.h" #include +#include "AMS_HighLevel.h" +#include "can-halal.h" +#include "state_machine.h" #define CAN_ID_IN 0x501 #define CAN_ID_OUT 0x502 @@ -9,5 +12,4 @@ void can_init(CAN_HandleTypeDef* hcan); 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); \ No newline at end of file diff --git a/Core/Src/can.c b/Core/Src/can.c index 963c179..747ff35 100644 --- a/Core/Src/can.c +++ b/Core/Src/can.c @@ -6,11 +6,8 @@ #include "can.h" -#include "AMS_HighLevel.h" -//#include "TMP1075.h" -#include "can-halal.h" -#include "state_machine.h" - +//#define CAN_ID_IN 0x501 +//#define CAN_ID_OUT 0x502 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 ftcan_transmit(CAN_ID_OUT, data, sizeof(data)); } + +void can_handle_recieve_command(const uint8_t *data){ + ftcan_msg_received_cb(0x501, 8, data); +}