From 8e736217012e988a303e76751ca32c41edbb32e7 Mon Sep 17 00:00:00 2001 From: jgromes Date: Tue, 30 Jun 2020 10:53:22 +0200 Subject: [PATCH] Added support for Arduino Portenta H7 (TRAVIS_FORCE_BUILD) --- .travis.yml | 6 ++++++ README.md | 2 +- src/BuildOpt.h | 26 +++++++++++++++++++++++--- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 889773ac..dd69e1c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ env: # see https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc#options # and https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification#boardstxt - BOARD="arduino:avr:uno" + - BOARD="arduino-beta:mbed:envie_m4" - BOARD="arduino:avr:mega:cpu=atmega2560" - BOARD="arduino:avr:leonardo" - BOARD="esp8266:esp8266:generic:xtal=80,ResetMethod=ck,CrystalFreq=26,FlashFreq=40,FlashMode=qio,eesz=512K" @@ -111,6 +112,11 @@ before_install: arduino --pref "boardsmanager.additional.urls=https://www.adafruit.com/package_adafruit_index.json" --save-prefs 2>&1; arduino --install-boards adafruit:samd; + elif [[ "$BOARD" =~ "arduino-beta:mbed:" ]]; then + export BUILD_EXAMPLES=false; + arduino --install-boards arduino-beta:mbed; + export SKIP_PAT='(HTTP|MQTT).*ino'; + fi # check if this release commit (or forced build) and if so, build for every board diff --git a/README.md b/README.md index 10da3c3f..e8677ece 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ SX127x, RFM9x, SX126x, RF69, SX1231, CC1101, nRF24L01, RFM2x, Si443x and SX128x ### Supported platforms: * __Arduino__ * [__AVR__](https://github.com/arduino/ArduinoCore-avr) - Arduino Uno, Mega, Leonardo, Pro Mini, Nano etc. - * [__mbed__](https://github.com/arduino/ArduinoCore-nRF528x-mbedos) - Arduino Nano 33 BLE + * [__mbed__](https://github.com/arduino/ArduinoCore-mbed) - Arduino Nano 33 BLE and Arduino Portenta H7 * [__megaAVR__](https://github.com/arduino/ArduinoCore-megaavr) - Arduino Uno WiFi Rev.2 and Nano Every * [__SAM__](https://github.com/arduino/ArduinoCore-sam) - Arduino Due * [__SAMD__](https://github.com/arduino/ArduinoCore-samd) - Arduino Zero, MKR boards, M0 Pro etc. diff --git a/src/BuildOpt.h b/src/BuildOpt.h index 84c9b684..490dbf1a 100644 --- a/src/BuildOpt.h +++ b/src/BuildOpt.h @@ -33,7 +33,7 @@ #if defined(RADIOLIB_CUSTOM_PLATFORM) // name for your platform - #define RADIOLIB_PLATFORM "Custom" + #define RADIOLIB_PLATFORM "Custom" // the following parameters must always be defined #define RADIOLIB_PIN_TYPE uint8_t @@ -51,6 +51,10 @@ // the following must be defined if the Arduino core does not support tone function //#define RADIOLIB_TONE_UNSUPPORTED + // some of RadioLib drivers may be excluded, to prevent collisions with platform (or to speed up build process) + // for example, to exclude ESP8266 driver: + //RADIOLIB_EXCLUDE_ESP8266 + #else #if defined(__AVR__) && !(defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_AVR_NANO_EVERY)) // Arduino AVR boards (except for megaAVR) - Uno, Mega etc. @@ -75,7 +79,7 @@ #define RADIOLIB_DEFAULT_SPI SPI // RadioLib has ESP8266 driver, this must be disabled to use ESP8266 as platform - #define _RADIOLIB_ESP8266_H + #define RADIOLIB_EXCLUDE_ESP8266 #elif defined(ESP32) // ESP32 boards @@ -192,7 +196,23 @@ #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1 // Nano 33 BLE uses mbed libraries, which already contain ESP8266 driver - #define _RADIOLIB_ESP8266_H + #define RADIOLIB_EXCLUDE_ESP8266 + + #elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) + // Arduino Portenta H7 + #define RADIOLIB_PLATFORM "Portenta H7" + #define RADIOLIB_PIN_TYPE pin_size_t + #define RADIOLIB_PIN_MODE PinMode + #define RADIOLIB_PIN_STATUS PinStatus + #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS + #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p) + #define RADIOLIB_NC (0xFF) + #define RADIOLIB_DEFAULT_SPI SPI + #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED + #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1 + + // Arduino Portenta H7 uses mbed libraries, which already contain ESP8266 driver + #define RADIOLIB_EXCLUDE_ESP8266 #elif defined(__STM32F4__) || defined(__STM32F1__) // Arduino STM32 core by Roger Clark (https://github.com/rogerclarkmelbourne/Arduino_STM32)