1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-08 04:43:46 +01:00

[es7210] Fix clang-tidy sign comparison errors (#11047)

This commit is contained in:
J. Nick Koston
2025-10-06 09:13:12 -05:00
committed by GitHub
parent 94fea68e3e
commit 3edcdc7d80

View File

@@ -97,12 +97,12 @@ bool ES7210::set_mic_gain(float mic_gain) {
} }
bool ES7210::configure_sample_rate_() { bool ES7210::configure_sample_rate_() {
int mclk_fre = this->sample_rate_ * MCLK_DIV_FRE; uint32_t mclk_fre = this->sample_rate_ * MCLK_DIV_FRE;
int coeff = -1; int coeff = -1;
for (int i = 0; i < (sizeof(ES7210_COEFFICIENTS) / sizeof(ES7210_COEFFICIENTS[0])); ++i) { for (size_t i = 0; i < (sizeof(ES7210_COEFFICIENTS) / sizeof(ES7210_COEFFICIENTS[0])); ++i) {
if (ES7210_COEFFICIENTS[i].lrclk == this->sample_rate_ && ES7210_COEFFICIENTS[i].mclk == mclk_fre) if (ES7210_COEFFICIENTS[i].lrclk == this->sample_rate_ && ES7210_COEFFICIENTS[i].mclk == mclk_fre)
coeff = i; coeff = static_cast<int>(i);
} }
if (coeff >= 0) { if (coeff >= 0) {