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
30a01d74
Commit
30a01d74
authored
Feb 28, 2015
by
TMRh20
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup RF24_config.h, add Teensy to arch/ support
parent
b320f9e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
31 deletions
+54
-31
RF24_config.h
RF24_config.h
+23
-31
arch/Teensy/RF24_arch_config.h
arch/Teensy/RF24_arch_config.h
+31
-0
No files found.
RF24_config.h
View file @
30a01d74
...
...
@@ -52,8 +52,10 @@
#include "arch/LittleWire/RF24_arch_config.h"
//Teensy
#elif defined (TEENSYDUINO)
#include "arch/Teensy/RF24_arch_config.h"
//Everything else
#else
...
...
@@ -68,12 +70,6 @@
// Define _BV for non-Arduino platforms and for Arduino DUE
#if defined (ARDUINO) && !defined (__arm__) && !defined (__ARDUINO_X86__)
#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
#define RF24_TINY
#define _SPI SPI
#include "arch/ATTiny/RF24_arch_config.h"
#else
#if defined SPI_UART
#include <SPI_UART.h>
#define _SPI uspi
...
...
@@ -90,26 +86,23 @@
#include <SPI.h>
#define _SPI SPI
#endif
#endif
#else
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#if defined(__arm__) || defined (
CORE_TEENSY) || defined (
__ARDUINO_X86__)
#if defined(__arm__) || defined (__ARDUINO_X86__)
#include <SPI.h>
#endif
#if !defined(CORE_TEENSY)
#define _BV(x) (1<<(x))
#if !defined(__arm__) && !defined (__ARDUINO_X86__)
extern
HardwareSPI
SPI
;
#endif
#else
#define printf Serial.printf
#define _BV(x) (1<<(x))
#if !defined(__arm__) && !defined (__ARDUINO_X86__)
extern
HardwareSPI
SPI
;
#endif
#define _SPI SPI
#endif
...
...
@@ -131,7 +124,7 @@
// Avoid spurious warnings
// Arduino DUE is arm and uses traditional PROGMEM constructs
#if 1
#if ! defined( NATIVE ) && defined( ARDUINO ) && ! defined(__arm__)
&& ! defined( CORE_TEENSY3 )
#if ! defined( NATIVE ) && defined( ARDUINO ) && ! defined(__arm__)
#undef PROGMEM
#define PROGMEM __attribute__(( section(".progmem.data") ))
#undef PSTR
...
...
@@ -145,26 +138,25 @@
#include <avr/pgmspace.h>
#define PRIPSTR "%S"
#else
#if ! defined(ARDUINO) // This doesn't work on Arduino DUE
#if ! defined(ARDUINO) // This doesn't work on Arduino DUE
typedef
char
const
char
;
#else // Fill in pgm_read_byte that is used, but missing from DUE
#else // Fill in pgm_read_byte that is used, but missing from DUE
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
#endif
#endif
#if !defined ( CORE_TEENSY )
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))
#endif
#define PRIPSTR "%s"
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
//Defined Linux
#endif
...
...
arch/Teensy/RF24_arch_config.h
0 → 100644
View file @
30a01d74
#if ARDUINO < 100
#include <WProgram.h>
#else
#include <Arduino.h>
#endif
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <SPI.h>
#define _SPI SPI
#define printf Serial.printf
#ifdef SERIAL_DEBUG
#define IF_SERIAL_DEBUG(x) ({x;})
#else
#define IF_SERIAL_DEBUG(x)
#endif
#define PRIPSTR "%s"
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