diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index c692243..3dfa684 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -61,6 +61,9 @@ jobs: - fqbn: arduino:mbed_portenta:envie_m7 platforms: | - name: arduino:mbed_portenta + - fqbn: arduino:mbed_opta:opta + platforms: | + - name: arduino:mbed_opta steps: - name: Checkout repository diff --git a/library.properties b/library.properties index 283ad99..b450a32 100644 --- a/library.properties +++ b/library.properties @@ -6,5 +6,5 @@ sentence=Enables sending and receiving data using the RS-485 standard with RS-48 paragraph=This library supports the Maxim Integrated MAX3157 and equivalent chipsets. category=Communication url=http://www.arduino.cc/en/Reference/ArduinoRS485 -architectures=samd,mbed_portenta +architectures=samd,mbed_portenta,mbed_opta includes=ArduinoRS485.h diff --git a/src/RS485.cpp b/src/RS485.cpp index 20a6451..5c8842d 100644 --- a/src/RS485.cpp +++ b/src/RS485.cpp @@ -76,7 +76,12 @@ void RS485Class::begin(unsigned long baudrate, uint16_t config, int predelay, in _transmisionBegun = false; +#if defined(ARDUINO_OPTA) + auto _opta_uart = static_cast(_serial); + _opta_uart->begin(baudrate, config, true); +#else _serial->begin(baudrate, config); +#endif } void RS485Class::end()