From 0994762ae7fc8f2b9bf20732b87782c9b022c7c9 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Wed, 3 Oct 2018 16:18:13 +0000 Subject: [PATCH] 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 --- scripts/irq2nvic_h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/irq2nvic_h b/scripts/irq2nvic_h index c36273bf..8368170e 100755 --- a/scripts/irq2nvic_h +++ b/scripts/irq2nvic_h @@ -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))