Skip to content
Snippets Groups Projects
Verified Commit 98904f56 authored by rahix's avatar rahix
Browse files

feat: Print a string before resetting


Signed-off-by: default avatarRahix <rahix@rahix.de>
parent 1a693480
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
......
......@@ -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;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment