Fix registerMap.c template, missing 'struct' keyword
Hello,
Here is my proposal to fix a compilation issue for the C generator template.
I used GCC to compile a simple AddressMap (like the one presented in the test folder), exported in C.
The compilation fails because of a type error: RegisterMap_ModuleName_t not found.
The struct keyword is missing from the type in the C template. We have to use struct RegisterMap_ModuleName_t instead of RegisterMap_ModuleName_t.
See diff below.
diff --git a/registerMap/export/c/output/templates/idiomatic/registerMap_template.c b/registerMap/export/c/output/templates/idiomatic/registerMap_template.c
index b54b1e3..dc96d79 100644
--- a/registerMap/export/c/output/templates/idiomatic/registerMap_template.c
+++ b/registerMap/export/c/output/templates/idiomatic/registerMap_template.c
@@ -35,7 +35,7 @@ struct {{ registerMap.name }}_MemorySpace_t myRegisterMap_memory = {
struct {{ registerMap.name }}_t {{ registerMap.name }} = {
{%- for thisModule in registerMap.modules %}
-{%- set pointerType = registerMap.name~'_'~thisModule.name~'_t volatile* const' %}
+{%- set pointerType = 'struct '~registerMap.name~'_'~thisModule.name~'_t volatile* const' %}
.{{ thisModule.name }} = ( {{ pointerType }} )( {{ registerMap.name }}_memory.base + {{ thisModule.offset }} ),
{% endfor -%}
}
All the best, R.