summaryrefslogtreecommitdiff
path: root/interrupt/SConscript
blob: 05cafb99a5060af4e4fa9c30c4b79d4a52e4e7e4 (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
27
28
29
30
31
32
33
Import('env')

headers = []
instances = []
sources = []
aliases = {}

interrupts = env['PLATFORM_SPEC'].get('interrupt', {})

env.Jinja2('interrupt_enums.h', 'interrupt_enums.h.j2', interrupts = interrupts)
headers.append('interrupt_enums.h')

sources.append(env.Jinja2('default_handlers.cpp', 'default_handlers.cpp.j2', interrupts = interrupts))

periph = env['PLATFORM_SPEC'].get('periph', {})

if 'nvic' in periph:
    headers.append('nvic.h')
    for name, data in periph['nvic'].items():
        instances.append({
            'type': 'NVIC_t',
            'name': name,
            'args': [data['offset']],
        })

    aliases['SCB'] = 'NVIC.SCB'
    aliases['interrupt_ctl'] = 'NVIC'

    sources.extend([
        env.Jinja2('vectors_nvic.cpp', 'vectors_nvic.cpp.j2', interrupts = interrupts),
    ])

Return('sources')