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
François Revol
firmware
Commits
339bc388
Verified
Commit
339bc388
authored
Jul 04, 2019
by
Rahix
Browse files
feat(epicardium): Reset board when pressing power button
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
4c9dfee7
Changes
1
Hide whitespace changes
Inline
Side-by-side
epicardium/main.c
View file @
339bc388
#include
<stdio.h>
#include
<stdlib.h>
#include
"max32665.h"
#include
"uart.h"
#include
"cdcacm.h"
#include
"card10.h"
#include
"pmic.h"
#include
"leds.h"
#include
"api/dispatcher.h"
#include
"serial.h"
...
...
@@ -35,14 +37,23 @@ void vApiDispatcher(void*pvParameters)
}
}
static
void
pmic_button
(
bool
falling
)
{
if
(
falling
)
{
MXC_GCR
->
rstr0
=
MXC_F_GCR_RSTR0_SYSTEM
;
}
}
int
main
(
void
)
{
card10_init
();
card10_diag
();
pmic_set_button_callback
(
pmic_button
);
cdcacm_init
();
printf
(
"Initializing tasks ...
\n
"
);
printf
(
"
=>
Initializing tasks ...
\n
"
);
/* Serial */
if
(
xTaskCreate
(
...
...
@@ -69,12 +80,13 @@ int main(void)
abort
();
}
printf
(
"Initializing dispatcher ...
\n
"
);
printf
(
"
=>
Initializing dispatcher ...
\n
"
);
api_dispatcher_init
();
printf
(
"Staring core1 payload ...
\n
"
);
printf
(
"
=>
Star
t
ing core1 payload ...
\n
"
);
core1_start
();
printf
(
"=> Starting FreeRTOS ...
\n
"
);
vTaskStartScheduler
();
printf
(
"ERROR: FreeRTOS did not start due to unknown error!
\n
"
);
}
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