From ecca0ee28e26567b71bc20db461ce046bc0cd210 Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Sun, 11 Aug 2013 14:11:11 +0200 Subject: [PATCH] fix for #117 and position of preprocessor directives --- sys/include/transceiver.h | 69 ++++++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 16 deletions(-) diff --git a/sys/include/transceiver.h b/sys/include/transceiver.h index d10df3b257..cf74246e84 100644 --- a/sys/include/transceiver.h +++ b/sys/include/transceiver.h @@ -3,35 +3,72 @@ #include +/* supported transceivers * + * NOTE: necessary to include here again due to + * https://github.com/RIOT-OS/RIOT/issues/117 */ +#ifdef MODULE_CC110X +#include +#endif + +#ifdef MODULE_CC110X_NG +#include +#endif + +#ifdef MODULE_CC2420 +#include +#endif + +#ifdef MODULE_MC1322X +#include +#include +#include +#endif + /* Stack size for transceiver thread */ #ifndef TRANSCEIVER_STACK_SIZE - #define TRANSCEIVER_STACK_SIZE (512) +#define TRANSCEIVER_STACK_SIZE (512) +#endif + +#ifndef PAYLOAD_SIZE +#define PAYLOAD_SIZE (0) +#endif +#ifdef MODULE_CC110X +#if (CC1100_MAX_DATA_LENGTH > PAYLOAD_SIZE) +#undef PAYLOAD_SIZE +#define PAYLOAD_SIZE (CC1100_MAX_DATA_LENGTH) +#endif +#endif +#ifdef MODULE_CC110X_NG +#if (CC1100_MAX_DATA_LENGTH > PAYLOAD_SIZE) +#undef PAYLOAD_SIZE +#define PAYLOAD_SIZE (CC1100_MAX_DATA_LENGTH) +#endif #endif #define PAYLOAD_SIZE (0) #ifdef MODULE_CC110X - #if (CC1100_MAX_DATA_LENGTH > PAYLOAD_SIZE) - #undef PAYLOAD_SIZE - #define PAYLOAD_SIZE (CC1100_MAX_DATA_LENGTH) - #endif +#if (CC1100_MAX_DATA_LENGTH > PAYLOAD_SIZE) +#undef PAYLOAD_SIZE +#define PAYLOAD_SIZE (CC1100_MAX_DATA_LENGTH) +#endif #endif #ifdef MODULE_CC110X_NG - #if (CC1100_MAX_DATA_LENGTH > PAYLOAD_SIZE) - #undef PAYLOAD_SIZE - #define PAYLOAD_SIZE (CC1100_MAX_DATA_LENGTH) +#if (CC1100_MAX_DATA_LENGTH > PAYLOAD_SIZE) +#undef PAYLOAD_SIZE +#define PAYLOAD_SIZE (CC1100_MAX_DATA_LENGTH) #endif #endif #ifdef MODULE_CC2420 - #if (CC2420_MAX_DATA_LENGTH > PAYLOAD_SIZE) - #undef PAYLOAD_SIZE - #define PAYLOAD_SIZE (CC2420_MAX_DATA_LENGTH) - #endif +#if (CC2420_MAX_DATA_LENGTH > PAYLOAD_SIZE) +#undef PAYLOAD_SIZE +#define PAYLOAD_SIZE (CC2420_MAX_DATA_LENGTH) +#endif #endif #ifdef MODULE_MC1322X - #if (MC1322X_MAX_DATA_LENGTH > PAYLOAD_SIZE) - #undef PAYLOAD_SIZE - #define PAYLOAD_SIZE (MC1322X_MAX_DATA_LENGTH) - #endif +#if (MC1322X_MAX_DATA_LENGTH > PAYLOAD_SIZE) +#undef PAYLOAD_SIZE +#define PAYLOAD_SIZE (MC1322X_MAX_DATA_LENGTH) +#endif #endif /* The maximum of threads to register */ #define TRANSCEIVER_MAX_REGISTERED (4)