Skip to content

Commit 7571428

Browse files
authored
Fix Galea gain tracker channels and EEG channel names (#787)
1 parent 5200967 commit 7571428

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

src/board_controller/brainflow_boards.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ BrainFlowBoards::BrainFlowBoards()
189189
{"marker_channel", 28},
190190
{"num_rows", 29},
191191
{"eeg_channels", {9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}},
192-
{"eeg_names", "F1,C3,F2,Cz,C4,Pz,P4,O2,P3,O1,X1,X2,X3,X4,X5,X6"},
192+
{"eeg_names", "F1,F2,C3,C4,P3,P4,O1,O2,Cz,Pz,X1,X2,X3,X4,X5,X6"},
193193
{"emg_channels", {1, 2, 3, 4, 7, 8}},
194194
{"eog_channels", {5, 6}},
195195
{"other_channels", {25, 26}},

src/board_controller/openbci/inc/openbci_gain_tracker.h

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class GaleaGainTracker : public OpenBCIGainTracker
195195
public:
196196
GaleaGainTracker ()
197197
: OpenBCIGainTracker ({4, 4, 4, 4, 4, 4, 4, 4, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 4, 4,
198-
4, 4, 12, 12}) // 8 EMG + 12 EEG + 4 AUX(EMG) + 2 Reserved
198+
4, 4, 12, 12}) // Channels 1-8: EMG, 9-18: EEG, 19-22: AUX(EMG), 23-24: Reserved
199199
{
200200
channel_letters = std::vector<char> {'1', '2', '3', '4', '5', '6', '7', '8', 'Q', 'W', 'E',
201201
'R', 'T', 'Y', 'U', 'I', 'A', 'S', 'D', 'G', 'H', 'J', 'K', 'L'};
@@ -213,27 +213,24 @@ class GaleaGainTracker : public OpenBCIGainTracker
213213
if ((config.at (0) == 'o') || (config.at (0) == 'd'))
214214
{
215215
std::copy (current_gains.begin (), current_gains.end (), old_gains.begin ());
216-
// 8 EMG + 12 EEG + 4 AUX(EMG) + 2 Reserved
216+
// Channels 1-8: EMG, 9-18: EEG, 19-22: AUX(EMG), 23-24: Reserved
217217
for (size_t i = 0; i < current_gains.size (); i++)
218218
{
219-
if (i < 8) // EMG channels 0-7
219+
if (i < 8) // Channels 1-8: EMG (indices 0-7)
220220
{
221221
current_gains[i] = 4;
222222
}
223-
else if (i < 20) // EEG channels 8-19
223+
else if (i < 18) // Channels 9-18: EEG (indices 8-17)
224224
{
225225
current_gains[i] = 12;
226226
}
227-
else if (i < 24) // AUX channels 20-23 (4 AUX EMG + 2 Reserved)
227+
else if (i < 22) // Channels 19-22: AUX EMG (indices 18-21)
228228
{
229-
if (i < 22) // AUX EMG channels 20-21
230-
{
231-
current_gains[i] = 4;
232-
}
233-
else // Reserved channels 22-23
234-
{
235-
current_gains[i] = 12;
236-
}
229+
current_gains[i] = 4;
230+
}
231+
else if (i < 24) // Channels 23-24: Reserved (indices 22-23)
232+
{
233+
current_gains[i] = 12;
237234
}
238235
}
239236
}

0 commit comments

Comments
 (0)