Commit 831d5c36 authored by 李俭双's avatar 李俭双

Merge branch 'dev' of http://tyw-server.synology.me:12345/ty/tianying_ty100 into lijianshuang

parents c8065168 8183f030
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
; *** Scatter-Loading Description File generated by uVision *** ; *** Scatter-Loading Description File generated by uVision ***
; ************************************************************* ; *************************************************************
LR_IROM1 0x00000000 0x00040000 { ; load region size_region LR_IROM1 0x00008000 0x00040000 { ; load region size_region
ER_IROM1 0x00000000 0x00040000 { ; load address = execution address ER_IROM1 0x00008000 0x00040000 { ; load address = execution address
*.o (RESET, +First) *.o (RESET, +First)
*(InRoot$$Sections) *(InRoot$$Sections)
.ANY (+RO) .ANY (+RO)
......
...@@ -13,7 +13,7 @@ const st_CAN_SendAttribute CAN_CH0_CANSendAttr[CAN_CH0_ID_SEND_TOTAL] = ...@@ -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}, {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}, {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) #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 #endif
}; };
......
...@@ -158,7 +158,7 @@ void Can_Set_Buff_450(canlib_uint8_t CopyData[]) ...@@ -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[]) void Can_Set_Buff_580(canlib_uint8_t CopyData[])
{ {
CANMsg580Union *p580; CANMsg580Union *p580;
...@@ -174,33 +174,48 @@ void Can_Set_Buff_580(canlib_uint8_t CopyData[]) ...@@ -174,33 +174,48 @@ void Can_Set_Buff_580(canlib_uint8_t CopyData[])
if(Get_Tpms_TX_Flag() == 1) if(Get_Tpms_TX_Flag() == 1)
{ {
if(++CAN_TX_Count > 3) //Can_580Send_flag = 1;
{ //if(CAN_TX_Count++ > 2)
Tpms_TX_Flag = 0; //{
CAN_TX_Count = 0; // Tpms_TX_Flag = 0;
} // CAN_TX_Count = 0;
// //Can_580Send_flag = 0;
//}
p580 -> Sig.TPMS_LEARN_CND_BYTE0 = 0x31; p580 -> Sig.TPMS_LEARN_CND_BYTE0 = 0x31;
p580 -> Sig.TPMS_LEARN_CND_BYTE1 = 0x01; p580 -> Sig.TPMS_LEARN_CND_BYTE1 = 0x01;
p580 -> Sig.TPMS_LEARN_CND_BYTE2 = 0x59; p580 -> Sig.TPMS_LEARN_CND_BYTE2 = 0x59;
p580 -> Sig.TPMS_LEARN_CND_BYTE3 = 0x08; p580 -> Sig.TPMS_LEARN_CND_BYTE3 = 0x08;
p580 -> Sig.TPMS_LEARN_CND_BYTE4 = 0x00; 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) else if(Get_Tpms_TX_Flag() == 2)
{ {
if(++CAN_TX_Count > 3) //Can_580Send_flag = 1;
{ //if(CAN_TX_Count++ > 2)
Tpms_TX_Flag = 0; //{
CAN_TX_Count = 0; // Tpms_TX_Flag = 0;
} // CAN_TX_Count = 0;
// //Can_580Send_flag = 0;
//}
p580 -> Sig.TPMS_LEARN_CND_BYTE0 = 0x31; p580 -> Sig.TPMS_LEARN_CND_BYTE0 = 0x31;
p580 -> Sig.TPMS_LEARN_CND_BYTE1 = 0x01; p580 -> Sig.TPMS_LEARN_CND_BYTE1 = 0x01;
p580 -> Sig.TPMS_LEARN_CND_BYTE2 = 0x59; p580 -> Sig.TPMS_LEARN_CND_BYTE2 = 0x59;
p580 -> Sig.TPMS_LEARN_CND_BYTE3 = 0x08; p580 -> Sig.TPMS_LEARN_CND_BYTE3 = 0x08;
p580 -> Sig.TPMS_LEARN_CND_BYTE4 = 0x01; p580 -> Sig.TPMS_LEARN_CND_BYTE4 = 0x01;
//if(Can_580Send_flag == 0)
//{
// Can_580Send_flag = 1;
// CAN_TX_Count++;
//}
} }
else 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_BYTE0 = 0x0;
//p580 -> Sig.TPMS_LEARN_CND_BYTE1 = 0x0; //p580 -> Sig.TPMS_LEARN_CND_BYTE1 = 0x0;
//p580 -> Sig.TPMS_LEARN_CND_BYTE2 = 0x0; //p580 -> Sig.TPMS_LEARN_CND_BYTE2 = 0x0;
......
...@@ -326,7 +326,11 @@ uint8_t Get_Busoff_Status(void) ...@@ -326,7 +326,11 @@ uint8_t Get_Busoff_Status(void)
{ {
return get_can_busoff(CAN_CH_0); 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) uint8_t COM_APP_Process(st_CAN_Msg *Msg)
{ {
// Can_Write((st_CAN_Msg *)Msg); // Can_Write((st_CAN_Msg *)Msg);
...@@ -380,9 +384,19 @@ uint8_t COM_APP_Process(st_CAN_Msg *Msg) ...@@ -380,9 +384,19 @@ uint8_t COM_APP_Process(st_CAN_Msg *Msg)
#if (IC_Current == TY200_080000b_ty) #if (IC_Current == TY200_080000b_ty)
case 0x580: case 0x580:
if (Get_Tpms_TX_Flag() != 0) if (Get_Tpms_TX_Flag() != 0)
{
if(CAN_Send_Cound++ <= 2)
{ {
CAN_result = CAN_Transmit(CAN0MSG14, &CAN_SendMsg); CAN_result = CAN_Transmit(CAN0MSG14, &CAN_SendMsg);
} }
else
{
CAN_Send_Cound = 0;
Tpms_TX_Flag = 0;
}
//Can_580Send_flag = 0;
}
break; break;
#endif #endif
......
...@@ -62,7 +62,7 @@ void EE_SDA_InConfig(void) ...@@ -62,7 +62,7 @@ void EE_SDA_InConfig(void)
--------------------------------------------------------------------------*/ --------------------------------------------------------------------------*/
void EE_SDA_OutConfig(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 * Function Name : EE_SDA_GetValue
...@@ -89,8 +89,8 @@ ee_uint8_t EE_SDA_GetValue(void) ...@@ -89,8 +89,8 @@ ee_uint8_t EE_SDA_GetValue(void)
--------------------------------------------------------------------------*/ --------------------------------------------------------------------------*/
void EE_SDA_OUT(ee_uint8_t data) void EE_SDA_OUT(ee_uint8_t data)
{ {
RTE_GPIO_Config(EE_SDA, RTE_GPIO_DIR_OUT | data); // RTE_GPIO_Config(EE_SDA, RTE_GPIO_DIR_OUT | data);
//RTE_GPIO_Set_Level(EE_SDA, data); RTE_GPIO_Set_Level(EE_SDA, data);
} }
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
...@@ -103,7 +103,7 @@ void EE_SDA_OUT(ee_uint8_t data) ...@@ -103,7 +103,7 @@ void EE_SDA_OUT(ee_uint8_t data)
--------------------------------------------------------------------------*/ --------------------------------------------------------------------------*/
void EE_SCL_OutConfig(void) 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 * Function Name : EE_SCL_OUT
...@@ -115,8 +115,8 @@ void EE_SCL_OutConfig(void) ...@@ -115,8 +115,8 @@ void EE_SCL_OutConfig(void)
--------------------------------------------------------------------------*/ --------------------------------------------------------------------------*/
void EE_SCL_OUT(ee_uint8_t data) void EE_SCL_OUT(ee_uint8_t data)
{ {
RTE_GPIO_Config(EE_SCL, RTE_GPIO_DIR_OUT | data); // RTE_GPIO_Config(EE_SCL, RTE_GPIO_DIR_OUT | data);
//RTE_GPIO_Set_Level(EE_SCL, data); RTE_GPIO_Set_Level(EE_SCL, data);
} }
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
......
...@@ -276,16 +276,17 @@ void Service_Interval_TimerSleepFix(Intlib_uint32_t FixTimer) ...@@ -276,16 +276,17 @@ void Service_Interval_TimerSleepFix(Intlib_uint32_t FixTimer)
void Service_Interval_SetKm(Intlib_uint32_t IntervalKm) void Service_Interval_SetKm(Intlib_uint32_t IntervalKm)
{ {
DataIntervalSave_t DataIntervalSave; DataIntervalSave_t DataIntervalSave;
DataIntervalSave_t ReadDataIntervalSave;
if ( g_IntervalCalc != Intlib_NULL ) Intlib_uint8_t u8Errcount = 0;
if (g_IntervalCalc != Intlib_NULL)
{ {
g_IntervalCalc->Interval100m = IntervalKm * 10; g_IntervalCalc->Interval100m = IntervalKm * 10;
g_IntervalCalc->MilAfterReset = g_ReadODO_Cbk( ); g_IntervalCalc->MilAfterReset = g_ReadODO_Cbk();
DataIntervalSave.Flag = 0x7887A55A; DataIntervalSave.Flag = 0x7887A55A;
DataIntervalSave.Interval100m = g_IntervalCalc->Interval100m; DataIntervalSave.Interval100m = g_IntervalCalc->Interval100m;
DataIntervalSave.MilAfterReset = g_IntervalCalc->MilAfterReset; DataIntervalSave.MilAfterReset = g_IntervalCalc->MilAfterReset;
if ( g_IntervalCalc->IntervalDayEnable ) if (g_IntervalCalc->IntervalDayEnable)
{ {
DataIntervalSave.Interval1s = g_IntervalCalc->Interval1s; DataIntervalSave.Interval1s = g_IntervalCalc->Interval1s;
DataIntervalSave.TotalTimer = g_IntervalCalc->CurTimer_1s; DataIntervalSave.TotalTimer = g_IntervalCalc->CurTimer_1s;
...@@ -296,9 +297,28 @@ void Service_Interval_SetKm(Intlib_uint32_t IntervalKm) ...@@ -296,9 +297,28 @@ void Service_Interval_SetKm(Intlib_uint32_t IntervalKm)
DataIntervalSave.TotalTimer = 0u; 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);
} }
} }
} }
......
...@@ -311,13 +311,13 @@ ...@@ -311,13 +311,13 @@
#define CheckSumErr 7 // Checksum Error #define CheckSumErr 7 // Checksum Error
#define UnknownPartID 8 // Unknown Part ID #define UnknownPartID 8 // Unknown Part ID
#define SWV 0x100 // 0x100 = 1.00 software version 软件版本号 #define SWV 0x114 // 0x100 = 1.00 software version 软件版本号
#define HWV 0x103 // 0x100 = 1.00 hardware version 硬件版本号 #define HWV 0x103 // 0x100 = 1.00 hardware version 硬件版本号
#define BTV 0x100 // 0x100 = 1.00 bootloader version boot程序版本号 #define BTV 0x100 // 0x100 = 1.00 bootloader version boot程序版本号
#define INTLV 0x112 // 0x100 = 1.00 internal version 内部版本号 #define INTLV 0x114 // 0x100 = 1.00 internal version 内部版本号
#define PROG_Y 0x24 // 0x24 = 2024年, program year #define PROG_Y 0x24 // 0x24 = 2024年, program year
#define PROG_M 0x08 // 0x03 = 3月, program month #define PROG_M 0x08 // 0x03 = 3月, program month
#define PROG_D 0x14 // 0x19 = 19日, program day #define PROG_D 0x16 // 0x19 = 19日, program day
/****************************************************************************** /******************************************************************************
Bootloader Variable Bootloader Variable
......
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