SETINTFLAGS AND flags,mask
SETINTFLAGS OR flags,mask
SETINTFLAGS NOT flags,mask
Flags - a variable/constant (0-255) which specifies flags byte condition.
Mask - is variable/constant (0-255) which specifies the mask.
Interrupt on a certain 'flags' byte condition.
Please also see the detailed usage notes under the 'setint' command, which also apply to the 'setintflags' command. Only one interrupt can be active at any time.
The setintflags command causes a polled interrupt on a certain flags condition. A polled interrupt is a quicker way of reacting to a particular event. It is the only type of interrupt available in the PICAXE system. The flags byte is checked between execution of each command line in the program, between each note of a tune command, and continuously during any pause command. If the particular inputs condition is true, a 'gosub' to the interrupt sub-procedure is executed immediately. When the sub-procedure has been carried out, program execution continues from the main program.
The interrupt inputs condition is any pattern of '0's and '1's on the flags byte masked by the byte 'mask'. Therefore any bits masked by a '0' in byte mask will be ignored. The system 'flags' byte is broken down into individual bit variables. See the appropriate command for more specific details about each flag.
||X2 parts - interrupt on INT0 hintsetup
||X2 parts - interrupt on INT1 hintsetup
||X2 parts - interrupt on INT2 hintsetup
||X2 parts - interrupt on any pin 0,1,2 hintsetup
||X2 parts - comparator flag compsetup
||hserial background receive has occurred hsersetup
||hi2c write has occurred (slave mode) hi2csetup
||timer overflow flag settimer
Therefore, interupts can easily be generated on specific events:
||to interrupt on timer overflow
||to interrupt on hi2c write (slave mode)
||to interrupt on background hardware serial receive
Only one input pattern is allowed at any time. To disable the interrupt execute a 'setintflags off' command. For more information about the various setintflags options (AND / OR / NOT) please see the setint command.