Files
ardupilot/libraries/AP_HAL_ChibiOS
Peter BarkerandClaude Opus 5 c5ce5fd3f6 hwdef: compile the pin-type regex once, cache MCU modules
valid_type() rebuilt an 18-entry list of patterns and ran up to 18
uncompiled re.match() calls for every pin line in every hwdef.  Compile
the alternation once as a class member instead.

get_mcu_lib() called importlib.import_module() every time, which is
also once per pin line; remember the module we found.

Together these take processing all 443 ChibiOS hwdefs from 0.45s to
0.40s.  The parse state of all 490 boards is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 19:24:04 +10:00
..
…
…
…
…
…
…
…
…
…
…
…
…
…