nvic: include the source json filename in the generated output

Make it a bit more obvious to people what they need to change.

Reported via: https://github.com/libopencm3/libopencm3/issues/974
This commit is contained in:
Karl Palsson 2018-10-03 16:18:13 +00:00
parent e2b67d7264
commit 0994762ae7
1 changed files with 2 additions and 1 deletions

View File

@ -34,7 +34,7 @@ import json
template_nvic_h = '''\
/* This file is part of the libopencm3 project.
*
* It was generated by the irq2nvic_h script.
* It was generated by the irq2nvic_h script from {sourcefile}
*/
#ifndef {includeguard}
@ -125,6 +125,7 @@ def convert(infile, outfile_nvic, outfile_vectornvic, outfile_cmsis):
data['isrdecls'] = "\n".join('void %s_isr(void) __attribute__((weak, alias("blocking_handler")));'%name.lower() for name in irqnames)
data['vectortableinitialization'] = ', \\\n '.join('[NVIC_%s_IRQ] = %s_isr'%(name.upper(), name.lower()) for name in irqnames)
data['cmsisbends'] = "\n".join("#define %s_IRQHandler %s_isr"%(name.upper(), name.lower()) for name in irqnames)
data['sourcefile'] = infile.name
outfile_nvic.write(template_nvic_h.format(**data))
outfile_vectornvic.write(template_vector_nvic_c.format(**data))