aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/Makefile2
-rw-r--r--firmware/firmware.c17
2 files changed, 9 insertions, 10 deletions
diff --git a/firmware/Makefile b/firmware/Makefile
index a65993e..7510e92 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -27,7 +27,7 @@ all: ${PROG}.elf ${PROG}.lst ${PROG}.hex ${PROG}.ehex size
${SRCS}: ${HEADERS} Makefile
${PROG}.elf: ${OBJS}
- ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
+ ${CC} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC}
size: ${PROG}.elf
${SIZE} -C --mcu=${MCU_TARGET} ${.ALLSRC}
diff --git a/firmware/firmware.c b/firmware/firmware.c
index 4a68195..b626e2f 100644
--- a/firmware/firmware.c
+++ b/firmware/firmware.c
@@ -70,7 +70,7 @@ main(void)
UCSRB = _BV(RXEN) | _BV(TXEN);
UBRRH = UBRRH_VALUE;
UBRRL = UBRRL_VALUE;
- UCSRA |= _BV(U2X);
+ UCSRA &= ~_BV(U2X);
putch('+'); /* say hallo */
for (;;) {
@@ -78,15 +78,14 @@ main(void)
switch (state) {
case INIT:
switch (ch) {
- case 'D':
+ case '@':
state = PAGE;
break;
- case 'P': /* legacy: confim programming state */
- putch('p');
- break;
- case 'R':
+ case '-':
reboot();
break;
+ default:
+ break;
}
break;
case PAGE:
@@ -100,7 +99,7 @@ main(void)
data.byte[n % 2] = ch;
if (n % 2)
boot_page_fill(off + n - 1, data.word);
- if (n++ == SPM_PAGESIZE)
+ if (++n == SPM_PAGESIZE)
state = CKSUM;
break;
case CKSUM:
@@ -109,9 +108,9 @@ main(void)
boot_spm_busy_wait();
boot_page_write(off);
boot_spm_busy_wait();
- putch('d'); /* confirm */
+ putch('.'); /* confirm */
} else
- putch('D');
+ putch('!'); /* flag error */
state = INIT;
break;
}