--- a/Makefile Wed Sep 24 22:41:46 2014 +0300
+++ b/Makefile Wed Sep 24 22:54:26 2014 +0300
@@ -6,6 +6,7 @@
HEX = build/src/$(PROG).hex
build/src/hello.elf: build/src/hello.o \
+ build/qmsk/src/serial.o \
build/qmsk/src/timer.o
##
--- a/src/hello.c Wed Sep 24 22:41:46 2014 +0300
+++ b/src/hello.c Wed Sep 24 22:54:26 2014 +0300
@@ -6,22 +6,36 @@
#define DEBUG_PORT PORTB
#include "debug.h"
+#include "serial.h"
#include "timer.h"
int main (void)
{
debug_init();
+ serial_init(SERIAL_BAUD_9600, SERIAL_PARITY_N, SERIAL_STOPBITS_1);
timer_init();
// init
+ char c = '.';
+ unsigned short timeout = 8000;
+
debug_set();
sei();
- unsigned short timeout = 8000;
// start
while (true) {
- timer_sleep(timeout);
+ if (timer_sleep(timeout)) {
+ c = '.';
+ } else if ((c = serial_read())) {
+
+ } else {
+ c = '?';
+ }
+
debug_toggle();
+
+ // out
+ serial_write(c);
}
}