adc_subscription: call efiSetPadMode for primary input only
Same pin can be used by two analog inputs (externaly muxed) Call brain_pin_markUsed() only while requesting for primary user
This commit is contained in:
parent
dce26afd3f
commit
4007e0d7f8
|
@ -73,8 +73,13 @@ TODO: this code is similar to initIfValid, what is the plan? shall we extract he
|
|||
*/
|
||||
brain_pin_e pin = getAdcChannelBrainPin(name, channel);
|
||||
if (pin != Gpio::Invalid) {
|
||||
// todo: external muxes for internal ADC #3350
|
||||
efiSetPadMode(name, pin, PAL_MODE_INPUT_ANALOG);
|
||||
// todo: external muxes for internal ADC #3350
|
||||
/* reuqest pin only for first muxed channel */
|
||||
if (!adcIsMuxedInput(channel)) {
|
||||
efiSetPadMode(name, pin, PAL_MODE_INPUT_ANALOG);
|
||||
} else {
|
||||
efiSetPadModeWithoutOwnershipAcquisition(name, pin, PAL_MODE_INPUT_ANALOG);
|
||||
}
|
||||
}
|
||||
|
||||
// if 0, default to the board's divider coefficient for given channel
|
||||
|
|
Loading…
Reference in New Issue