mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-07 05:13:31 +02:00
Enable a bunch of clang-tidy checks (#2149)
This commit is contained in:
@@ -149,7 +149,7 @@ static fix16_t fix16_div(fix16_t a, fix16_t b) {
|
||||
/* Figure out the sign of result */
|
||||
if ((a ^ b) & 0x80000000) {
|
||||
#ifndef FIXMATH_NO_OVERFLOW
|
||||
if (result == FIX16_MINIMUM)
|
||||
if (result == FIX16_MINIMUM) // NOLINT(clang-diagnostic-sign-compare)
|
||||
return FIX16_OVERFLOW;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -144,8 +144,8 @@ int32_t SGP40Component::measure_voc_index_() {
|
||||
// much
|
||||
if (this->store_baseline_ && this->seconds_since_last_store_ > SHORTEST_BASELINE_STORE_INTERVAL) {
|
||||
voc_algorithm_get_states(&voc_algorithm_params_, &this->state0_, &this->state1_);
|
||||
if (abs(this->baselines_storage_.state0 - this->state0_) > MAXIMUM_STORAGE_DIFF ||
|
||||
abs(this->baselines_storage_.state1 - this->state1_) > MAXIMUM_STORAGE_DIFF) {
|
||||
if ((uint32_t) abs(this->baselines_storage_.state0 - this->state0_) > MAXIMUM_STORAGE_DIFF ||
|
||||
(uint32_t) abs(this->baselines_storage_.state1 - this->state1_) > MAXIMUM_STORAGE_DIFF) {
|
||||
this->seconds_since_last_store_ = 0;
|
||||
this->baselines_storage_.state0 = this->state0_;
|
||||
this->baselines_storage_.state1 = this->state1_;
|
||||
|
||||
@@ -66,7 +66,7 @@ class SGP40Component : public PollingComponent, public sensor::Sensor, public i2
|
||||
uint8_t generate_crc_(const uint8_t *data, uint8_t datalen);
|
||||
uint16_t measure_raw_();
|
||||
ESPPreferenceObject pref_;
|
||||
int32_t seconds_since_last_store_;
|
||||
uint32_t seconds_since_last_store_;
|
||||
SGP40Baselines baselines_storage_;
|
||||
VocAlgorithmParams voc_algorithm_params_;
|
||||
bool self_test_complete_;
|
||||
|
||||
Reference in New Issue
Block a user