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(); }