From 746c1409ca8c73522f30d8db0086b9284da53f34 Mon Sep 17 00:00:00 2001 From: Lukas Bachschwell Date: Sun, 9 Apr 2023 21:19:52 +0200 Subject: [PATCH] Final Fixes Signed-off-by: Lukas Bachschwell --- HCPBridgeESP32/src/hciemulator.cpp | 3 +-- HCPBridgeESP32/src/main.cpp | 8 -------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/HCPBridgeESP32/src/hciemulator.cpp b/HCPBridgeESP32/src/hciemulator.cpp index 7da88a1..25159a6 100644 --- a/HCPBridgeESP32/src/hciemulator.cpp +++ b/HCPBridgeESP32/src/hciemulator.cpp @@ -162,11 +162,10 @@ void HCIEmulator::poll() // Log(LL_DEBUG, ("ST:"+String(m_lastSendTime)).c_str()); digitalWrite(TX_ON, HIGH); - delayMicroseconds(10); Serial.println("write data"); m_port->write(m_txbuffer, m_txlen); Log3(LL_DEBUG, "Response: ", m_txbuffer, m_txlen); - // delayMicroseconds(50); + delayMicroseconds(m_txlen * 9 * 22); // 8 bits + par * Bittime 18 micros on 57600 bauds digitalWrite(TX_ON, LOW); m_txlen = 0; } diff --git a/HCPBridgeESP32/src/main.cpp b/HCPBridgeESP32/src/main.cpp index 49e1813..61d1c61 100644 --- a/HCPBridgeESP32/src/main.cpp +++ b/HCPBridgeESP32/src/main.cpp @@ -96,13 +96,6 @@ void setup() pinMode(TX_ON, OUTPUT); digitalWrite(TX_ON, LOW); - // digitalWrite(TX_ON, HIGH); - // for (;;) - //{ - // RS485.write("hello there"); - // delay(100); - // } - xTaskCreatePinnedToCore( modBusPolling, /* Function to implement the task */ "ModBusTask", /* Name of the task */ @@ -210,5 +203,4 @@ void setup() // mainloop void loop() { - AsyncElegantOTA.loop(); }