updated can.c
This commit is contained in:
		@ -1,6 +1,9 @@
 | 
			
		||||
 | 
			
		||||
#include "stm32f3xx_hal.h"
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
#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);
 | 
			
		||||
@ -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);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user