1#include "main-header.h"
4#include "user_app_exe.h"
6void restart_app_at(
void *app);
20void reboot_immediately() {
24void avoid_watchdog(
void) __attribute__((no_instrument_function));
25void avoid_watchdog(
void) {
26 mculib_watchdog_avoid();
28void restart_app(
void) {
29 restart_app_at(get_app_header());
33void restart_app_adr(uint32_t address) {
35 printf(
"Ignoring request to start app at adr 0\r\n");
38 printf(
"Requested to start app at %p\r\n", address);
41 if (app->magic != 0x53434657) {
42 printf(
"invalid magic (%p)\r\n", app->magic);
45 void *p = (
void *)app->entry;
47 printf(
"Starting app at %p\r\n", p);
54void restart_app_at(
void *app) {
55 printf(
"Starting app at %p\r\n", app);
56 mculib_disable_irq(MAIN_MCULIBHANDLE);
59 printf(
"Restarting()\n");
62 uint32_t entry = (uint32_t)app;
63 asm volatile (
"mov r5,#0;"