diff options
| author | David Lamparter <equinox@diac24.net> | 2012-01-15 19:41:36 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2012-01-15 19:41:56 +0100 |
| commit | 73d3b9faf1d0ac88c52f4c7c2853da8d870f2581 (patch) | |
| tree | af39521b2e4889fd0724d8e2c5c83184c4ff78cd /kbc.c | |
| parent | d3dcf97e28cfeffe5d2e27a119077e12b61b2e7e (diff) | |
general cleanups
Diffstat (limited to 'kbc.c')
| -rw-r--r-- | kbc.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -87,12 +87,13 @@ static void usart_rxpoll() static void usart_dis() { UCSR0B = 0; (void)UDR0; } +#if 0 static uint8_t dbgtx[64]; static uint8_t dbgpos; static void dbg_wr(uint8_t what) { cli(); @@ -118,12 +119,16 @@ ISR(SIG_SPI) static void dbg_init(void) { DDRB |= B_MISO; /* MSB first, cpol = rise,fall, cpha = sample(r),setup(f) */ SPCR = (1 << SPIE) | (1 << SPE); } +#else +#define dbg_init() +#define dbg_wr(x) +#endif static volatile uint8_t statecntr = 0; #define mayabort if (TIFR0 & (1 << TOV0)) return bit; #define _wait_CLK(cond) while(cond) { mayabort; } #define wait_CLKlo _wait_CLK( PIND /* & p0 & p1 & p2 */ & D_CLK) @@ -329,14 +334,14 @@ static uint8_t wait_byte(void) static uint8_t cntr = 0; #ifdef KILLSWITCH static uint8_t error; #endif -static const EEMEM char passwd[sizeof(PIN) - 1] = PIN; -static char code[sizeof(PIN)]; +static const EEMEM uint8_t passwd[sizeof(PIN) - 1] = PIN; +static uint8_t code[sizeof(PIN)]; static void state_enter(void) { switch (state) { case STATE_NONE: case STATE_FAILURE: @@ -476,13 +481,13 @@ ISR(SIG_OVERFLOW0) } #define ESC 0x1b #define ENT 0x0d #define KBC_BASE 0x16 -const PROGMEM char kbc[] = { +const PROGMEM uint8_t kbc[] = { /* 0 1 2 3 4 5 6 7 * 8 9 a b c d e f */ '1', '_', /* 10 - 17 */ '_', '_', '_', '_', '_', '_', '2', '_', /* 18 - 1f */ '_', '_', '_', '_', '_', '4', '3', '_', /* 20 - 27 */ |
