Skip to content

stm32/boards/make-pins.py: Fix H7 ADC generation. #12867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ports/stm32/boards/make-pins.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ def add_adc(self, adc):
"Invalid adc '{:s}' for pin '{:s}'".format(adc_name, self.name())
)
adc_units = [int(x) for x in m.group(1)]
_adc_mode = m.group(2)
adc_mode = m.group(2)
if adc_mode == "INN":
# On H7 we have INN/INP, all other parts use IN only. Only use
# IN or INP channels.
continue
adc_channel = int(m.group(3))

# Pick the entry with the most ADC units, e.g. "ADC1_INP16/ADC12_INN1/ADC12_INP0" --> "ADC12_INN1".
Expand Down Expand Up @@ -247,6 +251,8 @@ def print_adcs(self, out_source):
)
# Don't include pins that weren't in pins.csv.
for pin in self.available_pins():
if pin._hidden:
continue
if adc_unit in pin._adc_units:
print(
" [{:d}] = {:s},".format(pin._adc_channel, self._cpu_pin_pointer(pin)),
Expand Down