Merge pull request #278 from qswain2/fix-typo-in-start-stop

Fix typo in start stop
This commit is contained in:
f4exb 2019-01-20 09:54:06 +01:00 committed by GitHub
commit 62e1a5f4da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 6 deletions

View File

@ -31,9 +31,11 @@ DeviceXTRXShared::DeviceXTRXShared() :
m_channel(-1),
m_source(0),
m_sink(0),
m_thread(0),
m_threadWasRunning(false)
m_threadWasRunning(false),
m_first_1pps_count(true),
m_last_1pps_count(0),
m_no_1pps_count_change_counter(0)
{}
DeviceXTRXShared::~DeviceXTRXShared()
@ -56,11 +58,34 @@ bool DeviceXTRXShared::get_gps_status()
{
uint64_t val = 0;
int res = xtrx_val_get(m_dev->getDevice(), XTRX_TRX, XTRX_CH_AB, XTRX_WAIT_1PPS, &val);
int res = xtrx_val_get(m_dev->getDevice(), (xtrx_direction_t) 0, XTRX_CH_AB, XTRX_OSC_LATCH_1PPS, &val);
if (res) {
if (res)
{
return false;
}
else
{
if (m_first_1pps_count)
{
m_last_1pps_count = val;
m_first_1pps_count = false;
}
else
{
if (m_last_1pps_count != val)
{
m_no_1pps_count_change_counter = 7;
m_last_1pps_count = val;
}
else if (m_no_1pps_count_change_counter != 0)
{
m_no_1pps_count_change_counter--;
}
return val != 0;
}
//qDebug("DeviceXTRXShared::get_gps_status: XTRX_OSC_LATCH_1PPS: %lu %u", val, m_no_1pps_count_change_counter);
return m_no_1pps_count_change_counter != 0;
}
}

View File

@ -148,6 +148,11 @@ public:
double get_board_temperature();
bool get_gps_status();
private:
bool m_first_1pps_count;
uint64_t m_last_1pps_count;
uint32_t m_no_1pps_count_change_counter;
};
#endif /* DEVICES_LIMESDR_DEVICELIMESDRSHARED_H_ */

View File

@ -21,7 +21,7 @@ def getInputOptions():
options.address = "127.0.0.1:8888"
if options.device_index < 0:
otions.device_index = 0
options.device_index = 0
if options.start and options.stop:
print("Cannot start and stop at the same time")