From 73d3b9faf1d0ac88c52f4c7c2853da8d870f2581 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sun, 15 Jan 2012 19:41:36 +0100 Subject: general cleanups --- .gitignore | 2 ++ Makefile | 6 ++++-- kbc.c | 11 ++++++++--- 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 @@ *.o *.flash *.eeprom +*.map +*.orig diff --git a/Makefile b/Makefile index 3f0732f..a44356e 100644 --- a/Makefile +++ b/Makefile @@ -31,11 +31,13 @@ love: kbc.flash kbc.eeprom $(ACC) $(ACFLAGS) -c -o $@ $< flash: kbc.flash - $(AVRDUDE) -y -p m48 -E noreset -U $^ + $(AVRDUDE) -y -p m48 -E noreset -U flash:w:$<:r +eeprom: kbc.eeprom + $(AVRDUDE) -y -p m48 -E noreset -U eeprom:w:$<:r clean: rm -f *.flash *.eeprom *.o -.PHONY: love flash clean +.PHONY: love flash eeprom clean .SECONDARY: 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() (void)UDR0; } +#if 0 static uint8_t dbgtx[64]; static uint8_t dbgpos; @@ -121,6 +122,10 @@ static void dbg_init(void) /* 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; @@ -332,8 +337,8 @@ static uint8_t cntr = 0; 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) { @@ -479,7 +484,7 @@ ISR(SIG_OVERFLOW0) #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 */ -- cgit v1.2.1