modm API documentation
|
#define | MODM_ISR_NAME(vector) |
#define | MODM_ISR_DECL(vector) |
#define | MODM_ISR_CALL(vector) |
#define | MODM_ISR(vector, ...) |
lbuild module: modm:architecture:interrupt
#define MODM_ISR |
Declare an interrupt handler.
This macro allows the declaration of interrupt handlers using the name declared in the datasheet in C or C++ code on any platform.
On AVRs this maps to ISR(MODM_ISR_NAME({vector}), args)
. On Cortex-M and Hosted this maps to void MODM_ISR_NAME({vector})(void) args
. extern "C"
is automatically added in a C++ environment.
On Cortex-M the vector name is validated at compile time against the device's vector table, so that misspelled vector names get caught during compilation. You can disable the validation by defining MODM_ISR_DISABLE_VALIDATION
.
vector | The name of the interrupt without any suffix (neither _vect , nor _IRQHandler ). |
... | Multiple compiler attributes can be added to an interrupt. For example modm_fastcode . |
#define MODM_ISR_CALL |
Directly calls an interrupt function.
This maps to MODM_ISR_NAME({vector})()
.
MODM_ISR_DECL({vector})
.On Cortex-M the vector name is validated at compile time against the device's vector table, so that misspelled vector names get caught during compilation. If this is undesirable you can manually call the vector using MODM_ISR_NAME(vector)()
or disable the validation by defining MODM_ISR_DISABLE_VALIDATION
.
vector | The name of the interrupt without any suffix (neither _vect , nor _IRQHandler ). |
#define MODM_ISR_DECL |
Forward declare in interrupt function.
This maps to extern void MODM_ISR_NAME({vector})(void)
. extern "C"
is used automatically in a C++ environment.
vector | The name of the interrupt without any suffix (neither _vect , nor _IRQHandler ). |
#define MODM_ISR_NAME |
Get the expanded interrupt name.
On AVRs this maps to {vector}_vect
. On Cortex-M this maps to {vector}_IRQHandler
. On Hosted this maps to {vector}_isr
.
MODM_ISR_NAME(ADC)
vs. the ADC
peripheral. When defining interrupt vectors for compatibility, you MUST use this macro instead of manually defining it! vector | The name of the interrupt without any suffix (neither _vect , nor _IRQHandler ). |