summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Franke <nobody@nowhere.ws>2013-01-26 20:55:12 +0100
committerChristian Franke <nobody@nowhere.ws>2013-01-26 20:55:12 +0100
commited14e1a4d70dc53b47eb36cf8a647fe854c5ec0f (patch)
tree1c54d489df0e44516ccbc32168a8b338195f9965
parenteee52b591f31a10895bcaae69ecbcc8a8920df79 (diff)
Stupid hotfix for keyboard hickups
-rw-r--r--kbc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/kbc.c b/kbc.c
index a1f70b8..95665c9 100644
--- a/kbc.c
+++ b/kbc.c
@@ -362,2 +362,3 @@ static uint8_t cntr = 0;
static uint8_t close_try = 0;
+static uint8_t idle_looped = 0;
#ifdef KILLSWITCH
@@ -428,3 +429,9 @@ static void state_enter(void)
break;
- nextstate = STATE_NONE;
+
+ /* We have some issues with the keyboard failing every
+ * now and then. Until we know more about the issue,
+ * reset it every 256th time we enter STATE_IDLE :/ */
+ idle_looped += 1;
+ if (idle_looped != 0xff)
+ nextstate = STATE_NONE;
break;
@@ -443,2 +450,3 @@ static void state_enter(void)
toutstate = STATE_IDLE;
+ idle_looped = 0; /* input still works, reset idle counter */
statecntr = WAIT_INPUT;