mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 23:48:11 +01:00
More fixes to formatting
This commit is contained in:
parent
4fbe82a504
commit
466c746375
3 changed files with 12 additions and 16 deletions
|
@ -87,7 +87,6 @@ void DS3232Component::setup() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DS3232Component::update() {
|
void DS3232Component::update() {
|
||||||
if (this->late_startup_)
|
if (this->late_startup_)
|
||||||
return;
|
return;
|
||||||
|
@ -171,19 +170,19 @@ void DS3232Component::loop() {
|
||||||
clear_nvram_();
|
clear_nvram_();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DS3232NVRAMState::NEED_RESET:
|
case DS3232NVRAMState::NEED_RESET:
|
||||||
if (this->busy_) {
|
if (this->busy_) {
|
||||||
ESP_LOGI(TAG, "Performing planned NVRAM factory reset...");
|
ESP_LOGI(TAG, "Performing planned NVRAM factory reset...");
|
||||||
this->nvram_state_ = DS3232NVRAMState::OK;
|
this->nvram_state_ = DS3232NVRAMState::OK;
|
||||||
this->variable_init_callback_.call();
|
this->variable_init_callback_.call();
|
||||||
if (this->nvram_state_ != DS3232NVRAMState::OK) {
|
if (this->nvram_state_ != DS3232NVRAMState::OK) {
|
||||||
ESP_LOGE(TAG, "NVRAM: Failed to reset to factory defaults.");
|
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));
|
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
|
/// @brief Reads i2c registers from chip
|
||||||
/// @return True - if data has been read; otherwise - false
|
/// @return True - if data has been read; otherwise - false
|
||||||
bool DS3232Component::read_data_() {
|
bool DS3232Component::read_data_() {
|
||||||
|
|
|
@ -22,7 +22,6 @@ enum DS3232PowerState {
|
||||||
BATTERY = 0b10
|
BATTERY = 0b10
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// @brief State of NVRAM functionality
|
/// @brief State of NVRAM functionality
|
||||||
enum DS3232NVRAMState {
|
enum DS3232NVRAMState {
|
||||||
/// @brief State is unknown
|
/// @brief State is unknown
|
||||||
|
|
|
@ -53,7 +53,6 @@ union DS3232AlarmMode {
|
||||||
mutable uint8_t raw;
|
mutable uint8_t raw;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// @brief Alarm description
|
/// @brief Alarm description
|
||||||
struct DS3232Alarm {
|
struct DS3232Alarm {
|
||||||
/// Indicates whether this alarm is enabled or not
|
/// Indicates whether this alarm is enabled or not
|
||||||
|
|
Loading…
Reference in a new issue