RF24Network v1
|
00001 00002 /* 00003 Copyright (C) 2011 James Coliz, Jr. <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 #ifndef ARDUINO 00023 #include <stdint.h> 00024 #include <stdio.h> 00025 #include <string.h> 00026 extern HardwareSPI SPI; 00027 #define _BV(x) (1<<(x)) 00028 #endif 00029 00030 #define SERIAL_DEBUG 00031 #ifdef SERIAL_DEBUG 00032 #define IF_SERIAL_DEBUG(x) ({x;}) 00033 #else 00034 #define IF_SERIAL_DEBUG(x) 00035 #endif 00036 00037 // Avoid spurious warnings 00038 #if ! defined( NATIVE ) && defined( ARDUINO ) 00039 #undef PROGMEM 00040 #define PROGMEM __attribute__(( section(".progmem.data") )) 00041 #undef PSTR 00042 #define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); &__c[0];})) 00043 #endif 00044 00045 // Progmem is Arduino-specific 00046 #ifdef ARDUINO 00047 #include <avr/pgmspace.h> 00048 #define PRIPSTR "%S" 00049 #else 00050 typedef char const prog_char; 00051 typedef uint16_t prog_uint16_t; 00052 #define PSTR(x) (x) 00053 #define printf_P printf 00054 #define strlen_P strlen 00055 #define PROGMEM 00056 #define pgm_read_word(p) (*(p)) 00057 #define PRIPSTR "%s" 00058 #endif 00059 00060 #endif // __RF24_CONFIG_H__ 00061 // vim:ai:cin:sts=2 sw=2 ft=cpp