Closed simonjwright closed 8 years ago
Even in Ada, this is not overkill in the case where different peripherals are defined in the same package (due to the < groupName > element), and where register types of those peripherals have name clashes.
In ATSAMG55J19 for example, the SYSC package defines multiple 'MR' registers: one for the RTT peripheral, one for the WDT peripheral, one for the RTC peripheral. If there's no prefix, then there's a type definition clash.
I agree that the side effect on the USART peripheral is unfortunate, and I'm trying currently to figure out a solution for that, but it's still better than compilation errors due to type clashes.
That being said, if you find a better way to fix the SYSC package (I was thinking of introducing nested packages eventually, but it's still not ideal), I'm ready to accept your contributions of course :)
In ATSAM .svd files, Atmel use the prependTo_name tag freely, and svd2ada now takes account of this.
There are 2 unfortunate results: looking at PWM, where we have
we end up with
and
where the PWM_ in PWM_CLK_Register is overkill (at least in Ada).
More annoyingly, in USART, the prependToName tag is USART1 for USART1, USART2 for USART2 etc, so that we end up with (for ATSAMG55J19)