a fork to test out advertising process
Dependencies: BLE_API TxIR mbed nRF51822
Fork of ir-puck by
Diff: IR.cpp
- Revision:
- 1:6ba27220d1da
- Parent:
- 0:c94311378ec1
--- a/IR.cpp Wed Jul 02 10:48:58 2014 +0000 +++ b/IR.cpp Tue Jul 08 09:38:31 2014 +0000 @@ -5,10 +5,17 @@ #define WORD(x, i) ((x)[(i)] << 8 | (x)[(i) + 1]) TxIR txir(p14); -Serial px(USBTX, USBRX); + +#define DEBUG 1 +#ifdef DEBUG + Serial px(USBTX, USBRX); + #define LOG(args...) px.printf(args) +#else + #define LOG(args...) +#endif void fireIRCode(uint8_t* header, uint8_t* one, uint8_t* zero, uint8_t* ptrail, uint8_t* predata, uint8_t* code) { - px.printf("Going to fire.\n"); + LOG("Going to fire.\n"); int raw_codes_length = 67; unsigned raw_codes[raw_codes_length]; raw_codes[0] = WORD(header, 0); @@ -33,5 +40,5 @@ txir.txSeq(26.32 / 1000000.0, 67, raw_codes); - px.printf("Wrote message :)\n"); + LOG("Wrote message :)\n"); } \ No newline at end of file