aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/radioInterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Transceiver52M/radioInterface.cpp')
-rw-r--r--Transceiver52M/radioInterface.cpp39
1 files changed, 19 insertions, 20 deletions
diff --git a/Transceiver52M/radioInterface.cpp b/Transceiver52M/radioInterface.cpp
index c3063ff..a377436 100644
--- a/Transceiver52M/radioInterface.cpp
+++ b/Transceiver52M/radioInterface.cpp
@@ -145,16 +145,31 @@ bool RadioInterface::tuneRx(double freq, size_t chan)
return mRadio->setRxFreq(freq, chan);
}
+/** synchronization thread loop */
+void *AlignRadioServiceLoopAdapter(RadioInterface *radioInterface)
+{
+ while (1) {
+ sleep(60);
+ radioInterface->alignRadio();
+ pthread_testcancel();
+ }
+ return NULL;
+}
+
+void RadioInterface::alignRadio() {
+ mRadio->updateAlignment(writeTimestamp+ (TIMESTAMP) 10000);
+}
+
bool RadioInterface::start()
{
if (mOn)
return true;
LOG(INFO) << "Starting radio device";
-#ifdef DEVICE_USRP1
- mAlignRadioServiceLoopThread.start((void * (*)(void*))AlignRadioServiceLoopAdapter,
- (void*)this);
-#endif
+ if (mRadio->requiresRadioAlign())
+ mAlignRadioServiceLoopThread.start(
+ (void * (*)(void*))AlignRadioServiceLoopAdapter,
+ (void*)this);
if (!mRadio->start())
return false;
@@ -191,22 +206,6 @@ bool RadioInterface::stop()
return true;
}
-#ifdef DEVICE_USRP1
-void *AlignRadioServiceLoopAdapter(RadioInterface *radioInterface)
-{
- while (1) {
- radioInterface->alignRadio();
- pthread_testcancel();
- }
- return NULL;
-}
-
-void RadioInterface::alignRadio() {
- sleep(60);
- mRadio->updateAlignment(writeTimestamp+ (TIMESTAMP) 10000);
-}
-#endif
-
void RadioInterface::driveTransmitRadio(std::vector<signalVector *> &bursts,
std::vector<bool> &zeros)
{