Mon, 26 Oct 2020 00:16:13 +0100
Extracted the display related functions in a Display class
1
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
1 | #include "stdio.h" |
4
219766126afb
another attempt using a more complete support of the protocol and async serial stuff
David Douard <david.douard@logilab.fr>
parents:
3
diff
changeset
|
2 | |
21 | 3 | #include <mbed.h> |
4 | #include <rtos.h> | |
5 | #include <string> | |
4
219766126afb
another attempt using a more complete support of the protocol and async serial stuff
David Douard <david.douard@logilab.fr>
parents:
3
diff
changeset
|
6 | |
5 | 7 | #include "hp34comm.h" |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
8 | #include "display.h" |
1
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
9 | |
19 | 10 | #include "QEI.h" |
18
4fd621551d55
[full replacement] implement a state machine for Rx
David Douard <david.douard@logilab.fr>
parents:
17
diff
changeset
|
11 | #include "Keypad.h" |
4fd621551d55
[full replacement] implement a state machine for Rx
David Douard <david.douard@logilab.fr>
parents:
17
diff
changeset
|
12 | |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
13 | // Pins and device declarations |
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
14 | #if defined TARGET_NUCLEO_F446RE |
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
15 | #include "def_f446re.h" |
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
16 | #elif defined TARGET_HP34970_FP_F303RD |
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
17 | #include "def_hp34970_fp.h" |
8 | 18 | #endif |
19 | ||
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
20 | #include "platform/CircularBuffer.h" |
26 | 21 | |
1
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
22 | |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
23 | Display *dsp; |
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
24 | volatile bool splashscreen; |
19 | 25 | HPSerial *hp; |
8 | 26 | Thread tdsp, tloop; |
19 | 27 | Ticker blinker; |
28 | Timeout rst_delay; | |
29 | Timeout splashscreen_timer; | |
30 | InterruptIn rst(HP_RST); | |
31 | ||
32 | QEI qenc(KP_ENC1, KP_ENC2, NC, 16); | |
33 | volatile uint8_t knob; | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
34 | bool shift; // true when kp is shifted, cleared by command 0x01 from Unit |
19 | 35 | |
36 | typedef enum { | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
37 | KEY_NONE=0, |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
38 | KEY_PRESSED, |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
39 | KEY_RELEASED |
19 | 40 | } key_event_t; |
41 | ||
42 | typedef struct keycode { | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
43 | uint8_t row; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
44 | uint8_t col; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
45 | key_event_t keyevent; |
19 | 46 | } keycode_t; |
47 | ||
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
48 | //volatile keycode_t cur_keycode; |
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
49 | |
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
50 | #define KEY_BUF_SIZE 10 |
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
51 | CircularBuffer<keycode_t, KEY_BUF_SIZE> key_buf; |
5 | 52 | |
34
94ab7ff42a1b
Add a key mapping table (protocol value vs. raw keycode) and send it
David Douard <david.douard@sdf3.org>
parents:
32
diff
changeset
|
53 | #define KP_NROWS 4 |
94ab7ff42a1b
Add a key mapping table (protocol value vs. raw keycode) and send it
David Douard <david.douard@sdf3.org>
parents:
32
diff
changeset
|
54 | #define KP_NCOLS 5 |
94ab7ff42a1b
Add a key mapping table (protocol value vs. raw keycode) and send it
David Douard <david.douard@sdf3.org>
parents:
32
diff
changeset
|
55 | DigitalIn kp_rows[KP_NROWS] = { |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
56 | KP_R0, |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
57 | KP_R1, |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
58 | KP_R2, |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
59 | KP_R3 |
19 | 60 | }; |
61 | ||
34
94ab7ff42a1b
Add a key mapping table (protocol value vs. raw keycode) and send it
David Douard <david.douard@sdf3.org>
parents:
32
diff
changeset
|
62 | DigitalOut kp_columns[KP_NCOLS] = { |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
63 | KP_C0, KP_C1, |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
64 | KP_C2, KP_C3, |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
65 | KP_C4 |
19 | 66 | }; |
18
4fd621551d55
[full replacement] implement a state machine for Rx
David Douard <david.douard@logilab.fr>
parents:
17
diff
changeset
|
67 | |
36
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
68 | /* key mapping |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
69 | RxC code name |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
70 | 0x2 0x00 View |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
71 | 0x1 0x01 Mon |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
72 | 3x3 0x02 Sto/Rcl |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
73 | 0x0 0x03 Scan |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
74 | 1x2 0x04 Alarm |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
75 | 1x1 0x05 Mx+B |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
76 | 1x0 0x06 Measure |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
77 | 2x0 0x07 Interval |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
78 | 3x2 0x08 Card Reset |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
79 | 3x1 0x09 Close |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
80 | 3x0 0x0A Open |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
81 | 0x3 0x0B Read |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
82 | 2x3 0x0C Shift |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
83 | 1x3 0x0D Write |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
84 | 0x4 0x0E Left |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
85 | 1x4 0x0F Right |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
86 | 2x2 0x10 Advanced |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
87 | 2x1 0x11 Step |
34
94ab7ff42a1b
Add a key mapping table (protocol value vs. raw keycode) and send it
David Douard <david.douard@sdf3.org>
parents:
32
diff
changeset
|
88 | */ |
94ab7ff42a1b
Add a key mapping table (protocol value vs. raw keycode) and send it
David Douard <david.douard@sdf3.org>
parents:
32
diff
changeset
|
89 | |
36
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
90 | uint8_t kp_mapping[KP_NROWS][KP_NCOLS] = { |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
91 | {0x03, 0x01, 0x00, 0x0B, 0x0E}, |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
92 | {0x06, 0x05, 0x04, 0x0D, 0x0F}, |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
93 | {0x07, 0x11, 0x10, 0x0C, 0xFF}, |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
94 | {0x0A, 0x09, 0x08, 0x02, 0xFF} |
19 | 95 | }; |
96 | ||
97 | void kp_cb(uint8_t row, uint8_t col); | |
98 | void kr_cb(uint8_t row, uint8_t col); | |
99 | ||
100 | Keypad *kpad; | |
1
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
101 | uint8_t curchar; |
26 | 102 | //uint8_t curcmd; |
1
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
103 | uint8_t nchars; |
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
104 | char buffer[MAX_BUFF+1]; |
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
105 | |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
106 | void refresh_display(void); |
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
107 | |
8 | 108 | void timeout_h() { |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
109 | #if defined(HAS_LED) |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
110 | led = !led; |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
111 | #endif |
8 | 112 | } |
113 | ||
1
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
114 | #ifdef DEBUG |
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
115 | |
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
116 | DigitalOut dbgpin(DBGPIN); |
5 | 117 | inline void pulse(uint8_t count=1, bool stayup=false) |
1
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
118 | { |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
119 | dbgpin = 0; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
120 | wait_us(2); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
121 | while (count--) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
122 | { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
123 | dbgpin = 1; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
124 | wait_us(2); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
125 | dbgpin = 0; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
126 | wait_us(2); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
127 | } |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
128 | if (stayup) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
129 | dbgpin = 1; |
1
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
130 | } |
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
131 | #else |
5 | 132 | inline void pulse(uint8_t count=1, bool stayup=false) |
1
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
133 | {} |
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
134 | #endif |
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
135 | |
19 | 136 | // callbacks & thread functions |
137 | void loop(); | |
138 | void reset(void); | |
139 | void reset_irq(void); | |
140 | void qei_cb(int dir); | |
141 | void end_splashscreen(void); | |
4
219766126afb
another attempt using a more complete support of the protocol and async serial stuff
David Douard <david.douard@logilab.fr>
parents:
3
diff
changeset
|
142 | |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
143 | /* |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
144 | #if defined(HAVE_PC) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
145 | FileHandle *mbed::mbed_override_console(int fd) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
146 | { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
147 | return static_cast<FileHandle*> (&pc); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
148 | } |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
149 | #endif |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
150 | */ |
3
a3233abe730e
beginning of a working display using the 3.2 OLED module
David Douard <david.douard@logilab.fr>
parents:
2
diff
changeset
|
151 | |
1
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
152 | void setup() { |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
153 | #if defined(HAVE_PC) |
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
154 | #if defined(TARGET_NUCLEO_F446RE) |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
155 | pc.set_baud(115200); |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
156 | #endif |
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
157 | |
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
158 | /* |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
159 | #if defined(TARGET_HP34970_FP_F303RD) |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
160 | pc.init(); |
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
161 | pc.connect(); |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
162 | #endif |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
163 | */ |
8 | 164 | #endif |
21 | 165 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
166 | printf("\n\nSETUP\n"); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
167 | printf(" System Core Clock = %.3f MHZ\r\n", |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
168 | (float)SystemCoreClock/1000000); |
21 | 169 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
170 | /* |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
171 | #if defined(HAS_LED) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
172 | printf("Attaching Led 1: %d\n", LED1); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
173 | blinker.attach(callback(timeout_h), 0.5f); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
174 | #endif |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
175 | */ |
21 | 176 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
177 | hp = NULL; |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
178 | #if defined(TARGET_NUCLEO_F446RE) |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
179 | printf("Serial communication pins\r\n"); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
180 | printf(" USBRX=%d\r\n", USBRX); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
181 | printf(" USBTX=%d\r\n", USBTX); |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
182 | #endif |
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
183 | #if defined(TARGET_HP34970_FP_F303RD) |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
184 | printf("Serial communication via USB\r\n"); |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
185 | #endif |
22 | 186 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
187 | printf("Setup HP communication pins\r\n"); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
188 | printf(" HP_RX=%d\r\n", HP_RX); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
189 | DigitalIn(HP_RX).mode(PullDown); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
190 | printf(" HP_TX=%d\r\n", HP_TX); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
191 | DigitalOut(HP_TX).write(1); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
192 | printf(" HP_RST=%d\r\n", HP_RST); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
193 | DigitalIn(HP_RST).mode(PullDown); |
21 | 194 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
195 | printf(" setup QEI pins\r\n"); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
196 | printf(" ENC1=%d\r\n", KP_ENC1); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
197 | DigitalIn(KP_ENC1).mode(PullDown); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
198 | printf(" ENC2=%d\r\n", KP_ENC2); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
199 | DigitalIn(KP_ENC2).mode(PullDown); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
200 | qenc.attach(&qei_cb); |
19 | 201 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
202 | printf(" setup Keypad\r\n"); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
203 | //cur_keycode.keyevent = KEY_NONE; |
19 | 204 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
205 | shift = false; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
206 | kpad = new Keypad(KP_NROWS, kp_rows, KP_NCOLS, kp_columns); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
207 | printf(" attach Keypad callbacks\r\n"); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
208 | kpad->attach(&kp_cb, &kr_cb); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
209 | printf(" start Keypad\r\n"); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
210 | kpad->start(); |
21 | 211 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
212 | printf("Setup OLED display\r\n"); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
213 | // init the LCD |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
214 | printf(" DSP_MOSI=%d\r\n", DSP_MOSI); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
215 | printf(" DSP_MISO=%d\r\n", DSP_MISO); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
216 | printf(" DSP_SCLK=%d\r\n", DSP_SCLK); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
217 | printf(" DSP_CS=%d\r\n", DSP_CS); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
218 | printf(" DSP_RST=%d\r\n", DSP_RST); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
219 | printf(" DSP_DC=%d\r\n", DSP_DC); |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
220 | dsp = new Display(20000000, DSP_MOSI, DSP_MISO, DSP_SCLK, DSP_CS, |
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
221 | DSP_RST, DSP_DC, "SSD1322"); |
19 | 222 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
223 | //curcmd = 0xFF; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
224 | curchar = 0; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
225 | nchars = 0; |
7
5cf4034ba4e0
attempt to update display by bloc
David Douard <david.douard@logilab.fr>
parents:
5
diff
changeset
|
226 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
227 | for (uint8_t i=0; i<sizeof(table)/sizeof(table[0]); ++i) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
228 | memset(table[i].buffer, 0, MAX_BUFF+1); |
19 | 229 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
230 | printf(" display splash screen\r\n"); |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
231 | dsp->show_splashscreen(); |
19 | 232 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
233 | printf("Starting LCD thread\r\n"); |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
234 | tdsp.start(&refresh_display); |
19 | 235 | |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
236 | //printf("Starting Event thread\r\n"); |
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
237 | //tloop.start(&loop); |
22 | 238 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
239 | /* |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
240 | dsp->clrbuff(); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
241 | show(0x00, "HH:MM:\tSS\t:mmmm", 15); // main dsp |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
242 | show(0x0C, "888", 3); // channel dsp |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
243 | show(0x0A, "\xFF\xFF\xFF\xFF", 4); // all flags |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
244 | */ |
21 | 245 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
246 | printf("Attaching timers\r\n"); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
247 | splashscreen = true; |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
248 | splashscreen_timer.attach(callback(&end_splashscreen), 2ms); |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
249 | rst.fall(&reset_irq); |
21 | 250 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
251 | printf("SETUP DONE\r\n"); |
19 | 252 | } |
8 | 253 | |
19 | 254 | void end_splashscreen(void) |
255 | { | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
256 | // print is forbidden here because we are in an ISR context here |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
257 | //printf("End of splash screen CB\r\n"); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
258 | splashscreen = false; |
19 | 259 | } |
260 | ||
261 | void reset_irq(void) | |
262 | { | |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
263 | rst_delay.attach(callback(&reset), 1ms); |
19 | 264 | } |
265 | ||
266 | void reset(void) | |
267 | { | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
268 | if (DigitalIn(HP_RST).read() == 0) { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
269 | if (hp == NULL) { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
270 | printf("setup HP communication handler\r\n"); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
271 | hp = new HPSerial(HP_TX, HP_RX); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
272 | } |
21 | 273 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
274 | printf("!! RST !! (gstate=%d, state=%d)\r\n", |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
275 | hp->gstate(), hp->state()); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
276 | //printf("Value is ... %X\n", hp->search()); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
277 | hp->startup(); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
278 | } |
1
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
279 | } |
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
280 | |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
281 | void refresh_display(void) { |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
282 | //uint8_t mask=1; |
7
5cf4034ba4e0
attempt to update display by bloc
David Douard <david.douard@logilab.fr>
parents:
5
diff
changeset
|
283 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
284 | while(1) { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
285 | pulse(0, true); |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
286 | if (splashscreen == false) { |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
287 | //Thread::wait(20); // give a bit of time for some more cmds |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
288 | dsp->copy_to_lcd(); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
289 | } |
8 | 290 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
291 | /* |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
292 | if (must_refresh & mask) { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
293 | for(uint8_t i=0; i<sizeof(zones)/sizeof(zones[0]); i++) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
294 | if (zones[i].flag == mask) { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
295 | dsp->copy_to_lcd(zones[i].x0/4, (zones[i].x1+3)/4, |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
296 | zones[i].y0, zones[i].y1); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
297 | must_refresh &= ~mask; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
298 | break; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
299 | } |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
300 | } |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
301 | mask = mask << 1; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
302 | if (mask == 0) { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
303 | mask = 1; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
304 | } |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
305 | */ |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
306 | pulse(0, false); |
26 | 307 | |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
308 | ThisThread::sleep_for(30ms); |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
309 | } |
1
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
310 | } |
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
311 | |
19 | 312 | void loop() |
313 | { // run over and over | |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
314 | keycode_t key = {0, 0, KEY_NONE}; |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
315 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
316 | unsigned int err[8]; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
317 | for (uint8_t i=0; i<8; i++) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
318 | err[i] = 0; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
319 | int p, pp; // rot encoder pulse counters |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
320 | p = 0; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
321 | pp = 0; |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
322 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
323 | while(1) { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
324 | p = qenc.getPulses(); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
325 | if (p != pp) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
326 | { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
327 | dsp->locate(0, 0); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
328 | dsp->printf("Pulses = %d ", p); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
329 | dsp->copy_to_lcd(); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
330 | pp = p; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
331 | } |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
332 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
333 | if (knob != 0) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
334 | { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
335 | if (hp != NULL) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
336 | { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
337 | printf("Sending keycode %X\r\n", knob); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
338 | hp->sendkey(knob); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
339 | printf(" DONE\r\n"); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
340 | } |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
341 | else |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
342 | { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
343 | dsp->locate(70, 0); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
344 | dsp->printf("Knob = %X ", knob); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
345 | dsp->copy_to_lcd(); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
346 | } |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
347 | knob = 0; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
348 | } |
34
94ab7ff42a1b
Add a key mapping table (protocol value vs. raw keycode) and send it
David Douard <david.douard@sdf3.org>
parents:
32
diff
changeset
|
349 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
350 | if (!key_buf.empty()) //cur_keycode.keyevent != KEY_NONE) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
351 | { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
352 | key_buf.pop(key); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
353 | printf("Keycode %dx%d: %s\r\n", |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
354 | key.row, key.col, key.keyevent==KEY_PRESSED?"pressed":"released"); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
355 | if (hp != NULL) { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
356 | uint8_t keycode = kp_mapping[key.row][key.col]; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
357 | if (key.keyevent == KEY_RELEASED) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
358 | keycode |= 0x40; // bit 6: key relased |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
359 | if (shift) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
360 | keycode |= 0x20; // bit 5: key shifted |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
361 | |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
362 | hp->sendkey(kp_mapping[key.row][key.col]); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
363 | } |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
364 | else |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
365 | { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
366 | dsp->locate(140, 0); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
367 | dsp->printf("KC: %dx%d[0x%s%X] %s", |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
368 | key.row, key.col, |
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
369 | kp_mapping[key.row][key.col] <= 0x0F ? "0" : "", |
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
370 | kp_mapping[key.row][key.col], |
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
371 | key.keyevent==KEY_PRESSED ? "PRE" : "REL"); |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
372 | dsp->copy_to_lcd(); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
373 | } |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
374 | // cur_keycode.keyevent = KEY_NONE; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
375 | } |
19 | 376 | |
21 | 377 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
378 | if ((hp != NULL) && (hp->cmd_available())) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
379 | { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
380 | HPSerial::CMD cmd; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
381 | if (hp->pop(cmd)) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
382 | { |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
383 | #if defined(HAS_LED) |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
384 | led = 1; |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
385 | #endif |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
386 | for (uint8_t i=0; i<7; i++) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
387 | if (hp->nerrors(i) > err[i]) { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
388 | printf("ERR: %d/%d/%d/%d/%d/%d/%d\r\n", |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
389 | hp->nerrors(0), |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
390 | hp->nerrors(1), |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
391 | hp->nerrors(2), |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
392 | hp->nerrors(3), |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
393 | hp->nerrors(4), |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
394 | hp->nerrors(5), |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
395 | hp->nerrors(6) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
396 | ); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
397 | break; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
398 | } |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
399 | for (uint8_t i=0; i<7; i++) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
400 | err[i] = hp->nerrors(i); |
19 | 401 | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
402 | printf("CMD[%d] %02X", (int)cmd.id, cmd.cmd); |
19 | 403 | |
36
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
404 | // 0x00: main display |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
405 | // 0x0C: channel display |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
406 | if ((cmd.cmd == 0x00) || (cmd.cmd == 0x0C)) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
407 | printf(": '%s'\r\n", cmd.value); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
408 | else { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
409 | printf(":"); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
410 | for (uint8_t i=0; i<cmd.size; i++) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
411 | printf("%02x ", cmd.value[i]); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
412 | printf("\r\n"); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
413 | } |
36
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
414 | |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
415 | if (cmd.cmd == 0x01) { |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
416 | // clear a flag |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
417 | if (cmd.value[0] == 0x0E) { |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
418 | // clear the Shift flag |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
419 | shift = false; |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
420 | } |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
421 | } else if (cmd.cmd == 0x86) { |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
422 | // shutdown |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
423 | // TODO |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
424 | } else { |
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
425 | // display related commands |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
426 | dsp->show(cmd.cmd, cmd.value, cmd.size); |
36
a6c7292742a0
Add support for the shift flag
David Douard <david.douard@sdf3.org>
parents:
35
diff
changeset
|
427 | } |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
428 | #if defined(HAS_LED) |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
429 | led = 0; |
32
bc1d6ecbb0cc
Update the main code: extract headers and use a CircularBuffer for key events
David Douard <david.douard@sdf3.org>
parents:
28
diff
changeset
|
430 | #endif |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
431 | } |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
432 | } |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
433 | //else |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
434 | ThisThread::sleep_for(1ms); |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
435 | } |
1
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
436 | } |
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
437 | |
19 | 438 | void qei_cb(int dir) |
439 | { | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
440 | if(dir == 1) // turn right |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
441 | knob = 0x80; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
442 | else // turn left |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
443 | knob = 0x81; // 83? |
19 | 444 | } |
445 | ||
446 | void kp_cb(uint8_t row, uint8_t col) | |
447 | { | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
448 | keycode_t key; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
449 | key.row = row; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
450 | key.col = col; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
451 | key.keyevent = KEY_PRESSED; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
452 | if(!key_buf.full()) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
453 | key_buf.push(key); |
19 | 454 | } |
455 | ||
456 | void kr_cb(uint8_t row, uint8_t col) | |
457 | { | |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
458 | keycode_t key; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
459 | key.row = row; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
460 | key.col = col; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
461 | key.keyevent = KEY_RELEASED; |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
462 | if(!key_buf.full()) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
463 | key_buf.push(key); |
19 | 464 | } |
465 | ||
1
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
466 | int main() |
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
467 | { |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
468 | setup(); |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
469 | printf("Main loop (noop)\r\n"); |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
470 | loop(); |
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
471 | /* |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
472 | while(1) |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
473 | { |
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
474 | timeout_h(); |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
475 | ThisThread::sleep_for(1ms); |
35
b2dca6b935bb
Indent src/main.cpp with 2-ws
David Douard <david.douard@sdf3.org>
parents:
34
diff
changeset
|
476 | } |
37
07e8ca2bdf6d
Extracted the display related functions in a Display class
David Douard <david.douard@sdf3.org>
parents:
36
diff
changeset
|
477 | */ |
1
3021fc79cc3b
kinf of working prototype using a ILI9341 based TFT
David Douard <david.douard@logilab.fr>
parents:
diff
changeset
|
478 | } |