Add MY_RS485_SOH_COUNT option (#1014)

This commit is contained in:
rejoe2
2017-12-18 16:57:53 +01:00
committed by Patrick Fallberg
parent 27b0177d26
commit b148d828ad
3 changed files with 11 additions and 1 deletions
+9
View File
@@ -225,6 +225,15 @@
#define MY_RS485_MAX_MESSAGE_LENGTH (40)
#endif
/**
* @def MY_RS485_SOH_COUNT
* @brief Use this in case of collisions on the bus. 3 might be a good setting.
*/
#ifndef MY_RS485_SOH_COUNT
#define MY_RS485_SOH_COUNT (1)
#endif
/**
* @def MY_RS485_DE_PIN
* @brief RS485 driver enable pin.
+1 -1
View File
@@ -266,7 +266,7 @@ bool transportSend(const uint8_t to, const void* data, const uint8_t len, const
#endif
// Start of header by writing multiple SOH
for(byte w=0; w<1; w++) {
for(byte w=0; w<MY_RS485_SOH_COUNT; w++) {
_dev.write(SOH);
}
_dev.write(to); // Destination address
+1
View File
@@ -177,6 +177,7 @@ MY_RS485_BAUD_RATE LITERAL1
MY_RS485_MAX_MESSAGE_LENGTH LITERAL1
MY_RS485_HWSERIAL LITERAL1
MY_RS485_DE_PIN LITERAL1
MY_RS485_SOH_COUNT LITERAL1
# Gateway / MQTT
MY_GATEWAY_SERIAL LITERAL1