Merge pull request #48 from mithro/fix-constants

cpu_interface: Fix indenting on constant generation.
This commit is contained in:
Tim Ansell 2018-01-13 19:07:04 +11:00 committed by GitHub
commit bebaef1e25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -144,10 +144,10 @@ def get_csr_header(regions, constants, with_access_functions=True):
else: else:
value = str(value) value = str(value)
ctype = "int" ctype = "int"
r += "#define "+name+" "+value+"\n" r += "#define "+name+" "+value+"\n"
if with_access_functions: if with_access_functions:
r += "static inline "+ctype+" "+name.lower()+"_read(void) {\n" r += "static inline "+ctype+" "+name.lower()+"_read(void) {\n"
r += "\treturn "+value+";\n}\n" r += "\treturn "+value+";\n}\n"
r += "\n#endif\n" r += "\n#endif\n"
return r return r