Skip to content

Commit

Permalink
CedrusResponseBox(): Disable any flow control.
Browse files Browse the repository at this point in the history
It was supposed to use hardware flow control (FlowControl=Hardware),
but that did not work until PTB v3.0.19.6 due to an IOPort parameter
handling bug. Since the bug is fixed, hardware flow control would be
used. This was supposed to make Cedrus to work more robust, but it
apparently had the opposite effect, as the following PTB forum message
suggests:

https://psychtoolbox.discourse.group/t/waiting-forever-for-data-transmission-with-cedrus-rb/5319

Disable flow control explicitely, to revert to pre 3.0.19.6 behaviour,
where Cedrus boxes worked as well as they could.

If this fixes the bug though, that means my original opinion about
the quality of Cedrus hardware - or the lack thereof - would be
true, and the fragile communication was not caused by our IOPort
driver bug, ie. by lack of hardware flow control. Let's see...
  • Loading branch information
kleinerm committed Apr 4, 2024
1 parent 70164d9 commit a595170
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Psychtoolbox/PsychHardware/CedrusResponseBox.m
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,7 @@ function ClearQueues(handle)
oldverb = IOPort('Verbosity', 0);

% Open link:
[dev.link, errmsg] = IOPort('OpenSerialPort', port, sprintf('BaudRate=%i Parity=None DataBits=8 StopBits=1 FlowControl=Hardware ReceiveTimeout=1 ReceiveLatency=0.0001 ', baudrate));
[dev.link, errmsg] = IOPort('OpenSerialPort', port, sprintf('BaudRate=%i Parity=None DataBits=8 StopBits=1 FlowControl=None ReceiveTimeout=1 ReceiveLatency=0.0001 ', baudrate));

IOPort('Verbosity', oldverb);

Expand Down

0 comments on commit a595170

Please sign in to comment.