summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2012-01-15 19:41:36 +0100
committerDavid Lamparter <equinox@diac24.net>2012-01-15 19:41:56 +0100
commit73d3b9faf1d0ac88c52f4c7c2853da8d870f2581 (patch)
treeaf39521b2e4889fd0724d8e2c5c83184c4ff78cd
parentd3dcf97e28cfeffe5d2e27a119077e12b61b2e7e (diff)
general cleanups
-rw-r--r--.gitignore2
-rw-r--r--Makefile6
-rw-r--r--kbc.c11
3 files changed, 14 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index 0b31adb..33fb1bd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
1*.o 1*.o
2*.flash 2*.flash
3*.eeprom 3*.eeprom
4*.map
5*.orig
diff --git a/Makefile b/Makefile
index 3f0732f..a44356e 100644
--- a/Makefile
+++ b/Makefile
@@ -31,11 +31,13 @@ love: kbc.flash kbc.eeprom
31 $(ACC) $(ACFLAGS) -c -o $@ $< 31 $(ACC) $(ACFLAGS) -c -o $@ $<
32 32
33flash: kbc.flash 33flash: kbc.flash
34 $(AVRDUDE) -y -p m48 -E noreset -U $^ 34 $(AVRDUDE) -y -p m48 -E noreset -U flash:w:$<:r
35eeprom: kbc.eeprom
36 $(AVRDUDE) -y -p m48 -E noreset -U eeprom:w:$<:r
35 37
36clean: 38clean:
37 rm -f *.flash *.eeprom *.o 39 rm -f *.flash *.eeprom *.o
38 40
39.PHONY: love flash clean 41.PHONY: love flash eeprom clean
40.SECONDARY: 42.SECONDARY:
41 43
diff --git a/kbc.c b/kbc.c
index 81ba569..3568eda 100644
--- a/kbc.c
+++ b/kbc.c
@@ -90,6 +90,7 @@ static void usart_dis()
90 (void)UDR0; 90 (void)UDR0;
91} 91}
92 92
93#if 0
93static uint8_t dbgtx[64]; 94static uint8_t dbgtx[64];
94static uint8_t dbgpos; 95static uint8_t dbgpos;
95 96
@@ -121,6 +122,10 @@ static void dbg_init(void)
121 /* MSB first, cpol = rise,fall, cpha = sample(r),setup(f) */ 122 /* MSB first, cpol = rise,fall, cpha = sample(r),setup(f) */
122 SPCR = (1 << SPIE) | (1 << SPE); 123 SPCR = (1 << SPIE) | (1 << SPE);
123} 124}
125#else
126#define dbg_init()
127#define dbg_wr(x)
128#endif
124 129
125static volatile uint8_t statecntr = 0; 130static volatile uint8_t statecntr = 0;
126 131
@@ -332,8 +337,8 @@ static uint8_t cntr = 0;
332static uint8_t error; 337static uint8_t error;
333#endif 338#endif
334 339
335static const EEMEM char passwd[sizeof(PIN) - 1] = PIN; 340static const EEMEM uint8_t passwd[sizeof(PIN) - 1] = PIN;
336static char code[sizeof(PIN)]; 341static uint8_t code[sizeof(PIN)];
337 342
338static void state_enter(void) 343static void state_enter(void)
339{ 344{
@@ -479,7 +484,7 @@ ISR(SIG_OVERFLOW0)
479#define ENT 0x0d 484#define ENT 0x0d
480 485
481#define KBC_BASE 0x16 486#define KBC_BASE 0x16
482const PROGMEM char kbc[] = { 487const PROGMEM uint8_t kbc[] = {
483/* 0 1 2 3 4 5 6 7 488/* 0 1 2 3 4 5 6 7
484 * 8 9 a b c d e f 489 * 8 9 a b c d e f
485 */ 490 */