Skip to content

Commit 24238d8

Browse files
Update src/AdvancedADC.cpp
Co-authored-by: Ibrahim Abdelkader <[email protected]>
1 parent 0bf0e0a commit 24238d8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/AdvancedADC.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,8 @@ int AdvancedADC::begin(uint32_t resolution, uint32_t sample_rate, size_t n_sampl
124124

125125
// Clear ALTx pin.
126126
for (size_t i=0; i<n_channels; i++) {
127-
for (size_t j=0; j<AN_ARRAY_SIZE(pin_alt); j++) {
128-
adc_pins[i] = (PinName) (adc_pins[i] & ~(uint32_t)pin_alt[j]);
129-
}
127+
adc_pins[i] = (PinName) (adc_pins[i] & ~(ADC_PIN_ALT_MASK));
130128
}
131-
132129
// Find an ADC that can be used with these set of pins/channels.
133130
for (size_t i=0; instance == ADC_NP && i<AN_ARRAY_SIZE(pin_alt); i++) {
134131
// Calculate alternate function pin.

0 commit comments

Comments
 (0)