Skip to content

stm32: Fix extraction of hse/hsi/pllm values from preprocessed source. #16444

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

Conversation

dpgeorge
Copy link
Member

Summary

Follow up to #15646.

The expressions for the micropy_hw_hse_value etc variables may contain parenthesis, eg micropy_hw_hse_value = ((25) * 1000000). To handle such a case, simplify the regex and always use eval(found) to evaluate the expression.

Testing

The WEACT_F411_BLACKPILL board now builds. Tested all 6 variants, they all build.

The expressions for the `micropy_hw_hse_value` etc variables may contain
parenthesis, eg `micropy_hw_hse_value = ((25) * 1000000)`.  To handle such
a case, simplify the regex and always use `eval(found)` to evaluate the
expression.

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge
Copy link
Member Author

@andrewleech please see what you think about this fix.

Copy link

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@andrewleech
Copy link
Contributor

andrewleech commented Dec 18, 2024

Thanks this looks perfect, it's a sensible cleanup to the regex and logic regardless.

@dpgeorge dpgeorge merged commit 3c1722e into micropython:master Dec 19, 2024
10 checks passed
@dpgeorge dpgeorge deleted the stm32-fix-pll-value-extraction branch December 19, 2024 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants