Updater: Write functional ram code loader
Updater RAM Code ---------------- * Ack running watchdog every 250 ms * Blink green LED every 250 ms Firmware -------- * Add RAM code loader * Reorganize initialization * Add update command to shell
This commit is contained in:
@@ -43,6 +43,9 @@
|
||||
#include <reflow-controller/ui/gui.h>
|
||||
#include <reflow-controller/safety/safety-controller.h>
|
||||
#include <reflow-controller/settings/settings.h>
|
||||
#include <reflow-controller/safety/safety-memory.h>
|
||||
#include <reflow-controller/safety/fault.h>
|
||||
#include <reflow-controller/updater/updater.h>
|
||||
|
||||
static void setup_nvic_priorities(void)
|
||||
{
|
||||
@@ -142,9 +145,32 @@ static bool mount_sd_card_if_avail(bool mounted)
|
||||
return mounted;
|
||||
}
|
||||
|
||||
static inline void handle_boot_status(void)
|
||||
{
|
||||
struct safety_memory_boot_status status;
|
||||
int res;
|
||||
|
||||
res = safety_memory_get_boot_status(&status);
|
||||
if (res != 0)
|
||||
panic_mode();
|
||||
if (status.reboot_to_bootloader) {
|
||||
status.reboot_to_bootloader = 0UL;
|
||||
safety_memory_set_boot_status(&status);
|
||||
|
||||
led_set(0, 1);
|
||||
led_set(1, 1);
|
||||
|
||||
start_updater();
|
||||
}
|
||||
}
|
||||
|
||||
static inline void setup_system(void)
|
||||
{
|
||||
setup_nvic_priorities();
|
||||
|
||||
/* Init safety controller and safety memory */
|
||||
safety_controller_init();
|
||||
|
||||
systick_setup();
|
||||
oven_driver_init();
|
||||
digio_setup_default_all();
|
||||
@@ -152,8 +178,10 @@ static inline void setup_system(void)
|
||||
loudspeaker_setup();
|
||||
gui_init();
|
||||
uart_gpio_config();
|
||||
|
||||
handle_boot_status();
|
||||
|
||||
setup_shell_uart(&shell_uart);
|
||||
safety_controller_init();
|
||||
adc_pt1000_setup_meas();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user