diff --git a/ModbusMaster.cpp b/ModbusMaster.cpp index 70fe245..419e8f0 100644 --- a/ModbusMaster.cpp +++ b/ModbusMaster.cpp @@ -33,12 +33,12 @@ Arduino library for communicating with Modbus slaves over RS232/485 (via RTU pro /* _____GLOBAL VARIABLES_____________________________________________________ */ -#ifdef __AVR__ +#if defined(ARDUINO_ARCH_AVR) HardwareSerial* MBSerial = &Serial; ///< Pointer to Serial class object -#endif - -#ifdef __arm__ +#elif defined(ARDUINO_ARCH_SAM) UARTClass* MBSerial = &Serial; ///< Pointer to Serial class object +#else + #error "This library only supports boards with an AVR or SAM processor. Please open an issue at https://github.com/4-20ma/ModbusMaster/issues and indicate which processor/platform you're using." #endif diff --git a/library.properties b/library.properties index 928713c..ec1edde 100644 --- a/library.properties +++ b/library.properties @@ -6,4 +6,4 @@ sentence=Enlighten your Arduino to be a Modbus master. paragraph=Enables communication with Modbus slaves over RS232/485 (via RTU protocol). Requires a RS232/485 transceiver. category=Communication url=https://github.com/4-20ma/ModbusMaster -architectures=* +architectures=avr,sam