From c41a092c7d45b0be5514e577a111a1a332b1a75a Mon Sep 17 00:00:00 2001 From: Johann Weging Date: Sun, 27 May 2018 14:23:25 +0200 Subject: [PATCH] SDS0X1 RX TX pin handling in NovaSdsInit --- sonoff/xsns_20_novasds.ino | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sonoff/xsns_20_novasds.ino b/sonoff/xsns_20_novasds.ino index dc5f0ab66..610e07427 100644 --- a/sonoff/xsns_20_novasds.ino +++ b/sonoff/xsns_20_novasds.ino @@ -83,12 +83,14 @@ void NovaSdsSecond() // Every second void NovaSdsInit() { novasds_type = 0; - if (pin[GPIO_SDS0X1] < 99) { - NovaSdsSerial = new TasmotaSerial(pin[GPIO_SDS0X1], -1, 1); + if (pin[GPIO_SDS0X1_RX] < 99 && pin[GPIO_SDS0X1_TX] < 99) { + NovaSdsSerial = new TasmotaSerial(pin[GPIO_SDS0X1_RX], pin[GPIO_SDS0X1_TX], 1); + if (NovaSdsSerial->begin(9600)) { - if (NovaSdsSerial->hardwareSerial()) { ClaimSerial(); } + if (NovaSdsSerial->hardwareSerial()) ClaimSerial(); novasds_type = 1; } + } } @@ -154,4 +156,4 @@ boolean Xsns20(byte function) return result; } -#endif // USE_NOVA_SDS \ No newline at end of file +#endif // USE_NOVA_SDS