diff options
| author | Christian Franke <nobody@nowhere.ws> | 2012-09-03 00:02:48 +0200 |
|---|---|---|
| committer | Christian Franke <nobody@nowhere.ws> | 2012-09-03 00:02:48 +0200 |
| commit | 97140abf540f41e97ae59beff8a3c106010641aa (patch) | |
| tree | 408b0291c30a498331814e3c9d5bbb31c9f5229a /kbc.c | |
| parent | b4491d3116e0f9c45972262d5d5d9c2e1e2da561 (diff) | |
some comments and bugfixes
Diffstat (limited to 'kbc.c')
| -rw-r--r-- | kbc.c | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -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) { |
