diff --git a/bootloader/main.c b/bootloader/main.c index be50bb16f5c855f47e68c84e9d5965271113a292..2c7a9e36ace0c94917d3b12acb43b6cdb9cecb60 100644 --- a/bootloader/main.c +++ b/bootloader/main.c @@ -179,6 +179,14 @@ static inline void boot(const void * vtable){ static void pmic_button(bool falling) { if (falling) { + printf("Resetting ...\n"); + /* + * Give the UART fifo time to clear. + * TODO: Do this properly + */ + for (int i = 0; i < 0x1000000; i++) { + __asm volatile("nop"); + } MXC_GCR->rstr0 = MXC_F_GCR_RSTR0_SYSTEM; } } diff --git a/epicardium/main.c b/epicardium/main.c index b2bd12e572e6433665c56ecdec807b9820a6bfbe..f472e6b3f6c9e0be8d0ddc1d2daafb06e5586142 100644 --- a/epicardium/main.c +++ b/epicardium/main.c @@ -40,6 +40,14 @@ void vApiDispatcher(void*pvParameters) static void pmic_button(bool falling) { if (falling) { + printf("Resetting ...\n"); + /* + * Give the UART fifo time to clear. + * TODO: Do this properly + */ + for (int i = 0; i < 0x1000000; i++) { + __asm volatile("nop"); + } MXC_GCR->rstr0 = MXC_F_GCR_RSTR0_SYSTEM; } }