summaryrefslogtreecommitdiff
path: root/kbc.c
diff options
context:
space:
mode:
Diffstat (limited to 'kbc.c')
-rw-r--r--kbc.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/kbc.c b/kbc.c
index 5d13e55..f343012 100644
--- a/kbc.c
+++ b/kbc.c
@@ -65,3 +65,11 @@ enum state {
};
-static volatile enum state state, nextstate, toutstate;
+
+/* state is the current system state */
+static volatile enum state state;
+
+/* system will advance to nextstate on return to main, if nextstate is != STATE_NONE */
+static volatile enum state nextstate;
+
+/* system will advance to toutstate on timeout. */
+static volatile enum state toutstate;
@@ -111,3 +119,3 @@ static void dbg_wr(uint8_t what)
-ISR(SIG_SPI)
+ISR(SPI_STC_vect)
{
@@ -403,3 +411,3 @@ static void state_enter(void)
case STATE_IDLE:
- memset(&code, 0, sizeof(code));
+ memset(code, 0, sizeof(code));
toutstate = STATE_IDLEBLINK;
@@ -489,3 +497,3 @@ static void state_enter(void)
-ISR(SIG_OVERFLOW0)
+ISR(TIMER0_OVF_vect)
{
@@ -538,2 +546,3 @@ static void handle_keypress(uint8_t data)
release = 0;
+ e0 = 0;
return;
@@ -605,3 +614,3 @@ static void handle_keypress(uint8_t data)
}
- memset(&code, 0, sizeof(code));
+ memset(code, 0, sizeof(code));
return;
@@ -618,3 +627,3 @@ static void handle_keypress(uint8_t data)
-ISR(SIG_USART_RECV)
+ISR(USART_RX_vect)
{