Skip to content

Commit cd2120b

Browse files
committed
better define
1 parent ece0e83 commit cd2120b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Diff for: src/libmodbus/modbus.h

+8-6
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ MODBUS_BEGIN_DECLS
5959
#endif
6060

6161
/* 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
62+
#ifndef RS485_SER_CONF_TYPE
63+
#if defined(ESP8266)
64+
#define RS485_SER_CONF_TYPE SerialConfig
65+
#elif defined(ESP32)
66+
#define RS485_SER_CONF_TYPE uint32_t
67+
#else
68+
#define RS485_SER_CONF_TYPE uint16_t
69+
#endif
6870
#endif
6971

7072
/* Modbus function codes */

0 commit comments

Comments
 (0)