Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Øyvind Kolås
firmware
Commits
ef21ef02
Commit
ef21ef02
authored
Oct 15, 2020
by
schneider
Browse files
fix(max86150): Turn off sensor at boot
parent
ee655973
Changes
2
Hide whitespace changes
Inline
Side-by-side
epicardium/modules/hardware.c
View file @
ef21ef02
...
...
@@ -13,6 +13,7 @@
#include
"pb.h"
#include
"pmic.h"
#include
"portexpander.h"
#include
"max86150.h"
#include
"gpio.h"
#include
"i2c.h"
...
...
@@ -191,6 +192,8 @@ int hardware_early_init(void)
*/
max86150_mutex_init
();
max86150_shut_down
();
/* Allow user space to trigger interrupts.
* Used for BLE, not sure if needed. */
SCB
->
CCR
|=
SCB_CCR_USERSETMPEND_Msk
;
...
...
epicardium/modules/max86150.c
View file @
ef21ef02
...
...
@@ -106,23 +106,16 @@ int epic_max86150_disable_sensor(void)
mutex_lock
(
&
max86150_mutex
);
hwlock_acquire
(
HWLOCK_I2C
);
max86150_shut_down
();
max86150_sensor_active
=
false
;
struct
stream_info
*
stream
=
&
max86150_stream
;
result
=
stream_deregister
(
SD_MAX86150
,
stream
);
if
(
result
<
0
)
{
goto
out_free
;
if
(
result
==
0
)
{
vQueueDelete
(
stream
->
queue
);
stream
->
queue
=
NULL
;
}
vQueueDelete
(
stream
->
queue
);
stream
->
queue
=
NULL
;
// disable max86150 leds
max86150_set_led_red_amplitude
(
0
);
max86150_set_led_ir_amplitude
(
0
);
max86150_sensor_active
=
false
;
result
=
0
;
out_free:
hwlock_release
(
HWLOCK_I2C
);
mutex_unlock
(
&
max86150_mutex
);
return
result
;
...
...
Write
Preview
Supports
Markdown
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