Newly Optimized RF24Network Layer  v1.0.7
2014-2015 - Optimized RF24 Network Layer for NRF24L01 radios
RF24Network_config.h
1 
2 /*
3  Copyright (C) 2011 James Coliz, Jr. <maniacbug@ymail.com>
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  version 2 as published by the Free Software Foundation.
8  */
9 
10 #ifndef __RF24NETWORK_CONFIG_H__
11 #define __RF24NETWORK_CONFIG_H__
12 
13  #if !defined(__AVR_ATtiny85__) && !defined(__AVR_ATtiny84__)
14 
15  /********** USER CONFIG - non ATTiny **************/
16 
17  //#define DUAL_HEAD_RADIO
18  //#define ENABLE_SLEEP_MODE //AVR only
19  #define RF24NetworkMulticast
20 
24  //#define DISABLE_FRAGMENTATION
25 
33  #define MAIN_BUFFER_SIZE 144 + 10
34 
39  #define MAX_PAYLOAD_SIZE MAIN_BUFFER_SIZE-10
40 
42  //#define DISABLE_USER_PAYLOADS
43 
45  //#define ENABLE_NETWORK_STATS
46 
48  #define ENABLE_DYNAMIC_PAYLOADS
49 
51  //#define SERIAL_DEBUG
52  //#define SERIAL_DEBUG_MINIMAL
53  //#define SERIAL_DEBUG_ROUTING
54  //#define SERIAL_DEBUG_FRAGMENTATION
55  //#define SERIAL_DEBUG_FRAGMENTATION_L2
56  /*************************************/
57 
58  #else // Different set of defaults for ATTiny - fragmentation is disabled and user payloads are set to 3 max
59  /********** USER CONFIG - ATTiny **************/
60  //#define DUAL_HEAD_RADIO
61  //#define ENABLE_SLEEP_MODE //AVR only
62  #define RF24NetworkMulticast
63  #define MAIN_BUFFER_SIZE 96 + 10
64  #define DISABLE_FRAGMENTATION
65  // Enable MAX PAYLOAD SIZE if enabling fragmentation
66  //#define MAX_PAYLOAD_SIZE MAIN_BUFFER_SIZE-10
67  #define ENABLE_DYNAMIC_PAYLOADS
68  //#define DISABLE_USER_PAYLOADS
69  #endif
70  /*************************************/
71 
72 
73 #endif //RF24_NETWORK_CONFIG_H
74 
75 #ifdef __cplusplus
76 
77 #if (defined (__linux) || defined (linux)) && !defined (__ARDUINO_X86__)
78  #include <RF24/RF24_config.h>
79 #else
80  #include <RF24_config.h>
81 #endif
82 
83  #if !defined (ARDUINO_ARCH_AVR)
84  #define sprintf_P sprintf
85  #endif
86 
87  #if defined (SERIAL_DEBUG_MINIMAL)
88  #define IF_SERIAL_DEBUG_MINIMAL(x) ({x;})
89  #else
90  #define IF_SERIAL_DEBUG_MINIMAL(x)
91  #endif
92 
93  #if defined (SERIAL_DEBUG_FRAGMENTATION)
94  #define IF_SERIAL_DEBUG_FRAGMENTATION(x) ({x;})
95  #else
96  #define IF_SERIAL_DEBUG_FRAGMENTATION(x)
97  #endif
98 
99  #if defined (SERIAL_DEBUG_FRAGMENTATION_L2)
100  #define IF_SERIAL_DEBUG_FRAGMENTATION_L2(x) ({x;})
101  #else
102  #define IF_SERIAL_DEBUG_FRAGMENTATION_L2(x)
103  #endif
104 
105  #if defined (SERIAL_DEBUG_ROUTING)
106  #define IF_SERIAL_DEBUG_ROUTING(x) ({x;})
107  #else
108  #define IF_SERIAL_DEBUG_ROUTING(x)
109  #endif
110 
111 
112 #endif //RF24_CONFIG_H
113