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
d2986026
Verified
Commit
d2986026
authored
Aug 24, 2019
by
Rahix
Browse files
fix(dispatcher): Initialize mutex before RTOS startup
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
3dd88fbb
Changes
3
Hide whitespace changes
Inline
Side-by-side
epicardium/modules/dispatcher.c
View file @
d2986026
...
...
@@ -13,14 +13,17 @@ TaskHandle_t dispatcher_task_id;
static
StaticSemaphore_t
api_mutex_data
;
SemaphoreHandle_t
api_mutex
=
NULL
;
void
dispatcher_mutex_init
(
void
)
{
api_mutex
=
xSemaphoreCreateMutexStatic
(
&
api_mutex_data
);
}
/*
* API dispatcher task. This task will sleep until an API call is issued and
* then wake up to dispatch it.
*/
void
vApiDispatcher
(
void
*
pvParameters
)
{
api_mutex
=
xSemaphoreCreateMutexStatic
(
&
api_mutex_data
);
LOG_DEBUG
(
"dispatcher"
,
"Ready."
);
while
(
1
)
{
if
(
api_dispatcher_poll
())
{
...
...
epicardium/modules/hardware.c
View file @
d2986026
...
...
@@ -177,6 +177,11 @@ int hardware_early_init(void)
*/
hwlock_init
();
/*
* API Dispatcher Mutex
*/
dispatcher_mutex_init
();
return
0
;
}
...
...
epicardium/modules/modules.h
View file @
d2986026
...
...
@@ -9,6 +9,7 @@
/* ---------- Dispatcher --------------------------------------------------- */
void
vApiDispatcher
(
void
*
pvParameters
);
void
dispatcher_mutex_init
(
void
);
extern
SemaphoreHandle_t
api_mutex
;
extern
TaskHandle_t
dispatcher_task_id
;
...
...
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