BayEOSArduino Library
RF24_config.h
1 
2 /*
3  Copyright (C) 2011 J. Coliz <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 __RF24_CONFIG_H__
11 #define __RF24_CONFIG_H__
12 
13 #if ARDUINO < 100
14 #include <WProgram.h>
15 #else
16 #include <Arduino.h>
17 #endif
18 
19 #include <stddef.h>
20 
21 // Stuff that is normally provided by Arduino
22 #ifdef ARDUINO
23 #include <SPI.h>
24 #else
25 #include <stdint.h>
26 #include <stdio.h>
27 #include <string.h>
28 extern HardwareSPI SPI;
29 #define _BV(x) (1<<(x))
30 #endif
31 
32 #undef SERIAL_DEBUG
33 #ifdef SERIAL_DEBUG
34 #define IF_SERIAL_DEBUG(x) ({x;})
35 #else
36 #define IF_SERIAL_DEBUG(x)
37 #endif
38 
39 // Avoid spurious warnings
40 #if 1
41 #if ! defined( NATIVE ) && defined( ARDUINO )
42 #undef PROGMEM
43 #define PROGMEM __attribute__(( section(".progmem.data") ))
44 #undef PSTR
45 #define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
46 #endif
47 #endif
48 
49 // Progmem is Arduino-specific
50 #ifdef ARDUINO
51 #include <avr/pgmspace.h>
52 #define PRIPSTR "%S"
53 #else
54 typedef char const char;
55 typedef uint16_t prog_uint16_t;
56 #define PSTR(x) (x)
57 #define printf_P printf
58 #define strlen_P strlen
59 #define PROGMEM
60 #define pgm_read_word(p) (*(p))
61 #define PRIPSTR "%s"
62 #endif
63 
64 #endif // __RF24_CONFIG_H__
65 // vim:ai:cin:sts=2 sw=2 ft=cpp