Files
Klipper/src/generic/armcm_boot.h
Kevin O'Connor 84fd89b8cf ctr: Add support for multiple integers in DECL_CTR_INT
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-22 12:22:51 -04:00

21 lines
719 B
C

#ifndef __GENERIC_ARMCM_BOOT_H
#define __GENERIC_ARMCM_BOOT_H
#include "ctr.h" // DECL_CTR_INT
// Declare an IRQ handler
#define DECL_ARMCM_IRQ(FUNC, NUM) \
DECL_CTR_INT("DECL_ARMCM_IRQ " __stringify(FUNC), 1, CTR_INT(NUM))
// Statically declare an IRQ handler and run-time enable it
#define armcm_enable_irq(FUNC, NUM, PRIORITY) do { \
DECL_ARMCM_IRQ(FUNC, (NUM)); \
NVIC_SetPriority((NUM), (PRIORITY)); \
NVIC_EnableIRQ((NUM)); \
} while (0)
// Vectors created by scripts/buildcommands.py from DECL_ARMCM_IRQ commands
extern const void * const VectorTable[];
#endif // armcm_boot.h