Added compatibility with ESP8266 platform
This commit is contained in:
parent
3f0dc11008
commit
e751d31aa9
5 changed files with 48 additions and 36 deletions
|
@ -5,6 +5,7 @@ env:
|
||||||
- BOARD="arduino:avr:uno"
|
- BOARD="arduino:avr:uno"
|
||||||
- BOARD="arduino:avr:leonardo"
|
- BOARD="arduino:avr:leonardo"
|
||||||
- BOARD="arduino:avr:mega:cpu=atmega2560"
|
- BOARD="arduino:avr:mega:cpu=atmega2560"
|
||||||
|
- BOARD="esp8266:esp8266:generic:xtal=80,ResetMethod=ck,CrystalFreq=26,FlashFreq=40,FlashMode=qio,eesz=512K"
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
# install Arduino IDE
|
# install Arduino IDE
|
||||||
|
@ -12,6 +13,7 @@ before_install:
|
||||||
- tar xf arduino-$ARDUINO_IDE_VERSION-linux64.tar.xz
|
- tar xf arduino-$ARDUINO_IDE_VERSION-linux64.tar.xz
|
||||||
- mv arduino-$ARDUINO_IDE_VERSION $HOME/arduino-ide
|
- mv arduino-$ARDUINO_IDE_VERSION $HOME/arduino-ide
|
||||||
- export PATH=$PATH:$HOME/arduino-ide
|
- export PATH=$PATH:$HOME/arduino-ide
|
||||||
|
|
||||||
# firewall Arduino IDE noise (https://github.com/per1234/arduino-ci-script/issues/1#issuecomment-504158113)
|
# firewall Arduino IDE noise (https://github.com/per1234/arduino-ci-script/issues/1#issuecomment-504158113)
|
||||||
- sudo iptables -P INPUT DROP
|
- sudo iptables -P INPUT DROP
|
||||||
- sudo iptables -P FORWARD DROP
|
- sudo iptables -P FORWARD DROP
|
||||||
|
@ -20,6 +22,12 @@ before_install:
|
||||||
- sudo iptables -A OUTPUT -o lo -j ACCEPT
|
- sudo iptables -A OUTPUT -o lo -j ACCEPT
|
||||||
- sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
|
- sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
|
||||||
|
|
||||||
|
# install 3rd party boards
|
||||||
|
- arduino --pref "boardsmanager.additional.urls=http://arduino.esp8266.com/stable/package_esp8266com_index.json,https://dl.espressif.com/dl/package_esp32_index.json" --save-prefs 2>&1
|
||||||
|
- if [[ "$BOARD" =~ "esp8266:esp8266:" ]]; then
|
||||||
|
arduino --install-boards esp8266:esp8266;
|
||||||
|
fi
|
||||||
|
|
||||||
# create directory to save the library and create symbolic link
|
# create directory to save the library and create symbolic link
|
||||||
install:
|
install:
|
||||||
- mkdir -p $HOME/Arduino/libraries
|
- mkdir -p $HOME/Arduino/libraries
|
||||||
|
|
|
@ -39,7 +39,9 @@
|
||||||
#include "Module.h"
|
#include "Module.h"
|
||||||
|
|
||||||
#include "modules/CC1101.h"
|
#include "modules/CC1101.h"
|
||||||
|
#ifndef ESP8266
|
||||||
#include "modules/ESP8266.h"
|
#include "modules/ESP8266.h"
|
||||||
|
#endif
|
||||||
#include "modules/HC05.h"
|
#include "modules/HC05.h"
|
||||||
#include "modules/JDY08.h"
|
#include "modules/JDY08.h"
|
||||||
#include "modules/nRF24.h"
|
#include "modules/nRF24.h"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#if ARDUINO >= 100
|
#if ARDUINO >= 100
|
||||||
#include "Arduino.h"
|
#include "Arduino.h"
|
||||||
#else
|
#else
|
||||||
#include "WProgram.h"
|
#error "Unsupported Arduino version (< 1.0.0)"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#define RADIOLIB_DEBUG
|
//#define RADIOLIB_DEBUG
|
||||||
|
@ -71,52 +71,52 @@
|
||||||
/*!
|
/*!
|
||||||
\brief Use 1 bit stop.
|
\brief Use 1 bit stop.
|
||||||
*/
|
*/
|
||||||
#define UART_STOPBIT_1 0x01
|
#define RADIOLIB_UART_STOPBIT_1 0x01
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Use 1.5 bit stop.
|
\brief Use 1.5 bit stop.
|
||||||
*/
|
*/
|
||||||
#define UART_STOPBIT_1_5 0x02
|
#define RADIOLIB_UART_STOPBIT_1_5 0x02
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Use 2 bit stop.
|
\brief Use 2 bit stop.
|
||||||
*/
|
*/
|
||||||
#define UART_STOPBIT_2 0x03
|
#define RADIOLIB_UART_STOPBIT_2 0x03
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief No parity.
|
\brief No parity.
|
||||||
*/
|
*/
|
||||||
#define UART_PARITY_NONE 0x00
|
#define RADIOLIB_UART_PARITY_NONE 0x00
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Odd parity.
|
\brief Odd parity.
|
||||||
*/
|
*/
|
||||||
#define UART_PARITY_ODD 0x01
|
#define RADIOLIB_UART_PARITY_ODD 0x01
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Even parity.
|
\brief Even parity.
|
||||||
*/
|
*/
|
||||||
#define UART_PARITY_EVEN 0x02
|
#define RADIOLIB_UART_PARITY_EVEN 0x02
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief No flow control.
|
\brief No flow control.
|
||||||
*/
|
*/
|
||||||
#define UART_FLOW_NONE 0x00
|
#define RADIOLIB_UART_FLOW_NONE 0x00
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief RTS only.
|
\brief RTS only.
|
||||||
*/
|
*/
|
||||||
#define UART_FLOW_RTS 0x01
|
#define RADIOLIB_UART_FLOW_RTS 0x01
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief CTS only.
|
\brief CTS only.
|
||||||
*/
|
*/
|
||||||
#define UART_FLOW_CTS 0x02
|
#define RADIOLIB_UART_FLOW_CTS 0x02
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Both RTS and CTS.
|
\brief Both RTS and CTS.
|
||||||
*/
|
*/
|
||||||
#define UART_FLOW_BOTH 0x03
|
#define RADIOLIB_UART_FLOW_BOTH 0x03
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\}
|
\}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#ifndef ESP8266
|
||||||
#include "ESP8266.h"
|
#include "ESP8266.h"
|
||||||
|
|
||||||
ESP8266::ESP8266(Module* module) {
|
ESP8266::ESP8266(Module* module) {
|
||||||
|
@ -219,3 +220,4 @@ size_t ESP8266::getNumBytes(uint32_t timeout, size_t minBytes) {
|
||||||
|
|
||||||
return(atoi(pch));
|
return(atoi(pch));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef _RADIOLIB_ESP8266_H
|
#if !defined(_RADIOLIB_ESP8266_H) && !defined(ESP8266)
|
||||||
#define _RADIOLIB_ESP8266_H
|
#define _RADIOLIB_ESP8266_H
|
||||||
|
|
||||||
#include "Module.h"
|
#include "Module.h"
|
||||||
|
|
Loading…
Add table
Reference in a new issue