SPRU514Z July 2001 – October 2023 SM320F28335-EP
There are several additional restrictions to the C language for CLA.
Since the CLA code is executed in an interrupt driven environment, there is no C system boot sequence. As a result, global/static data initialization must be done during program execution, either by the C28x driver code or within a CLA function.
Variables defined as const can be initialized globally. The compiler creates initialized data sections named .const_cla to hold these variables.
Most GCC extensions are supported by the CLA compiler. Both the C and the CLA compiler have GCC extensions enabled by default. See the --relaxed_ansi option in Section 6.14.3 and the list of GCC language extensions in Section 6.15 for more information.
The interrupt function attribute described in Section 6.9.15 can be used with CLA interrupts, so long as you do not include any arguments to the interrupt attribute. The INTERRUPT pragma is also supported by the CLA compiler. For example, the following uses are supported:
__attribute__((interrupt))
void interrupt_name(void) {...}
#pragma INTERRUPT(interrupt_name);
void interrupt _name(void) {...}
For CLA2 background tasks, the "BACKGROUND" argument specifies that this is a background task instead of a regular interrupt. The following uses are supported.
__attribute__((interrupt("BACKGROUND")))
void task_name(void) {...}
#pragma INTERRUPT(task_name, "BACKGROUND");
void task_name(void) {...}
The CLA compiler does not permit function calls to be made in background tasks. Inline functions are permitted and can be used instead.