mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-06 04:48:27 +02:00
Force braces around multi-line statements (#3094)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
@@ -124,10 +124,11 @@ void VL53L0XSensor::setup() {
|
||||
uint8_t &val = ref_spad_map[i / 8];
|
||||
uint8_t mask = 1 << (i % 8);
|
||||
|
||||
if (i < first_spad_to_enable || spads_enabled == spad_count)
|
||||
if (i < first_spad_to_enable || spads_enabled == spad_count) {
|
||||
val &= ~mask;
|
||||
else if (val & mask)
|
||||
} else if (val & mask) {
|
||||
spads_enabled += 1;
|
||||
}
|
||||
}
|
||||
|
||||
this->write_bytes(0xB0, ref_spad_map, 6);
|
||||
|
||||
@@ -60,10 +60,11 @@ class VL53L0XSensor : public sensor::Sensor, public PollingComponent, public i2c
|
||||
if (enables.tcc)
|
||||
budget_us += (timeouts.msrc_dss_tcc_us + tcc_overhead);
|
||||
|
||||
if (enables.dss)
|
||||
if (enables.dss) {
|
||||
budget_us += 2 * (timeouts.msrc_dss_tcc_us + dss_overhead);
|
||||
else if (enables.msrc)
|
||||
} else if (enables.msrc) {
|
||||
budget_us += (timeouts.msrc_dss_tcc_us + msrc_overhead);
|
||||
}
|
||||
|
||||
if (enables.pre_range)
|
||||
budget_us += (timeouts.pre_range_us + pre_range_overhead);
|
||||
@@ -191,12 +192,13 @@ class VL53L0XSensor : public sensor::Sensor, public PollingComponent, public i2c
|
||||
|
||||
uint8_t get_vcsel_pulse_period_(VcselPeriodType type) {
|
||||
uint8_t vcsel;
|
||||
if (type == VCSEL_PERIOD_PRE_RANGE)
|
||||
if (type == VCSEL_PERIOD_PRE_RANGE) {
|
||||
vcsel = reg(0x50).get();
|
||||
else if (type == VCSEL_PERIOD_FINAL_RANGE)
|
||||
} else if (type == VCSEL_PERIOD_FINAL_RANGE) {
|
||||
vcsel = reg(0x70).get();
|
||||
else
|
||||
} else {
|
||||
return 255;
|
||||
}
|
||||
|
||||
return (vcsel + 1) << 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user