More fixes to formatting

This commit is contained in:
Vladimir Kozhevnikov 2024-02-06 01:18:08 +03:00
parent 4fbe82a504
commit 466c746375
3 changed files with 12 additions and 16 deletions

View file

@ -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_() {

View file

@ -22,7 +22,6 @@ enum DS3232PowerState {
BATTERY = 0b10
};
/// @brief State of NVRAM functionality
enum DS3232NVRAMState {
/// @brief State is unknown

View file

@ -53,7 +53,6 @@ union DS3232AlarmMode {
mutable uint8_t raw;
};
/// @brief Alarm description
struct DS3232Alarm {
/// Indicates whether this alarm is enabled or not