reset tx-retry-conter, increase receive priority

This commit is contained in:
MichaelDvP
2020-06-05 08:34:41 +02:00
parent d9da0bfdde
commit 5f29ad27d7
5 changed files with 8 additions and 3 deletions

View File

@@ -49,6 +49,8 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
LOG_DEBUG(F("Registering new Boiler with device ID 0x%02X"), device_id);
// the telegram handlers...
register_telegram_type(0x10, F("UBAErrorMessage1"), false, nullptr);
register_telegram_type(0x11, F("UBAErrorMessage2"), false, nullptr);
register_telegram_type(0x18, F("UBAMonitorFast"), false, std::bind(&Boiler::process_UBAMonitorFast, this, _1));
register_telegram_type(0x19, F("UBAMonitorSlow"), true, std::bind(&Boiler::process_UBAMonitorSlow, this, _1));
register_telegram_type(0x34, F("UBAMonitorWW"), false, std::bind(&Boiler::process_UBAMonitorWW, this, _1));

View File

@@ -582,9 +582,11 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) {
txservice_.send_poll(); // close the bus
txservice_.post_send_query(); // follow up with any post-read
tx_successful = true;
txservice_.reset_retry_count();
} else if (first_value == TxService::TX_WRITE_FAIL) {
LOG_ERROR(F("Last Tx write rejected by host"));
txservice_.send_poll(); // close the bus
txservice_.reset_retry_count();
}
} else {
// got a telegram with data in it. See if the src/dest matches that from the last one we sent
@@ -595,6 +597,7 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) {
LOG_DEBUG(F("Last Tx read successful"));
txservice_.increment_telegram_read_count();
txservice_.send_poll(); // close the bus
txservice_.reset_retry_count();
tx_successful = true;
}
}

View File

@@ -390,7 +390,7 @@ void TxService::send() {
// if there's nothing in the queue to transmit, send back a poll and quit
if (tx_telegrams_.empty()) {
send_poll();
//send_poll();
return;
}

View File

@@ -103,7 +103,7 @@ void EMSuart::start(uint8_t tx_mode) {
drop_next_rx = true;
buf_handle = xRingbufferCreate(128, RINGBUF_TYPE_NOSPLIT);
ESP_ERROR_CHECK(uart_isr_register(EMSUART_UART, emsuart_rx_intr_handler, NULL, ESP_INTR_FLAG_IRAM, &uart_handle));
xTaskCreate(emsuart_recvTask, "emsuart_recvTask", 2048, NULL, 12, NULL);
xTaskCreate(emsuart_recvTask, "emsuart_recvTask", 2048, NULL, configMAX_PRIORITIES -1, NULL);
EMS_UART.int_ena.brk_det = 1; // activate only break
}

View File

@@ -30,7 +30,7 @@
#define EMS_MAXBUFFERS 3 // buffers for circular filling to avoid collisions
#define EMS_MAXBUFFERSIZE 33 // max size of the buffer. EMS packets are max 32 bytes, plus extra 2 for BRKs
#define EMSUART_recvTaskPrio 1 // 0, 1 or 2. 0 being the lowest
#define EMSUART_recvTaskPrio 2 // 0, 1 or 2. 0 being the lowest
#define EMSUART_recvTaskQueueLen 10 // number of queued Rx triggers
#define EMS_TXMODE_DEFAULT 1