From 281c4654fd86f6a9e599f4eb5e0a0ab73ab1b808 Mon Sep 17 00:00:00 2001 From: Florian Date: Tue, 21 May 2024 22:03:30 +0200 Subject: [PATCH] t --- components/tcs_intercom/tcs_intercom.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/components/tcs_intercom/tcs_intercom.cpp b/components/tcs_intercom/tcs_intercom.cpp index c423849..cbeffed 100644 --- a/components/tcs_intercom/tcs_intercom.cpp +++ b/components/tcs_intercom/tcs_intercom.cpp @@ -27,6 +27,10 @@ namespace esphome + + #if defined(ESP32) + ESP_LOGI(TAG, "ESP32 detected"); + // Doorman Hardware Revision uint8_t ver[3]; uint32_t value; @@ -35,15 +39,19 @@ namespace esphome ver[1] = value >> 8; ver[2] = value >> 16; + ESP_LOGI(TAG, "Version: %i.%i.%i", ver[0], ver[1], ver[2]); + if(ver[0] > 0) { + ESP_LOGI(TAG, "PCB Version detected"); + const gpio_num_t rx_pin = static_cast(22); const gpio_num_t tx_pin = static_cast(23); this->rx_pin_ = rx_pin; this->tx_pin_ = tx_pin; } - + #endif this->rx_pin_->setup(); @@ -83,18 +91,6 @@ namespace esphome } LOG_TEXT_SENSOR(TAG, "Bus Command", this->bus_command_); - - - - - uint8_t ver[3]; - uint32_t value; - esp_efuse_read_block(EFUSE_BLK3, &value, 0, 24); - ver[0] = value >> 0; - ver[1] = value >> 8; - ver[2] = value >> 16; - - ESP_LOGI(TAG, "Version: %i.%i.%i", ver[0], ver[1], ver[2]); } void TCSComponent::loop()