Skip to content

Commit 4af2c42

Browse files
committed
re,de pins bug fix
1 parent c2a9f37 commit 4af2c42

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/RS485_defs.h

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
#ifndef _ARDUINO_RS485_DEFS_H_INCLUDED
22
#define _ARDUINO_RS485_DEFS_H_INCLUDED
33

4+
#ifndef RS485_DEFAULT_TX_PIN
45
#ifdef PIN_SERIAL1_TX
56
#define RS485_DEFAULT_TX_PIN PIN_SERIAL1_TX
67
#else
7-
#define RS485_DEFAULT_TX_PIN 1
8+
#define RS485_DEFAULT_TX_PIN 1
9+
#endif
810
#endif
911

1012
#ifdef __AVR__
1113
#define RS485_DEFAULT_DE_PIN 2
1214
#define RS485_DEFAULT_RE_PIN -1
1315
#elif defined(ESP32) || defined(ESP8266)
16+
#ifndef RS485_DEFAULT_DE_PIN
1417
#define RS485_DEFAULT_DE_PIN 0
18+
#endif
19+
#ifndef RS485_DEFAULT_RE_PIN
1520
#define RS485_DEFAULT_RE_PIN 0
21+
#endif
1622
#else
1723
#define RS485_DEFAULT_DE_PIN A6
1824
#define RS485_DEFAULT_RE_PIN A5
@@ -26,7 +32,6 @@
2632
#define RS485_SER_CONF_TYPE uint16_t
2733
#endif
2834

29-
3035
#define RS485_DEFAULT_PRE_DELAY 50
3136
#define RS485_DEFAULT_POST_DELAY 50
3237

0 commit comments

Comments
 (0)