Commit d759c75e authored by 陈家乐's avatar 陈家乐

🐞 fix:更换EEPROM库,保养存储改为16字节

parent a2b71239
...@@ -28,7 +28,7 @@ typedef struct ...@@ -28,7 +28,7 @@ typedef struct
Intlib_uint32_t Interval100m; /*设定的里程间隔 0.1km */ Intlib_uint32_t Interval100m; /*设定的里程间隔 0.1km */
Intlib_uint32_t Interval1s; /*设定的时间间隔 1s */ Intlib_uint32_t Interval1s; /*设定的时间间隔 1s */
Intlib_uint32_t MilAfterReset; /*上次复位后里程值 0.1km */ Intlib_uint32_t MilAfterReset; /*上次复位后里程值 0.1km */
Intlib_uint32_t TotalTimer; /*已走动时间 1s */ //Intlib_uint32_t TotalTimer; /*已走动时间 1s */
} DataIntervalSave_t; } DataIntervalSave_t;
static Int_PowerSts g_PowerSts_Cbk; static Int_PowerSts g_PowerSts_Cbk;
...@@ -84,7 +84,7 @@ void Service_Interval_KL30_Init(Intlib_uint8_t *pMemSpace, Maintain_Init_t *pIni ...@@ -84,7 +84,7 @@ void Service_Interval_KL30_Init(Intlib_uint8_t *pMemSpace, Maintain_Init_t *pIni
DataIntervalSave.Interval100m = g_IntervalCalc->Interval100m; DataIntervalSave.Interval100m = g_IntervalCalc->Interval100m;
DataIntervalSave.MilAfterReset = g_IntervalCalc->MilAfterReset; DataIntervalSave.MilAfterReset = g_IntervalCalc->MilAfterReset;
DataIntervalSave.Interval1s = g_IntervalCalc->Interval1s; DataIntervalSave.Interval1s = g_IntervalCalc->Interval1s;
DataIntervalSave.TotalTimer = g_IntervalCalc->CurTimer_1s; //DataIntervalSave.TotalTimer = g_IntervalCalc->CurTimer_1s;
if ( g_EEPromWrite_Cbk != Intlib_NULL ) if ( g_EEPromWrite_Cbk != Intlib_NULL )
{ {
g_EEPromWrite_Cbk(( Intlib_uint32_t * )&DataIntervalSave, (Intlib_uint16_t)(sizeof(DataIntervalSave_t) / 4)); g_EEPromWrite_Cbk(( Intlib_uint32_t * )&DataIntervalSave, (Intlib_uint16_t)(sizeof(DataIntervalSave_t) / 4));
...@@ -95,7 +95,7 @@ void Service_Interval_KL30_Init(Intlib_uint8_t *pMemSpace, Maintain_Init_t *pIni ...@@ -95,7 +95,7 @@ void Service_Interval_KL30_Init(Intlib_uint8_t *pMemSpace, Maintain_Init_t *pIni
g_IntervalCalc->Interval100m = DataIntervalSave.Interval100m; g_IntervalCalc->Interval100m = DataIntervalSave.Interval100m;
g_IntervalCalc->MilAfterReset = DataIntervalSave.MilAfterReset; g_IntervalCalc->MilAfterReset = DataIntervalSave.MilAfterReset;
g_IntervalCalc->Interval1s = DataIntervalSave.Interval1s; g_IntervalCalc->Interval1s = DataIntervalSave.Interval1s;
g_IntervalCalc->CurTimer_1s = DataIntervalSave.TotalTimer; //g_IntervalCalc->CurTimer_1s = DataIntervalSave.TotalTimer;
} }
} }
else else
...@@ -213,7 +213,7 @@ void Service_Interval_Processing(void) ...@@ -213,7 +213,7 @@ void Service_Interval_Processing(void)
DataIntervalSave.Interval100m = g_IntervalCalc->Interval100m; DataIntervalSave.Interval100m = g_IntervalCalc->Interval100m;
DataIntervalSave.MilAfterReset = g_IntervalCalc->MilAfterReset; DataIntervalSave.MilAfterReset = g_IntervalCalc->MilAfterReset;
DataIntervalSave.Interval1s = g_IntervalCalc->Interval1s; DataIntervalSave.Interval1s = g_IntervalCalc->Interval1s;
DataIntervalSave.TotalTimer = g_IntervalCalc->CurTimer_1s; //DataIntervalSave.TotalTimer = g_IntervalCalc->CurTimer_1s;
g_EEPromWrite_Cbk(( Intlib_uint32_t * )&DataIntervalSave, (Intlib_uint16_t)(sizeof(DataIntervalSave_t) / 4)); g_EEPromWrite_Cbk(( Intlib_uint32_t * )&DataIntervalSave, (Intlib_uint16_t)(sizeof(DataIntervalSave_t) / 4));
} }
} }
...@@ -291,37 +291,37 @@ void Service_Interval_SetKm(Intlib_uint32_t IntervalKm) ...@@ -291,37 +291,37 @@ void Service_Interval_SetKm(Intlib_uint32_t IntervalKm)
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;
} }
else else
{ {
DataIntervalSave.Interval1s = 0u; DataIntervalSave.Interval1s = 0u;
DataIntervalSave.TotalTimer = 0u; //DataIntervalSave.TotalTimer = 0u;
} }
while (u8Errcount < 3) //while (u8Errcount < 3)
{ //{
if (g_EEPromWrite_Cbk != Intlib_NULL) if (g_EEPromWrite_Cbk != Intlib_NULL)
{ {
g_EEPromWrite_Cbk((Intlib_uint32_t *)&DataIntervalSave, (Intlib_uint16_t)(sizeof(DataIntervalSave_t) / 4)); g_EEPromWrite_Cbk((Intlib_uint32_t *)&DataIntervalSave, (Intlib_uint16_t)(sizeof(DataIntervalSave_t) / 4));
} }
if (g_EEPromRead_Cbk != Intlib_NULL) // if (g_EEPromRead_Cbk != Intlib_NULL)
{ // {
g_EEPromRead_Cbk((Intlib_uint32_t *)&ReadDataIntervalSave, (Intlib_uint16_t)(sizeof(DataIntervalSave_t) / 4)); // g_EEPromRead_Cbk((Intlib_uint32_t *)&ReadDataIntervalSave, (Intlib_uint16_t)(sizeof(DataIntervalSave_t) / 4));
} // }
//
if (memcmp(&DataIntervalSave, &ReadDataIntervalSave, sizeof(DataIntervalSave_t)) == 0) // if (memcmp(&DataIntervalSave, &ReadDataIntervalSave, sizeof(DataIntervalSave_t)) == 0)
{ // {
break; // break;
} // }
u8Errcount++; // u8Errcount++;
if(u8Errcount >= 3) // if(u8Errcount >= 3)
{ // {
break; // break;
} // }
Gen_TimeDelay(10 * 1000u, 50u); // Gen_TimeDelay(10 * 1000u, 50u);
} //}
} }
} }
Intlib_uint32_t Get_Interval_SetKm(void) Intlib_uint32_t Get_Interval_SetKm(void)
...@@ -356,7 +356,7 @@ void Service_Interval_SetDay(Intlib_uint32_t IntervalDay) ...@@ -356,7 +356,7 @@ void Service_Interval_SetDay(Intlib_uint32_t IntervalDay)
DataIntervalSave.Interval100m = g_IntervalCalc->Interval100m; DataIntervalSave.Interval100m = g_IntervalCalc->Interval100m;
DataIntervalSave.MilAfterReset = g_IntervalCalc->MilAfterReset; DataIntervalSave.MilAfterReset = g_IntervalCalc->MilAfterReset;
DataIntervalSave.Interval1s = g_IntervalCalc->Interval1s; DataIntervalSave.Interval1s = g_IntervalCalc->Interval1s;
DataIntervalSave.TotalTimer = g_IntervalCalc->CurTimer_1s; //DataIntervalSave.TotalTimer = g_IntervalCalc->CurTimer_1s;
if ( g_EEPromWrite_Cbk != Intlib_NULL ) if ( g_EEPromWrite_Cbk != Intlib_NULL )
{ {
......
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