Added support for MegaCoreX

pull/239/head
jgromes 2020-12-25 14:21:41 +01:00
rodzic 533131f83f
commit 65379c4772
4 zmienionych plików z 27 dodań i 6 usunięć

Wyświetl plik

@ -29,6 +29,7 @@ jobs:
- SparkFun:apollo3:amap3redboard
- STM32:stm32:GenF3
- stm32duino:STM32F1:mapleMini
- MegaCoreX:megaavr:4809
runs-on: ubuntu-latest
name: ${{ matrix.board }}
@ -120,6 +121,10 @@ jobs:
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"
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
- name: Install platform

Wyświetl plik

@ -85,7 +85,7 @@
//#define RADIOLIB_EXCLUDE_SSTV
#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.
#define RADIOLIB_PLATFORM "Arduino AVR"
#define RADIOLIB_PIN_TYPE uint8_t
@ -284,6 +284,19 @@
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
#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
// other platforms not covered by the above list - this may or may not work
#define RADIOLIB_PLATFORM "Unknown"

Wyświetl plik

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

Wyświetl plik

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