summaryrefslogtreecommitdiff
path: root/interrupt/vectors_nvic.cpp.j2
blob: 962efcec0b7e5069e273218be16896843488b505 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "interrupt.h"

void entry();
extern int _ram_end;

[[gnu::section(".vectors")]]
interrupt::vector_t vectors[] = {
	(interrupt::vector_t)&_ram_end,
	entry,

    {% for i in range(2, 16) %}
        {% if i in interrupts.exception %}
            interrupt::handler<interrupt::exception::{{ interrupts.exception[i] }}>,
        {% else %}
            0,
        {% endif %}
    {% endfor %}

    {% for i in range(interrupts.irq | max + 1 if interrupts.irq else 0) %}
        {% if i in interrupts.irq %}
            interrupt::handler<interrupt::irq::{{ interrupts.irq[i] }}>,
        {% else %}
            0,
        {% endif %}
    {% endfor %}
};