Commit 84142281 authored by Jim Mussared's avatar Jim Mussared Committed by Damien George

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

Fixes are:
- Only emit ADC table entries for pins that aren't cpu-hidden
  (i.e. ignore `X,-Y` rows).
- Only use the P channels on H7.
Signed-off-by: default avatarJim Mussared <jim.mussared@gmail.com>
parent 8c432ea2
......@@ -135,7 +135,11 @@ class Stm32Pin(boardgen.Pin):
"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".
......@@ -247,6 +251,8 @@ class Stm32PinGenerator(boardgen.PinGenerator):
)
# 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)),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment