Commit 83dccd28 authored by darky's avatar darky

Intel Gallileo support added

parent 58293d6f
......@@ -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()]));
......
......@@ -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>
......
......@@ -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)
......
......@@ -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
......
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