mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 08:28:12 +01:00
Fix lint for TSL2591 (#3118)
This commit is contained in:
parent
7590d5eacb
commit
ad1f4429c9
1 changed files with 10 additions and 7 deletions
|
@ -394,24 +394,27 @@ void TSL2591Component::automatic_gain_update(uint16_t full_spectrum) {
|
||||||
|
|
||||||
switch (this->gain_) {
|
switch (this->gain_) {
|
||||||
case TSL2591_GAIN_LOW:
|
case TSL2591_GAIN_LOW:
|
||||||
if (full_spectrum < 54) // 1/3 FS / GAIN_HIGH
|
if (full_spectrum < 54) { // 1/3 FS / GAIN_HIGH
|
||||||
new_gain = TSL2591_GAIN_HIGH;
|
new_gain = TSL2591_GAIN_HIGH;
|
||||||
else if (full_spectrum < 875) // 1/3 FS / GAIN_MED
|
} else if (full_spectrum < 875) { // 1/3 FS / GAIN_MED
|
||||||
new_gain = TSL2591_GAIN_MED;
|
new_gain = TSL2591_GAIN_MED;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case TSL2591_GAIN_MED:
|
case TSL2591_GAIN_MED:
|
||||||
if (full_spectrum < 57) // 1/3 FS / (GAIN_MAX/GAIN_MED)
|
if (full_spectrum < 57) { // 1/3 FS / (GAIN_MAX/GAIN_MED)
|
||||||
new_gain = TSL2591_GAIN_MAX;
|
new_gain = TSL2591_GAIN_MAX;
|
||||||
else if (full_spectrum < 1365) // 1/3 FS / (GAIN_HIGH/GAIN_MED)
|
} else if (full_spectrum < 1365) { // 1/3 FS / (GAIN_HIGH/GAIN_MED)
|
||||||
new_gain = TSL2591_GAIN_HIGH;
|
new_gain = TSL2591_GAIN_HIGH;
|
||||||
else if (full_spectrum > 62000 / fs_divider) // 2/3 FS / (GAIN_LOW/GAIN_MED) clipped to 95% FS
|
} else if (full_spectrum > 62000 / fs_divider) { // 2/3 FS / (GAIN_LOW/GAIN_MED) clipped to 95% FS
|
||||||
new_gain = TSL2591_GAIN_LOW;
|
new_gain = TSL2591_GAIN_LOW;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case TSL2591_GAIN_HIGH:
|
case TSL2591_GAIN_HIGH:
|
||||||
if (full_spectrum < 920) // 1/3 FS / (GAIN_MAX/GAIN_HIGH)
|
if (full_spectrum < 920) { // 1/3 FS / (GAIN_MAX/GAIN_HIGH)
|
||||||
new_gain = TSL2591_GAIN_MAX;
|
new_gain = TSL2591_GAIN_MAX;
|
||||||
else if (full_spectrum > 62000 / fs_divider) // 2/3 FS / (GAIN_MED/GAIN_HIGH) clipped to 95% FS
|
} else if (full_spectrum > 62000 / fs_divider) { // 2/3 FS / (GAIN_MED/GAIN_HIGH) clipped to 95% FS
|
||||||
new_gain = TSL2591_GAIN_LOW;
|
new_gain = TSL2591_GAIN_LOW;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case TSL2591_GAIN_MAX:
|
case TSL2591_GAIN_MAX:
|
||||||
if (full_spectrum > 62000 / fs_divider) // 2/3 FS / (GAIN_MED/GAIN_HIGH) clipped to 95% FS
|
if (full_spectrum > 62000 / fs_divider) // 2/3 FS / (GAIN_MED/GAIN_HIGH) clipped to 95% FS
|
||||||
|
|
Loading…
Reference in a new issue