diff options
author | Thomas Tsou <tom@tsou.cc> | 2013-11-09 02:46:29 -0500 |
---|---|---|
committer | Thomas Tsou <tom@tsou.cc> | 2013-11-15 23:35:07 -0500 |
commit | e0fa2bfd937406cbaf992f8d16d0a262dd6ddd87 (patch) | |
tree | 0e709be5c14e868cbb52ed9b083190f702fa7889 /Transceiver52M/radioInterface.cpp | |
parent | 6f4906e375999c242c6e84e1e59cf478490763ed (diff) |
Transceiver52M: Remove extra copy in receive drive path
Currently the code allocations a signalVector and then copies
into a radioVector. This is unnecessary because the latter is
a derived class making the first allocation unnecessary.
Modify the radioVector constructor to allow direct use in the
case above.
Signed-off-by: Thomas Tsou <tom@tsou.cc>
Diffstat (limited to 'Transceiver52M/radioInterface.cpp')
-rw-r--r-- | Transceiver52M/radioInterface.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/Transceiver52M/radioInterface.cpp b/Transceiver52M/radioInterface.cpp index f98194f..6e82c8a 100644 --- a/Transceiver52M/radioInterface.cpp +++ b/Transceiver52M/radioInterface.cpp @@ -234,36 +234,33 @@ bool RadioInterface::driveReceiveRadio() GSM::Time rcvClock = mClock.get(); rcvClock.decTN(receiveOffset); unsigned tN = rcvClock.TN(); - int rcvSz = recvCursor; + int recvSz = recvCursor; int readSz = 0; const int symbolsPerSlot = gSlotLen + 8; + int burstSize = (symbolsPerSlot + (tN % 4 == 0)) * mSPSRx; // while there's enough data in receive buffer, form received // GSM bursts and pass up to Transceiver // Using the 157-156-156-156 symbols per timeslot format. - while (rcvSz > (symbolsPerSlot + (tN % 4 == 0)) * mSPSRx) { - GSM::Time tmpTime = rcvClock; - + while (recvSz > burstSize) { for (size_t i = 0; i < mChans; i++) { - signalVector rxVector((symbolsPerSlot + (tN % 4 == 0)) * mSPSRx); - unRadioifyVector((float *) (recvBuffer[i]->begin() + readSz), rxVector); - - if (rcvClock.FN() >= 0) - burst = new radioVector(rxVector, tmpTime); + burst = new radioVector(burstSize, rcvClock); - if (burst && (mReceiveFIFO[i].size() < 32)) + unRadioifyVector((float *) (recvBuffer[i]->begin() + readSz), *burst); + if (mReceiveFIFO[i].size() < 32) mReceiveFIFO[i].write(burst); - else { + else delete burst; - } } mClock.incTN(); rcvClock.incTN(); - readSz += (symbolsPerSlot+(tN % 4 == 0)) * mSPSRx; - rcvSz -= (symbolsPerSlot+(tN % 4 == 0)) * mSPSRx; + readSz += burstSize; + recvSz -= burstSize; tN = rcvClock.TN(); + + burstSize = (symbolsPerSlot + (tN % 4 == 0)) * mSPSRx; } if (readSz > 0) { |