code cleanup

This commit is contained in:
Gábor Poczkodi 2024-10-18 03:14:15 +02:00
parent 706c61bb6e
commit 95c16c3453
3 changed files with 2 additions and 3 deletions

View file

@ -322,6 +322,8 @@ void Si4713Component::loop() {
// config // config
template<typename T> T GET_ENUM_LAST(T value) { return T::LAST; }
#define CHECK_ENUM(value) \ #define CHECK_ENUM(value) \
if (value >= GET_ENUM_LAST(value)) { \ if (value >= GET_ENUM_LAST(value)) { \
ESP_LOGE(TAG, "%s(%d) invalid", __func__, (int) value); \ ESP_LOGE(TAG, "%s(%d) invalid", __func__, (int) value); \

View file

@ -204,7 +204,6 @@ class Si4713Component : public PollingComponent, public i2c::I2CDevice {
public: public:
Si4713Component(); Si4713Component();
// float get_setup_priority() const override { return setup_priority::HARDWARE; }
void setup() override; void setup() override;
void dump_config() override; void dump_config() override;
void update() override; void update() override;

View file

@ -57,8 +57,6 @@ static const int IALDUR_MAX = 65535;
static const uint8_t RDS_STATION_MAX = 8; // TODO static const uint8_t RDS_STATION_MAX = 8; // TODO
static const uint8_t RDS_TEXT_MAX = 64; // TODO static const uint8_t RDS_TEXT_MAX = 64; // TODO
template<typename T> T GET_ENUM_LAST(T value) { return T::LAST; }
enum class OpMode { enum class OpMode {
OPMODE_ANALOG = 0b01010000, // 0x50 OPMODE_ANALOG = 0b01010000, // 0x50
OPMODE_DIGITAL = 0b00001111, // 0x0F OPMODE_DIGITAL = 0b00001111, // 0x0F