I have the following scenario: My XEM6110 interfaces with an ADC. I read out the ADC from the connected PC using a FIFO and a block throttled pipe (ReadFromBlockPipeOut).
The issue now is that an external signal defines the data start. When this external signal goes high, the ADC starts to sample and the FIFO starts to fill. I also generate a trigger when this happens.
On the PC side I need to wait for the trigger and then start reading from the FIFO (ReadFromBlockPipeOut) as soon as possible, otherwise I will get a FIFO overflow.
But polling for the trigger using IsTriggered in a loop and then starting ReadFromBlockPipeOut is not just very inefficient but also very unreliable: Since the OS can take some ms or even s from the time that the code if(IsTriggered(...)==1) goes to ReadFromBlockPipeOut, I can get a FIFO overflow.
Is there a way for wait for a trigger without polling? Or even better, start calling ReadFromBlockPipeOut which then blocks until a specific trigger is raised?
Or any other way to solve this?