diff --git a/esphome/components/ds3232/ds3232.cpp b/esphome/components/ds3232/ds3232.cpp index 0788b1793e..9396ae99a6 100644 --- a/esphome/components/ds3232/ds3232.cpp +++ b/esphome/components/ds3232/ds3232.cpp @@ -87,7 +87,6 @@ void DS3232Component::setup() { } } - void DS3232Component::update() { if (this->late_startup_) return; @@ -171,19 +170,19 @@ void DS3232Component::loop() { clear_nvram_(); } break; - case DS3232NVRAMState::NEED_RESET: - if (this->busy_) { - ESP_LOGI(TAG, "Performing planned NVRAM factory reset..."); - this->nvram_state_ = DS3232NVRAMState::OK; - this->variable_init_callback_.call(); - if (this->nvram_state_ != DS3232NVRAMState::OK) { - ESP_LOGE(TAG, "NVRAM: Failed to reset to factory defaults."); + case DS3232NVRAMState::NEED_RESET: + if (this->busy_) { + ESP_LOGI(TAG, "Performing planned NVRAM factory reset..."); + this->nvram_state_ = DS3232NVRAMState::OK; + this->variable_init_callback_.call(); + if (this->nvram_state_ != DS3232NVRAMState::OK) { + ESP_LOGE(TAG, "NVRAM: Failed to reset to factory defaults."); + } + this->busy_ = false; } - this->busy_ = false; - } - break; - default: - break; + break; + default: + break; } } @@ -352,7 +351,6 @@ void DS3232Component::process_alarms_() { this->write_bytes(I2C_REG_STATUS, reg_data_.raw_blocks.status_raw, sizeof(reg_data_.raw_blocks.status_raw)); } - /// @brief Reads i2c registers from chip /// @return True - if data has been read; otherwise - false bool DS3232Component::read_data_() { diff --git a/esphome/components/ds3232/ds3232.h b/esphome/components/ds3232/ds3232.h index 421ae42595..7e79126bae 100644 --- a/esphome/components/ds3232/ds3232.h +++ b/esphome/components/ds3232/ds3232.h @@ -22,7 +22,6 @@ enum DS3232PowerState { BATTERY = 0b10 }; - /// @brief State of NVRAM functionality enum DS3232NVRAMState { /// @brief State is unknown diff --git a/esphome/components/ds3232/ds3232_alarm.h b/esphome/components/ds3232/ds3232_alarm.h index ae536c241a..09c45f4c05 100644 --- a/esphome/components/ds3232/ds3232_alarm.h +++ b/esphome/components/ds3232/ds3232_alarm.h @@ -53,7 +53,6 @@ union DS3232AlarmMode { mutable uint8_t raw; }; - /// @brief Alarm description struct DS3232Alarm { /// Indicates whether this alarm is enabled or not