diff options
Diffstat (limited to 'Transceiver52M')
-rw-r--r-- | Transceiver52M/DriveLoop.cpp | 7 | ||||
-rw-r--r-- | Transceiver52M/Transceiver.cpp | 18 | ||||
-rw-r--r-- | Transceiver52M/radioInterface.cpp | 17 | ||||
-rw-r--r-- | Transceiver52M/radioInterface.h | 2 |
4 files changed, 28 insertions, 16 deletions
diff --git a/Transceiver52M/DriveLoop.cpp b/Transceiver52M/DriveLoop.cpp index c080c12..7e250f8 100644 --- a/Transceiver52M/DriveLoop.cpp +++ b/Transceiver52M/DriveLoop.cpp @@ -29,8 +29,7 @@ DriveLoop::DriveLoop(int wSamplesPerSymbol, GSM::Time wTransmitLatency, RadioInterface *wRadioInterface) { - mRadioDriveLoopThread = new Thread(32768); - + mRadioDriveLoopThread = NULL; mSamplesPerSymbol = wSamplesPerSymbol; mRadioInterface = wRadioInterface; @@ -70,6 +69,9 @@ DriveLoop::DriveLoop(int wSamplesPerSymbol, DriveLoop::~DriveLoop() { + if (mRadioDriveLoopThread) + delete mRadioDriveLoopThread; + delete gsmPulse; sigProcLibDestroy(); } @@ -77,6 +79,7 @@ DriveLoop::~DriveLoop() void DriveLoop::start() { mOn = true; + mRadioDriveLoopThread = new Thread(32768); mRadioDriveLoopThread->start((void * (*)(void*))RadioDriveLoopAdapter, (void*) this); } diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 6cfcf32..7b60cd2 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -60,10 +60,9 @@ Transceiver::Transceiver(int wBasePort, mDriveLoop(wDriveLoop), mTransmitPriorityQueue(NULL), mChannel(wChannel), mTSC(-1) { - mFIFOServiceLoopThread = new Thread(32768); ///< thread to push bursts into transmit FIFO - mControlServiceLoopThread = new Thread(32768); ///< thread to process control messages from GSM core - mTransmitPriorityQueueServiceLoopThread = new Thread(32768);///< thread to process transmit bursts from GSM core - + mFIFOServiceLoopThread = NULL; + mControlServiceLoopThread = NULL; + mTransmitPriorityQueueServiceLoopThread = NULL; mSamplesPerSymbol = wSamplesPerSymbol; mRadioInterface = wRadioInterface; @@ -101,6 +100,10 @@ Transceiver::~Transceiver() { delete gsmPulse; mTransmitPriorityQueue->clear(); + + delete mFIFOServiceLoopThread; + delete mControlServiceLoopThread; + delete mTransmitPriorityQueueServiceLoopThread; } @@ -304,6 +307,7 @@ void Transceiver::pullFIFO() void Transceiver::start() { + mControlServiceLoopThread = new Thread(32768); mControlServiceLoopThread->start((void * (*)(void*))ControlServiceLoopAdapter,(void*) this); } @@ -362,11 +366,13 @@ void Transceiver::driveControl() generateRACHSequence(*gsmPulse,mSamplesPerSymbol); // Start radio interface threads. + mOn = true; + mFIFOServiceLoopThread = new Thread(32768); + mTransmitPriorityQueueServiceLoopThread = new Thread(32768); + mFIFOServiceLoopThread->start((void * (*)(void*))FIFOServiceLoopAdapter,(void*) this); mTransmitPriorityQueueServiceLoopThread->start((void * (*)(void*))TransmitPriorityQueueServiceLoopAdapter,(void*) this); writeClockInterface(); - - mOn = true; } } } diff --git a/Transceiver52M/radioInterface.cpp b/Transceiver52M/radioInterface.cpp index c1d43b6..316779f 100644 --- a/Transceiver52M/radioInterface.cpp +++ b/Transceiver52M/radioInterface.cpp @@ -75,6 +75,8 @@ RadioInterface::~RadioInterface(void) mRadio->stop(); close(); + delete mAlignRadioServiceLoopThread; + for (i = 0; i < CHAN_M; i++) { if (rcvBuffer[i] != NULL) delete rcvBuffer[i]; @@ -160,17 +162,15 @@ bool RadioInterface::start() if (mOn) return false; - LOG(INFO) << "starting radio interface..."; + mOn = true; #ifdef USRP1 - mAlignRadioServiceLoopThread.start((void * (*)(void*))AlignRadioServiceLoopAdapter, - (void*)this); + mAlignRadioServiceLoopThread = new Thread(32768); + mAlignRadioServiceLoopThread->start((void * (*)(void*))AlignRadioServiceLoopAdapter, + (void*)this); #endif writeTimestamp = mRadio->initialWriteTimestamp(); readTimestamp = mRadio->initialReadTimestamp(); mRadio->start(); - LOG(DEBUG) << "Radio started"; - mRadio->updateAlignment(writeTimestamp-10000); - mRadio->updateAlignment(writeTimestamp-10000); for (i = 0; i < CHAN_M; i++) { sendBuffer[i] = new float[8*2*INCHUNK]; @@ -180,7 +180,10 @@ bool RadioInterface::start() /* Init I/O specific variables if applicable */ init(); - mOn = true; + mRadio->start(); + LOG(DEBUG) << "Radio started"; + mRadio->updateAlignment(writeTimestamp-10000); + mRadio->updateAlignment(writeTimestamp-10000); return true; } diff --git a/Transceiver52M/radioInterface.h b/Transceiver52M/radioInterface.h index dde1414..99c66b1 100644 --- a/Transceiver52M/radioInterface.h +++ b/Transceiver52M/radioInterface.h @@ -36,7 +36,7 @@ class RadioInterface { protected: - Thread mAlignRadioServiceLoopThread; ///< thread that synchronizes transmit and receive sections + Thread *mAlignRadioServiceLoopThread; ///< thread that synchronizes transmit and receive sections VectorFIFO mReceiveFIFO[CHAN_M]; ///< FIFO that holds receive bursts |