Commit 9a2ea4c4 authored by 陈家乐's avatar 陈家乐

🐞 fix:修改保养存储策略

parent 18921f19
...@@ -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);
} }
} }
} }
......
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