DMX Library for STM devices

Dependents:   DISCO-F746NG_DMX-Test

Fork of DMX by Suga koubou

Revision:
9:e687f321c428
Parent:
8:d4a45bba41d2
Child:
10:b748aab8404c
diff -r d4a45bba41d2 -r e687f321c428 DMX.cpp
--- a/DMX.cpp	Mon Mar 11 04:02:26 2013 +0000
+++ b/DMX.cpp	Fri Mar 29 02:06:50 2013 +0000
@@ -99,9 +99,10 @@
         mode_tx = DMX_MODE_DATA;
         _dmx.attach(this, &DMX::int_tx, Serial::TxIrq);
 #ifdef DMX_UART_DIRECT
-        _uart->THR = 0;
+        while(!(_uart->LSR & (1<<5)));
+        _uart->THR = DMX_START_CODE;
 #else
-        _dmx.putc(0);
+        _dmx.putc(DMX_START_CODE);
 #endif
         break;
     }
@@ -148,7 +149,7 @@
     if (mode_rx == DMX_MODE_BREAK) {
 
         // Start Code
-        if (dat == 0) {
+        if (dat == DMX_START_CODE) {
             addr_rx = 0;
             mode_rx = DMX_MODE_DATA;
         } else {