ZigEmbeddedGroup / regz

Generate zig code from ATDF or SVD files for microcontrollers.
MIT License
82 stars 29 forks source link

Export interrupt indices as well #82

Closed ekoeppen closed 1 year ago

ekoeppen commented 1 year ago

There are some use cases where the interrupt indices (interrupt vector numbers) are needed, e.g. when working with the NVIC on Cortex-M chips. The indices could in theory be generated on the application side (or in Microzig) by processing the VectorTable structure at comptime, but it seems a bit easier to just generate something like const VectorIndices = enum(..) { right away via regz.

mattnite commented 1 year ago

One regression in the rewrite was the generated system registers for ARM. They would explicitly name a bit position after its interrupt for NVIC registers. Would fixing that regression be enough, or should we still communicate this info regardless?

ekoeppen commented 1 year ago

That sounds reasonable! I'll close this then, I can anyways work around this until the regression is fixed.