RF24 v1
RF24_config.h
00001 
00002 /*
00003  Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>
00004 
00005  This program is free software; you can redistribute it and/or
00006  modify it under the terms of the GNU General Public License
00007  version 2 as published by the Free Software Foundation.
00008  */
00009 
00010 #ifndef __RF24_CONFIG_H__
00011 #define __RF24_CONFIG_H__
00012 
00013 #if ARDUINO < 100
00014 #include <WProgram.h>
00015 #else
00016 #include <Arduino.h>
00017 #endif
00018 
00019 #include <stddef.h>
00020 
00021 // Stuff that is normally provided by Arduino
00022 #ifdef ARDUINO
00023 #include <SPI.h>
00024 #else
00025 #include <stdint.h>
00026 #include <stdio.h>
00027 #include <string.h>
00028 extern HardwareSPI SPI;
00029 #define _BV(x) (1<<(x))
00030 #endif
00031 
00032 #undef SERIAL_DEBUG
00033 #ifdef SERIAL_DEBUG
00034 #define IF_SERIAL_DEBUG(x) ({x;})
00035 #else
00036 #define IF_SERIAL_DEBUG(x)
00037 #endif
00038 
00039 // Avoid spurious warnings
00040 #if ! defined( NATIVE ) && defined( ARDUINO )
00041 #undef PROGMEM
00042 #define PROGMEM __attribute__(( section(".progmem.data") ))
00043 #undef PSTR
00044 #define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); &__c[0];}))
00045 #endif
00046 
00047 // Progmem is Arduino-specific
00048 #ifdef ARDUINO
00049 #include <avr/pgmspace.h>
00050 #define PRIPSTR "%S"
00051 #else
00052 typedef char const prog_char;
00053 typedef uint16_t prog_uint16_t;
00054 #define PSTR(x) (x)
00055 #define printf_P printf
00056 #define strlen_P strlen
00057 #define PROGMEM
00058 #define pgm_read_word(p) (*(p)) 
00059 #define PRIPSTR "%s"
00060 #endif
00061 
00062 #endif // __RF24_CONFIG_H__
00063 // vim:ai:cin:sts=2 sw=2 ft=cpp
 All Classes Files Functions Enumerations