diff --git a/fusee/fusee-primary/src/utils.c b/fusee/fusee-primary/src/utils.c index 87e84e7..26e8381 100644 --- a/fusee/fusee-primary/src/utils.c +++ b/fusee/fusee-primary/src/utils.c @@ -59,21 +59,12 @@ } } -__attribute__((noreturn)) void car_reboot(void) { - /* Reset the processor. */ - car_get_regs()->rst_dev_l |= 1<<2; - - while (true) { - /* Wait for reboot. */ - } -} - __attribute__((noreturn)) void wait_for_button_and_reboot(void) { uint32_t button; while (true) { button = btn_read(); if (button & BTN_POWER) { - car_reboot(); + pmc_reboot(1 << 1); } } } diff --git a/fusee/fusee-primary/src/utils.h b/fusee/fusee-primary/src/utils.h index 7fe8e6c..23893e9 100644 --- a/fusee/fusee-primary/src/utils.h +++ b/fusee/fusee-primary/src/utils.h @@ -121,7 +121,6 @@ __attribute__((noreturn)) void watchdog_reboot(void); __attribute__((noreturn)) void pmc_reboot(uint32_t scratch0); -__attribute__((noreturn)) void car_reboot(void); __attribute__((noreturn)) void wait_for_button_and_reboot(void); __attribute__((noreturn)) void generic_panic(void); diff --git a/fusee/fusee-secondary/src/utils.c b/fusee/fusee-secondary/src/utils.c index b74e016..ed7636a 100644 --- a/fusee/fusee-secondary/src/utils.c +++ b/fusee/fusee-secondary/src/utils.c @@ -58,21 +58,12 @@ } } -__attribute__((noreturn)) void car_reboot(void) { - /* Reset the processor. */ - car_get_regs()->rst_dev_l |= 1<<2; - - while (true) { - /* Wait for reboot. */ - } -} - __attribute__((noreturn)) void wait_for_button_and_reboot(void) { uint32_t button; while (true) { button = btn_read(); if (button & BTN_POWER) { - car_reboot(); + pmc_reboot(1 << 1); } } } diff --git a/fusee/fusee-secondary/src/utils.h b/fusee/fusee-secondary/src/utils.h index 3d84a56..6b26428 100644 --- a/fusee/fusee-secondary/src/utils.h +++ b/fusee/fusee-secondary/src/utils.h @@ -122,7 +122,6 @@ __attribute__((noreturn)) void watchdog_reboot(void); __attribute__((noreturn)) void pmc_reboot(uint32_t scratch0); -__attribute__((noreturn)) void car_reboot(void); __attribute__((noreturn)) void wait_for_button_and_reboot(void); void wait_for_button(void);