Final cleanup for hoerman esp-idf ready! Compiles agian, works again. esp-idf might need some trickyness to get running.

This commit is contained in:
2025-09-30 00:40:21 +02:00
parent b8581dcf31
commit 31861e7785
4 changed files with 59 additions and 61 deletions

View File

@@ -1,5 +1,7 @@
#pragma once
#include <algorithm>
class HoermannMainComponent;
#include "hciemulator.h"
#include "esphome/components/uart/uart.h"
@@ -40,7 +42,7 @@ class HoermannMainComponent: public Component{
this->_tx_on->setup();
this->emulator = new HCIEmulator(this->_tx_on, this->_uart);
this->_tx_on->digital_write(LOW);
this->_tx_on->digital_write(false);
this->set_continue_ = true;
xTaskCreatePinnedToCore(
dispatcherFn, // Function to implement the task
@@ -53,11 +55,6 @@ class HoermannMainComponent: public Component{
1 // Core where the task should run
);
}
void stop_polling(){
this->_tx_on->digital_write(HIGH);
this->set_continue_ = false;
}
void modBusPolling(void *parameter)
{
@@ -65,7 +62,7 @@ class HoermannMainComponent: public Component{
{
if (lastCall > 0)
{
maxPeriod = _max(micros() - lastCall, maxPeriod);
maxPeriod = std::max((micros() - lastCall), (unsigned long)maxPeriod);
}
lastCall = micros();
emulator->poll();