Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RF24
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
RF24
Commits
53cb5794
Commit
53cb5794
authored
Dec 10, 2011
by
maniacbug
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved environment-specific checking out to RF24_config.h
parent
f3934084
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
29 deletions
+63
-29
RF24.cpp
RF24.cpp
+1
-27
RF24.h
RF24.h
+1
-2
RF24_config.h
RF24_config.h
+61
-0
No files found.
RF24.cpp
View file @
53cb5794
...
@@ -6,37 +6,11 @@
...
@@ -6,37 +6,11 @@
version 2 as published by the Free Software Foundation.
version 2 as published by the Free Software Foundation.
*/
*/
#if ARDUINO < 100
#include <WProgram.h>
#else
#include <Arduino.h>
#endif
#include <SPI.h>
#include <SPI.h>
#include "nRF24L01.h"
#include "nRF24L01.h"
#include "RF24_config.h"
#include "RF24.h"
#include "RF24.h"
#undef SERIAL_DEBUG
#ifdef SERIAL_DEBUG
#define IF_SERIAL_DEBUG(x) ({x;})
#else
#define IF_SERIAL_DEBUG(x)
#endif
// Avoid spurious warnings
#if ! defined( NATIVE ) && defined( ARDUINO )
#undef PROGMEM
#define PROGMEM __attribute__(( section(".progmem.data") ))
#undef PSTR
#define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); &__c[0];}))
#endif
#ifdef ARDUINO
#define PRIPSTR "%S"
#else
#define PRIPSTR "%s"
#endif
/****************************************************************************/
/****************************************************************************/
void
RF24
::
csn
(
int
mode
)
void
RF24
::
csn
(
int
mode
)
...
...
RF24.h
View file @
53cb5794
...
@@ -9,8 +9,7 @@
...
@@ -9,8 +9,7 @@
#ifndef __RF24_H__
#ifndef __RF24_H__
#define __RF24_H__
#define __RF24_H__
#include <stddef.h>
#include <RF24_config.h>
#include <avr/pgmspace.h>
typedef
enum
{
RF24_PA_MIN
=
0
,
RF24_PA_LOW
,
RF24_PA_HIGH
,
RF24_PA_MAX
,
RF24_PA_ERROR
}
rf24_pa_dbm_e
;
typedef
enum
{
RF24_PA_MIN
=
0
,
RF24_PA_LOW
,
RF24_PA_HIGH
,
RF24_PA_MAX
,
RF24_PA_ERROR
}
rf24_pa_dbm_e
;
typedef
enum
{
RF24_1MBPS
=
0
,
RF24_2MBPS
,
RF24_250KBPS
}
rf24_datarate_e
;
typedef
enum
{
RF24_1MBPS
=
0
,
RF24_2MBPS
,
RF24_250KBPS
}
rf24_datarate_e
;
...
...
RF24_config.h
0 → 100644
View file @
53cb5794
/*
Copyright (C) 2011 James Coliz, Jr. <maniacbug@ymail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
*/
#ifndef __RF24_CONFIG_H__
#define __RF24_CONFIG_H__
#if ARDUINO < 100
#include <WProgram.h>
#else
#include <Arduino.h>
#endif
#include <stddef.h>
// Stuff that is normally provided by Arduino
#ifndef ARDUINO
#include <stdint.h>
#include <stdio.h>
#include <string.h>
extern
HardwareSPI
SPI
;
#define _BV(x) (1<<(x))
#endif
#undef SERIAL_DEBUG
#ifdef SERIAL_DEBUG
#define IF_SERIAL_DEBUG(x) ({x;})
#else
#define IF_SERIAL_DEBUG(x)
#endif
// Avoid spurious warnings
#if ! defined( NATIVE ) && defined( ARDUINO )
#undef PROGMEM
#define PROGMEM __attribute__(( section(".progmem.data") ))
#undef PSTR
#define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); &__c[0];}))
#endif
// Progmem is Arduino-specific
#ifdef ARDUINO
#include <avr/pgmspace.h>
#define PRIPSTR "%S"
#else
typedef
char
const
prog_char
;
typedef
uint16_t
prog_uint16_t
;
#define PSTR(x) (x)
#define printf_P printf
#define strlen_P strlen
#define PROGMEM
#define pgm_read_word(p) (*(p))
#define PRIPSTR "%s"
#endif
#endif // __RF24_CONFIG_H__
// vim:ai:cin:sts=2 sw=2 ft=cpp
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment