From 95fef51c896ccb6ce21415cfa124f984c412bd92 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Thu, 1 Jun 2023 13:21:53 -0400 Subject: [PATCH] add ARDUINO_ARCH_RTTHREAD to support RT-Thread --- Adafruit_SSD1306.cpp | 2 +- Adafruit_SSD1306.h | 2 ++ README.md | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Adafruit_SSD1306.cpp b/Adafruit_SSD1306.cpp index 7a37698..ce8a288 100644 --- a/Adafruit_SSD1306.cpp +++ b/Adafruit_SSD1306.cpp @@ -36,7 +36,7 @@ * */ -#ifdef __AVR__ +#if defined(__AVR__) || defined(ARDUINO_ARCH_RTTHREAD) #include #elif defined(ESP8266) || defined(ESP32) || defined(ARDUINO_ARCH_RP2040) #include diff --git a/Adafruit_SSD1306.h b/Adafruit_SSD1306.h index ae3eb4d..610864e 100644 --- a/Adafruit_SSD1306.h +++ b/Adafruit_SSD1306.h @@ -51,6 +51,8 @@ typedef uint8_t PortMask; typedef volatile RwReg PortReg; typedef uint32_t PortMask; #define HAVE_PORTREG +#elif defined(ARDUINO_ARCH_RTTHREAD) +#undef HAVE_PORTREG #elif (defined(__arm__) || defined(ARDUINO_FEATHER52)) && \ !defined(ARDUINO_ARCH_MBED) && !defined(ARDUINO_ARCH_RP2040) typedef volatile uint32_t PortReg; diff --git a/README.md b/README.md index 6dc7e1d..f7a2a5b 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ Intel Curie | X | | | WICED | X | | | No hardware SPI - bitbang only ATtiny85 | | X | | Particle | X | | | +RTduino | X | | | * ATmega328 : Arduino UNO, Adafruit Pro Trinket, Adafruit Metro 328, Adafruit Metro Mini * ATmega32u4 : Arduino Leonardo, Arduino Micro, Arduino Yun, Teensy 2.0, Adafruit Flora, Bluefruit Micro @@ -60,5 +61,6 @@ Particle | X | | | * ATSAMD21 : Arduino Zero, M0 Pro, Adafruit Metro Express, Feather M0 * ATtiny85 : Adafruit Gemma, Arduino Gemma, Adafruit Trinket * Particle: Particle Argon + * RTduino : [RTduino](https://github.com/RTduino/RTduino) is the Arduino ecosystem compatibility layer for [RT-Thread RTOS](https://github.com/RT-Thread/rt-thread) BSPs \ No newline at end of file