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
83dccd28
Commit
83dccd28
authored
Nov 18, 2014
by
darky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Intel Gallileo support added
parent
58293d6f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
12 deletions
+37
-12
RF24.cpp
RF24.cpp
+1
-1
RF24.h
RF24.h
+1
-1
RF24_config.h
RF24_config.h
+16
-9
printf.h
printf.h
+19
-1
No files found.
RF24.cpp
View file @
83dccd28
...
...
@@ -595,7 +595,7 @@ void RF24::printDetails(void)
print_byte_register
(
PSTR
(
"CONFIG"
),
CONFIG
);
print_byte_register
(
PSTR
(
"DYNPD/FEATURE"
),
DYNPD
,
2
);
#if defined(__arm__) || defined (RF24_LINUX)
#if defined(__arm__) || defined (RF24_LINUX)
|| defined (__ARDUINO_X86__)
printf_P
(
PSTR
(
"Data Rate
\t
= %s
\r\n
"
),
pgm_read_word
(
&
rf24_datarate_e_str_P
[
getDataRate
()]));
printf_P
(
PSTR
(
"Model
\t\t
= %s
\r\n
"
),
pgm_read_word
(
&
rf24_model_e_str_P
[
isPVariant
()]));
printf_P
(
PSTR
(
"CRC Length
\t
= %s
\r\n
"
),
pgm_read_word
(
&
rf24_crclength_e_str_P
[
getCRCLength
()]));
...
...
RF24.h
View file @
83dccd28
...
...
@@ -16,7 +16,7 @@
#define __RF24_H__
#include "RF24_config.h"
#if
defined (__linux) || defined (LINUX
)
#if
(defined (__linux) || defined (LINUX)) && !defined (__ARDUINO_X86__
)
#include "RPi/bcm2835.h"
#elif defined SOFTSPI
#include <DigitalIO.h>
...
...
RF24_config.h
View file @
83dccd28
...
...
@@ -8,6 +8,10 @@
Added Arduino Due support from https://github.com/mcrosson/
*/
/* spaniakos <spaniakos@gmail.com>
Added __ARDUINO_X86__ support
*/
#ifndef __RF24_CONFIG_H__
#define __RF24_CONFIG_H__
...
...
@@ -20,8 +24,7 @@
//#define SOFTSPI // Requires library from https://github.com/greiman/DigitalIO
/**********************/
#if defined (__linux) || defined (linux)
#if (defined (__linux) || defined (linux)) && !defined (__ARDUINO_X86__)
#define RF24_LINUX
#include <stdint.h>
...
...
@@ -67,7 +70,7 @@
// Define _BV for non-Arduino platforms and for Arduino DUE
#if defined (ARDUINO) && !defined (__arm__)
#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
...
...
@@ -95,13 +98,13 @@
#include <string.h>
#if defined(__arm__) || defined (CORE_TEENSY)
#if defined(__arm__) || defined (CORE_TEENSY)
|| defined (__ARDUINO_X86__)
#include <SPI.h>
#endif
#if !defined(CORE_TEENSY)
#if !defined(CORE_TEENSY)
#define _BV(x) (1<<(x))
#if !defined(__arm__)
#if !defined(__arm__)
&& !defined (__ARDUINO_X86__)
extern
HardwareSPI
SPI
;
#endif
#else
...
...
@@ -120,7 +123,12 @@
#define printf_P(...)
#endif
#endif
#if defined (__ARDUINO_X86__)
#define printf_P printf
#define _BV(bit) (1<<(bit))
#endif
// Avoid spurious warnings
// Arduino DUE is arm and uses traditional PROGMEM constructs
#if 1
...
...
@@ -134,7 +142,7 @@
// Progmem is Arduino-specific
// Arduino DUE is arm and does not include avr/pgmspace
#if defined(ARDUINO) && ! defined(__arm__)
#if defined(ARDUINO) && ! defined(__arm__)
&& !defined (__ARDUINO_X86__)
#include <avr/pgmspace.h>
#define PRIPSTR "%S"
#else
...
...
@@ -144,7 +152,6 @@
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
#endif
#if !defined ( CORE_TEENSY )
typedef
uint16_t
prog_uint16_t
;
#define PSTR(x) (x)
...
...
printf.h
View file @
83dccd28
...
...
@@ -5,6 +5,7 @@
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
*/
/* Galileo support from spaniakos <spaniakos@gmail.com> */
/**
* @file printf.h
...
...
@@ -16,7 +17,7 @@
#ifndef __PRINTF_H__
#define __PRINTF_H__
#if defined (ARDUINO) && !defined (__arm__)
#if defined (ARDUINO) && !defined (__arm__)
&& !defined(__ARDUINO_X86__)
int
serial_putc
(
char
c
,
FILE
*
)
{
...
...
@@ -34,6 +35,23 @@ void printf_begin(void)
void
printf_begin
(
void
){}
#elif defined(__ARDUINO_X86__)
int
serial_putc
(
char
c
,
FILE
*
)
{
Serial
.
write
(
c
);
return
c
;
}
void
printf_begin
(
void
)
{
//JESUS - For reddirect stdout to /dev/ttyGS0 (Serial Monitor port)
stdout
=
freopen
(
"/dev/ttyGS0"
,
"w"
,
stdout
);
delay
(
500
);
printf
(
"redirecting to Serial..."
);
//JESUS -----------------------------------------------------------
}
#else
#error This example is only for use on Arduino.
#endif // ARDUINO
...
...
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