Files
MAX_CARLINK_A270S/MXC_A27-PCB4.5-CANUI/app/moto/protocol/can_protocol.c

48 lines
975 B
C

#include "awtk.h"
#include "can_protocol.h"
#include "moto_config.h"
uint8_t tcs_twinkle = 0;
uint8_t tcs_switch = 0;
//37B
void tcsworking_event_handing(int *buf){
uint8_t data = 0;
*(buf++);
*(buf++);
data = *(buf++);
tcs_twinkle = getBitValue(data,7);//tcs闪烁控制指令 为1闪烁
}
//12B
void tcsswitch_event_handing(int *buf){
uint8_t data = 0;
uint8_t tcs_data = 0;
data = *(buf++);
tcs_data = getBit2Value(data,0);//tcs开关信号
if(tcs_data<=1)
tcs_switch = tcs_data;
}
//0xA5
void abs_dtc_event_handing(int *buf){
char dtc[5] = {0};
dtc[4] = *(buf++)&0xFF;
dtc[3] = *(buf++)&0xFF;
dtc[2] = *(buf++)&0xFF;
dtc[1] = *(buf++)&0xFF;
dtc[0] = *(buf++)&0xFF;
Set_can_abs_dtc(dtc);
}
//0x402
void ecu_dtc_event_handing2(int *buf){
char dtc[5] = {0};
dtc[4] = *(buf++)&0xFF;
dtc[3] = *(buf++)&0xFF;
dtc[2] = *(buf++)&0xFF;
dtc[1] = *(buf++)&0xFF;
dtc[0] = *(buf++)&0xFF;
Set_can_abs_dtc(dtc);
}