Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
fleur
firmware
Commits
c0ba5e0c
Verified
Commit
c0ba5e0c
authored
Aug 24, 2019
by
Rahix
Browse files
fix(max30001): Initialize mutex before RTOS startup
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
2d277ef0
Changes
3
Hide whitespace changes
Inline
Side-by-side
epicardium/modules/hardware.c
View file @
c0ba5e0c
...
...
@@ -182,6 +182,11 @@ int hardware_early_init(void)
*/
dispatcher_mutex_init
();
/*
* MAX30001 mutex init
*/
max30001_mutex_init
();
return
0
;
}
...
...
epicardium/modules/max30001.c
View file @
c0ba5e0c
...
...
@@ -370,10 +370,14 @@ static void max300001_interrupt_callback(void *_)
}
/* }}} */
void
max30001_mutex_init
(
void
)
{
max30001_mutex
=
xSemaphoreCreateMutexStatic
(
&
max30001_mutex_data
);
}
void
vMAX30001Task
(
void
*
pvParameters
)
{
max30001_task_id
=
xTaskGetCurrentTaskHandle
();
max30001_mutex
=
xSemaphoreCreateMutexStatic
(
&
max30001_mutex_data
);
int
lockret
=
hwlock_acquire
(
HWLOCK_SPI_ECG
,
pdMS_TO_TICKS
(
100
));
if
(
lockret
<
0
)
{
...
...
epicardium/modules/modules.h
View file @
c0ba5e0c
...
...
@@ -92,7 +92,9 @@ void disp_forcelock();
#define BHI160_MUTEX_WAIT_MS 50
void
vBhi160Task
(
void
*
pvParameters
);
/* ---------- MAX30001 ----------------------------------------------------- */
#define MAX30001_MUTEX_WAIT_MS 50
void
vMAX30001Task
(
void
*
pvParameters
);
void
max30001_mutex_init
(
void
);
#endif
/* MODULES_H */
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment