DMX Library for STM devices
Dependents: DISCO-F746NG_DMX-Test
Fork of DMX by
Diff: DMX.cpp
- Revision:
- 12:1f176eee2d28
- Parent:
- 11:cb132e066057
- Child:
- 13:9841af9ac344
diff -r cb132e066057 -r 1f176eee2d28 DMX.cpp --- a/DMX.cpp Fri Sep 20 01:52:31 2013 +0000 +++ b/DMX.cpp Mon Sep 23 09:15:57 2013 +0000 @@ -12,12 +12,8 @@ #include "DMX.h" DMX::DMX (PinName p_tx, PinName p_rx) : _dmx(p_tx, p_rx) { - int i; - for (i = 0; i < DMX_SIZE; i ++) { - data_tx[i] = 0; - data_rx[i] = 0; - } + clear(); // mode_tx = DMX_MODE_BEGIN; mode_tx = DMX_MODE_STOP; mode_rx = DMX_MODE_BEGIN; @@ -193,3 +189,12 @@ timeout01.detach(); mode_tx = DMX_MODE_STOP; } + +void DMX::clear () { + int i; + + for (i = 0; i < DMX_SIZE; i ++) { + data_tx[i] = 0; + data_rx[i] = 0; + } +}