Commit ab10570e authored by 高士达's avatar 高士达

Merge branch 'CHENJIALE' into 'dev'

Chenjiale

See merge request !66
parents 4e6b837e 86f6245d
......@@ -2,8 +2,8 @@
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_IROM1 0x00000000 0x00040000 { ; load region size_region
ER_IROM1 0x00000000 0x00040000 { ; load address = execution address
LR_IROM1 0x00008000 0x00040000 { ; load region size_region
ER_IROM1 0x00008000 0x00040000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
......
......@@ -13,7 +13,7 @@ const st_CAN_SendAttribute CAN_CH0_CANSendAttr[CAN_CH0_ID_SEND_TOTAL] =
{0x6EFul, 100ul * 1000ul, 97ul * 1000ul, 0u, MSG_STD, 3u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_6EF, (void *)0},
{0x450ul, 100ul * 1000ul, 96ul * 1000ul, 0u, MSG_STD, 4u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_450, (void *)0},
#if (IC_Current == TY200_080000b_ty)
{0x580ul, 8ul * 1000ul, 0ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_580, (void *)0},
{0x580ul, 40ul * 1000ul, 0ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCKE_EVENT, Can_Set_Buff_580, (void *)0},
#endif
};
......
......@@ -158,7 +158,7 @@ void Can_Set_Buff_450(canlib_uint8_t CopyData[])
}
}
//uint8_t Can_580Send_flag = 0;
void Can_Set_Buff_580(canlib_uint8_t CopyData[])
{
CANMsg580Union *p580;
......@@ -174,33 +174,48 @@ void Can_Set_Buff_580(canlib_uint8_t CopyData[])
if(Get_Tpms_TX_Flag() == 1)
{
if(++CAN_TX_Count > 3)
{
Tpms_TX_Flag = 0;
CAN_TX_Count = 0;
}
//Can_580Send_flag = 1;
//if(CAN_TX_Count++ > 2)
//{
// Tpms_TX_Flag = 0;
// CAN_TX_Count = 0;
// //Can_580Send_flag = 0;
//}
p580 -> Sig.TPMS_LEARN_CND_BYTE0 = 0x31;
p580 -> Sig.TPMS_LEARN_CND_BYTE1 = 0x01;
p580 -> Sig.TPMS_LEARN_CND_BYTE2 = 0x59;
p580 -> Sig.TPMS_LEARN_CND_BYTE3 = 0x08;
p580 -> Sig.TPMS_LEARN_CND_BYTE4 = 0x00;
//if(Can_580Send_flag == 0)
//{
// Can_580Send_flag = 1;
// CAN_TX_Count++;
//}
}
else if(Get_Tpms_TX_Flag() == 2)
{
if(++CAN_TX_Count > 3)
{
Tpms_TX_Flag = 0;
CAN_TX_Count = 0;
}
//Can_580Send_flag = 1;
//if(CAN_TX_Count++ > 2)
//{
// Tpms_TX_Flag = 0;
// CAN_TX_Count = 0;
// //Can_580Send_flag = 0;
//}
p580 -> Sig.TPMS_LEARN_CND_BYTE0 = 0x31;
p580 -> Sig.TPMS_LEARN_CND_BYTE1 = 0x01;
p580 -> Sig.TPMS_LEARN_CND_BYTE2 = 0x59;
p580 -> Sig.TPMS_LEARN_CND_BYTE3 = 0x08;
p580 -> Sig.TPMS_LEARN_CND_BYTE4 = 0x01;
//if(Can_580Send_flag == 0)
//{
// Can_580Send_flag = 1;
// CAN_TX_Count++;
//}
}
else
{
CAN_TX_Count = 0;
//Can_580Send_flag = 0;
//CAN_TX_Count = 0;
//p580 -> Sig.TPMS_LEARN_CND_BYTE0 = 0x0;
//p580 -> Sig.TPMS_LEARN_CND_BYTE1 = 0x0;
//p580 -> Sig.TPMS_LEARN_CND_BYTE2 = 0x0;
......
......@@ -326,7 +326,11 @@ uint8_t Get_Busoff_Status(void)
{
return get_can_busoff(CAN_CH_0);
}
extern uint8_t Can_341_Flg;
//extern uint8_t Can_341_Flg;
//extern uint8_t Can_580Send_flag;
uint8_t CAN_Send_Cound = 0;
extern uint8_t Tpms_TX_Flag;
uint8_t COM_APP_Process(st_CAN_Msg *Msg)
{
// Can_Write((st_CAN_Msg *)Msg);
......@@ -380,9 +384,19 @@ uint8_t COM_APP_Process(st_CAN_Msg *Msg)
#if (IC_Current == TY200_080000b_ty)
case 0x580:
if (Get_Tpms_TX_Flag() != 0)
{
if(CAN_Send_Cound++ <= 2)
{
CAN_result = CAN_Transmit(CAN0MSG14, &CAN_SendMsg);
}
else
{
CAN_Send_Cound = 0;
Tpms_TX_Flag = 0;
}
//Can_580Send_flag = 0;
}
break;
#endif
......
......@@ -62,7 +62,7 @@ void EE_SDA_InConfig(void)
--------------------------------------------------------------------------*/
void EE_SDA_OutConfig(void)
{
RTE_GPIO_Config(EE_SDA, RTE_GPIO_OUTPUT_OD);
RTE_GPIO_Config(EE_SDA, RTE_GPIO_DIR_OUT);
}
/*-------------------------------------------------------------------------
* Function Name : EE_SDA_GetValue
......@@ -89,8 +89,8 @@ ee_uint8_t EE_SDA_GetValue(void)
--------------------------------------------------------------------------*/
void EE_SDA_OUT(ee_uint8_t data)
{
RTE_GPIO_Config(EE_SDA, RTE_GPIO_DIR_OUT | data);
//RTE_GPIO_Set_Level(EE_SDA, data);
// RTE_GPIO_Config(EE_SDA, RTE_GPIO_DIR_OUT | data);
RTE_GPIO_Set_Level(EE_SDA, data);
}
/*-------------------------------------------------------------------------
......@@ -103,7 +103,7 @@ void EE_SDA_OUT(ee_uint8_t data)
--------------------------------------------------------------------------*/
void EE_SCL_OutConfig(void)
{
RTE_GPIO_Config(EE_SCL, RTE_GPIO_OUTPUT_OD);
RTE_GPIO_Config(EE_SCL, RTE_GPIO_DIR_OUT);
}
/*-------------------------------------------------------------------------
* Function Name : EE_SCL_OUT
......@@ -115,8 +115,8 @@ void EE_SCL_OutConfig(void)
--------------------------------------------------------------------------*/
void EE_SCL_OUT(ee_uint8_t data)
{
RTE_GPIO_Config(EE_SCL, RTE_GPIO_DIR_OUT | data);
//RTE_GPIO_Set_Level(EE_SCL, data);
// RTE_GPIO_Config(EE_SCL, RTE_GPIO_DIR_OUT | data);
RTE_GPIO_Set_Level(EE_SCL, data);
}
/*-------------------------------------------------------------------------
......
......@@ -276,16 +276,17 @@ void Service_Interval_TimerSleepFix(Intlib_uint32_t FixTimer)
void Service_Interval_SetKm(Intlib_uint32_t IntervalKm)
{
DataIntervalSave_t DataIntervalSave;
if ( g_IntervalCalc != Intlib_NULL )
DataIntervalSave_t ReadDataIntervalSave;
Intlib_uint8_t u8Errcount = 0;
if (g_IntervalCalc != Intlib_NULL)
{
g_IntervalCalc->Interval100m = IntervalKm * 10;
g_IntervalCalc->MilAfterReset = g_ReadODO_Cbk( );
g_IntervalCalc->MilAfterReset = g_ReadODO_Cbk();
DataIntervalSave.Flag = 0x7887A55A;
DataIntervalSave.Interval100m = g_IntervalCalc->Interval100m;
DataIntervalSave.MilAfterReset = g_IntervalCalc->MilAfterReset;
if ( g_IntervalCalc->IntervalDayEnable )
if (g_IntervalCalc->IntervalDayEnable)
{
DataIntervalSave.Interval1s = g_IntervalCalc->Interval1s;
DataIntervalSave.TotalTimer = g_IntervalCalc->CurTimer_1s;
......@@ -296,9 +297,28 @@ void Service_Interval_SetKm(Intlib_uint32_t IntervalKm)
DataIntervalSave.TotalTimer = 0u;
}
if ( g_EEPromWrite_Cbk != Intlib_NULL )
while (u8Errcount < 3)
{
g_EEPromWrite_Cbk(( Intlib_uint32_t * )&DataIntervalSave, sizeof(DataIntervalSave_t) / 4);
if (g_EEPromWrite_Cbk != Intlib_NULL)
{
g_EEPromWrite_Cbk((Intlib_uint32_t *)&DataIntervalSave, sizeof(DataIntervalSave_t) / 4);
}
if (g_EEPromRead_Cbk != Intlib_NULL)
{
g_EEPromRead_Cbk((Intlib_uint32_t *)&ReadDataIntervalSave, sizeof(DataIntervalSave_t) / 4);
}
if (memcmp(&DataIntervalSave, &ReadDataIntervalSave, sizeof(DataIntervalSave_t)) == 0)
{
break;
}
u8Errcount++;
if(u8Errcount >= 3)
{
break;
}
Gen_TimeDelay(10 * 1000u, 50u);
}
}
}
......
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