Add support for the shift flag draft

Sun, 25 Oct 2020 23:00:17 +0100

author
David Douard <david.douard@sdf3.org>
date
Sun, 25 Oct 2020 23:00:17 +0100
changeset 36
a6c7292742a0
parent 35
b2dca6b935bb
child 37
07e8ca2bdf6d

Add support for the shift flag

src/main.cpp file | annotate | diff | comparison | revisions
--- a/src/main.cpp	Sun Oct 25 22:45:24 2020 +0100
+++ b/src/main.cpp	Sun Oct 25 23:00:17 2020 +0100
@@ -72,35 +72,35 @@
 		KP_C4
 };
 
-/* mapping (RxC)
-	 0x2 0x00:  View
-	 0x1 0x01:  Mon
-	 3x3 0x02:  Sto/Rcl
-	 0x0 0x03:  Scan
-	 1x2 0x04:  Alarm
-	 1x1 0x05:  Mx+B
-	 1x0 0x06:  Measure
-	 2x0 0x07:  Interval
-	 3x2 0x08:  Card Reset
-	 3x1 0x09:  Close
-	 3x0 0x0A:  Open
-	 0x3 0x0B:  Read
-	 2x3 0x0C:  Shift
-	 1x3 0x0D:  Write
-	 0x4 0x0E:  Left
-	 1x4 0x0F:  Right
-	 2x2 0x10:  Advanced
-	 2x1 0x11:  Step
+/* key mapping
+   RxC   code   name
+	 0x2   0x00   View
+	 0x1   0x01   Mon
+	 3x3   0x02   Sto/Rcl
+	 0x0   0x03   Scan
+	 1x2   0x04   Alarm
+	 1x1   0x05   Mx+B
+	 1x0   0x06   Measure
+	 2x0   0x07   Interval
+	 3x2   0x08   Card Reset
+	 3x1   0x09   Close
+	 3x0   0x0A   Open
+	 0x3   0x0B   Read
+	 2x3   0x0C   Shift
+	 1x3   0x0D   Write
+	 0x4   0x0E   Left
+	 1x4   0x0F   Right
+	 2x2   0x10   Advanced
+	 2x1   0x11   Step
 */
 
-uint8_t kp_mapping[KP_NROWS][KP_NCOLS] = { // [row][column]
+uint8_t kp_mapping[KP_NROWS][KP_NCOLS] = {
 		{0x03, 0x01, 0x00, 0x0B, 0x0E},
 		{0x06, 0x05, 0x04, 0x0D, 0x0F},
 		{0x07, 0x11, 0x10, 0x0C, 0xFF},
 		{0x0A, 0x09, 0x08, 0x02, 0xFF}
 };
 
-
 void kp_cb(uint8_t row, uint8_t col);
 void kr_cb(uint8_t row, uint8_t col);
 
@@ -770,6 +770,8 @@
 
 				printf("CMD[%d] %02X", (int)cmd.id, cmd.cmd);
 
+				// 0x00: main display
+				// 0x0C: channel display
 				if ((cmd.cmd == 0x00) || (cmd.cmd == 0x0C))
 					printf(": '%s'\r\n", cmd.value);
 				else {
@@ -778,7 +780,20 @@
 						printf("%02x ", cmd.value[i]);
 					printf("\r\n");
 				}
-				show(cmd.cmd, cmd.value, cmd.size);
+
+				if (cmd.cmd == 0x01) {
+          // clear a flag
+					if (cmd.value[0] == 0x0E) {
+            // clear the Shift flag
+						shift = false;
+					}
+				} else if (cmd.cmd == 0x86) {
+          // shutdown
+					// TODO
+				} else {
+          // display related commands
+					show(cmd.cmd, cmd.value, cmd.size);
+				}
 #if defined(HAS_LED)
 				led = 0;
 #endif

mercurial

PKPLX0Z + whatever-3a4b9ec3c0b0/content/10MHz_ref.rstUT!ZPKPL0vP - [whatever-3a4b9ec3c0b0/content/10MHz_ref_2.rstUT!ZPKPLai Q) 5 whatever-3a4b9ec3c0b0/content/HPZR24W.rstUT!ZPKPL'C5i* whatever-3a4b9ec3c0b0/content/LPD422FM.rstUT!ZPKPLf) "whatever-3a4b9ec3c0b0/content/TeK2445.rstUT!ZPKPLrrQ + %whatever-3a4b9ec3c0b0/content/TeK2445_2.rstUT!ZPKPLe t+ 3whatever-3a4b9ec3c0b0/content/TeK2445_3.rstUT!ZPKPLj) ?whatever-3a4b9ec3c0b0/content/ZPB30A1.rstUT!ZPKPL3g ) Gwhatever-3a4b9ec3c0b0/content/eip545b.rstUT!ZPKPLe"7 + Rwhatever-3a4b9ec3c0b0/content/eip545b_2.rstUT!ZPKPL8d# + Wwhatever-3a4b9ec3c0b0/content/eip545b_3.rstUT!ZPKPL|âb+ ewhatever-3a4b9ec3c0b0/content/eip545b_4.rstUT!ZPKPLԸS + 1nwhatever-3a4b9ec3c0b0/content/eip545b_5.rstUT!ZPKPLZ%Gt& ) ywhatever-3a4b9ec3c0b0/content/hp3456a.rstUT!ZPKPLKٍ )* whatever-3a4b9ec3c0b0/content/hp34970a.rstUT!ZPKPLD. !, whatever-3a4b9ec3c0b0/content/hp34970a_2.rstUT!ZPKPL| , 9whatever-3a4b9ec3c0b0/content/hp34970a_3.rstUT!ZPKPL^a , zwhatever-3a4b9ec3c0b0/content/hp34970a_4.rstUT!ZPKPLKX$ 3 }whatever-3a4b9ec3c0b0/content/hp34970a_protocol.rstUT!ZPKPL 7) whatever-3a4b9ec3c0b0/content/hp3562a.rstUT!ZPKPLL/ !+ 2whatever-3a4b9ec3c0b0/content/hp3562a_2.rstUT!ZPKPLyť}" + whatever-3a4b9ec3c0b0/content/hp3562a_3.rstUT!ZPKPLۃ#I+ Gwhatever-3a4b9ec3c0b0/content/hp3562a_4.rstUT!ZPKPLL ) Rwhatever-3a4b9ec3c0b0/content/hp5334a.rstUT!ZPKPLdH:") whatever-3a4b9ec3c0b0/content/hp8662a.rstUT!ZPKPL~ + hwhatever-3a4b9ec3c0b0/content/hp8662a_2.rstUT!ZPKPLv# ) whatever-3a4b9ec3c0b0/content/hp8904a.rstUT!ZPKPLAi6: + Kwhatever-3a4b9ec3c0b0/content/hp8904a_2.rstUT!ZPKPLΗ`7B:< ywhatever-3a4b9ec3c0b0/content/images/ZPB30A1/DS1Z_serial.pngUT!ZPKPLn > L7whatever-3a4b9ec3c0b0/content/images/ZPB30A1/overall_setup.jpgUT!ZPKPLCW\kfh8 7whatever-3a4b9ec3c0b0/content/images/ZPB30A1/zpb30a1.jpgUT!ZPKPLC$+z> whatever-3a4b9ec3c0b0/content/images/ZPB30A1/zpb30a1_board.jpgUT!ZPKPLjn? Fwhatever-3a4b9ec3c0b0/content/images/ZPB30A1/zpb30a1_bottom.jpgUT!ZPKPL |? &_whatever-3a4b9ec3c0b0/content/images/ZPB30A1/zpb30a1_mosfet.jpgUT!ZPKPL~S-!> 5whatever-3a4b9ec3c0b0/content/images/ZPB30A1/zpb30a1_setup.jpgUT!ZPKPL4|w^$.A 7U"whatever-3a4b9ec3c0b0/content/images/ZR24W/CM6807_app_circuit.svgUT!ZPKPLRZn3 ]#whatever-3a4b9ec3c0b0/content/images/ZR24W/back.jpgUT!ZPKPLtV %hj8 o*whatever-3a4b9ec3c0b0/content/images/ZR24W/ext_power.jpgUT!ZPKPLWv%QpR8 y/whatever-3a4b9ec3c0b0/content/images/ZR24W/input_DC.jpegUT!ZPKPL<9X!]7 *3whatever-3a4b9ec3c0b0/content/images/ZR24W/input_DC.kraUT!ZPKPL7 H 9 |9whatever-3a4b9ec3c0b0/content/images/ZR24W/psu_bottom.jpgUT!ZPKPL_~c T 6 !whatever-3a4b9ec3c0b0/content/images/ZR24W/psu_top.jpgUT!ZPKPL\ON\<GA whatever-3a4b9ec3c0b0/content/images/ZR24W/tny279_app_circuit.svgUT!ZPKPLӗ^& 5 *whatever-3a4b9ec3c0b0/content/images/eip545b/A201.pdfUT!ZPKPL'Է;;#5 Dwhatever-3a4b9ec3c0b0/content/images/eip545b/A201.svgUT!ZPKPL whatever-3a4b9ec3c0b0/content/images/eip545b/band_3_search.pngUT!ZPKPLz^C 'whatever-3a4b9ec3c0b0/content/images/eip545b/better_sensitivity.jpgUT!ZPKPLJ7|< whatever-3a4b9ec3c0b0/content/images/eip545b/closed_unit.jpgUT!ZPKPLB7 whatever-3a4b9ec3c0b0/content/images/eip545b/inside.jpgUT!ZPKPL3 5 8 ςwhatever-3a4b9ec3c0b0/content/images/eip545b/pm_full.jpgUT!ZPKPLRb4 whatever-3a4b9ec3c0b0/content/images/eip545b/psu.jpgUT!ZPKPL|> Vwhatever-3a4b9ec3c0b0/content/images/eip545b/psu_tantalums.jpgUT!ZPKPL *6<F9 3whatever-3a4b9ec3c0b0/content/images/eip545b/psu_test.jpgUT!ZPKPLBW[: whatever-3a4b9ec3c0b0/content/images/eip545b/rusty_yig.jpgUT!ZPKPL"me5r9 XEwhatever-3a4b9ec3c0b0/content/images/eip545b/test_cpu.jpgUT!ZPKPL,@_ j ? ëwhatever-3a4b9ec3c0b0/content/images/eip545b/vco_pcb_bottom.jpgUT!ZPKPL HP^ h <  #whatever-3a4b9ec3c0b0/content/images/eip545b/vco_pcb_top.jpgUT!ZPKPL@!o> j-whatever-3a4b9ec3c0b0/content/images/eip545b/working_band1.jpgUT!ZPKPLv9_nh> a6whatever-3a4b9ec3c0b0/content/images/eip545b/working_band3.jpgUT!ZPKPLb> ((; >whatever-3a4b9ec3c0b0/content/images/eip545b/yig_bottom.jpgUT!ZPKPLy@b; Cwhatever-3a4b9ec3c0b0/content/images/eip545b/yig_broken.jpgUT!ZPKPLO 8 Ewhatever-3a4b9ec3c0b0/content/images/eip545b/yig_top.jpgUT!ZPKPLzXAԎ e 9 Iwhatever-3a4b9ec3c0b0/content/images/freq_ref/efratom.jpgUT!ZPKPL)β8+,C _Swhatever-3a4b9ec3c0b0/content/images/freq_ref/efratom_enclosure.jpgUT!ZPKPLDI1l @ iZwhatever-3a4b9ec3c0b0/content/images/freq_ref/efratom_inside.jpgUT!ZPKPL6 > L0ewhatever-3a4b9ec3c0b0/content/images/freq_ref/efratom_lamp.jpgUT!ZPKPL褆 H"A ̿nwhatever-3a4b9ec3c0b0/content/images/freq_ref/efratom_sticker.jpgUT!ZPKPLKe. 8 uwhatever-3a4b9ec3c0b0/content/images/freq_ref/extron.jpgUT!ZPKPLn H kwhatever-3a4b9ec3c0b0/content/images/freq_ref/extron_dephasing_10MHz.jpgUT!ZPKPLFz > Nwhatever-3a4b9ec3c0b0/content/images/freq_ref/extron_fixed.jpgUT!ZPKPLp F hwhatever-3a4b9ec3c0b0/content/images/freq_ref/extron_working_10MHz.jpgUT!ZPKPLncM kwhatever-3a4b9ec3c0b0/content/images/freq_ref/lt1616_bipolar_output_DC2DC.svgUT!ZPKPLlS_\^8 whatever-3a4b9ec3c0b0/content/images/hp3456a/1.0011v.jpgUT!ZPKPLij? whatever-3a4b9ec3c0b0/content/images/hp3456a/geller_2016_02.svgUT!ZPKPLu܂? whatever-3a4b9ec3c0b0/content/images/hp3456a/geller_2016_11.svgUT!ZPKPL*P{ f~ 4 =qwhatever-3a4b9ec3c0b0/content/images/hp3456a/psu.jpgUT!ZPKPLJMWY7 whatever-3a4b9ec3c0b0/content/images/hp3456a/psu_C7.jpgUT!ZPKPL[&0> Dwhatever-3a4b9ec3c0b0/content/images/hp3456a/psu_schematic.svgUT!ZPKPLDl@;? whatever-3a4b9ec3c0b0/content/images/hp34970a/block_diagram.svgUT!ZPKPL:<= Pwhatever-3a4b9ec3c0b0/content/images/hp34970a/bottom-view.jpgUT!ZPKPL}sZd9 whatever-3a4b9ec3c0b0/content/images/hp34970a/channel.jpgUT!ZPKPLZJe7 whatever-3a4b9ec3c0b0/content/images/hp34970a/digit.jpgUT!ZPKPL%0(}5 ?Bwhatever-3a4b9ec3c0b0/content/images/hp34970a/dmm.jpgUT!ZPKPL2RcI> (+whatever-3a4b9ec3c0b0/content/images/hp34970a/fm24c04_dump.jpgUT!ZPKPL#X F A Owhatever-3a4b9ec3c0b0/content/images/hp34970a/front-panel-pcb.jpgUT!ZPKPL)< u E Y$whatever-3a4b9ec3c0b0/content/images/hp34970a/front-panel-sockets.jpgUT!ZPKPLd= whatever-3a4b9ec3c0b0/content/images/hp34970a/front-panel.jpgUT!ZPKPLQiqp^r< whatever-3a4b9ec3c0b0/content/images/hp34970a/front-view.jpgUT!ZPKPLj6E6 .whatever-3a4b9ec3c0b0/content/images/hp34970a/oled.jpgUT!ZPKPL qyt)= whatever-3a4b9ec3c0b0/content/images/hp34970a/oled_module.jpgUT!ZPKdd+(