From a595170c41d68b1a973ea64e65e6dc2ea2a613e1 Mon Sep 17 00:00:00 2001 From: Mario Kleiner Date: Thu, 4 Apr 2024 01:15:36 +0100 Subject: [PATCH] CedrusResponseBox(): Disable any flow control. 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... --- Psychtoolbox/PsychHardware/CedrusResponseBox.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Psychtoolbox/PsychHardware/CedrusResponseBox.m b/Psychtoolbox/PsychHardware/CedrusResponseBox.m index b6e4ee705b..de8b55d5de 100644 --- a/Psychtoolbox/PsychHardware/CedrusResponseBox.m +++ b/Psychtoolbox/PsychHardware/CedrusResponseBox.m @@ -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);