From 99cd169b1c2e7cc22e6130dc5a36efda178c094c Mon Sep 17 00:00:00 2001 From: Aaron Cuevas Lopez Date: Wed, 12 Aug 2015 19:32:00 +0200 Subject: [PATCH] Remove inline definitions and need to function call --- Source/Processors/DataThreads/RHD2000Thread.cpp | 8 ++++---- .../Processors/DataThreads/rhythm-api/rhd2000datablock.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/Processors/DataThreads/RHD2000Thread.cpp b/Source/Processors/DataThreads/RHD2000Thread.cpp index 25a5973f3..5b3b32290 100644 --- a/Source/Processors/DataThreads/RHD2000Thread.cpp +++ b/Source/Processors/DataThreads/RHD2000Thread.cpp @@ -1531,7 +1531,7 @@ bool RHD2000Thread::updateBuffer() for (int chan = 0; chan < nChans; chan++) { channel++; - thisSample[channel] = float(Rhd2000DataBlock::convertUsbWord(bufferPtr, chanIndex) - 32768)*0.195f; + thisSample[channel] = float(*(uint16*)(bufferPtr + chanIndex) - 32768)*0.195f; chanIndex += 2*numStreams; } } @@ -1545,7 +1545,7 @@ bool RHD2000Thread::updateBuffer() int auxNum = (samp+3) % 4; if (auxNum < 3) { - auxSamples[dataStream][auxNum] = float(Rhd2000DataBlock::convertUsbWord(bufferPtr, auxIndex) - 32768)*0.0000374; + auxSamples[dataStream][auxNum] = float(*(uint16*)(bufferPtr + auxIndex) - 32768)*0.0000374; } for (int chan = 0; chan < 3; chan++) { @@ -1570,7 +1570,7 @@ bool RHD2000Thread::updateBuffer() // ADC waveform units = volts thisSample[channel] = //0.000050354 * float(dataBlock->boardAdcData[adcChan][samp]); - 0.00015258789 * float(Rhd2000DataBlock::convertUsbWord(bufferPtr, index)) - 5 - 0.4096; // account for +/-5V input range and DC offset + 0.00015258789 * float(*(uint16*)(bufferPtr + index)) - 5 - 0.4096; // account for +/-5V input range and DC offset index += 2; } } @@ -1578,7 +1578,7 @@ bool RHD2000Thread::updateBuffer() { index += 16; } - eventCode = Rhd2000DataBlock::convertUsbWord(bufferPtr, index); + eventCode = *(uint16*)(bufferPtr + index); index += 4; dataBuffer->addToBuffer(thisSample, ×tamp, &eventCode, 1); #if 0 diff --git a/Source/Processors/DataThreads/rhythm-api/rhd2000datablock.h b/Source/Processors/DataThreads/rhythm-api/rhd2000datablock.h index a9ac2ce15..025248c38 100755 --- a/Source/Processors/DataThreads/rhythm-api/rhd2000datablock.h +++ b/Source/Processors/DataThreads/rhythm-api/rhd2000datablock.h @@ -49,9 +49,9 @@ class Rhd2000DataBlock void print(int stream) const; void write(ofstream &saveOut, int numDataStreams) const; - static inline bool checkUsbHeader(unsigned char usbBuffer[], int index); - static inline unsigned int convertUsbTimeStamp(unsigned char usbBuffer[], int index); - static inline int convertUsbWord(unsigned char usbBuffer[], int index); + static bool checkUsbHeader(unsigned char usbBuffer[], int index); + static unsigned int convertUsbTimeStamp(unsigned char usbBuffer[], int index); + static int convertUsbWord(unsigned char usbBuffer[], int index); private: void allocateIntArray3D(vector > > &array3D, int xSize, int ySize, int zSize);