Skip to content

Commit b148d82

Browse files
rejoe2fallberg
authored andcommitted
Add MY_RS485_SOH_COUNT option (#1014)
1 parent 27b0177 commit b148d82

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

MyConfig.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,15 @@
225225
#define MY_RS485_MAX_MESSAGE_LENGTH (40)
226226
#endif
227227

228+
/**
229+
* @def MY_RS485_SOH_COUNT
230+
* @brief Use this in case of collisions on the bus. 3 might be a good setting.
231+
*/
232+
#ifndef MY_RS485_SOH_COUNT
233+
#define MY_RS485_SOH_COUNT (1)
234+
#endif
235+
236+
228237
/**
229238
* @def MY_RS485_DE_PIN
230239
* @brief RS485 driver enable pin.

hal/transport/MyTransportRS485.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ bool transportSend(const uint8_t to, const void* data, const uint8_t len, const
266266
#endif
267267

268268
// Start of header by writing multiple SOH
269-
for(byte w=0; w<1; w++) {
269+
for(byte w=0; w<MY_RS485_SOH_COUNT; w++) {
270270
_dev.write(SOH);
271271
}
272272
_dev.write(to); // Destination address

keywords.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ MY_RS485_BAUD_RATE LITERAL1
177177
MY_RS485_MAX_MESSAGE_LENGTH LITERAL1
178178
MY_RS485_HWSERIAL LITERAL1
179179
MY_RS485_DE_PIN LITERAL1
180+
MY_RS485_SOH_COUNT LITERAL1
180181

181182
# Gateway / MQTT
182183
MY_GATEWAY_SERIAL LITERAL1

0 commit comments

Comments
 (0)