Commit 83dccd28 authored by darky's avatar darky

Intel Gallileo support added

parent 58293d6f
...@@ -595,7 +595,7 @@ void RF24::printDetails(void) ...@@ -595,7 +595,7 @@ void RF24::printDetails(void)
print_byte_register(PSTR("CONFIG"),CONFIG); print_byte_register(PSTR("CONFIG"),CONFIG);
print_byte_register(PSTR("DYNPD/FEATURE"),DYNPD,2); 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("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("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()])); printf_P(PSTR("CRC Length\t = %s\r\n"),pgm_read_word(&rf24_crclength_e_str_P[getCRCLength()]));
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#define __RF24_H__ #define __RF24_H__
#include "RF24_config.h" #include "RF24_config.h"
#if defined (__linux) || defined (LINUX) #if (defined (__linux) || defined (LINUX)) && !defined (__ARDUINO_X86__)
#include "RPi/bcm2835.h" #include "RPi/bcm2835.h"
#elif defined SOFTSPI #elif defined SOFTSPI
#include <DigitalIO.h> #include <DigitalIO.h>
......
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
Added Arduino Due support from https://github.com/mcrosson/ Added Arduino Due support from https://github.com/mcrosson/
*/ */
/* spaniakos <spaniakos@gmail.com>
Added __ARDUINO_X86__ support
*/
#ifndef __RF24_CONFIG_H__ #ifndef __RF24_CONFIG_H__
#define __RF24_CONFIG_H__ #define __RF24_CONFIG_H__
...@@ -20,8 +24,7 @@ ...@@ -20,8 +24,7 @@
//#define SOFTSPI // Requires library from https://github.com/greiman/DigitalIO //#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 #define RF24_LINUX
#include <stdint.h> #include <stdint.h>
...@@ -67,7 +70,7 @@ ...@@ -67,7 +70,7 @@
// Define _BV for non-Arduino platforms and for Arduino DUE // 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__) #if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
#define RF24_TINY #define RF24_TINY
#define _SPI SPI #define _SPI SPI
...@@ -95,13 +98,13 @@ ...@@ -95,13 +98,13 @@
#include <string.h> #include <string.h>
#if defined(__arm__) || defined (CORE_TEENSY) #if defined(__arm__) || defined (CORE_TEENSY) || defined (__ARDUINO_X86__)
#include <SPI.h> #include <SPI.h>
#endif #endif
#if !defined(CORE_TEENSY) #if !defined(CORE_TEENSY)
#define _BV(x) (1<<(x)) #define _BV(x) (1<<(x))
#if !defined(__arm__) #if !defined(__arm__) && !defined (__ARDUINO_X86__)
extern HardwareSPI SPI; extern HardwareSPI SPI;
#endif #endif
#else #else
...@@ -120,7 +123,12 @@ ...@@ -120,7 +123,12 @@
#define printf_P(...) #define printf_P(...)
#endif #endif
#endif #endif
#if defined (__ARDUINO_X86__)
#define printf_P printf
#define _BV(bit) (1<<(bit))
#endif
// Avoid spurious warnings // Avoid spurious warnings
// Arduino DUE is arm and uses traditional PROGMEM constructs // Arduino DUE is arm and uses traditional PROGMEM constructs
#if 1 #if 1
...@@ -134,7 +142,7 @@ ...@@ -134,7 +142,7 @@
// Progmem is Arduino-specific // Progmem is Arduino-specific
// Arduino DUE is arm and does not include avr/pgmspace // 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> #include <avr/pgmspace.h>
#define PRIPSTR "%S" #define PRIPSTR "%S"
#else #else
...@@ -144,7 +152,6 @@ ...@@ -144,7 +152,6 @@
#define pgm_read_byte(addr) (*(const unsigned char *)(addr)) #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
#endif #endif
#if !defined ( CORE_TEENSY ) #if !defined ( CORE_TEENSY )
typedef uint16_t prog_uint16_t; typedef uint16_t prog_uint16_t;
#define PSTR(x) (x) #define PSTR(x) (x)
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
*/ */
/* Galileo support from spaniakos <spaniakos@gmail.com> */
/** /**
* @file printf.h * @file printf.h
...@@ -16,7 +17,7 @@ ...@@ -16,7 +17,7 @@
#ifndef __PRINTF_H__ #ifndef __PRINTF_H__
#define __PRINTF_H__ #define __PRINTF_H__
#if defined (ARDUINO) && !defined (__arm__) #if defined (ARDUINO) && !defined (__arm__) && !defined(__ARDUINO_X86__)
int serial_putc( char c, FILE * ) int serial_putc( char c, FILE * )
{ {
...@@ -34,6 +35,23 @@ void printf_begin(void) ...@@ -34,6 +35,23 @@ void printf_begin(void)
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 #else
#error This example is only for use on Arduino. #error This example is only for use on Arduino.
#endif // ARDUINO #endif // ARDUINO
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment