BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mangoh-drivers
Project
Overview
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
mangoh-drivers
Commits
9e7f16d3
Commit
9e7f16d3
authored
Mar 27, 2019
by
David Frey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update bme680 app to not crash if timer is delayed
parent
f7063ff3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
bme680ApiImpl.c
...ironmentalSensor/bsecIntegrationComponent/bme680ApiImpl.c
+7
-5
bsecIntegration.c
...onmentalSensor/bsecIntegrationComponent/bsecIntegration.c
+6
-1
No files found.
apps/Bme680EnvironmentalSensor/bsecIntegrationComponent/bme680ApiImpl.c
View file @
9e7f16d3
...
...
@@ -80,11 +80,13 @@ le_result_t mangOH_bme680_Configure(
if
(
samplingRate
!=
_s
.
samplingRate
)
{
_s
.
samplingRate
=
samplingRate
;
LE_ASSERT_OK
(
le_timer_SetMsInterval
(
_s
.
timer
,
(
uint32_t
)(
1000
.
0
/
sr
)));
if
(
!
le_timer_IsRunning
(
_s
.
timer
))
{
LE_ASSERT_OK
(
le_timer_Start
(
_s
.
timer
));
}
le_timer_Stop
(
_s
.
timer
);
/*
* Set the timer to 1ms to trigger a reading with the new settings immediately. Once that
* reading is performed, BSEC will decide how to set the timer.
*/
LE_ASSERT_OK
(
le_timer_SetMsInterval
(
_s
.
timer
,
1
.
0
));
LE_ASSERT_OK
(
le_timer_Start
(
_s
.
timer
));
}
return
status
==
BSEC_OK
?
LE_OK
:
LE_FAULT
;
...
...
apps/Bme680EnvironmentalSensor/bsecIntegrationComponent/bsecIntegration.c
View file @
9e7f16d3
...
...
@@ -354,7 +354,12 @@ static void TimerHandler(le_timer_Ref_t t)
}
}
int64_t
nextTimerMs
=
(
sensorSettings
.
next_call
-
GetTimestampNs
())
/
(
1000LL
*
1000LL
);
LE_FATAL_IF
(
nextTimerMs
<=
0
,
"Processing too slowly - next timeout scheduled for %lld ms"
,
nextTimerMs
);
LE_DEBUG
(
"Configuring timer to %"
PRId64
" ms"
,
nextTimerMs
);
if
(
nextTimerMs
<=
0
)
{
LE_WARN
(
"Next timer set to occur in %"
PRId64
" ms. Setting to 1 ms instead"
,
nextTimerMs
);
nextTimerMs
=
1
;
}
LE_ASSERT_OK
(
le_timer_SetMsInterval
(
t
,
nextTimerMs
));
LE_ASSERT_OK
(
le_timer_Start
(
t
));
}
...
...
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