-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetIOPort.m
More file actions
54 lines (51 loc) · 1.51 KB
/
setIOPort.m
File metadata and controls
54 lines (51 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
function [globals] = setIOPort(globals)
globals.sendTriggers = true;
try
config_io;
globals.portObj = io64;
globals.portStatus = io64(globals.portObj);
globals.portAddress = hex2dec('3FF8');
io64(globals.portObj,globals.portAddress,0);
choice = questdlg(sprintf(....
'Successfully setup IO port.%cWould you like to continue?',10),...
'Continue?', ...
'Exit execution','Let''s go!','Exit execution');
switch choice
case 'Exit execution'
Screen('CloseAll');
globals.stoppedEarly = true;
return
case ''
Screen('CloseAll');
globals.stoppedEarly = true;
return
case 'Let''s go!'
% Continue execution.
otherwise
Screen('CloseAll');
globals.stoppedEarly = true;
return
end
catch
choice = questdlg(sprintf(...
'Failed to setup IO port.%cWhat would you like to do?',10),...
'IO port not working', ...
'Exit execution','Continue; I am testing','Exit execution');
switch choice
case 'Exit execution'
Screen('CloseAll');
globals.stoppedEarly = true;
return
case 'Continue; I am testing'
globals.sendTriggers = false;
case ''
Screen('CloseAll');
globals.stoppedEarly = true;
return
otherwise
Screen('CloseAll');
globals.stoppedEarly = true;
return
end
end
return