diff --git a/src/energenie/drv/hrfm69.c b/src/energenie/drv/hrfm69.c index c7d59d5..6960e45 100644 --- a/src/energenie/drv/hrfm69.c +++ b/src/energenie/drv/hrfm69.c @@ -3,6 +3,8 @@ * Hope RF RFM69 radio controller low level register interface. */ +#include + #include "system.h" #include "hrfm69.h" #include "spi.h" diff --git a/src/energenie/drv/radio.c b/src/energenie/drv/radio.c index a92ec56..b8ea7ec 100644 --- a/src/energenie/drv/radio.c +++ b/src/energenie/drv/radio.c @@ -368,8 +368,6 @@ // and not on every FIFO load. int i; - uint8_t irqflags1; - uint8_t irqflags2; /* VALIDATE: Check input parameters are in range */ if (times == 0 || len == 0) //TODO: make this an ASSERT() @@ -410,9 +408,9 @@ /* CONFIRM: Was the transmit ok? */ // Check final flags in case of overruns etc - irqflags1 = HRF_readreg(HRF_ADDR_IRQFLAGS1); - irqflags2 = HRF_readreg(HRF_ADDR_IRQFLAGS2); - +#if defined(TRACE) + uint8_t irqflags1 = HRF_readreg(HRF_ADDR_IRQFLAGS1); + uint8_t irqflags2 = HRF_readreg(HRF_ADDR_IRQFLAGS2); TRACE_OUTS("irqflags1,2="); TRACE_OUTN(irqflags1); TRACE_OUTC(','); @@ -424,6 +422,7 @@ { TRACE_FAIL("FIFO not empty or overrun at end of burst"); } +#endif } diff --git a/src/energenie/drv/trace.h b/src/energenie/drv/trace.h index c281c4d..abf396a 100644 --- a/src/energenie/drv/trace.h +++ b/src/energenie/drv/trace.h @@ -11,20 +11,32 @@ #ifndef _TRACE_H #define _TRACE_H +//#define TRACE_POSIX + /* POSIX IMPLEMENTATION */ /* Printf is not available on some platforms, or not very efficient. * These macros make it possible to re-map I/O to more efficient functions. */ +#if defined(TRACE_POSIX) #include #include +#define TRACE #define TRACE_OUTS(S) do{printf("%s", S);fflush(stdout);} while (0) #define TRACE_OUTN(N) do{printf("%d", (unsigned int)N);fflush(stdout);} while (0) #define TRACE_OUTC(C) putc(C, stdout) #define TRACE_NL() do{TRACE_OUTC('\n');fflush(stdout);} while (0) #define TRACE_FAIL(msg) do{fprintf(stderr, "%s", msg);exit(-1);} while (0) +#else // no trace defined + +#define TRACE_OUTS(S) +#define TRACE_OUTN(N) +#define TRACE_OUTC(C) +#define TRACE_NL() +#define TRACE_FAIL(M) +#endif #endif /***** END OF FILE *****/ diff --git a/src/energenie/radio_rpi.so b/src/energenie/radio_rpi.so index 05cefbf..0129587 100755 --- a/src/energenie/radio_rpi.so +++ b/src/energenie/radio_rpi.so Binary files differ