1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 10:05:46 -05:00

HackRF: fixed bandwidth selection

This commit is contained in:
f4exb 2017-05-26 17:42:57 +02:00
parent 2ae702763b
commit 3b44a5367c
2 changed files with 3 additions and 3 deletions

View File

@ -296,7 +296,7 @@ bool HackRFOutput::applySettings(const HackRFOutputSettings& settings, bool forc
{
if (m_dev != 0)
{
uint32_t bw_index = hackrf_compute_baseband_filter_bw_round_down_lt(settings.m_bandwidth);
uint32_t bw_index = hackrf_compute_baseband_filter_bw_round_down_lt(settings.m_bandwidth + 1); // +1 so the round down to lower than yields desired bandwidth
rc = (hackrf_error) hackrf_set_baseband_filter_bandwidth(m_dev, bw_index);
if (rc != HACKRF_SUCCESS)

View File

@ -185,7 +185,7 @@ bool HackRFInput::handleMessage(const Message& message)
MsgConfigureHackRF& conf = (MsgConfigureHackRF&) message;
qDebug() << "HackRFInput::handleMessage: MsgConfigureHackRF";
bool success = applySettings(conf.getSettings(), false);
bool success = applySettings(conf.getSettings(), conf.getForce());
if (!success)
{
@ -373,7 +373,7 @@ bool HackRFInput::applySettings(const HackRFInputSettings& settings, bool force)
if (m_dev != 0)
{
uint32_t bw_index = hackrf_compute_baseband_filter_bw_round_down_lt(m_settings.m_bandwidth);
uint32_t bw_index = hackrf_compute_baseband_filter_bw_round_down_lt(m_settings.m_bandwidth + 1); // +1 so the round down to lower than yields desired bandwidth
rc = (hackrf_error) hackrf_set_baseband_filter_bandwidth(m_dev, bw_index);
if (rc != HACKRF_SUCCESS)