Skip to content

Commit 3f9f218

Browse files
committed
fix(adc): fix s2 cali loss resolution
1 parent bf28df9 commit 3f9f218

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/esp_adc/esp32s2/adc_cali_line_fitting.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ static esp_err_t cali_raw_to_voltage(void *arg, int raw, int *voltage)
143143
//pointers are checked in the upper layer
144144

145145
cali_chars_line_fitting_t *ctx = arg;
146-
*voltage = raw * ctx->coeff_a / coeff_a_scaling + ctx->coeff_b / coeff_b_scaling;
146+
*voltage = (raw * ctx->coeff_a / (coeff_a_scaling / coeff_b_scaling) + ctx->coeff_b) / coeff_b_scaling;
147147

148148
return ESP_OK;
149149
}

0 commit comments

Comments
 (0)