1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-01 00:08:15 +00:00

clang-format

This commit is contained in:
Edward Firmo 2024-12-09 19:41:21 +01:00
parent 17919fdf9a
commit fa437896a1
3 changed files with 4 additions and 8 deletions

View File

@ -18,9 +18,7 @@ void ADCSensor::set_sample_count(uint8_t sample_count) {
} }
} }
float ADCSensor::get_setup_priority() const { float ADCSensor::get_setup_priority() const { return setup_priority::DATA; }
return setup_priority::DATA;
}
} // namespace adc } // namespace adc
} // namespace esphome } // namespace esphome

View File

@ -38,8 +38,8 @@ void ADCSensor::setup() {
for (int32_t i = 0; i <= ADC_ATTEN_DB_12_COMPAT; i++) { for (int32_t i = 0; i <= ADC_ATTEN_DB_12_COMPAT; i++) {
auto adc_unit = this->channel1_ != ADC1_CHANNEL_MAX ? ADC_UNIT_1 : ADC_UNIT_2; auto adc_unit = this->channel1_ != ADC1_CHANNEL_MAX ? ADC_UNIT_1 : ADC_UNIT_2;
auto cal_value = esp_adc_cal_characterize(adc_unit, (adc_atten_t) i, ADC_WIDTH_MAX_SOC_BITS, auto cal_value = esp_adc_cal_characterize(adc_unit, (adc_atten_t) i, ADC_WIDTH_MAX_SOC_BITS,
1100, // default vref 1100, // default vref
&this->cal_characteristics_[i]); &this->cal_characteristics_[i]);
switch (cal_value) { switch (cal_value) {
case ESP_ADC_CAL_VAL_EFUSE_VREF: case ESP_ADC_CAL_VAL_EFUSE_VREF:
ESP_LOGV(TAG, "Using eFuse Vref for calibration"); ESP_LOGV(TAG, "Using eFuse Vref for calibration");

View File

@ -50,9 +50,7 @@ float ADCSensor::sample() {
return raw / 1024.0f; return raw / 1024.0f;
} }
std::string ADCSensor::unique_id() { std::string ADCSensor::unique_id() { return get_mac_address() + "-adc"; }
return get_mac_address() + "-adc";
}
} // namespace adc } // namespace adc
} // namespace esphome } // namespace esphome