Q-Code User Manual
Ver. 7.0 2021/11/30
153
mvam pa_state
mvam pa
}
[Path]
TR1: LED
; Call assembly.
4.4.2 C-Code
User can insert C module after the label of
[C-Code]
in
Q-Code
.
Note: NY4 / NY5 / NY5+ / NY6 / NY7 / NY9T do not support this command.
Ex.
Uses C programming language to control IC.
[C-Code]
//#define USER_DEBUG_MODE 1
#ifdef USER_DEBUG_MODE
void debug_print(int data)
{
// do something
}
#else
#define debug_print(x)
#endif
[Path]
PowerOn
: debug_print(0)
If the XIP (Execute in place) function is enabled, the C-Code can also specify that some programs are
stored in the XIP section. And add XIP attribute to the function prototype declaration.
Ex.
Specify that the function is stored in the XIP section.
[C-Code]
void func1(void) __XIP;
void func1(void)
{
// do something
}
In addition to using the __XIP attribute directly, user can also know whether the XIP (Execute in place)
function is enabled by the pre-defined _SPI_XIP macro. If the XIP function is enabled, the _SPI_XIP
macro will be 1, otherwise will be 0. It is recommended to use the following example when
programming C-Code to refer to the _SPI_XIP macro and to define the XIP attribute separately.