EmbeddedNim / svd2nim

Convert CMSIS ARM SVD files to nim register memory mappings
MIT License
19 stars 2 forks source link

5 refactors (no functional change) #7

Closed dwhall closed 10 months ago

dwhall commented 1 year ago

renderDevice() was kind of long and had mixed levels of abstraction. Four commits in this PR are individual extract-to-function refactors that move code out of renderDevice() to their own function.

The last commit simply changes capitalization of a variable to be the same throughout the file. Nim ignores capitalization, but my editor does not and I was previously unable to jump-to-definition.

There should be no functional change to the code after these commits.

Since this is a stylistic and not a functional change, your tastes may vary. However, these changes help two upcoming changes in the next PR (1 using the defer statement to close outf in case of an exception) and (2 add a renderAutogenHeader proc that renders meta information about the SVD file as comments at the top of the Nim output).

dwhall commented 1 year ago

I understand these changes were not invited. If you'd prefer I keep them in my own fork, I understand. Just let me know.

auxym commented 1 year ago

No I'm glad for these contributions! And the codebase sure needs some cleanup and refactoring. I'm just pretty busy and wanted to have quick look at the code before hitting merge. I'll get around to it soon-ish. Thanks!

auxym commented 10 months ago

Thanks, merged.

Sorry for the delay. I think you had made changes that allowed better / more efficient generated code? Please do submit a PR if you get the chance.