Simplify a bit the rst logic and make a bit more robust draft

Thu, 09 Sep 2021 21:59:53 +0200

author
David Douard <david.douard@sdfa3.org>
date
Thu, 09 Sep 2021 21:59:53 +0200
changeset 63
f71f6c0af3cd
parent 62
55e3b4441b11
child 64
897330ee6e9d

Simplify a bit the rst logic and make a bit more robust

src/main.cpp file | annotate | diff | comparison | revisions
--- a/src/main.cpp	Thu Sep 09 21:49:16 2021 +0200
+++ b/src/main.cpp	Thu Sep 09 21:59:53 2021 +0200
@@ -29,7 +29,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);
@@ -235,21 +235,22 @@
 
 void end_splashscreen(void)
 {
-  // print is forbidden here because we are in an ISR context here
-  //printf("End of splash screen CB\r\n");
   splashscreen = false;
-  dsp->cls();
-  dsp->power_off();
+  // wait for the reset irq from the CPU board
+  must_shutdown = true;
 }
 
+/*
 void reset_irq_tmr(void)
 {
 	must_reset = true;
 }
+*/
 
 void reset_irq(void)
 {
-	rst_delay.attach(callback(&reset_irq_tmr), 50ms);
+	must_reset = true;
+	//rst_delay.attach(callback(&reset_irq_tmr), 50ms);
 }
 
 void reset(void)
@@ -258,13 +259,13 @@
   printf("Reset connection to the main unit\n");
   if (DigitalIn(HP_RST).read() == 0) {
 	  byescreen_timer.detach(); // cancel a "poweroff", if any
+	  splashscreen_timer.detach(); // same for splashscreen
 	  splashscreen = false; // in case it still on
 
     if (hp == NULL) {
       printf("setup HP communication handler\r\n");
       hp = new HPSerial(HP_TX, HP_RX);
-    }
-	else {
+    } else {
 		printf("Connection already initialized\n");
 	}
 
@@ -274,10 +275,12 @@
 	dsp->power_on();
 	dsp->cls();
     printf("Initiate startup sequence\n");
-	if (last_key.keyevent == KEY_PRESSED)
+	if (last_key.keyevent == KEY_PRESSED) {
+		printf("  with key pressed\n");
 		hp->send_startup_seq(kp_mapping[last_key.row][last_key.col]);
-	else
+	} else {
 		hp->send_startup_seq();
+	}
   }
   else
   {
@@ -310,10 +313,13 @@
   while(1) {
 	if (must_reset) {
 	  must_reset = false;
+	  must_shutdown = false;  // just in case...
 	  reset();
 	}
+
 	if (must_shutdown) {
 		must_shutdown = false;
+		dsp->cls();
 		dsp->power_off();
 	}
 

mercurial

PKjU- + whatever-202ad178f68f/content/10MHz_ref.rstUTN:mcPKjUDzJ - Ywhatever-202ad178f68f/content/10MHz_ref_2.rstUTN:mcPKjUb܈ J) 7 whatever-202ad178f68f/content/HPZR24W.rstUTN:mcPKjUiq1:* whatever-202ad178f68f/content/LPD422FM.rstUTN:mcPKjUvR|Vi) "whatever-202ad178f68f/content/TeK2445.rstUTN:mcPKjU=O + %whatever-202ad178f68f/content/TeK2445_2.rstUTN:mcPKjU+ ^+ 3whatever-202ad178f68f/content/TeK2445_3.rstUTN:mcPKjU#) ?whatever-202ad178f68f/content/ZPB30A1.rstUTN:mcPKjUKi-@X Gwhatever-202ad178f68f/content/data/eip545b/EIP545B-2060048-02B_SPECIAL-WB68-modified.binUTN:mcPKjUAP-@O vwhatever-202ad178f68f/content/data/eip545b/EIP545B-2060048-02B_SPECIAL-WB68.binUTN:mcPKjUy#5@X Vwhatever-202ad178f68f/content/data/eip545b/EIP545B-2060048-03B_SPECIAL-WB68-modified.binUTN:mcPKjUy#5@O whatever-202ad178f68f/content/data/eip545b/EIP545B-2060048-03B_SPECIAL-WB68.binUTN:mcPKjU@@X whatever-202ad178f68f/content/data/eip545b/EIP545B-2060048-04B_SPECIAL-WB68-modified.binUTN:mcPKjUeX @@O EPwhatever-202ad178f68f/content/data/eip545b/EIP545B-2060048-04B_SPECIAL-WB68.binUTN:mcPKjU%2 vA Аwhatever-202ad178f68f/content/data/eip545b/EIP545B-2060048.f9dasmUTN:mcPKjUuį: ]whatever-202ad178f68f/content/data/eip545b/EIP545B_ROM.binUTN:mcPKjUV() * }?whatever-202ad178f68f/content/dell2407.rstUTN:mcPKjU5M_ ) Lwhatever-202ad178f68f/content/eip545b.rstUTN:mcPKjU2<6 + 2Wwhatever-202ad178f68f/content/eip545b_2.rstUTN:mcPKjU + ]whatever-202ad178f68f/content/eip545b_3.rstUTN:mcPKjU|âb+ kwhatever-202ad178f68f/content/eip545b_4.rstUTN:mcPKjUԸS + Pswhatever-202ad178f68f/content/eip545b_5.rstUTN:mcPKjU+)?+ whatever-202ad178f68f/content/eip545b_6.rstUTN:mcPKjU a 2 whatever-202ad178f68f/content/eip545b_firmware.rstUTN:mcPKjU?v ) whatever-202ad178f68f/content/hp3456a.rstUTN:mcPKjU! #* whatever-202ad178f68f/content/hp34970a.rstUTN:mcPKjU'|, `!, whatever-202ad178f68f/content/hp34970a_2.rstUTN:mcPKjUGJ, whatever-202ad178f68f/content/hp34970a_3.rstUTN:mcPKjU-  , }whatever-202ad178f68f/content/hp34970a_4.rstUTN:mcPKjUAU5A", whatever-202ad178f68f/content/hp34970a_5.rstUTN:mcPKjUbn v, whatever-202ad178f68f/content/hp34970a_6.rstUTN:mcPKjU"6 3 whatever-202ad178f68f/content/hp34970a_protocol.rstUTN:mcPKjUfYu) 2whatever-202ad178f68f/content/hp3562a.rstUTN:mcPKjUwԤ %+ whatever-202ad178f68f/content/hp3562a_2.rstUTN:mcPKjUR~+ whatever-202ad178f68f/content/hp3562a_3.rstUTN:mcPKjUzu:c+ {whatever-202ad178f68f/content/hp3562a_4.rstUTN:mcPKjUYi ) whatever-202ad178f68f/content/hp5334a.rstUTN:mcPKjU9@$) {whatever-202ad178f68f/content/hp8662a.rstUTN:mcPKjU|e + whatever-202ad178f68f/content/hp8662a_2.rstUTN:mcPKjUG-` 1+ whatever-202ad178f68f/content/hp8662a_3.rstUTN:mcPKjU+ ) (whatever-202ad178f68f/content/hp8904a.rstUTN:mcPKjUlM, + W6whatever-202ad178f68f/content/hp8904a_2.rstUTN:mcPKjUΗ`7B:< ;whatever-202ad178f68f/content/images/ZPB30A1/DS1Z_serial.pngUTN:mcPKjUn > Vswhatever-202ad178f68f/content/images/ZPB30A1/overall_setup.jpgUTN:mcPKjUCW\kfh8 swhatever-202ad178f68f/content/images/ZPB30A1/zpb30a1.jpgUTN:mcPKjUC$+z> whatever-202ad178f68f/content/images/ZPB30A1/zpb30a1_board.jpgUTN:mcPKjUjn? Pwhatever-202ad178f68f/content/images/ZPB30A1/zpb30a1_bottom.jpgUTN:mcPKjU |? 0whatever-202ad178f68f/content/images/ZPB30A1/zpb30a1_mosfet.jpgUTN:mcPKjU~S-!> q"whatever-202ad178f68f/content/images/ZPB30A1/zpb30a1_setup.jpgUTN:mcPKjU4|w^$.A A(whatever-202ad178f68f/content/images/ZR24W/CM6807_app_circuit.svgUTN:mcPKjURZn3 )whatever-202ad178f68f/content/images/ZR24W/back.jpgUTN:mcPKjUtV %hj8 0whatever-202ad178f68f/content/images/ZR24W/ext_power.jpgUTN:mcPKjUWv%QpR8 6whatever-202ad178f68f/content/images/ZR24W/input_DC.jpegUTN:mcPKjU<9X!]7 f9whatever-202ad178f68f/content/images/ZR24W/input_DC.kraUTN:mcPKjU7 H 9 uwhatever-202ad178f68f/content/images/ZR24W/psu_bottom.jpgUTN:mcPKjU_~c T 6 ]whatever-202ad178f68f/content/images/ZR24W/psu_top.jpgUTN:mcPKjU\ON\<GA )whatever-202ad178f68f/content/images/ZR24W/tny279_app_circuit.svgUTN:mcPKjUP'= fwhatever-202ad178f68f/content/images/dell2407wfp/L6561-AN.svgUTN:mcPKjUk#<~= whatever-202ad178f68f/content/images/dell2407wfp/NCP1200A.svgUTN:mcPKjUx@< Swhatever-202ad178f68f/content/images/dell2407wfp/alive-1.jpgUTN:mcPKjU)/Gux: .whatever-202ad178f68f/content/images/dell2407wfp/alive.jpgUTN:mcPKjU9U`> whatever-202ad178f68f/content/images/dell2407wfp/apt8075bn.jpgUTN:mcPKjU>˺> whatever-202ad178f68f/content/images/dell2407wfp/back-pcbs.jpgUTN:mcPKjU2589 Mwhatever-202ad178f68f/content/images/dell2407wfp/back.jpgUTN:mcPKjUO6; whatever-202ad178f68f/content/images/dell2407wfp/badcap.jpgUTN:mcPKjUTW@ whatever-202ad178f68f/content/images/dell2407wfp/dead-mosfet.jpgUTN:mcPKjU&sv? ػwhatever-202ad178f68f/content/images/dell2407wfp/dead-parts.jpgUTN:mcPKjUK?(z|9 bLwhatever-202ad178f68f/content/images/dell2407wfp/hack.jpgUTN:mcPKjUsZ9= whatever-202ad178f68f/content/images/dell2407wfp/junk_pcb.jpgUTN:mcPKjU~5= Iwhatever-202ad178f68f/content/images/dell2407wfp/pcb-back.jpgUTN:mcPKjU?X~ F  whatever-202ad178f68f/content/images/dell2407wfp/proper-transistor.jpgUTN:mcPKjUjC whatever-202ad178f68f/content/images/dell2407wfp/psu-repaired-1.jpgUTN:mcPKjU A hwhatever-202ad178f68f/content/images/dell2407wfp/psu-repaired.jpgUTN:mcPKjUjׂLE [Dwhatever-202ad178f68f/content/images/dell2407wfp/psu-schematic-p1.svgUTN:mcPKjUh{BE whatever-202ad178f68f/content/images/dell2407wfp/psu-schematic-p2.svgUTN:mcPKjURPJAtv8 Cwhatever-202ad178f68f/content/images/dell2407wfp/psu.jpgUTN:mcPKjUe~: whatever-202ad178f68f/content/images/dell2407wfp/stand.jpgUTN:mcPKjUӗ^& 5 whatever-202ad178f68f/content/images/eip545b/A201.pdfUTN:mcPKjU'Է;;#5 !whatever-202ad178f68f/content/images/eip545b/A201.svgUTN:mcPKjU dwhatever-202ad178f68f/content/images/eip545b/band_3_search.pngUTN:mcPKjUz^C whatever-202ad178f68f/content/images/eip545b/better_sensitivity.jpgUTN:mcPKjUJ7|< ywhatever-202ad178f68f/content/images/eip545b/closed_unit.jpgUTN:mcPKjUB7 Qwhatever-202ad178f68f/content/images/eip545b/inside.jpgUTN:mcPK]]('