1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-14 04:11:48 -05:00

Fixed LO PPM calculation for the HackRF and Airspy

This commit is contained in:
f4exb 2015-09-27 18:32:19 +02:00
parent fd78dda566
commit f331a3986e
2 changed files with 4 additions and 2 deletions

View File

@ -266,7 +266,8 @@ bool AirspyInput::handleMessage(const Message& message)
void AirspyInput::setCenterFrequency(quint64 freq_hz) void AirspyInput::setCenterFrequency(quint64 freq_hz)
{ {
freq_hz += (freq_hz * m_settings.m_LOppmTenths) / 10000000ULL; qint64 df = ((qint64)freq_hz * m_settings.m_LOppmTenths) / 10000000LL;
freq_hz += df;
airspy_error rc = (airspy_error) airspy_set_freq(m_dev, static_cast<uint32_t>(freq_hz)); airspy_error rc = (airspy_error) airspy_set_freq(m_dev, static_cast<uint32_t>(freq_hz));

View File

@ -227,7 +227,8 @@ bool HackRFInput::handleMessage(const Message& message)
void HackRFInput::setCenterFrequency(quint64 freq_hz) void HackRFInput::setCenterFrequency(quint64 freq_hz)
{ {
freq_hz += (freq_hz * m_settings.m_LOppmTenths) / 10000000ULL; qint64 df = ((qint64)freq_hz * m_settings.m_LOppmTenths) / 10000000LL;
freq_hz += df;
hackrf_error rc = (hackrf_error) hackrf_set_freq(m_dev, static_cast<uint64_t>(freq_hz)); hackrf_error rc = (hackrf_error) hackrf_set_freq(m_dev, static_cast<uint64_t>(freq_hz));