快排仪表以及A270S版本生成

This commit is contained in:
2025-02-11 18:48:14 +08:00
parent f0fb64e4e6
commit 08e216ffb2
63 changed files with 29766 additions and 29566 deletions

View File

@ -7,10 +7,18 @@
#include "gpio_protocol.h"
#include "moto_config.h"
#if DEVICE_MXC_A58
// #define CAN_USE_TX_DEMO
#elif DEVICE_MXC_A59
// #define CAN_USE_TX_DEMO
#else
#ifdef UI_VIEW_QUICKLY_ARRANGE
#define CAN_USE_TX_DEMO
#endif
#endif
#define CAN_RX_BUF_NUM 32
@ -692,27 +700,38 @@ int iCanGetTransmitErrorCount(CanPort_t *cap)
}
#ifdef CAN_USE_TX_DEMO
int cantx_count = 0;
static void can_txdemo_thread(void *param)
{
CanPort_t *cap = param;
// CanMsg txmsg = {0};
// txmsg.IDE = CAN_Id_Standard;
// txmsg.DLC = 4;
// txmsg.Data[0] = 0x11;
// txmsg.Data[1] = 0x22;
// txmsg.Data[2] = 0x33;
// txmsg.Data[3] = 0x44;
uint8_t checksum = 0;
CanMsg txmsg = {0};
txmsg.StdId = 0x200;
txmsg.StdId = 0x213;
//txmsg.ExtId = 0x400;
txmsg.IDE = CAN_Id_Standard;
txmsg.DLC = 8;
txmsg.Data[0] = Get_sys_tcs_on_off()?0x8:0x00;
txmsg.Data[0] = Get_sys_quickly_arrange()?0x0:0x10;
if(Get_sys_grade() >= 7)
txmsg.Data[1] = 0xFF;//档位
else
txmsg.Data[1] = Get_sys_grade();//档位
txmsg.Data[2] = Get_sys_velocity();//速度
txmsg.Data[3] = 0x00;
txmsg.Data[4] = 0x00;
txmsg.Data[5] = 0x00;
txmsg.Data[6] = 0x00;
txmsg.Data[7] = 0x00;
for (;;) {
txmsg.Data[0] = Get_sys_tcs_on_off()?0x8:0x00;
iCanWrite(cap, &txmsg, 1, 0);
vTaskDelay(pdMS_TO_TICKS(100));
if(Get_sys_power_on_self_test() == 100){
txmsg.Data[0] = Get_sys_quickly_arrange()?0x0:0x10;
if(Get_sys_grade() >= 7)
txmsg.Data[1] = 0xFF;//档位
else
txmsg.Data[1] = Get_sys_grade();
txmsg.Data[2] = Get_sys_velocity();
iCanWrite(cap, &txmsg, 1, 0);
}
vTaskDelay(pdMS_TO_TICKS(10));
}
}
#endif
@ -794,11 +813,18 @@ static void can_rxdemo_thread(void *param)
#else
switch(rxmsg[i].StdId){
// #ifdef UI_VIEW_QUICKLY_ARRANGE
// case 0x100:
// if(abs_speed_flag != 10)
// abs_speed_flag = 10;
// ASB_speed_event_handing(tlv_data_value);
// break;
// #endif
case 0x141:
if(abs_speed_flag != 10)
abs_speed_flag = 10;
ASB_141_speed_event_handing(tlv_data_value);
break;
case 0x101:
if(speed_flag != 10)
speed_flag = 10;
@ -841,7 +867,7 @@ int can_demo(void)
// canfilter.ID = 0x37B;
// canfilter.IDMASK = 0x7ff;
canfilter.ID = 0x402;
canfilter.IDMASK = 0x503;
canfilter.IDMASK = 0X543;
vCanSetFilter(cap, &canfilter);
#endif