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
François Revol
firmware
Commits
abd6b503
Commit
abd6b503
authored
5 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
fix(bme680): Use the hw locks
parent
3028b763
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
epicardium/modules/bsec.c
+29
-4
29 additions, 4 deletions
epicardium/modules/bsec.c
with
29 additions
and
4 deletions
epicardium/modules/bsec.c
+
29
−
4
View file @
abd6b503
...
...
@@ -168,6 +168,26 @@ done:
epic_file_close
(
fd
);
}
static
int8_t
i2c_write
(
uint8_t
addr
,
uint8_t
reg
,
uint8_t
*
p_buf
,
uint16_t
size
)
{
int8_t
ret
;
hwlock_acquire
(
HWLOCK_I2C
);
ret
=
card10_bosch_i2c_write
(
addr
,
reg
,
p_buf
,
size
);
hwlock_release
(
HWLOCK_I2C
);
return
ret
;
}
static
int8_t
i2c_read
(
uint8_t
addr
,
uint8_t
reg
,
uint8_t
*
p_buf
,
uint16_t
size
)
{
int8_t
ret
;
hwlock_acquire
(
HWLOCK_I2C
);
ret
=
card10_bosch_i2c_read
(
addr
,
reg
,
p_buf
,
size
);
hwlock_release
(
HWLOCK_I2C
);
return
ret
;
}
/*!
* @brief Load library config from non-volatile memory
*
...
...
@@ -216,6 +236,11 @@ void ulp_plus_button_press()
}
#endif
static
void
delay
(
uint32_t
msec
)
{
vTaskDelay
(
pdMS_TO_TICKS
(
msec
));
}
/*!
* @brief Main function which configures BSEC library and then reads and processes the data from sensor based
* on timer ticks
...
...
@@ -233,9 +258,9 @@ void vBSECTask(void *pvParameters)
ret
=
bsec_iot_init
(
BSEC_SAMPLE_RATE_LP
,
0
.
0
f
,
card10_bosch_
i2c_write
,
card10_bosch_
i2c_read
,
card10_bosch_
delay
,
i2c_write
,
i2c_read
,
delay
,
state_load
,
config_load
);
...
...
@@ -259,7 +284,7 @@ void vBSECTask(void *pvParameters)
/* State is saved every 100 samples, which means every 1200 * 3 secs = 60 minutes */
bsec_iot_loop
(
card10_bosch_
delay
,
delay
,
get_timestamp_us
,
output_ready
,
state_save
,
...
...
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