Skip to content

Commit 179cc21

Browse files
authored
Merge pull request #89 from marcobarilari/marco_clean-cleanUP
remove EyeLink('Shutdown') from clean up
2 parents e7be247 + d783151 commit 179cc21

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/cleanUp.m

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ function cleanUp()
1616
% Screen Close All
1717
sca;
1818

19-
% Shut down connection with Eyelink
20-
try
21-
Eyelink('shutdown');
22-
catch
23-
end
24-
2519
% Close Psychportaudio if open
2620
if PsychPortAudio('GetOpenDeviceCount') ~= 0
2721
PsychPortAudio('Close');

src/eyeTracker.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,19 +228,22 @@
228228
% Exit program if this fails.
229229
elInit = Eyelink('Initialize');
230230
if elInit ~= 0
231+
Eyelink('shutdown');
231232
error([newline 'Eyelink is not initialized, aborted.']);
232233
end
233234

234235
% Make sure EL is still connected: returns 1 if connected, -1 if dummy-connected,
235236
% 2 if broadcast-connected and 0 if not connected. Exit program if this fails.
236237
elConnection = Eyelink('IsConnected');
237238
if elConnection ~= 1
239+
Eyelink('shutdown');
238240
error([newline 'Eyelink is not connected, aborted.']);
239241
end
240242

241243
% Initialize Eyelink system and connection: returns 1 when succesful, 0
242244
% otherwise
243245
if ~EyelinkInit(0, 1)
246+
Eyelink('shutdown');
244247
fprintf('Eyelink Init aborted.\n');
245248
return
246249
end

0 commit comments

Comments
 (0)