mirror of
https://github.com/zmkfirmware/zmk.git
synced 2026-03-19 20:45:18 -05:00
fix(battery): change nRF52 ADC gain
With ADC pin, maximum 3.6V input needs gain 1/6 to be less than the 0.6V reference. With VDDHDIV5, maximum 6V input corresponds to 1.2V so gain 1/2 will be less than the 0.6V reference and be slightly more precise.
This commit is contained in:
committed by
Pete Johanson
parent
cb9c573b53
commit
e65a7e3075
@@ -93,7 +93,7 @@ static int vddh_init(const struct device *dev) {
|
||||
|
||||
#ifdef CONFIG_ADC_NRFX_SAADC
|
||||
drv_data->acc = (struct adc_channel_cfg){
|
||||
.gain = ADC_GAIN_1_5,
|
||||
.gain = ADC_GAIN_1_2,
|
||||
.reference = ADC_REF_INTERNAL,
|
||||
.acquisition_time = ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 40),
|
||||
.input_positive = SAADC_CH_PSELN_PSELN_VDDHDIV5,
|
||||
|
||||
@@ -140,7 +140,7 @@ static int bvd_init(const struct device *dev) {
|
||||
|
||||
#ifdef CONFIG_ADC_NRFX_SAADC
|
||||
drv_data->acc = (struct adc_channel_cfg){
|
||||
.gain = ADC_GAIN_1_5,
|
||||
.gain = ADC_GAIN_1_6,
|
||||
.reference = ADC_REF_INTERNAL,
|
||||
.acquisition_time = ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 40),
|
||||
.input_positive = SAADC_CH_PSELP_PSELP_AnalogInput0 + drv_cfg->io_channel.channel,
|
||||
|
||||
Reference in New Issue
Block a user