Skip to content

Commit c78a515

Browse files
pmmarquezaentinger
authored andcommitted
Apply suggestions by @aentinger for allowing custom pin definitions.
1 parent b000358 commit c78a515

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/RS485.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#endif
3131
#endif
3232

33-
#ifndef RS485_DEFAULT_DE_PIN
3433
#ifdef __AVR__
3534
#define RS485_DEFAULT_DE_PIN 2
3635
#define RS485_DEFAULT_RE_PIN -1
@@ -41,11 +40,19 @@
4140
#define RS485_DEFAULT_DE_PIN A4
4241
#define RS485_DEFAULT_RE_PIN A5
4342
#else
43+
#ifndef RS485_DEFAULT_DE_PIN
4444
#define RS485_DEFAULT_DE_PIN A6
4545
#define RS485_DEFAULT_RE_PIN A5
4646
#endif
4747
#endif
4848

49+
#ifdef CUSTOM_RS485_DEFAULT_DE_PIN
50+
# define RS485_DEFAULT_DE_PIN CUSTOM_RS485_DEFAULT_DE_PIN
51+
#endif
52+
53+
#ifdef CUSTOM_RS485_DEFAULT_RE_PIN
54+
# define RS485_DEFAULT_RE_PIN CUSTOM_RS485_DEFAULT_RE_PIN
55+
#endif
4956

5057
#define RS485_DEFAULT_PRE_DELAY 50
5158
#define RS485_DEFAULT_POST_DELAY 50

0 commit comments

Comments
 (0)