DMX Library for STM devices
Dependents: DISCO-F746NG_DMX-Test
Fork of DMX by
Revision 18:e5e5eca21b4a, committed 2015-12-12
- Comitter:
- Gottfried
- Date:
- Sat Dec 12 13:57:52 2015 +0000
- Parent:
- 17:b87addd12d20
- Commit message:
- some changes
Changed in this revision
DMX.cpp | Show annotated file Show diff for this revision Revisions of this file |
DMX.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/DMX.cpp Sat Dec 12 13:16:07 2015 +0000 +++ b/DMX.cpp Sat Dec 12 13:57:52 2015 +0000 @@ -20,7 +20,9 @@ is_recived(0), is_sent(0), mode_tx(DMX_MODE_STOP), - mode_rx(DMX_MODE_BEGIN) + mode_rx(DMX_MODE_BEGIN), + addr_tx(0), + addr_rx(0) { data_tx = new char[myDMXSize]; data_rx = new char[myDMXSize]; @@ -42,14 +44,14 @@ delete[] data_rx; } -void DMX::put(int addr, int data) +void DMX::put(int addr, char data) { if(addr < 0 || addr >= myDMXSize) return; data_tx[addr] = data; } -void DMX::put(unsigned char *buf, int addr, int len) +void DMX::put(char *buf, int addr, int len) { if(!len) len = myDMXSize; @@ -69,7 +71,7 @@ return data_rx[addr]; } -void DMX::get(unsigned char *buf, int addr, int len) +void DMX::get(char *buf, int addr, int len) { if(!len) len = myDMXSize;
--- a/DMX.h Sat Dec 12 13:16:07 2015 +0000 +++ b/DMX.h Sat Dec 12 13:57:52 2015 +0000 @@ -49,17 +49,17 @@ * @param addr DMX data address (0-511) * @param data DMX data (0-255) */ - void put(int addr, int data); + void put(int addr, char data); /** Send the data * @param buf DMX data buffer * @param addr DMX data address * @param len data length */ - void put(unsigned char *buf, int addr = 0, int len = 0); + void put(char *buf, int addr = 0, int len = 0); /** Send the data * @param addr DMX data address (0-511) - * @return DMX data (0-255) + * @return DMX data (0-255) or -1 on error */ int get(int addr); /** Send the data @@ -67,7 +67,7 @@ * @param addr DMX data address * @param len data length */ - void get(unsigned char *buf, int addr = 0, int len = 0); + void get(char *buf, int addr = 0, int len = 0); /** Start DMX send operation */