mirror of
https://github.com/greatscottgadgets/hackrf.git
synced 2026-03-11 09:54:43 +01:00
Don't commit to table-based tuning for non-praline
This commit is contained in:
@@ -212,7 +212,7 @@ radio_error_t radio_set_frequency(
|
||||
case TRANSCEIVER_MODE_RX_SWEEP:
|
||||
case TRANSCEIVER_MODE_TX:
|
||||
// TODO return if, of components so we can support them in the getter
|
||||
real_hz = tuning_set_frequency(max283x_tune_config, frequency.hz);
|
||||
real_hz = set_freq(frequency.hz);
|
||||
break;
|
||||
default:
|
||||
return RADIO_ERR_INVALID_CONFIG;
|
||||
|
||||
@@ -22,16 +22,13 @@
|
||||
#ifndef __TUNE_CONFIG_H__
|
||||
#define __TUNE_CONFIG_H__
|
||||
|
||||
#ifdef PRALINE
|
||||
typedef struct {
|
||||
uint16_t rf_range_end_mhz;
|
||||
uint16_t if_mhz;
|
||||
bool high_lo;
|
||||
} tune_config_t;
|
||||
|
||||
#ifndef PRALINE
|
||||
// TODO maybe one day?
|
||||
static const tune_config_t max283x_tune_config[] = {};
|
||||
#else
|
||||
// clang-format off
|
||||
/* tuning table optimized for TX */
|
||||
static const tune_config_t max2831_tune_config_tx[] = {
|
||||
|
||||
@@ -143,22 +143,7 @@ bool set_freq(const uint64_t freq)
|
||||
return success;
|
||||
}
|
||||
|
||||
uint64_t tuning_set_frequency(const tune_config_t* config, const uint64_t frequency_hz)
|
||||
{
|
||||
(void) config;
|
||||
|
||||
bool result = set_freq(frequency_hz);
|
||||
if (!result) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return frequency_hz;
|
||||
}
|
||||
#else
|
||||
bool set_freq(const uint64_t freq)
|
||||
{
|
||||
return tuning_set_frequency(max2831_tune_config_rx_sweep, freq) != 0;
|
||||
}
|
||||
|
||||
uint64_t tuning_set_frequency(const tune_config_t* cfg, const uint64_t freq)
|
||||
{
|
||||
|
||||
@@ -30,12 +30,14 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
bool set_freq(const uint64_t freq); // TODO deprecate
|
||||
bool set_freq(const uint64_t freq);
|
||||
bool set_freq_explicit(
|
||||
const uint64_t if_freq_hz,
|
||||
const uint64_t lo_freq_hz,
|
||||
const rf_path_filter_t path);
|
||||
|
||||
#ifdef PRALINE
|
||||
uint64_t tuning_set_frequency(const tune_config_t* config, const uint64_t frequency_hz);
|
||||
#endif
|
||||
|
||||
#endif /*__TUNING_H__*/
|
||||
|
||||
Reference in New Issue
Block a user