How to wait for a condition on an input port
version
1.1.1
scope
Example.
This code is provided as example code for a user to base their code on.
description
How to wait for a condition on an input port
boards
Unless otherwise specified, this example runs on the SliceKIT Core Board, but can easily be run on any XMOS device by using a different XN file.
An input operation can be made to wait for one of two conditions on a port: equal to (pinseq) or not equal to (pinsneq) some value.
The following statement instructs input_port to wait until the value stored on its pins is not equal to input_value before sampling and providing it to the processor to store in input_value.
input_port when pinsneq(input_value) :> input_value;