app_specific/include/isr_howto.h File Reference

ISR declaration. More...

Defines

#define DECLARE_ISR
 Declaration of user ISR.

Detailed Description

ISR declaration.

Author:
Piotr Romaniuk, (c) ELESOFTROM
Version:
1.0 Feb 5, 2011

This file (isr_howto.h) is only for documentation. Do not include it into source code.
The DioneOS uses its own method for user ISR declaration. Like in general case, user needs to write his ISR function, that should be defined like regular C function, e.g.

 void user_uart_a0( void )
 {
         //..user ISR code
 }
Warning:
Do not use '#pragma vector=...' nor __interrupt prefix in the user ISR definition.

In order to connect user ISR to interrupt vector use custom declaration DECLARE_ISR that should be added in assembler file system/app_specific/src/isr_declarations.asm


Define Documentation

#define DECLARE_ISR

Declaration of user ISR.

This is assembler macro that is required to connect user ISR to interrupt vector.

Parameters:
[in]vector_nameinterrupt vector name
[in]user_isr_fnname of the user ISR function
[in]early_prologmacro name that encapsulates code inserted at very beginning in system ISR. This is useful when you need to signal on DEBUG_PORT pin interrupt moment. When this feature is not required use EMPTY_PREPROLOG_ISR as this parameter.
Warning:
Code from early_prolog macro is inserted before registers are saved. Use it carefully, you must not corrupt registers.


DECLARE_ISR vector_name, user_isr_fn, early_prolog

Note:
Because this declaration is in assembler file it must be consistent with assembler syntax:
1. always start a line with space, otherwise it will be interpreted as label
2. do not use parenthesis '( )' in argument list
3. separate arguments with comma ','
4. if you need to put comment, start a line with semicolon ';'