# HG changeset patch # User David Douard # Date 1633633559 -7200 # Node ID a0f97359f2661c787b5e6538cbfd0832a9de0fb0 # Parent e19b4147caa95255568a6357c98cb8bda97fe236 Revert to soft reset on RST irq diff -r e19b4147caa9 -r a0f97359f266 src/main.cpp --- a/src/main.cpp Thu Oct 07 21:05:13 2021 +0200 +++ b/src/main.cpp Thu Oct 07 21:05:59 2021 +0200 @@ -20,7 +20,7 @@ HPSerial *hp; Thread tdsp(osPriorityNormal, OS_STACK_SIZE, nullptr, "DSP"); Ticker dsp_refresh; -//Timeout rst_delay; +Timeout rst_delay; Timeout splashscreen_timer; Timeout byescreen_timer; InterruptIn rst(HP_RST); @@ -178,6 +178,7 @@ printf("SETUP DONE\r\n"); if (rst.read() == 0) + // in case we reset the FP while the unit is running reset(); } @@ -188,18 +189,18 @@ must_shutdown = true; } -/* + void reset_irq_tmr(void) { must_reset = true; } -*/ + void reset_irq(void) { - must_reset = true; - //rst_delay.attach(callback(&reset_irq_tmr), 50ms); - NVIC_SystemReset(); + //must_reset = true; + rst_delay.attach(callback(&reset_irq_tmr), 600ms); + //NVIC_SystemReset(); } void reset(void) @@ -220,6 +221,7 @@ } dsp->power_on(); dsp->cls(); + printf("Initiate startup sequence\n"); if (last_key.keyevent == KEY_PRESSED) { printf(" with key pressed\n"); @@ -264,13 +266,12 @@ must_shutdown = false; // just in case... reset(); } - - if (must_shutdown) { + else if (must_shutdown) { must_shutdown = false; dsp->cls(); dsp->power_off(); } - + else { if (knob != 0) { if (hp != NULL) @@ -388,6 +389,7 @@ } } } + } //else ThisThread::sleep_for(1ms); }