src/main.cpp

changeset 57
cce151e4bf3d
parent 54
f6774bd0d570
child 62
55e3b4441b11
equal deleted inserted replaced
56:c296edace64a 57:cce151e4bf3d
253 void reset(void) 253 void reset(void)
254 { 254 {
255 // this should be called as a result of the HP_RST pin going LO 255 // this should be called as a result of the HP_RST pin going LO
256 printf("Reset connection to the main unit\n"); 256 printf("Reset connection to the main unit\n");
257 if (DigitalIn(HP_RST).read() == 0) { 257 if (DigitalIn(HP_RST).read() == 0) {
258 byescreen_timer.detach(); // cancel a "poweroff", if any
259
258 if (hp == NULL) { 260 if (hp == NULL) {
259 printf("setup HP communication handler\r\n"); 261 printf("setup HP communication handler\r\n");
260 hp = new HPSerial(HP_TX, HP_RX); 262 hp = new HPSerial(HP_TX, HP_RX);
261 } 263 }
262 else { 264 else {
333 key_buf.pop(key); 335 key_buf.pop(key);
334 keycode = kp_mapping[key.row][key.col]; 336 keycode = kp_mapping[key.row][key.col];
335 337
336 if ((keycode == KC_SHIFT) && (key.keyevent == KEY_PRESSED)) 338 if ((keycode == KC_SHIFT) && (key.keyevent == KEY_PRESSED))
337 { 339 {
338 shift = true; 340 // toggle the shift indicator
339 dsp->set_flag_status(0x0E, true); 341 if (shift)
342 shift = false;
343 else
344 shift = false;
345 dsp->set_flag_status(0x0E, shift);
340 dsp->draw_flag(0x0E); 346 dsp->draw_flag(0x0E);
341 } 347 }
342 348
343 if (hp != NULL) { 349 if (hp != NULL) {
344 if ((shift) && (keycode != KC_SHIFT)) 350 if ((shift) && (keycode != KC_SHIFT))

mercurial