Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
TianYing_ty100
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TY
TianYing_ty100
Commits
d759c75e
Commit
d759c75e
authored
Sep 14, 2024
by
陈家乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:更换EEPROM库,保养存储改为16字节
parent
a2b71239
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
25 deletions
+25
-25
eepromManage_20240305.lib
Firmware/Source/Component/Eeprom/eepromManage_20240305.lib
+0
-0
eepromManage_TestVersion.lib
...ware/Source/Component/Eeprom/eepromManage_TestVersion.lib
+0
-0
Service_Interval.c
...ware/Source/Component/Service_Interval/Service_Interval.c
+25
-25
No files found.
Firmware/Source/Component/Eeprom/eepromManage_20240305.lib
deleted
100644 → 0
View file @
a2b71239
File deleted
Firmware/Source/Component/Eeprom/eepromManage_TestVersion.lib
0 → 100644
View file @
d759c75e
File added
Firmware/Source/Component/Service_Interval/Service_Interval.c
View file @
d759c75e
...
...
@@ -28,7 +28,7 @@ typedef struct
Intlib_uint32_t
Interval100m
;
/*设定的里程间隔 0.1km */
Intlib_uint32_t
Interval1s
;
/*设定的时间间隔 1s */
Intlib_uint32_t
MilAfterReset
;
/*上次复位后里程值 0.1km */
Intlib_uint32_t
TotalTimer
;
/*已走动时间 1s */
//
Intlib_uint32_t TotalTimer; /*已走动时间 1s */
}
DataIntervalSave_t
;
static
Int_PowerSts
g_PowerSts_Cbk
;
...
...
@@ -84,7 +84,7 @@ void Service_Interval_KL30_Init(Intlib_uint8_t *pMemSpace, Maintain_Init_t *pIni
DataIntervalSave
.
Interval100m
=
g_IntervalCalc
->
Interval100m
;
DataIntervalSave
.
MilAfterReset
=
g_IntervalCalc
->
MilAfterReset
;
DataIntervalSave
.
Interval1s
=
g_IntervalCalc
->
Interval1s
;
DataIntervalSave
.
TotalTimer
=
g_IntervalCalc
->
CurTimer_1s
;
//
DataIntervalSave.TotalTimer = g_IntervalCalc->CurTimer_1s;
if
(
g_EEPromWrite_Cbk
!=
Intlib_NULL
)
{
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
g_IntervalCalc
->
Interval100m
=
DataIntervalSave
.
Interval100m
;
g_IntervalCalc
->
MilAfterReset
=
DataIntervalSave
.
MilAfterReset
;
g_IntervalCalc
->
Interval1s
=
DataIntervalSave
.
Interval1s
;
g_IntervalCalc
->
CurTimer_1s
=
DataIntervalSave
.
TotalTimer
;
//
g_IntervalCalc->CurTimer_1s = DataIntervalSave.TotalTimer;
}
}
else
...
...
@@ -213,7 +213,7 @@ void Service_Interval_Processing(void)
DataIntervalSave
.
Interval100m
=
g_IntervalCalc
->
Interval100m
;
DataIntervalSave
.
MilAfterReset
=
g_IntervalCalc
->
MilAfterReset
;
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
));
}
}
...
...
@@ -291,37 +291,37 @@ void Service_Interval_SetKm(Intlib_uint32_t IntervalKm)
if
(
g_IntervalCalc
->
IntervalDayEnable
)
{
DataIntervalSave
.
Interval1s
=
g_IntervalCalc
->
Interval1s
;
DataIntervalSave
.
TotalTimer
=
g_IntervalCalc
->
CurTimer_1s
;
//
DataIntervalSave.TotalTimer = g_IntervalCalc->CurTimer_1s;
}
else
{
DataIntervalSave
.
Interval1s
=
0u
;
DataIntervalSave
.
TotalTimer
=
0u
;
//
DataIntervalSave.TotalTimer = 0u;
}
while
(
u8Errcount
<
3
)
{
//
while (u8Errcount < 3)
//
{
if
(
g_EEPromWrite_Cbk
!=
Intlib_NULL
)
{
g_EEPromWrite_Cbk
((
Intlib_uint32_t
*
)
&
DataIntervalSave
,
(
Intlib_uint16_t
)(
sizeof
(
DataIntervalSave_t
)
/
4
));
}
if
(
g_EEPromRead_Cbk
!=
Intlib_NULL
)
{
g_EEPromRead_Cbk
((
Intlib_uint32_t
*
)
&
ReadDataIntervalSave
,
(
Intlib_uint16_t
)(
sizeof
(
DataIntervalSave_t
)
/
4
));
}
if
(
memcmp
(
&
DataIntervalSave
,
&
ReadDataIntervalSave
,
sizeof
(
DataIntervalSave_t
))
==
0
)
{
break
;
}
u8Errcount
++
;
if
(
u8Errcount
>=
3
)
{
break
;
}
Gen_TimeDelay
(
10
*
1000u
,
50u
);
}
//
if (g_EEPromRead_Cbk != Intlib_NULL)
//
{
//
g_EEPromRead_Cbk((Intlib_uint32_t *)&ReadDataIntervalSave, (Intlib_uint16_t)(sizeof(DataIntervalSave_t) / 4));
//
}
//
//
if (memcmp(&DataIntervalSave, &ReadDataIntervalSave, sizeof(DataIntervalSave_t)) == 0)
//
{
//
break;
//
}
//
u8Errcount++;
//
if(u8Errcount >= 3)
//
{
//
break;
//
}
//
Gen_TimeDelay(10 * 1000u, 50u);
//
}
}
}
Intlib_uint32_t
Get_Interval_SetKm
(
void
)
...
...
@@ -356,7 +356,7 @@ void Service_Interval_SetDay(Intlib_uint32_t IntervalDay)
DataIntervalSave
.
Interval100m
=
g_IntervalCalc
->
Interval100m
;
DataIntervalSave
.
MilAfterReset
=
g_IntervalCalc
->
MilAfterReset
;
DataIntervalSave
.
Interval1s
=
g_IntervalCalc
->
Interval1s
;
DataIntervalSave
.
TotalTimer
=
g_IntervalCalc
->
CurTimer_1s
;
//
DataIntervalSave.TotalTimer = g_IntervalCalc->CurTimer_1s;
if
(
g_EEPromWrite_Cbk
!=
Intlib_NULL
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment