Commit 6a9d1abf authored by 崔立宝's avatar 崔立宝

修改禅道35730、35715、35701、35699、35693问题

parent 10951c04
......@@ -202,12 +202,12 @@ interrupt void Api_CAN_Rev_isr(void)
{
if (m_dlc == 8)
{
if (CanClk.Signal.Exist5F2 == Disable)
{
CanClk.ID5F2Cn++;
}
//if (CanClk.Signal.Exist5F2 == Disable)
//{
//CanClk.ID5F2Cn++;
//}
if (CanClk.ID5F2Cn > 2)
//if (CanClk.ID5F2Cn > 2)
{
CanMsg5F2.ProceF = msg_full;
CanMsg5F2.Data[7].bbyte = CANRXDSR7;
......
......@@ -44,8 +44,10 @@ void Api_Sys_ON(void)
TIM0_TIE_C2I = Disable;
//CPMUAPICTL_APIE=1; //�����������ж�
// CPMUAPICTL_APIFE=1; //ʹ�����������жϹ���,����ʼ��ʱ
TIM1_TIE_C7I = Enable;
TIM1_TIE_C7I = Enable;
bsp_CAN_SleepRelease();
ClearOdoCanOut = 0;
ClearOdoCanOutCn = 0;
}
/*-------------------------------------------------------------------------
* Function Name : Api_Sys_Off glz--20170505
......@@ -409,7 +411,7 @@ void Api_GPIO_Init(void)
DIRC_CS_OUT = OUT;
DIRC_FMQ = OUT;
DIRC_ZZX_LED_P = OUT;
//ZZX_LED_P = OUT; //--
DIRC_YURE_LED_P = OUT;
......
......@@ -265,14 +265,14 @@ interrupt void Api_VehCap_isr(void)
}
if (VehFre.Cycl > VehFreLimit)
{
AccPulse++;
AccPulse++; //= 1000;//+;
FreDiv4Pulse++;
}
// pECU_OUT = !pECU_OUT;
if(2==FreDiv4Pulse)
// pECU_OUT = !pECU_OUT;
if(2==FreDiv4Pulse)
{
CS_OUT=!CS_OUT;
FreDiv4Pulse=0;
CS_OUT=!CS_OUT;
FreDiv4Pulse=0;
}
OldVehCnt.dw32 = CurVehCnt.dw32;
......
......@@ -498,6 +498,7 @@ void App_CheckCanDrop(void)
if (CanClk.ID5F2Cn == null)
{
CanMsg5F2.Data[7].bbyte = 0;
ClearOdoCanTimes = 0;
CanClk.Signal.Exist5F2 = Disable;
}
......@@ -1115,10 +1116,7 @@ void App_GetNormalData(void)
}
else
{
if (ClearOdoCanTimes < 10)
{
ClearOdoCanTimes = 0;
}
ClearOdoCanTimes = 0;
}
CanMsg5F2.ProceF = Disable;
......@@ -1276,38 +1274,40 @@ INT8U bsp_CANSendExtFrame (INT32U id,INT8U priority,INT8U length,INT8U *txdata)
--------------------------------------------------------------------------*/
INT8U bsp_CANSendStdFrame (INT32U id, INT8U priority, INT8U length, INT8U *txdata)
{
INT8U txbuffer,index;
INT16U cn = null;
INT8U txbuffer, index;
if (!CANTFLG) //Is Transmit Buffer full ? Full ( TXEx=0;)
return failt;
if(id == null)
if (id == null)
return failt;
CANTBSEL = CANTFLG; /* Select lowest empty buffer */
txbuffer = CANTBSEL; // Backup selected buffer
//====
CANTXIDR0 = (INT8U)((id & 0x07F8) >> 3);
CANTXIDR1 = (INT8U)((id & 0x0007) << 5);
if(length>8)
if (length>8)
length=8;
for ( index=0; index < length; index++) {
for ( index=0; index < length; index++)
{
*(&CANTXDSR0 + index) = txdata[index]; //Load data to Tx buffer Data Segment Registers
}
CANTXDLR = length; /* Set Data Length Code */
CANTXDLR = length; /* Set Data Length Code */
CANTXTBPR = priority; /* Set Priority */
CANTFLG = txbuffer; /* Start transmission */
CANTFLG = txbuffer; /* Start transmission */
////////////////glz--20170519 busoff ////////////////////
if ((CANTFLG & txbuffer) != txbuffer)
if ((CANTFLG & txbuffer) != 0)
{
return 2; //failt; lzs--gai
return failt;
}
else
{
CanClk.BusOffTime = T_100ms;
CanClk.BusOffCn = null;
CanClk.BusOffCn = null;
return success;
}
......@@ -1327,7 +1327,7 @@ void App_SendCANMsg(void)
if (Curkeyinput == KeyON)
{
//--------------------------------
if(CanClk.Can18FFB317Time == null)
if (CanClk.Can18FFB317Time == null)
{
wTemp = AccKm.ShortAccKm/10;
g_txCanMsg.id = 0x18FFB317;
......@@ -1432,6 +1432,7 @@ void App_SendCANMsg(void)
if (bReturn != 0)
CanClk.CanCFE6CEETime = 25; //50mS
}
//清零外发
if (CanClk.Can49ETime == null)
{
......@@ -1456,11 +1457,13 @@ void App_SendCANMsg(void)
{
if (ClearOdoCanOut)
{
ClearOdoCanOutCn = ClearOdoCanOut;
ClearOdoCanOut--;
g_txCanMsg.msg[7] |= 0x90;
}
}
else
{
ClearOdoCanOutCn = 0;
g_txCanMsg.msg[7] |= 0x50;
}
}
......@@ -1477,11 +1480,18 @@ void App_SendCANMsg(void)
}
}
g_txCanMsg.dlc = 8;
bReturn = bsp_CANSendStdFrame(g_txCanMsg.id, 3, g_txCanMsg.dlc, g_txCanMsg.msg);
bReturn = bsp_CANSendStdFrame(g_txCanMsg.id, 0x80, g_txCanMsg.dlc, g_txCanMsg.msg);
if (bReturn != 0)
{
CanClk.Can49ETime = 488; //1000mS
//AccPulse+= 250;
}
else
{
if (g_txCanMsg.msg[7] == 0x90)
{
ClearOdoCanOut = ClearOdoCanOutCn;
}
}
}
}
}
......
......@@ -86,8 +86,6 @@ void App_Read_EE_Memory(INT16U ReadAddr,INT8U *DestStr,INT16U len)
*(DestStr + i) = Api_Flash_byte_read(ReadAddr + i);
}
}
/*-------------------------------------------------------------------------
* Function Name : App_ReadAccKm
* Description : ��ȡ�ۼ����
......@@ -288,6 +286,8 @@ void App_WriteAccReg(void)
--------------------------------------------------------------------------*/
void App_CalAccKm(void)
{
INT8U temp[16] = {0};
if((CarFlag.FlagBits.AccSaveState) && (!CarFlag.FlagBits.AdjEnable))
{
if((Radio.VehRadio >null)&&(Radio.VehRadio <65535))
......@@ -304,7 +304,7 @@ void App_CalAccKm(void)
}
AccKm.ShortAccKm ++;
AccKm.LongAccKm ++;
// AccKm.LongAccKm=AccKm.LongAccKm+100;//百倍速
//AccKm.LongAccKm=AccKm.LongAccKm+100;//百倍速
}
if(AccKm.ShortAccKm > 9999)
......@@ -346,16 +346,27 @@ void App_CalAccKm(void)
}
}
}
if((VehMeter.CurBoardVal >= VehMeterParamer.Resistor[VehMeterParamer.bVirtualVal-1]-3)&&\
(RevMeter.CurBoardVal >= RevMeterParamer.Resistor[RevMeterParamer.bVirtualVal-1]-200)&&(Key1Input == PushDown))
if ((VehMeter.CurBoardVal >= VehMeterParamer.Resistor[VehMeterParamer.bVirtualVal - 1] - 3) &&\
(RevMeter.CurBoardVal >= RevMeterParamer.Resistor[RevMeterParamer.bVirtualVal - 1] - 200) && (Key1Input == PushDown))
{
if(G_Button.PushTime >= T_1s)
{
AccKm.ClrCnt = null;
App_ClearAccStock();
OUT_2000km_Clear = null;
bsp_IIC_WritePage(0xa2, 256,(INT8U *)&OUT_2000km_Clear, Register_Len);
}
if (G_Button.PushTime >= T_1s)
{
AccKm.ClrCnt = null;
AccPulse = null;
do
{
App_ClearAccStock();
}
while (CarFlag.FlagBits.AccSaveState == Enable);
if (OUT_2000km_Clear)
{
OUT_2000km_Clear = null;
bsp_IIC_WritePage(0xa2, 256, (INT8U *)&temp, Register_Len);
}
}
}
/*OUT 2000km Clear*/
......@@ -391,6 +402,7 @@ void App_CalAccKmCan(void)
{
INT8U check;
//ÿ100ms��������ۼ�
if((g_accTime>=T_100ms) && (CarFlag.FlagBits.AccSaveState))
{
if(VehMeter.CurBoardVal > null)
......
......@@ -703,7 +703,9 @@ void GUI_BeepProc(BeepType *Bp)
if (CarFlag.FlagBits.BeepProcEn)
{
if (Curkeyinput == KeyON)
{ //安全带报警
{
//安全带报警
if (((bDSTable[ID_SAFEBELT] & STATEMASK) == 0x01) && (VehMeter.CurBoardVal > 20))
{
Bp[3].Prio = SafeAlr;
......@@ -762,6 +764,7 @@ void GUI_BeepProc(BeepType *Bp)
Bp[2].CurBeepCn = null;
}
//超速报警
if ((bDSTable[ID_VEHSPD] & STATEMASK) == 0x01)
{
Bp[4].Prio = VehAlr;
......@@ -781,6 +784,7 @@ void GUI_BeepProc(BeepType *Bp)
}
//燃油低报警
if ((bDSTable[ID_FUELLOW] & STATEMASK) == 0x01)
{
Bp[5].Prio = FuelAlr;
......@@ -802,6 +806,7 @@ void GUI_BeepProc(BeepType *Bp)
CarFlag.FlagBits.BeepProcEn = Disable;
}
//转速报警
if ((bDSTable[ID_MOTSPD] & STATEMASK) == 0x01)
{
......@@ -1094,6 +1099,8 @@ void far GUI_BeepOut(void)
--------------------------------------------------------------------------*/
void GUI_CheckKeyProc(KeyType *KeyMenu)
{
INT8U temp[16] = {0};
if (Curkeyinput == KeyON)
{
if (((KeyMenu->PushTime >= T_20s) || (ClearOdoCanTimes >= 10)) && (AccKm.LongAccKm < 20000) && (AccKm.LongAccKm > 0))
......@@ -1102,14 +1109,16 @@ void GUI_CheckKeyProc(KeyType *KeyMenu)
{
ClearOdoCanOut = 30;
OUT_2000km_Clear = one;
bsp_IIC_WritePage(0xa2, 256, (INT8U *)&OUT_2000km_Clear, Register_Len);
temp[0] = one;
bsp_IIC_WritePage(0xa2, 256, (INT8U *)&temp, Register_Len);
do
{
App_ClearAccStock();
}
while (CarFlag.FlagBits.AccSaveState == Enable);
CarFlag.FlagBits.AccSaveState = Enable;
//CarFlag.FlagBits.AccSaveState = Enable;
ClearOdoCanTimes = 0;
......
......@@ -268,7 +268,8 @@
EXTERN_VAR volatile INT8U g_bReturn;
EXTERN_VAR volatile INT8U OUT_2000km_Clear;
EXTERN_VAR volatile INT8U ClearOdoCanTimes;
EXTERN_VAR volatile INT8U ClearOdoCanOut;
EXTERN_VAR volatile INT8U ClearOdoCanOut;
EXTERN_VAR volatile INT8U ClearOdoCanOutCn;
//
EXTERN_VAR MULCANMSG MulCanMsg_ECM18EBFF00;
EXTERN_VAR INT8U Engine21_18EBFF00;
......
This diff is collapsed.
......@@ -7,7 +7,17 @@
//20230325 修改驾驶员相关报警逻辑(禅道问题)
//20230403 修改车厂清零,10km以内清后下电上电恢复问题
//20231115 变更:增加远程报文清零功能(接收清零报文0x5F2,发送清零状态报文0x49E)
//20231116 修改IGNON、IGNOFF门槛值,由16.6V改为6.5V
//20231116 修改IGNON、IGNOFF门槛值,由16.6V改为6.5V
//20231208 修改清零外发不是30帧和清零后里程继续累加及需发12帧清零指令才清零禅道问题
INT8U Read_OUT_2000km_Clear(void)
{
INT8U temp[16];
bsp_IIC_ReadPage(0xa2, 256, (INT8U *)&temp, Register_Len);
return temp[0];
}
void main(void)
{
......@@ -38,7 +48,7 @@ void main(void)
OBD_LED_P=0;//lzs--jia
Ht16c23_Init(ON);
App_ReadAccKm();
bsp_IIC_ReadPage(0xa2, 256, (INT8U *)&OUT_2000km_Clear, Register_Len);
OUT_2000km_Clear = Read_OUT_2000km_Clear();
CarFlag.FlagBits.SysOffEn = Enable;
GUI_Motor_Start();
RunStep = Out_Proc;
......
......@@ -155,17 +155,19 @@ TARGET_FREQUENCY=16000000
[Recent HI-WAVE FindProcedure Search]
Search0=App_CalAccKm
Search1=Api_CAN_Rev_isr
Search2=App_ReadAccKm
Search3=main
Search4=GUI_LedNormalDisplay
Search5=App_CheckCanDrop
Search6=GUI_ZAQD_QDDPRG
Search7=Api_InitParamer
Search8=App_CalFuelBoard
Search9=App_CalVehBoard
Search10=GUI_CheckKeyProc
Search11=Gui_Icon
Search12=QY1_Disp
Search13=Show_num
Search0=bsp_CANSendStdFrame
Search1=App_SendCANMsg
Search2=GUI_CheckKeyProc
Search3=App_ReadAccKm
Search4=App_CalAccKm
Search5=GUI_BeepOut
Search6=Api_CAN_Rev_isr
Search7=main
Search8=GUI_LedNormalDisplay
Search9=App_CheckCanDrop
Search10=GUI_ZAQD_QDDPRG
Search11=Api_InitParamer
Search12=App_CalFuelBoard
Search13=App_CalVehBoard
Search14=Gui_Icon
Search15=QY1_Disp
This diff is collapsed.
No preview for this file type
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
Data < ADDXPR ONLY_ADD_IF_NEW "FuelMeter.DestPosition"
Data < ADDXPR ONLY_ADD_IF_NEW "FuelMeter.CurPosition"
Data < ADDXPR ONLY_ADD_IF_NEW "FuleSpeed"
Data < ADDXPR ONLY_ADD_IF_NEW "Fuelnum"
Data < ADDXPR ONLY_ADD_IF_NEW "FuelMeter.CurBoardVal"
Data < ADDXPR ONLY_ADD_IF_NEW "FuleShowFlag"
Data < ADDXPR ONLY_ADD_IF_NEW "main.c::AccKm"
Data < ADDXPR ONLY_ADD_IF_NEW "G_Button.PushTime"
Data < ADDXPR ONLY_ADD_IF_NEW "AccKm"
Data < ADDXPR ONLY_ADD_IF_NEW "OldAccKm"
Data < ADDXPR ONLY_ADD_IF_NEW "OUT_2000km_Clear"
Data < ADDXPR ONLY_ADD_IF_NEW "FuelMeter"
Data < ADDXPR ONLY_ADD_IF_NEW "FuelMeterParamer"
Data < ADDXPR ONLY_ADD_IF_NEW "OBD_CheckTime"
Data < ADDXPR ONLY_ADD_IF_NEW "CanMsg5F2.Data[7].bbyte"
Data < ADDXPR ONLY_ADD_IF_NEW "ClearOdoCanTimes"
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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