Everything
3.7 Interrupt handler for RTOS

#pragma rtos_interrupt and the __rtos_interrupt keyword of the CA78K0R are converted into #pragma rtos_interrupt of the CC-RL.

 

The format of the CA78K0R is as follows.

#pragma rtos_interrupt [interrupt-request-name function-name]

or

__rtos_interrupt function-declaration

 

The format of the CC-RL is as follows.

#pragma rtos_interrupt [(] function-name [(vect=address)][)]

function-declaration

 

-

When the interrupt request name exists, #include "iodefine.h" is output.

-

__rtos_interrupt is converted into #pragma rtos_interrupt.

-

"interrupt-request-name" is converted into "vect=address" as a macro that indicates the address. The macro value is defined by iodefine.h.

-

Function names can be omitted in the format of the CA78K0R and so the CA78K0R has a facility that prevents the user from defining ret_int and _kernel_int_entry which are used by the RTOS interrupt handler. Since the same facility is not available in the CC-RL, if the interrupt request name and function name are omitted, the CcnvCA78K0R outputs a message and comments out the #pragma directive.

-

When a macro or typedef is used in declaration or definition of an interrupt function using the __rtos_interrupt keyword, the function name may be interpreted erroneously. Perform conversion after expanding the macro or typedef in advance.

-

If there is a #pragma directive and a description of an interrupt function by a keyword for the same function, converting both of them into #pragma directives sometimes generates duplicate #pragma directives after conversion and a compile error will occur. In this case, delete the duplicate description.

-

When omitting parameters of a function declaration in which the __rtos_interrupt keyword is specified, a compile error will occur in the CC-RL. The void type has to be written as the parameter type.

 

[Examples]

Pattern 1

Before conversion

#pragma rtos_interrupt INTP0 func
void func(void) { }

After conversion

#pragma rtos_interrupt func (vect=INTP0)
void func(void) { }

Pattern 2

Before conversion

__rtos_interrupt void func(void) { }

After conversion

#pragma rtos_interrupt func
void func(void) { }

Pattern 3

Before conversion

#pragma rtos_interrupt

After conversion

// #pragma rtos_interrupt

Pattern 4

Before conversion

__rtos_interrupt void func1(void), func2(void);

After conversion

#pragma rtos_interrupt func1
void func1(void);
#pragma rtos_interrupt func2
void func2(void);

Pattern 5

Before conversion

#pragma rtos_interrupt INTP0 func
__rtos_interrupt func(void);

After conversion

#pragma rtos_interrupt func(vect=INTP0)
void func(void);
#pragma rtos_interrupt func
void func(void);

Corrective action

Duplicate #pragma directives will cause an error in the CC-RL. Delete one of the #pragma directives.

Pattern 6

Before conversion

typedef void func_t(void);
__rtos_interrupt func_t f1;

After conversion

typedef void func_t(void);
__rtos_interrupt func_t f1;

Corrective action

A compile error will occur in the CC-RL. Expand typedef or the macro in advance.