diff --git a/epicardium/epicardium.h b/epicardium/epicardium.h index 6d73b46108ce96617958be94ede314f03ec02f2d..88712b1763561b8b86ae539cab4071705e07fc1a 100644 --- a/epicardium/epicardium.h +++ b/epicardium/epicardium.h @@ -31,6 +31,7 @@ typedef _Bool bool; /* clang-format off */ #define API_SYSTEM_EXIT 0x1 #define API_SYSTEM_EXEC 0x2 +#define API_SYSTEM_RESET 0x3 #define API_INTERRUPT_ENABLE 0xA #define API_INTERRUPT_DISABLE 0xB @@ -196,6 +197,11 @@ int epic_exec(char *name); */ API(API_SYSTEM_EXEC, int __epic_exec(char *name)); +/** + * Reset/Restart card10 + */ +API(API_SYSTEM_RESET, void epic_system_reset(void)); + /** * UART/Serial Interface * ===================== diff --git a/epicardium/modules/lifecycle.c b/epicardium/modules/lifecycle.c index 992b0d5ff0f4a5d1c84808374e44baecc54cd3d5..97360d6799714e29f75bf8d9521a866c80cd8d95 100644 --- a/epicardium/modules/lifecycle.c +++ b/epicardium/modules/lifecycle.c @@ -275,6 +275,14 @@ static void load_menu(bool reset) /* Helpers }}} */ /* API {{{ */ +/* + * Restart the firmware + */ +void epic_system_reset(void) +{ + card10_reset(); +} + /* * This is NOT the epic_exec() called from Pycardium, but an implementation of * the same call for use in Epicardium. This function is synchroneous and will