Skip to content
Snippets Groups Projects
Verified Commit a357a3f6 authored by rahix's avatar rahix
Browse files

feat(lifecycle): Properly reset hardware


Signed-off-by: default avatarRahix <rahix@rahix.de>
parent 944578ca
No related branches found
No related tags found
No related merge requests found
...@@ -173,6 +173,24 @@ int hardware_init(void) ...@@ -173,6 +173,24 @@ int hardware_init(void)
*/ */
int hardware_reset(void) int hardware_reset(void)
{ {
card10_init(); /*
* API Dispatcher & API Interrupts
*/
api_interrupt_init();
api_dispatcher_init();
/*
* LEDs
*/
leds_init();
epic_leds_set_rocket(0, 0);
epic_leds_set_rocket(1, 0);
epic_leds_set_rocket(2, 0);
/*
* Display
*/
display_init_slim();
return 0; return 0;
} }
...@@ -114,10 +114,12 @@ static int do_load(struct load_info *info) ...@@ -114,10 +114,12 @@ static int do_load(struct load_info *info)
core1_wait_ready(); core1_wait_ready();
/* /*
* Reinitialize API * Reinitialize Hardware & Drivers
*/ */
api_dispatcher_init(); res = hardware_reset();
api_interrupt_init(); if (res < 0) {
return res;
}
switch (info->type) { switch (info->type) {
case PL_PYTHON_SCRIPT: case PL_PYTHON_SCRIPT:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment