Browse Source

fix(power): Add support for capacitors on ADC for BVD

Add a little delay so any capacitors connected to the ADC for the BVD can charge up when using power_gpios

Co-authored-by: Jasper Smit <jrhrsmit@gmail.com>
xmkb
jrhrsmit 4 years ago committed by GitHub
parent
commit
e40ca1eb7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      app/drivers/sensor/battery_voltage_divider/battery_voltage_divider.c

3
app/drivers/sensor/battery_voltage_divider/battery_voltage_divider.c

@ -77,6 +77,9 @@ static int bvd_sample_fetch(const struct device *dev, enum sensor_channel chan)
LOG_DBG("Failed to enable ADC power GPIO: %d", rc); LOG_DBG("Failed to enable ADC power GPIO: %d", rc);
return rc; return rc;
} }
// wait for any capacitance to charge up
k_sleep(K_MSEC(10));
} }
// Read ADC // Read ADC

Loading…
Cancel
Save