I have a question about waiting on a value on a port. However there is only an example about a 1 bit port while I use a 4 bit port.
I have the code
Code: Select all
void waitForInputPortToBe(in port portToCheck, int pin, int value){
int portValue;
portToCheck :> portValue;
while(portValue & (1 << pin) == value){
portToCheck :> portValue;
}
}
But in the XMOS manual there is a very nice way to wait on a one bit port, but how to do this for a 4 bit port?
I thought it should be something like this, but it is not:
Code: Select all
void waitForInputPortToBe(in port portToCheck, int pin, int value){
portToCheck when pinseq ((value & (1 << pin))) :> value;
}