Skip to content

Commit ece0e83

Browse files
committed
fix
1 parent cffd690 commit ece0e83

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ category=Communication
88
url=https://www.arduino.cc/en/ArduinoModbus/ArduinoModbus
99
architectures=*
1010
includes=ArduinoModbus.h
11-
depends=mostafahk/ArduinoRS485
11+
depends=ArduinoRS485

src/libmodbus/modbus.h

+9
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ MODBUS_BEGIN_DECLS
5858
#define ON 1
5959
#endif
6060

61+
/* ESP8266 / ESP32 compatibility */
62+
#if defined(ESP8266)
63+
#define RS485_SER_CONF_TYPE SerialConfig
64+
#elif defined(ESP32)
65+
#define RS485_SER_CONF_TYPE uint32_t
66+
#else
67+
#define RS485_SER_CONF_TYPE uint16_t
68+
#endif
69+
6170
/* Modbus function codes */
6271
#define MODBUS_FC_READ_COILS 0x01
6372
#define MODBUS_FC_READ_DISCRETE_INPUTS 0x02

0 commit comments

Comments
 (0)