# HG changeset patch # User David Douard # Date 1606164940 -3600 # Node ID cce151e4bf3dee1f9e40eab233bc9b21cc0f5b1f # Parent c296edace64a9761daa3f5e058ff1144f9c60416 Small fixes in main - toggle the shift indicator when the key is pressed while already on - attempt to fix the restart-while-shuting-down bug diff -r c296edace64a -r cce151e4bf3d src/main.cpp --- a/src/main.cpp Tue Nov 17 20:21:11 2020 +0100 +++ b/src/main.cpp Mon Nov 23 21:55:40 2020 +0100 @@ -255,6 +255,8 @@ // this should be called as a result of the HP_RST pin going LO printf("Reset connection to the main unit\n"); if (DigitalIn(HP_RST).read() == 0) { + byescreen_timer.detach(); // cancel a "poweroff", if any + if (hp == NULL) { printf("setup HP communication handler\r\n"); hp = new HPSerial(HP_TX, HP_RX); @@ -335,8 +337,12 @@ if ((keycode == KC_SHIFT) && (key.keyevent == KEY_PRESSED)) { - shift = true; - dsp->set_flag_status(0x0E, true); + // toggle the shift indicator + if (shift) + shift = false; + else + shift = false; + dsp->set_flag_status(0x0E, shift); dsp->draw_flag(0x0E); }