Skip to content

Commit

Permalink
PsychEyelinkDispatchCallback(): Keep all persistent variables grouped…
Browse files Browse the repository at this point in the history
… on top.
  • Loading branch information
kleinerm committed May 18, 2024
1 parent adb29ad commit bd6ebc8
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
% previous comments where code was previously added, this
% was done for easier reading of the code.

global eyelinkanimationtarget;
global eyelinkanimationtarget; %#ok<GVMIS>

% Cached texture handle and size for eyelink eye image and texture:
persistent eyelinktex;
Expand All @@ -90,6 +90,14 @@
persistent GL_RGBA8;
persistent hostDataFormat;

% target & feedback beep waveforms and PsychPortAudio buffers
persistent audio_status;
persistent audio_devinfo;
persistent audio_n_chan;
persistent audio_fs;
%persistent audio_ppa_isSlave;
persistent beep_waveforms;

persistent inDrift;
newImage = 0;

Expand Down Expand Up @@ -146,12 +154,6 @@
return;
end

% target & feedback beep waveforms and PsychPortAudio buffers
persistent audio_status;
persistent audio_devinfo;
persistent audio_n_chan;
persistent audio_fs;
%persistent audio_ppa_isSlave;
if ~isempty(el.ppa_pahandle) && isempty(audio_status)
audio_status = PsychPortAudio('GetStatus', el.ppa_pahandle);
audio_devinfo = PsychPortAudio('GetDevices', [], audio_status.OutDeviceIndex);
Expand All @@ -165,7 +167,7 @@
audio_n_chan = 1;
audio_fs = Snd('DefaultRate');
end
persistent beep_waveforms;

if isempty(beep_waveforms)
if el.targetbeep
beep_waveforms{1} = repmat(MakeBeep(el.cal_target_beep(1), el.cal_target_beep(3), audio_fs) .* el.cal_target_beep(2), audio_n_chan, 1);
Expand Down

0 comments on commit bd6ebc8

Please sign in to comment.