Added support for MegaCoreX

This commit is contained in:
jgromes 2020-12-25 14:21:41 +01:00
parent 533131f83f
commit 65379c4772
4 changed files with 27 additions and 6 deletions

View file

@ -29,6 +29,7 @@ jobs:
- SparkFun:apollo3:amap3redboard - SparkFun:apollo3:amap3redboard
- STM32:stm32:GenF3 - STM32:stm32:GenF3
- stm32duino:STM32F1:mapleMini - stm32duino:STM32F1:mapleMini
- MegaCoreX:megaavr:4809
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: ${{ matrix.board }} name: ${{ matrix.board }}
@ -120,6 +121,10 @@ jobs:
echo "::set-output name=options:::bootloader_version=original,cpu_speed=speed_72mhz" echo "::set-output name=options:::bootloader_version=original,cpu_speed=speed_72mhz"
echo "::set-output name=index-url::--additional-urls http://dan.drown.org/stm32duino/package_STM32duino_index.json" echo "::set-output name=index-url::--additional-urls http://dan.drown.org/stm32duino/package_STM32duino_index.json"
elif [[ "${{ contains(matrix.board, 'MegaCoreX:megaavr') }}" == "true" ]]; then
# MegaCoreX
echo "::set-output name=index-url::--additional-urls https://mcudude.github.io/MegaCoreX/package_MCUdude_MegaCoreX_index.json"
fi fi
- name: Install platform - name: Install platform

View file

@ -85,7 +85,7 @@
//#define RADIOLIB_EXCLUDE_SSTV //#define RADIOLIB_EXCLUDE_SSTV
#else #else
#if defined(__AVR__) && !(defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_AVR_NANO_EVERY)) #if defined(__AVR__) && !(defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_AVR_NANO_EVERY) || defined(ARDUINO_ARCH_MEGAAVR))
// Arduino AVR boards (except for megaAVR) - Uno, Mega etc. // Arduino AVR boards (except for megaAVR) - Uno, Mega etc.
#define RADIOLIB_PLATFORM "Arduino AVR" #define RADIOLIB_PLATFORM "Arduino AVR"
#define RADIOLIB_PIN_TYPE uint8_t #define RADIOLIB_PIN_TYPE uint8_t
@ -284,6 +284,19 @@
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1 #define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
#elif defined(ARDUINO_ARCH_MEGAAVR)
// MegaCoreX by MCUdude (https://github.com/MCUdude/MegaCoreX)
#define RADIOLIB_PLATFORM "MegaCoreX"
#define RADIOLIB_PIN_TYPE uint8_t
#define RADIOLIB_PIN_MODE uint8_t
#define RADIOLIB_PIN_STATUS uint8_t
#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_PROGMEM PROGMEM
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
#else #else
// other platforms not covered by the above list - this may or may not work // other platforms not covered by the above list - this may or may not work
#define RADIOLIB_PLATFORM "Unknown" #define RADIOLIB_PLATFORM "Unknown"

View file

@ -33,9 +33,11 @@ void ISerial::flush() {
_mod->ModuleSerial->flush(); _mod->ModuleSerial->flush();
} }
#ifndef ARDUINO_ARCH_MEGAAVR
size_t ISerial::print(const __FlashStringHelper *ifsh) { size_t ISerial::print(const __FlashStringHelper *ifsh) {
return(_mod->ModuleSerial->print(ifsh)); return(_mod->ModuleSerial->print(ifsh));
} }
#endif
size_t ISerial::print(const String &s) { size_t ISerial::print(const String &s) {
return(_mod->ModuleSerial->print(s)); return(_mod->ModuleSerial->print(s));
@ -77,9 +79,11 @@ size_t ISerial::print(const Printable& x) {
return(_mod->ModuleSerial->print(x)); return(_mod->ModuleSerial->print(x));
} }
#ifndef ARDUINO_ARCH_MEGAAVR
size_t ISerial::println(const __FlashStringHelper *ifsh) { size_t ISerial::println(const __FlashStringHelper *ifsh) {
return(_mod->ModuleSerial->println(ifsh)); return(_mod->ModuleSerial->println(ifsh));
} }
#endif
size_t ISerial::println(const String &s) { size_t ISerial::println(const String &s) {
return(_mod->ModuleSerial->println(s)); return(_mod->ModuleSerial->println(s));

View file

@ -3,11 +3,6 @@
#include "Module.h" #include "Module.h"
#include <stdio.h>
#include "WString.h"
#include "Printable.h"
/*! /*!
\class ISerial \class ISerial
@ -25,7 +20,9 @@ class ISerial {
int available(); int available();
void flush(); void flush();
#ifndef ARDUINO_ARCH_MEGAAVR
size_t print(const __FlashStringHelper *); size_t print(const __FlashStringHelper *);
#endif
size_t print(const String &); size_t print(const String &);
size_t print(const char[]); size_t print(const char[]);
size_t print(char); size_t print(char);
@ -37,7 +34,9 @@ class ISerial {
size_t print(double, int = 2); size_t print(double, int = 2);
size_t print(const Printable&); size_t print(const Printable&);
#ifndef ARDUINO_ARCH_MEGAAVR
size_t println(const __FlashStringHelper *); size_t println(const __FlashStringHelper *);
#endif
size_t println(const String &s); size_t println(const String &s);
size_t println(const char[]); size_t println(const char[]);
size_t println(char); size_t println(char);