Skip to content

Commit 814a0b8

Browse files
committed
Added Particle and ESP8266 Support
1 parent 6f3d1f1 commit 814a0b8

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

RadioHead.h

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@
547547
#define RH_PLATFORM_STM32F4_HAL 8
548548
#define RH_PLATFORM_RASPI 9
549549
#define RH_PLATFORM_NRF51 10
550+
#define RH_PLATFORM_PARTICLE 11
550551

551552
////////////////////////////////////////////////////
552553
// Select platform automatically, if possible
@@ -557,6 +558,8 @@
557558
#define RH_PLATFORM RH_PLATFORM_NRF51
558559
#elif defined(ARDUINO)
559560
#define RH_PLATFORM RH_PLATFORM_ARDUINO
561+
#elif defined(SPARK)
562+
#define RH_PLATFORM RH_PLATFORM_PARTICLE
560563
#elif defined(__MSP430G2452__) || defined(__MSP430G2553__)
561564
#define RH_PLATFORM RH_PLATFORM_MSP430
562565
#elif defined(MCU_STM32F103RE)
@@ -594,6 +597,14 @@
594597
#define RH_HAVE_SERIAL
595598
#endif
596599

600+
#elif (RH_PLATFORM == RH_PLATFORM_PARTICLE)
601+
#include "application.h"
602+
#define RH_HAVE_HARDWARE_SPI
603+
#define RH_HAVE_SERIAL
604+
#define PROGMEM
605+
#define memcpy_P memcpy
606+
#include "math.h"
607+
597608
#elif (RH_PLATFORM == RH_PLATFORM_MSP430) // LaunchPad specific
598609
#include "legacymsp430.h"
599610
#include "Energia.h"
@@ -624,7 +635,7 @@
624635

625636
#elif (RH_PLATFORM == RH_PLATFORM_STM32STD) // STM32 with STM32F4xx_StdPeriph_Driver
626637
#include <stm32f4xx.h>
627-
#include <wirish.h>
638+
#include <wirish.h>
628639
#include <stdint.h>
629640
#include <string.h>
630641
#include <math.h>
@@ -678,13 +689,22 @@
678689
////////////////////////////////////////////////////
679690
// This is an attempt to make a portable atomic block
680691
#if (RH_PLATFORM == RH_PLATFORM_ARDUINO)
692+
#ifndef ESP8266
681693
#if defined(__arm__)
682694
#include <RHutil/atomic.h>
683695
#else
684696
#include <util/atomic.h>
685697
#endif
686698
#define ATOMIC_BLOCK_START ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
687699
#define ATOMIC_BLOCK_END }
700+
#else
701+
// If you want to pool instead wiring and check RF69 DIO0 pin
702+
// uncomment to define the following line
703+
//#define RH_RF69_IRQLESS
704+
#define ATOMIC_BLOCK_START
705+
#define ATOMIC_BLOCK_END
706+
#endif
707+
688708
#elif (RH_PLATFORM == RH_PLATFORM_UNO32)
689709
#include <peripheral/int.h>
690710
#define ATOMIC_BLOCK_START unsigned int __status = INTDisableInterrupts(); {

0 commit comments

Comments
 (0)