Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jeff Gough
firmware
Commits
7dd77fe8
Commit
7dd77fe8
authored
5 years ago
by
Jeff Gough
Browse files
Options
Downloads
Patches
Plain Diff
Increase delay to 5 seconds
parent
dbc3b8fb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#3069
passed
5 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
epicardium/ble/app/common/app_db.c
+6
-3
6 additions, 3 deletions
epicardium/ble/app/common/app_db.c
with
6 additions
and
3 deletions
epicardium/ble/app/common/app_db.c
+
6
−
3
View file @
7dd77fe8
...
...
@@ -99,7 +99,7 @@ static appDbRec_t *pAppDbNewRec = appDb.rec;
static
TimerHandle_t
store_timer
;
static
StaticTimer_t
store_timer_buffer
;
static
void
store_callback
();
#define STORE_DELAY pdMS_TO_TICKS(
1
000)
#define STORE_DELAY pdMS_TO_TICKS(
5
000)
/*************************************************************************************************/
/*!
...
...
@@ -129,9 +129,11 @@ void AppDbInit(void)
);
}
/* TODO this should actually put tasks into a queue. On the other end of the queue */
/* a worker task can read tasks off the queue and execute them */
static
void
store
(
void
)
{
LOG_
DEBUG
(
"appDb"
,
"store() called, resetting timer"
);
LOG_
INFO
(
"appDb"
,
"store() called, resetting timer"
);
if
(
xTimerReset
(
store_timer
,
10
)
!=
pdPASS
)
{
/* (Re)start the timer */
/* Store timer could not be reset, write to persistent storage anyway */
store_callback
();
...
...
@@ -140,10 +142,11 @@ static void store(void)
static
void
store_callback
()
{
LOG_INFO
(
"appDb"
,
"STORE_DELAY passed, writing to persistent storage"
);
int
fd
=
epic_file_open
(
"pairings.bin"
,
"w"
);
if
(
fd
>=
0
)
{
if
(
epic_file_write
(
fd
,
&
appDb
,
sizeof
(
appDb
))
!=
sizeof
(
appDb
))
{
LOG_DEBUG
(
"appDb"
,
"STORE_DELAY passed, writing to persistent storage"
);
}
epic_file_close
(
fd
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment