Q-Code User Manual
Ver. 7.0 2021/11/30
154
Therefore, when the XIP (Execute in place) function state of
Q-Code_NX1
changes, the C-Code does
not require additional fixes. When users define macros, please avoid starting with the underline and
avoid conflicts with the
Q-Code_NX1
Firmware kernel function.
Ex.
Reference the _SPI_XIP macros.
[C-Code]
#if _SPI_XIP == 1
# define XIP __XIP
#else
# define XIP
#endif
void func1(void) XIP;
void func1(void)
{
// do something
}
4.4.3 BG(BG1, BG2, BG3)
This command is for user to execute command in background.
Q-Code
provides 3 threads of
background, and user can start a background thread in another one.
Note:
1. NY4 / NY5 / NY5+ / NY6 / NY7 / NY9T only support BG1 / BG2.
2. NX1 supports BG1 / BG2 / BG3.
3. BG1 can only call the paths defined in [Background1], and vice versa.
Ex.
Use background command to achieve 3Hz flashing.
[Path]
PowerOn:
BG(OUT1,OUT2), Delay(1), Stop
; execute next command after calling
background1 and background2 path.
[Background1]
OUT1: PB=[X X 1 1], Delay (0.166), PB=[X X 0 0], Delay (0.166), OUT1
[Background2]
OUT2: PB=[0 0 X X], Delay (0.166), PB=[1 1 X X], Delay (0.166), OUT2
4.4.4 Break
This command is for user to immediately stop current PlayV, PlayM or Delay commands in foreground,
and execute the next command.
Note: NX1 does not support this command.
Ex.
V0 will stop playing after 1 second, and immediately execute StopV command.