Skip to content

Commit 99cd169

Browse files
committed
Remove inline definitions and need to function call
1 parent 5bf879e commit 99cd169

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

Source/Processors/DataThreads/RHD2000Thread.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@ bool RHD2000Thread::updateBuffer()
15311531
for (int chan = 0; chan < nChans; chan++)
15321532
{
15331533
channel++;
1534-
thisSample[channel] = float(Rhd2000DataBlock::convertUsbWord(bufferPtr, chanIndex) - 32768)*0.195f;
1534+
thisSample[channel] = float(*(uint16*)(bufferPtr + chanIndex) - 32768)*0.195f;
15351535
chanIndex += 2*numStreams;
15361536
}
15371537
}
@@ -1545,7 +1545,7 @@ bool RHD2000Thread::updateBuffer()
15451545
int auxNum = (samp+3) % 4;
15461546
if (auxNum < 3)
15471547
{
1548-
auxSamples[dataStream][auxNum] = float(Rhd2000DataBlock::convertUsbWord(bufferPtr, auxIndex) - 32768)*0.0000374;
1548+
auxSamples[dataStream][auxNum] = float(*(uint16*)(bufferPtr + auxIndex) - 32768)*0.0000374;
15491549
}
15501550
for (int chan = 0; chan < 3; chan++)
15511551
{
@@ -1570,15 +1570,15 @@ bool RHD2000Thread::updateBuffer()
15701570
// ADC waveform units = volts
15711571
thisSample[channel] =
15721572
//0.000050354 * float(dataBlock->boardAdcData[adcChan][samp]);
1573-
0.00015258789 * float(Rhd2000DataBlock::convertUsbWord(bufferPtr, index)) - 5 - 0.4096; // account for +/-5V input range and DC offset
1573+
0.00015258789 * float(*(uint16*)(bufferPtr + index)) - 5 - 0.4096; // account for +/-5V input range and DC offset
15741574
index += 2;
15751575
}
15761576
}
15771577
else
15781578
{
15791579
index += 16;
15801580
}
1581-
eventCode = Rhd2000DataBlock::convertUsbWord(bufferPtr, index);
1581+
eventCode = *(uint16*)(bufferPtr + index);
15821582
index += 4;
15831583
dataBuffer->addToBuffer(thisSample, &timestamp, &eventCode, 1);
15841584
#if 0

Source/Processors/DataThreads/rhythm-api/rhd2000datablock.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ class Rhd2000DataBlock
4949
void print(int stream) const;
5050
void write(ofstream &saveOut, int numDataStreams) const;
5151

52-
static inline bool checkUsbHeader(unsigned char usbBuffer[], int index);
53-
static inline unsigned int convertUsbTimeStamp(unsigned char usbBuffer[], int index);
54-
static inline int convertUsbWord(unsigned char usbBuffer[], int index);
52+
static bool checkUsbHeader(unsigned char usbBuffer[], int index);
53+
static unsigned int convertUsbTimeStamp(unsigned char usbBuffer[], int index);
54+
static int convertUsbWord(unsigned char usbBuffer[], int index);
5555

5656
private:
5757
void allocateIntArray3D(vector<vector<vector<int> > > &array3D, int xSize, int ySize, int zSize);

0 commit comments

Comments
 (0)