From 95c16c3453ff167abcf087dd1472bd07fcf6bc2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Poczkodi?= Date: Fri, 18 Oct 2024 03:14:15 +0200 Subject: [PATCH] code cleanup --- esphome/components/si4713_i2c/si4713.cpp | 2 ++ esphome/components/si4713_i2c/si4713.h | 1 - esphome/components/si4713_i2c/si4713defs.h | 2 -- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/esphome/components/si4713_i2c/si4713.cpp b/esphome/components/si4713_i2c/si4713.cpp index 3b8772dea6..19001beebb 100644 --- a/esphome/components/si4713_i2c/si4713.cpp +++ b/esphome/components/si4713_i2c/si4713.cpp @@ -322,6 +322,8 @@ void Si4713Component::loop() { // config +template T GET_ENUM_LAST(T value) { return T::LAST; } + #define CHECK_ENUM(value) \ if (value >= GET_ENUM_LAST(value)) { \ ESP_LOGE(TAG, "%s(%d) invalid", __func__, (int) value); \ diff --git a/esphome/components/si4713_i2c/si4713.h b/esphome/components/si4713_i2c/si4713.h index 02a8bbb9e1..b19edf067c 100644 --- a/esphome/components/si4713_i2c/si4713.h +++ b/esphome/components/si4713_i2c/si4713.h @@ -204,7 +204,6 @@ class Si4713Component : public PollingComponent, public i2c::I2CDevice { public: Si4713Component(); - // float get_setup_priority() const override { return setup_priority::HARDWARE; } void setup() override; void dump_config() override; void update() override; diff --git a/esphome/components/si4713_i2c/si4713defs.h b/esphome/components/si4713_i2c/si4713defs.h index 7425d01493..87c7316671 100644 --- a/esphome/components/si4713_i2c/si4713defs.h +++ b/esphome/components/si4713_i2c/si4713defs.h @@ -57,8 +57,6 @@ static const int IALDUR_MAX = 65535; static const uint8_t RDS_STATION_MAX = 8; // TODO static const uint8_t RDS_TEXT_MAX = 64; // TODO -template T GET_ENUM_LAST(T value) { return T::LAST; } - enum class OpMode { OPMODE_ANALOG = 0b01010000, // 0x50 OPMODE_DIGITAL = 0b00001111, // 0x0F