Commit 46266bfc authored by 时昊's avatar 时昊

1.恢复原来Execute_Specify_Step()函数的调用

2.恢复VOICE_CHECK_BEGIN变量的判断
3.将CAN,IO,PWM三个函数分离
4.删除无用函数
5.默认步数是0
parent 8d11c196
......@@ -153,36 +153,6 @@ void COM_TX_Process(void)
CanFD_Write_Fun(&CANFD_CH0_CanFDMsgTxOp, 2u);
}
// void Msg_Load_Init(void)
// {
// uint32_t i = 0u;
// uint32_t *addr;
// uint32_t Total_Msg;
// uint32_t Total_Msg_addr;
// PreLoad_Info = ( uint32_t *)FIX_LOAD_ADDRESS;
// g_Verify_Result = Check_Infordata_CRC_32(&PreLoad_Info->total_msg, 28);
// if ( g_Verify_Result == 1U )
// {
// Total_Msg = PreLoad_Info->total_msg.word;
// Total_Msg_addr = PreLoad_Info->total_msg_begin.word;
// addr = ( uint32_t *)Total_Msg_addr;
// for ( i = 0; i < Total_Msg; i++ )
// {
// Load_Attr [ i ].u32MsgID = (*(addr + i * 4)); // convert_0;
// Load_Attr [ i ].u32MsgCycle = (*(addr + 1 + i * 4)); // convert_1;
// Load_Attr [ i ].u8MsgPro = (*(addr + 2 + i * 4)); // convert_2;//通道
// Load_Attr [ i ].u8MsgDLC = (*(addr + 3 + i * 4)); // convert_3;
// }
// addr = ( uint32_t * )PreLoad_Info->sub_step_addr.word;
// for ( i = 0; i < PreLoad_Info->total_step.word; i++ )
// {
// Sub_Attr [ i ].Subaddr = (*(addr + 0 + i * 2));
// Sub_Attr [ i ].SubStep = (*(addr + 1 + i * 2));
// }
// }
// }
void Msg_Load_Init(void)
{
uint32_t i = 0u;
......@@ -194,8 +164,6 @@ void Msg_Load_Init(void)
st_IO *io_list;
st_PWM *pwm_list;
PreLoad_Info = ( uint32_t *)FIX_LOAD_ADDRESS;
g_Verify_Result = Check_Infordata_CRC_32(&PreLoad_Info->total_msg_begin, PreLoad_Info->crc_Len ,PreLoad_Info->crc_result);
if ( g_Verify_Result == 1U )
......@@ -208,88 +176,8 @@ void Msg_Load_Init(void)
Load_Attr [ i ].u32MsgCycle = Total_Msg_addr[i].u16Cycle; //(*(addr + 1 + i * 4)); // convert_1;
Load_Attr [ i ].u8MsgPro = Total_Msg_addr[i].u8COM; //(*(addr + 2 + i * 4)); // convert_2;
Load_Attr [ i ].u8MsgDLC = Total_Msg_addr[i].u8Len; //(*(addr + 3 + i * 4)); // convert_3;
//Total_Msg_addr[CAN_addr[i].nuber].u16ID;
//Total_Msg_addr[CAN_addr[i].nuber].u16Cycle;
//Total_Msg_addr[CAN_addr[i].nuber].u8COM;
//Total_Msg_addr[CAN_addr[i].nuber].u8Len;
// Total_Msg_addr[i].u8Mode;
// Total_Msg_addr[i].u8MsgSTD_EXT;
//printf("%04x %04X %02X %02X %02X %02X \r\n",Total_Msg_addr[i].u16ID
// ,Total_Msg_addr[i].u16Cycle
// ,Total_Msg_addr[i].u8COM
// ,Total_Msg_addr[i].u8Len
// ,Total_Msg_addr[i].u8Mode
// ,Total_Msg_addr[i].u8MsgSTD_EXT);
}
//printf("\r\n");
step_list = (st_step_list*)PreLoad_Info->total_step_begin.word;
//for ( i = 0; i < PreLoad_Info->total_step.word; i++ )
//{
// printf("%08x %08X %08X %08X %08X %08X \r\n" ,step_list[i].u32Subaddr_CAN
// ,step_list[i].u32SubStep_CAN
// ,step_list[i].u32Subaddr_IO
// ,step_list[i].u32SubStep_IO
// ,step_list[i].u32Subaddr_PWM
// ,step_list[i].u32SubStep_PWM);
//}
//for ( k = 0; k < PreLoad_Info->total_step.word; k++ )
//{
// can_list = (st_CAN *)step_list[k].u32Subaddr_CAN;
// io_list = (st_IO *)step_list[k].u32Subaddr_IO;
// pwm_list = (st_PWM *)step_list[k].u32Subaddr_PWM;
// printf("\r\nNo.%d :\r\n CAN:\r\n",(k+1));
// for ( i = 0; i < step_list[k].u32SubStep_CAN; i++ )
// {
// printf("%08x :\r\n",can_list[i].nuber);
// for ( j = 0; j < 64; j++ )
// {
// printf("%02x",can_list[i].msg[j]);
// }
// printf("\r\n");
// }
// printf("\r\nIO:\r\n");
// for ( i = 0; i < step_list[k].u32SubStep_IO; i++ )
// {
// printf("%02X %02X %02X \r\n",io_list[i].pin
// ,io_list[i].level
// ,io_list[i].IN_OUT);
// }
//
// printf("\r\nPWM:\r\n");
// for ( i = 0; i < step_list[k].u32SubStep_PWM; i++ )
// {
// printf("%02x %02x %04x %04x\r\n",pwm_list[i].pin
// ,pwm_list[i].IN_OUT
// ,pwm_list[i].duty
// ,pwm_list[i].freq);
// }
//}
}
}
......@@ -311,28 +199,74 @@ void Execute_Specify_Step(uint32_t step)
{
if ( step < PreLoad_Info->total_step.word )
{
CAN_addr = (st_CAN *)step_list[step].u32Subaddr_CAN;
for ( i = 0; i < step_list[step].u32SubStep_CAN; i++ )
{
// pbuff = ( void *)(CAN_addr[i].msg);
for ( j = 0; j < /*CAN0_FD_DLC_ChangeTo_Register(Load_Attr [ i ].u8MsgDLC)*/64; j++ )
{
Load_AttrBuff [ CAN_addr[ i ].nuber ].sig.Msg [ j ] = CAN_addr[i].msg[ j ];
}
CanFD_Msg_TX_SetMsgBuffer(&CANFD_CH0_CanFDMsgTxOp, CAN_addr[ i ].nuber , \
CAN0_FD_DLC_ChangeTo_Register(Load_Attr [ i ].u8MsgDLC),\
Load_AttrBuff [ CAN_addr[ i ].nuber ].sig.Msg);
}
/*IO_addr = (st_IO *)step_list[step].u32Subaddr_IO;
for ( i = 0; i < step_list[step].u32SubStep_IO; i++ )//step是步数,u32SubStep_IO是每个步数的
{ //pin是每个IO的pin,level是每个IO的level, u32SubStep_IO等同于IO_addr[i]里的i;
F1KM_16843_Port_IO_P [IO_addr[i].pin].Set_Output(IO_addr[i].level);
}
PWM_addr = (st_PWM *)step_list[step].u32Subaddr_PWM;
for ( i = 0; i < step_list[step].u32SubStep_PWM; i++ )
{
F1KM_16843_Port_PWM_Out[PWM_addr[i].pin].PWM_Output(PWM_addr[i].duty, PWM_addr[i].freq);
}*/
}
}
}
void Execute_Specify_Step_IO(uint32_t step)
{
uint32_t i = 0u;
uint32_t j = 0u;
static st_PWM *PWM_addr;
static st_IO *IO_addr;
static st_CAN *CAN_addr;
uint32_t buff_idx;
uint32_t buff_id;
uint8_t *pbuff;
if ( g_Verify_Result == 1U )
{
if ( step < PreLoad_Info->total_step.word )
{
IO_addr = (st_IO *)step_list[step].u32Subaddr_IO;
for ( i = 0; i < step_list[step].u32SubStep_IO; i++ )//step是步数,u32SubStep_IO是每个步数的
{ //pin是每个IO的pin,level是每个IO的level, u32SubStep_IO等同于IO_addr[i]里的i;
F1KM_16843_Port_IO_P [IO_addr[i].pin].Set_Output(IO_addr[i].level);
}
}
}
}
void Execute_Specify_Step_PWM(uint32_t step)
{
uint32_t i = 0u;
uint32_t j = 0u;
static st_PWM *PWM_addr;
static st_IO *IO_addr;
static st_CAN *CAN_addr;
uint32_t buff_idx;
uint32_t buff_id;
uint8_t *pbuff;
if ( g_Verify_Result == 1U )
{
if ( step < PreLoad_Info->total_step.word )
{
PWM_addr = (st_PWM *)step_list[step].u32Subaddr_PWM;
for ( i = 0; i < step_list[step].u32SubStep_PWM; i++ )
{
......
......@@ -86,7 +86,7 @@ void MENU_CHECK_STEP_SUB(void)
// }
void MENU_CHECK_Init(void)
{
MENU_CHECK_STEP = 1;
MENU_CHECK_STEP = 0;
}
......@@ -989,7 +989,7 @@ void HW_ODO_Clear(void)
{
if(UDS_DID_F1F8 == 0)
{
//Execute_Specify_Step(7);
Execute_Specify_Step(7);
UDS_DID_F1F8 = 1;
}
else if(UDS_DID_F1F8 == 1)
......@@ -1018,7 +1018,7 @@ void HW_ODO_Clear(void)
}
else if(UDS_DID_F1F8 == 2)
{
//Execute_Specify_Step(6);
Execute_Specify_Step(6);
UDS_DID_F1F8 =3;
LINE_ODO_CLEAR_BEGIN = 1u;
VOICE_ODO_CLEAR_Retry = 150;
......@@ -1037,7 +1037,7 @@ void SET_ODO_Clear_F(void)
uint8_t Part_Number[]={0x39, 0x32, 0x31, 0x30, 0x30, 0x30, 0x31, 0x2D, 0x44, 0x45, 0x31, 0x30};
if((VOICE_ODO_CLEAR_Retry == 0) && (ODO_Retry != VOICE_ODO_CLEAR_Retry))
{
//Execute_Specify_Step(7);
Execute_Specify_Step(7);
ODO_BACK = 1u;
}
ODO_Retry = VOICE_ODO_CLEAR_Retry;
......@@ -1928,17 +1928,16 @@ void Function_Check_Ctrl(uint32_t cmd)
if ( UDS_EunD != MENU_CHECK_STEP )
{
if (1)//( VOICE_CHECK_BEGIN == 0 )
if ( VOICE_CHECK_BEGIN == 0 )
{
VOICE_CHECK_BEGIN = 1u;
VOICE_CHECK_Retry = 10u;
p [ 0 ] = (MENU_CHECK_STEP) / 100; // 65535
p [ 1 ] = ((MENU_CHECK_STEP) % 100) / 10;
p [ 2 ] = (MENU_CHECK_STEP) % 10; // 65535
//p [ 2 ] += 1;
p [ 3 ] = 0xff;
General_Number_Disp(p, 40, 48 + 64);
UDS_EunD = MENU_CHECK_STEP;
//UDS_EunD = MENU_CHECK_STEP;
}
else if ( VOICE_CHECK_BEGIN == 1 )
{
......@@ -1954,78 +1953,6 @@ void Function_Check_Ctrl(uint32_t cmd)
}
if(MENU_CHECK_STEP != 0)
{
/*if(MENU_CHECK_STEP == 1)
{
LINE_OUT_CHARGER = 0;
LINE_OUT_OIL = 0;
LINE_OUT_BREAK_LEVEL = 0;
LINE_OUT_WARSH_LEVEL = 0;
LINE_OUT_EPS = 0;
DIAG_BUFER [ 0 ] = 0x00;
DIAG_BUFER [ 1 ] = 0xE0;
DIAG_BUFER [ 2 ] = 0x7F;
DIAG_BUFER [ 3 ] = 0x80;
DIAG_BUFER [ 4 ] = 0x00;
DIAG_BUFER [ 5 ] = 0x4F;
DIAG_BUFER [ 6 ] = 0x71;
DIAG_BUFER [ 7 ] = 0x02;
DIAG_BUFER [ 8 ] = 0x68;
DIAG_BUFER [ 9 ] = 0x88;
DIAG_BUFER [ 10] = 0x22;
DIAG_BUFER [ 11] = 0x74;
DIAG_BUFER [ 12] = 0x00;
DIAG_BUFER [ 13] = 0x00;
DIAG_BUFER [ 14] = 0x00;
DIAG_BUFER [ 15] = 0x00;
DIAG_BUFER [ 16] = 0x00;
DIAG_BUFER [ 17] = 0x00;
DIAG_BUFER [ 18] = 0x00;
UDS_S_Data_Request(DIAG_ID_Tx, DIAG_BUFER, 19);
}
else */
// if(MENU_CHECK_STEP == 1)
// {
// LINE_OUT_CHARGER = 1;
// LINE_OUT_OIL = 0u;
// LINE_OUT_BREAK_LEVEL = 0u;
// LINE_OUT_WARSH_LEVEL = 0u;
// LINE_OUT_EPS = 0u;
// }
// else if(MENU_CHECK_STEP == 2)
// {
// LINE_OUT_CHARGER = 0;
// LINE_OUT_OIL = 1u;
// LINE_OUT_BREAK_LEVEL = 0u;
// LINE_OUT_WARSH_LEVEL = 0u;
// LINE_OUT_EPS = 0u;
// }
// else if(MENU_CHECK_STEP == 3)
// {
// LINE_OUT_CHARGER = 0;
// LINE_OUT_OIL = 0u;
// LINE_OUT_BREAK_LEVEL = 1u;
// LINE_OUT_WARSH_LEVEL = 0u;
// LINE_OUT_EPS = 0u;
// }
// else if(MENU_CHECK_STEP == 4)
// {
// LINE_OUT_CHARGER = 0;
// LINE_OUT_OIL = 0u;
// LINE_OUT_BREAK_LEVEL = 0u;
// LINE_OUT_WARSH_LEVEL = 1u;
// LINE_OUT_EPS = 0u;
// }
// else if(MENU_CHECK_STEP == 5)
// {
// LINE_OUT_CHARGER = 0;
// LINE_OUT_OIL = 0u;
// LINE_OUT_BREAK_LEVEL = 0u;
// LINE_OUT_WARSH_LEVEL = 0u;
// LINE_OUT_EPS = 1u;
// }
// else
{
if ( MENU_CHECK_STEP > Get_Total_CheckStep( ) )
{
......@@ -2034,17 +1961,16 @@ void Function_Check_Ctrl(uint32_t cmd)
if ( MENU_BACK != MENU_CHECK_STEP )
{
Execute_Specify_Step((MENU_CHECK_STEP));
//Execute_Specify_Step_IO(MENU_CHECK_STEP);
if(MENU_CHECK_STEP >= 1)
{
//Execute_Specify_Step_PWM(MENU_CHECK_STEP - 1);
Execute_Specify_Step((MENU_CHECK_STEP - 1));
Execute_Specify_Step_IO(MENU_CHECK_STEP - 1);
Execute_Specify_Step_PWM(MENU_CHECK_STEP - 1);
}
MENU_BACK = MENU_CHECK_STEP;
}
}
}
}
}
......
......@@ -900,7 +900,7 @@ void Display_FUNC_CHECK(void)
TFT_LCD_Draw_Bmp(60, 48, ( uint8_t * )FUNC_TEST_Info_TEXT);
p [ 0 ] = 0; // 65535
p [ 1 ] = 0;
p [ 2 ] = 1;
p [ 2 ] = 0;
p [ 3 ] = 0xff;
General_Number_Disp(p, 40, 48 + 64);
}
......@@ -1045,7 +1045,7 @@ void Version_Info(uint32_t ON_OFF)
DIAG_BUFER [ 18] = 0x00;
UDS_S_Data_Request(DIAG_ID_Tx, DIAG_BUFER, 19);
//Execute_Specify_Step(9);
Execute_Specify_Step(9);
if((LCDAR == 1) && (LCDAL == 1))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment