src/main.cpp

changeset 7
5cf4034ba4e0
parent 5
f1c85c2500f2
child 8
55021f3f1929
equal deleted inserted replaced
6:8cb67d7afd79 7:5cf4034ba4e0
14 14
15 Serial pc(USBTX, USBRX); 15 Serial pc(USBTX, USBRX);
16 16
17 #define DEBUG 17 #define DEBUG
18 18
19 SSD1322 dsp(SPI_8, 20000000, PB_15, PB_14, PB_13, PB_12, D11, D12, "SSD1322", 256, 64); 19 SSD1322 dsp(SPI_8, 20000000, PB_15, PB_14, PB_13, PB_12, D11, D12, "SSD1322", 256, 64);
20 20
21 21
22 uint8_t curchar; 22 uint8_t curchar;
23 uint8_t cmd; 23 uint8_t cmd;
24 uint8_t nchars; 24 uint8_t nchars;
39 } DSP; 39 } DSP;
40 40
41 static DSP table[] = 41 static DSP table[] =
42 { 42 {
43 { 0x00, 0xF, 0x0, 0, 0, 0x01, MAX_BUFF, 245, Mono19x27}, // main display 43 { 0x00, 0xF, 0x0, 0, 0, 0x01, MAX_BUFF, 245, Mono19x27}, // main display
44 { 0x0C, 0xF, 0x0,204, 38, 0x01, 3, 45, Mono15x22}, // channels display 44 { 0x0C, 0xF, 0x0,204, 38, 0x01, 3, 45, Mono15x22}, // channels display
45 { 0x01, 0xF, 0x0, 0, 0, 0x80, MAX_BUFF, 0, Terminal6x8}, 45 // { 0x01, 0xF, 0x0, 0, 0, 0x80, MAX_BUFF, 0, Terminal6x8},
46 { 0x02, 0xF, 0x0, 0, 0, 0x80, MAX_BUFF, 0, Terminal6x8}, 46 // { 0x02, 0xF, 0x0, 0, 0, 0x80, MAX_BUFF, 0, Terminal6x8},
47 { 0x0A, 0xF, 0x0, 0, 57, 0x0C, 4, 0, Terminal6x8}, // flags + bits 47 { 0x0A, 0xF, 0x0, 0, 57, 0x0C, 4, 0, Terminal6x8}, // flags + bits
48 { 0xFF, 0xF, 0x0, 0, 0, 0x80, MAX_BUFF, 0, Terminal6x8}, 48 // { 0xFF, 0xF, 0x0, 0, 0, 0x80, MAX_BUFF, 0, Terminal6x8},
49 }; 49 };
50 50
51 // 9x10 51 // 9x10
52 const unsigned char icon_alarm[] __attribute__((aligned (2))) = 52 const unsigned char icon_alarm[] __attribute__((aligned (2))) =
53 { 53 {
54 0x1c, 0x0, 54 0x1c, 0x0,
55 0x3e, 0x0, 55 0x3e, 0x0,
56 0x7f, 0x0, 56 0x7f, 0x0,
57 0x7f, 0x0, 57 0x7f, 0x0,
61 0x7f, 0x0, 61 0x7f, 0x0,
62 0xff, 0x80, 62 0xff, 0x80,
63 0x10, 0x0 63 0x10, 0x0
64 }; 64 };
65 65
66 const unsigned char icon_curve[] __attribute__((aligned (2))) = 66 const unsigned char icon_curve[] __attribute__((aligned (2))) =
67 { 67 {
68 0x80, 0x0, 68 0x80, 0x0,
69 0x80, 0x0, 69 0x80, 0x0,
70 0x80, 0x80, 70 0x80, 0x80,
71 0x81, 0x0, 71 0x81, 0x0,
74 0xc0, 0x0, 74 0xc0, 0x0,
75 0x80, 0x0, 75 0x80, 0x0,
76 0x80, 0x0, 76 0x80, 0x0,
77 0xff, 0x80 77 0xff, 0x80
78 }; 78 };
79 79
80 typedef struct _FLAG 80 typedef struct _FLAG
81 { 81 {
82 uint8_t flag; 82 uint8_t flag;
83 uint8_t zone;
83 uint8_t x; 84 uint8_t x;
84 uint8_t y; 85 uint8_t y;
85 const char* msg; 86 const char* msg;
86 const unsigned char* icon; 87 const unsigned char* icon;
87 } FLAG; 88 } FLAG;
88
89 static const FLAG flags[] =
90 {
91 //{ 0x00, 160, 30, "Alarm"}, // for the 'alarm' box
92 { 0x00, 246, 0, NULL, icon_alarm}, // F1.1
93 { 0x01, 246, 11, NULL, icon_curve}, // F1.2
94 { 0x03, 204, 30, "Channel"}, // F1.4
95 { 0x14, 68, 44, "4W"}, // F2.5
96 { 0x32, 40, 44, "*"}, // F4.3
97 { 0x33, 40, 44, "VIEW"}, // F4.4
98 { 0x34, 0, 30, "MON"}, // F4.5
99 { 0x35, 0, 44, "SCAN"}, // F4.6
100 { 0x36, 0, 44, "CONFIG"}, // F4.7
101
102 { 0xFF, 0, 0, "ADRS"},
103 { 0xFF, 0, 0, "RMT"},
104 { 0xFF, 0, 0, "ERROR"},
105 { 0xFF, 0, 0, "EXT"},
106 { 0xFF, 0, 0, "ONCE"},
107 { 0xFF, 0, 0, "AUTO"},
108 { 0xFF, 0, 0, "MEM"},
109 { 0xFF, 0, 0, "LAST"},
110 { 0xFF, 0, 0, "MIN"},
111 { 0xFF, 0, 0, "MAX"},
112 { 0xFF, 0, 0, "AVG"},
113 { 0xFF, 0, 0, "OC"},
114
115 { 0xFF, 0, 0, "H"},
116 { 0xFF, 0, 0, "1"},
117 { 0xFF, 0, 0, "2"},
118 { 0xFF, 0, 0, "3"},
119 { 0xFF, 0, 0, "4"},
120 { 0xFF, 0, 0, "L"},
121
122 };
123 89
124 typedef struct _FRAME 90 typedef struct _FRAME
125 { 91 {
126 uint8_t flag; 92 uint8_t flag;
127 uint8_t x0; 93 uint8_t x0;
128 uint8_t y0; 94 uint8_t y0;
129 uint8_t x1; 95 uint8_t x1;
130 uint8_t y1; 96 uint8_t y1;
131 } FRAME; 97 } FRAME;
132 98
99 static const FLAG flags[] =
100 {
101 // flag, zone, x0, y0, msg, icon
102 // right-side icons area
103 { 0x00, 0x02, 0, 0, NULL, icon_alarm}, // F1.1
104 { 0x01, 0x02, 0, 11, NULL, icon_curve}, // F1.2
105 { 0x14, 0x02, 0, 22, "4W"}, // F2.5
106
107 { 0x03, 0x04, 1, 2, "Channel"}, // F1.4
108
109 // col 1
110 { 0x34, 0x10, 0, 0, "MON"}, // F4.5
111 { 0x33, 0x10, 0, 8, "VIEW"}, // F4.4
112 { 0x35, 0x10, 0, 16, "SCAN"}, // F4.6
113
114 //col 2
115 { 0x32, 0x20, 0, 0, "*"}, // F4.3
116 { 0x36, 0x20, 0, 8, "CFG"}, // F4.7
117 { 0xFF, 0x20, 0, 16, "ERROR"},
118
119 /*
120 { 0xFF, 0, 0, "ADRS"},
121 { 0xFF, 0, 0, "RMT"},
122 { 0xFF, 0, 0, "EXT"},
123
124 { 0xFF, 0, 0, "ONCE"},
125 { 0xFF, 0, 0, "AUTO"},
126 { 0xFF, 0, 0, "MEM"},
127
128 { 0xFF, 0, 0, "LAST"},
129 { 0xFF, 0, 0, "MIN"},
130 { 0xFF, 0, 0, "MAX"},
131
132 { 0xFF, 0, 0, "AVG"},
133 { 0xFF, 0, 0, "OC"},
134 */
135
136 { 0x05, 0x08, 0, 0, "Alarm"}, // F1.6
137 { 0x06, 0x08, 0, 10, "H"}, // F1.7
138 { 0x13, 0x08, 6, 10, "1"}, // F2.4
139 { 0x10, 0x08, 12, 10, "2"}, // F2.1
140 { 0x12, 0x08, 18, 10, "3"}, // F2.3
141 { 0x11, 0x08, 24, 10, "4"}, // F2.2
142 { 0x04, 0x08, 30, 10, "L"}, // F1.5
143
144 };
145
146 static const FRAME zones[] =
147 {
148 { 0x01, 0, 0, 245, 27}, // main display area
149 { 0x02, 246, 0, 255, 27}, // right notif area
150 { 0x04, 203, 28, 255, 54}, // channels display area
151 { 0x08, 160, 28, 202, 54}, // alarms area
152 { 0x10, 0, 28, 32, 54}, // flags col1
153 { 0x20, 33, 28, 70, 54}, // flags col2
154 { 0x40, 71, 28, 159, 54}, // flags col3
155
156 { 0x80, 0, 55, 255, 63}, // flags bits display area
157 };
158
133 static const FRAME frames[] = 159 static const FRAME frames[] =
134 { 160 {
135 { 0x02, 203, 35, 248, 55}, // F1.3 161 { 0x02, 203, 35, 248, 55}, // F1.3
136 }; 162 };
137 163
140 #define DBGPIN PC_0 166 #define DBGPIN PC_0
141 167
142 DigitalOut dbgpin(DBGPIN); 168 DigitalOut dbgpin(DBGPIN);
143 inline void pulse(uint8_t count=1, bool stayup=false) 169 inline void pulse(uint8_t count=1, bool stayup=false)
144 { 170 {
145 dbgpin = 0; 171 dbgpin = 0;
146 wait_us(2); 172 wait_us(2);
147 while (count--) 173 while (count--)
148 { 174 {
149 dbgpin = 1; 175 dbgpin = 1;
150 wait_us(2); 176 wait_us(2);
151 dbgpin = 0; 177 dbgpin = 0;
152 wait_us(2); 178 wait_us(2);
153 } 179 }
154 if (stayup) 180 if (stayup)
155 dbgpin = 1; 181 dbgpin = 1;
156 182
157 } 183 }
158 #else 184 #else
159 inline void pulse(uint8_t count=1, bool stayup=false) 185 inline void pulse(uint8_t count=1, bool stayup=false)
160 {} 186 {}
161 #endif 187 #endif
162 188
163 189
164 HPSerial hp; 190 HPSerial hp;
165 volatile bool must_refresh; 191 volatile uint8_t must_refresh;
166 Thread tdsp, tloop; 192 Thread tdsp, tloop;
167 193
168 void copy_to_lcd(void); 194 void copy_to_lcd(void);
169 void test_dsp(); 195 void test_dsp();
170 196
180 // myLCD.claim(stdout); // send stdout to the LCD display 206 // myLCD.claim(stdout); // send stdout to the LCD display
181 // myLCD.claim(stderr); // send stderr to the LCD display 207 // myLCD.claim(stderr); // send stderr to the LCD display
182 dsp.background(Black); // set background to black 208 dsp.background(Black); // set background to black
183 dsp.foreground(0xF); 209 dsp.foreground(0xF);
184 dsp.cls(); 210 dsp.cls();
185 dsp.locate(0, 0); 211
186 dsp.set_font(Mono19x27);
187
188 cmd = 0xFF; 212 cmd = 0xFF;
189 curchar = 0; 213 curchar = 0;
190 nchars = 0; 214 nchars = 0;
191 215
192 for (uint8_t i=0; i<sizeof(table)/sizeof(table[0]); ++i) 216 for (uint8_t i=0; i<sizeof(table)/sizeof(table[0]); ++i)
193 memset(table[i].buffer, 0, MAX_BUFF+1); 217 memset(table[i].buffer, 0, MAX_BUFF+1);
194 218
219 dsp.locate(30, 10);
220 dsp.set_font(Mono19x27);
195 dsp.printf("HP34970A"); 221 dsp.printf("HP34970A");
196 dsp.set_font(Terminal6x8); 222 dsp.set_font(Terminal6x8);
197 for(uint8_t i=0; i<4; i++) { 223 dsp.locate(90, 40);
198 dsp.locate(160, i*8); 224 dsp.printf("David Douard");
199 dsp.printf("Lg %d", i+1);
200 dsp.locate(208, (3-i)*8);
201 dsp.printf("Lg %d", i+1);
202 }
203 dsp.copy_to_lcd(); 225 dsp.copy_to_lcd();
204 wait(2); 226 wait(2);
205 dsp.cls(); 227 dsp.cls();
206
207 test_dsp();
208 dsp.copy_to_lcd();
209 wait(2);
210 dsp.cls();
211
212 } 228 }
213 229
214 void copy_to_lcd(void) { 230 void copy_to_lcd(void) {
231 uint8_t mask=1;
232
215 while(1) { 233 while(1) {
216 pulse(0, true); 234 pulse(0, true);
217 if (must_refresh) { 235 if (must_refresh & mask) {
218 must_refresh = false; 236 for(uint8_t i=0; i<sizeof(zones)/sizeof(zones[0]); i++)
219 dsp.copy_to_lcd(); 237 if (zones[i].flag == mask) {
220 } 238 dsp.copy_to_lcd(zones[i].x0/4, (zones[i].x1+3)/4,
239 zones[i].y0, zones[i].y1);
240 must_refresh &= ~mask;
241 break;
242 }
243 }
244 mask = mask << 1;
245 if (mask == 0) {
246 mask = 1;
247 }
248
221 pulse(0, false); 249 pulse(0, false);
222 Thread::wait(100); 250 Thread::wait(10);
223 } 251 }
224 } 252 }
225 253
226 void show(uint8_t cmd, char *txt, uint8_t nchar=0) { 254 void show(uint8_t cmd, char *txt, uint8_t nchar=0) {
227 uint8_t i, len; 255 uint8_t i, len;
228 uint16_t bgcolor, fgcolor; 256 uint16_t bgcolor, fgcolor;
229 char *oldv; 257 char *oldv;
230 258
231 pulse(1, true); 259 pulse(1, true);
232 260
233 must_refresh = false;
234
235 len = MAX_BUFF; 261 len = MAX_BUFF;
236 262
237 for (i=0; i<sizeof(table)/sizeof(table[0]); ++i) { 263 for (i=0; i<sizeof(table)/sizeof(table[0]); ++i) {
238 if (table[i].cmd == cmd) { 264 if (table[i].cmd == cmd) {
239 bgcolor = table[i].bgcolor; 265 bgcolor = table[i].bgcolor;
240 fgcolor = table[i].color; 266 fgcolor = table[i].color;
241 dsp.background(bgcolor); 267 dsp.background(bgcolor);
242 dsp.foreground(fgcolor); 268 dsp.foreground(fgcolor);
243 dsp.locate(table[i].x0, table[i].y0);
244 dsp.set_font((unsigned char*) table[i].font); 269 dsp.set_font((unsigned char*) table[i].font);
245 oldv = table[i].buffer; 270 oldv = table[i].buffer;
246 271
272 dsp.locate(table[i].x0, table[i].y0);
247 273
248 if (table[i].fmt & 0x01 ) { 274 if (table[i].fmt & 0x01 ) {
249 // ascii 275 // ascii
250 if (table[i].width > 0) 276 if (table[i].width > 0)
251 dsp.fillrect(table[i].x0, table[i].y0, table[i].x0 + table[i].width, table[i].y0 + table[i].font[2], bgcolor); 277 dsp.fillrect(table[i].x0, table[i].y0, table[i].x0 + table[i].width, table[i].y0 + table[i].font[2], bgcolor);
256 break; 282 break;
257 } 283 }
258 if (txt[k] == 0x09) { // \t is a special char for 'unselected' display value 284 if (txt[k] == 0x09) { // \t is a special char for 'unselected' display value
259 txt[k] = 0x00; 285 txt[k] = 0x00;
260 dsp.printf(txt); 286 dsp.printf(txt);
261 287
262 if (fgcolor == table[i].color) 288 if (fgcolor == table[i].color)
263 fgcolor /= 2; 289 fgcolor /= 2;
264 else 290 else
265 fgcolor = table[i].color; 291 fgcolor = table[i].color;
266 dsp.foreground(fgcolor); 292 dsp.foreground(fgcolor);
267 txt = &(txt[k+1]); 293 txt = &(txt[k+1]);
268 k = 0; 294 k = 0;
269 } 295 }
270 } 296 }
297 if (cmd == 0x00) // main area
298 must_refresh |= 0x01;
299 if (cmd == 0x0C) // channels area
300 must_refresh |= 0x04;
271 } 301 }
272 302
303 /*
273 if (table[i].fmt & 0x02 ) { 304 if (table[i].fmt & 0x02 ) {
274 // hex 305 // hex
275 for (uint8_t j=0;; j++) { 306 for (uint8_t j=0;; j++) {
276 if (txt[j] == 0x00) 307 if (txt[j] == 0x00)
277 break; 308 break;
278 dsp.printf("%02X ", txt[j]); 309 dsp.printf("%02X ", txt[j]);
279 } 310 }
280 for (uint8_t j=3*strlen(txt); j<table[i].maxsize; j++) 311 for (uint8_t j=3*strlen(txt); j<table[i].maxsize; j++)
281 dsp.printf(" "); 312 dsp.printf(" ");
282 } 313 }
283 314 */
284 if (table[i].fmt & 0x04 ) { 315 if (table[i].fmt & 0x04 ) {
285 // binary 316 // binary
286 dsp.foreground(fgcolor); 317 dsp.foreground(fgcolor);
287 dsp.printf(" ["); 318 dsp.printf(" [");
288 for (uint8_t j=0; j<max(nchar, table[i].maxsize) ; j++) { 319 for (uint8_t j=0; j<max(nchar, table[i].maxsize) ; j++) {
298 dsp.printf("%d", (8-k)); 329 dsp.printf("%d", (8-k));
299 } 330 }
300 } 331 }
301 dsp.foreground(fgcolor); 332 dsp.foreground(fgcolor);
302 dsp.printf("]"); 333 dsp.printf("]");
334 must_refresh |= 0x80;
303 } 335 }
304 336
305 if (table[i].fmt & 0x08 ) { 337 if (table[i].fmt & 0x08 ) {
306 // flags 338 // flags
307 for (uint8_t j=0; j<max(nchar, table[i].maxsize) ; j++) { 339 for (uint8_t j=0; j<max(nchar, table[i].maxsize) ; j++) {
308 for (uint8_t k=0; k<8; k++) { 340 for (uint8_t k=0; k<8; k++) {
309 if ((txt[j] & (1 << k) ) != (oldv[j] & (1 << k))) { 341 if ((txt[j] & (1 << k) ) != (oldv[j] & (1 << k))) {
310 342
311 if (txt[j] & (1 << k)) 343 if (txt[j] & (1 << k))
312 dsp.foreground(fgcolor); 344 dsp.foreground(fgcolor);
313 else 345 else
314 dsp.foreground(bgcolor); 346 dsp.foreground(bgcolor);
315 347
348 /*
316 for (uint8_t l=0; 349 for (uint8_t l=0;
317 l<(sizeof(frames)/sizeof(frames[0])); ++l) { 350 l<(sizeof(frames)/sizeof(frames[0])); ++l) {
318 if (frames[l].flag & ((j<<4) + k)) 351 if (frames[l].flag & ((j<<4) + k))
319 dsp.rect(frames[l].x0, frames[l].y0, 352 dsp.fillrect(frames[l].x0, frames[l].y0,
320 frames[l].x1, frames[l].y1, 353 frames[l].x1, frames[l].y1,
321 fgcolor); 354 fgcolor/8);
322 else 355 else
323 dsp.rect(frames[l].x0, frames[l].y0, 356 dsp.fillrect(frames[l].x0, frames[l].y0,
324 frames[l].x1, frames[l].y1, 357 frames[l].x1, frames[l].y1,
325 bgcolor); 358 bgcolor);
326 359
327 } 360 }
328 361 */
362
329 for (uint8_t l=0; 363 for (uint8_t l=0;
330 l<(sizeof(flags)/sizeof(flags[0])); ++l) { 364 l<(sizeof(flags)/sizeof(flags[0])); ++l) {
331 if (flags[l].flag == ((j<<4) + k)) { 365 if (flags[l].flag == ((j<<4) + k)) {
332 if (flags[l].msg != NULL) { // a string 366 for (uint8_t m=0; m<(sizeof(zones)/sizeof(zones[0])); m++) {
333 dsp.locate(flags[l].x, flags[l].y); 367 if (flags[l].zone == zones[m].flag) {
334 dsp.printf(flags[l].msg);} 368 if (flags[l].msg != NULL) { // a string
335 else { // an icon 369 dsp.locate(flags[l].x + zones[m].x0,
336 Bitmap_s pic = {9, 10, 2, flags[l].icon}; 370 flags[l].y + zones[m].y0);
337 dsp.Bitmap_BW(pic, flags[l].x, flags[l].y); 371 dsp.printf(flags[l].msg);}
372 else { // an icon
373 Bitmap_s pic = {9, 10, 2, flags[l].icon};
374 dsp.Bitmap_BW(pic,
375 flags[l].x + zones[m].x0,
376 flags[l].y + zones[m].y0);
377 }
378 must_refresh |= zones[m].flag;
379 break;
380 }
338 } 381 }
339 //break; 382 break;
340 } 383 }
341 } 384 }
342 } 385 }
343 } 386 }
344 } 387 }
345 } 388 }
346 389
347 for(uint8_t j=0; j<table[i].maxsize; j++) 390 for(uint8_t j=0; j<table[i].maxsize; j++)
348 oldv[j] = txt[j]; 391 oldv[j] = txt[j];
392 break;
349 } 393 }
350 } 394 }
351 395
352 must_refresh = true;
353 //dsp.copy_to_lcd(); 396 //dsp.copy_to_lcd();
354 pulse(1, false); 397 pulse(1, false);
355 } 398 }
356 399
357 void test_dsp() 400 void test_dsp()
358 { 401 {
402 const FRAME *z;
359 show(0x00, "8g8g8g8g8g8g8", 13); // main dsp 403 show(0x00, "8g8g8g8g8g8g8", 13); // main dsp
360 show(0x0C, "888", 3); // channel dsp 404 show(0x0C, "888", 3); // channel dsp
361 show(0x0A, "\xFF\xFF\xFF\xFF", 4); // all flags 405 show(0x0A, "\xFF\xFF\xFF\xFF", 4); // all flags
406 dsp.copy_to_lcd();
407 wait(3);
408 dsp.cls();
409
410
411 for (uint8_t i=0; i<(sizeof(zones)/sizeof(zones[0])); i++)
412 {
413 z = &zones[i];
414 dsp.fillrect(z->x0, z->y0, z->x1, z->y1, 4+i);
415 dsp.locate(z->x0+1, z->y0+1);
416 dsp.printf("%d", i);
417 }
418 for (uint8_t i=0; i<(sizeof(zones)/sizeof(zones[0])); i++)
419 {
420 z = &zones[i];
421 pc.printf("Zone %d [%x]: %d, %d, %d, %d\n", i, z->flag,
422 z->x0, z->y0, z->x1, z->y1);
423 must_refresh = z->flag;
424 wait(1);
425 }
426 pc.printf("Done\n");
427 wait(2);
428 pc.printf("Copy ALL\n");
429 dsp.copy_to_lcd();
430 wait(2);
431 dsp.cls();
362 } 432 }
363 433
364 434
365 void loop() { // run over and over 435 void loop() { // run over and over
366 while(1){ 436 while(1){
367 if (hp.cmd_available()) 437 if (hp.cmd_available())
368 { 438 {
369 HPSerial::CMD cmd; 439 HPSerial::CMD cmd;
370 if (hp.pop(cmd)) 440 if (hp.pop(cmd))
371 { 441 {/*
372 pc.printf("CMD[%s:%d %d/%d/%d/%d/%d/%d/%d] %X\n", (cmd.direction==HPSerial::Rx)?"Rx":"Tx", cmd.id, 442 pc.printf("CMD[%s:%d %d/%d/%d/%d/%d/%d/%d] %X\n", (cmd.direction==HPSerial::Rx)?"Rx":"Tx", cmd.id,
373 hp.nerrors(0), 443 hp.nerrors(0),
374 hp.nerrors(1), 444 hp.nerrors(1),
375 hp.nerrors(2), 445 hp.nerrors(2),
376 hp.nerrors(3), 446 hp.nerrors(3),
377 hp.nerrors(4), 447 hp.nerrors(4),
378 hp.nerrors(5), 448 hp.nerrors(5),
379 hp.nerrors(6), 449 hp.nerrors(6),
380 cmd.cmd); 450 cmd.cmd);
381 451 */
382 if (cmd.direction == HPSerial::Rx) { 452 if (cmd.direction == HPSerial::Rx) {
383 if ((cmd.cmd == 0x00) || (cmd.cmd == 0x0C)) 453 // if ((cmd.cmd == 0x00) || (cmd.cmd == 0x0C))
384 pc.printf(" data=%s\n", cmd.value); 454 // pc.printf(" data=%s\n", cmd.value);
385 show(cmd.cmd, cmd.value, cmd.size); 455 show(cmd.cmd, cmd.value, cmd.size);
386 456
387 } 457 }
388 } 458 }
389 } 459 }
390 Thread::wait(0.01); 460 Thread::wait(0.01);
391 } 461 }
392 } 462 }
393 463
394 int main() 464 int main()
395 { 465 {
396 setup(); 466 setup();
467
397 tdsp.start(copy_to_lcd); 468 tdsp.start(copy_to_lcd);
469
470 test_dsp();
471 wait(5);
472 dsp.cls();
473
398 tloop.start(loop); 474 tloop.start(loop);
399 while(1); 475 while(1);
400 //loop(); 476 //loop();
401 } 477 }

mercurial