dmx: move dmx out to PORTD2, and debug to PORTB5 (integrated LED); support \n for commands
authorTero Marttila <terom@paivola.fi>
Sat, 08 Nov 2014 17:51:09 +0200
changeset 98 e743c905cbf5
parent 97 ce91458641c1
child 99 b1f2b34d4f8c
dmx: move dmx out to PORTD2, and debug to PORTB5 (integrated LED); support \n for commands
src/dmx.c
src/hello-dmx.c
--- a/src/dmx.c	Sat Jun 07 16:23:30 2014 +0300
+++ b/src/dmx.c	Sat Nov 08 17:51:09 2014 +0200
@@ -1,9 +1,9 @@
 #include <util/delay.h>
 
 // DMX
-#define DMX_DDR     DDRB
-#define DMX_PORT    PORTB
-#define DMX_DATA    3       // SPI MOSI
+#define DMX_DDR     DDRD
+#define DMX_PORT    PORTD
+#define DMX_DATA    2
 
 // baud rate: 250k = 4µs / bit
 #define DMX_BAUD    (250 * 1000)
--- a/src/hello-dmx.c	Sat Jun 07 16:23:30 2014 +0300
+++ b/src/hello-dmx.c	Sat Nov 08 17:51:09 2014 +0200
@@ -14,7 +14,7 @@
 // debug
 #define DEBUG_DDR   DDRB
 #define DEBUG_PORT  PORTB
-#define DEBUG_LED   0
+#define DEBUG_LED   5
 
 void led_init ()
 {
@@ -259,7 +259,7 @@
 char input (char c)
 {
     // control
-    if (c == '\r') {
+    if (c == '\r' || c == '\n') {
         char ret = '?';
 
         if (console.state == CMD) {