Reduce warnings

Removed_REF_marker
erikkaashoek 5 years ago
parent 465b7111a4
commit ea384b4313

@ -58,9 +58,9 @@
#define HIGH_MAX_FREQ_MHZ 960 #define HIGH_MAX_FREQ_MHZ 960
#endif #endif
#ifdef TINYSA4 #ifdef TINYSA4
#define DEFAULT_IF 978000000 #define DEFAULT_IF ((uint32_t)978000000)
#define DEFAULT_SPUR_IF 979000000 #define DEFAULT_SPUR_IF ((uint32_t)979000000)
#define DEFAULT_MAX_FREQ 800000000 #define DEFAULT_MAX_FREQ ((uint32_t)800000000)
#define HIGH_MIN_FREQ_MHZ 850 #define HIGH_MIN_FREQ_MHZ 850
#define HIGH_MAX_FREQ_MHZ 1150 #define HIGH_MAX_FREQ_MHZ 1150
#endif #endif
@ -1085,11 +1085,17 @@ enum {
// -------------------- Si4432.c --------------- // -------------------- Si4432.c ---------------
void set_calibration_freq(int ref);
uint16_t set_rbw(uint16_t WISH);
uint16_t force_rbw(int f);
#ifdef __SI4463__ #ifdef __SI4463__
extern int SI4463_R; extern int SI4463_R;
void Si4463_set_refer(int ref); void SI4463_set_freq(uint32_t freq);
void SI446x_set_AGC_LNA(uint8_t v); void SI446x_set_AGC_LNA(uint8_t v);
void SI4463_set_gpio(int i, int s); void SI4463_set_gpio(int i, int s);
void SI4463_set_output_level(int t);
#define GPIO_HIGH 3 #define GPIO_HIGH 3
#define GPIO_LOW 2 #define GPIO_LOW 2
void SI4463_start_tx(uint8_t CHANNEL); void SI4463_start_tx(uint8_t CHANNEL);

@ -272,8 +272,8 @@ VNA_SHELL_FUNCTION(cmd_if)
shell_printf("usage: if {433M..435M}\r\n"); shell_printf("usage: if {433M..435M}\r\n");
return; return;
} else { } else {
int a = my_atoi(argv[0]); uint32_t a = (uint32_t)my_atoi(argv[0]);
if (a!= 0 &&( a < (DEFAULT_IF - 2000000) || a>(DEFAULT_IF + 2000000))) if (a!= 0 &&( a < (DEFAULT_IF - (uint32_t)2000000) || a>(DEFAULT_IF + (uint32_t)2000000)))
goto usage; goto usage;
setting.auto_IF = false; setting.auto_IF = false;
set_IF(a); set_IF(a);
@ -325,13 +325,13 @@ VNA_SHELL_FUNCTION(cmd_v)
VNA_SHELL_FUNCTION(cmd_y) VNA_SHELL_FUNCTION(cmd_y)
{ {
int rvalue; int rvalue;
int lvalue = 0;
if (argc != 1 && argc != 2) { if (argc != 1 && argc != 2) {
shell_printf("usage: y {addr(0-95)} [value(0-0xFF)]\r\n"); shell_printf("usage: y {addr(0-95)} [value(0-0xFF)]\r\n");
return; return;
} }
rvalue = my_atoui(argv[0]); rvalue = my_atoui(argv[0]);
#ifdef __SI4432__ #ifdef __SI4432__
int lvalue = 0;
SI4432_Sel = VFO; SI4432_Sel = VFO;
if (argc == 2){ if (argc == 2){
lvalue = my_atoui(argv[1]); lvalue = my_atoui(argv[1]);

@ -1756,8 +1756,8 @@ pureRSSI_t perform(bool break_on_operation, int i, uint32_t f, int tracking)
modulation_delay += config.cor_nfm; // -17 default modulation_delay += config.cor_nfm; // -17 default
// modulation_index = 0; // default value // modulation_index = 0; // default value
} }
if ((setting.mode == M_GENLOW && f > 480000000 - DEFAULT_IF) || if ((setting.mode == M_GENLOW && f > ((uint32_t)480000000) - DEFAULT_IF) ||
(setting.mode == M_GENHIGH && f > 480000000) ) (setting.mode == M_GENHIGH && f > ((uint32_t)480000000) ) )
modulation_index += 2; modulation_index += 2;
current_fm_modulation = (int *)fm_modulation[modulation_index]; current_fm_modulation = (int *)fm_modulation[modulation_index];
f -= fm_modulation_offset[modulation_index]; // Shift output frequency f -= fm_modulation_offset[modulation_index]; // Shift output frequency
@ -1815,13 +1815,14 @@ modulation_again:
if (/* MODE_INPUT(setting.mode) && */ i > 0 && FREQ_IS_CW()) // In input mode in zero span mode after first setting of the LO's if (/* MODE_INPUT(setting.mode) && */ i > 0 && FREQ_IS_CW()) // In input mode in zero span mode after first setting of the LO's
goto skip_LO_setting; // No more LO changes required, save some time and jump over the code goto skip_LO_setting; // No more LO changes required, save some time and jump over the code
int32_t local_IF; uint32_t local_IF;
again: // Spur reduction jumps to here for second measurement again: // Spur reduction jumps to here for second measurement
if (MODE_HIGH(setting.mode)) local_IF=0; // to get rid of warning
if (MODE_HIGH(setting.mode)) {
local_IF = 0; local_IF = 0;
else if (MODE_LOW(setting.mode)){ // All low mode } else if (MODE_LOW(setting.mode)){ // All low mode
if (!setting.auto_IF) { if (!setting.auto_IF) {
local_IF = setting.frequency_IF; local_IF = setting.frequency_IF;
} }
@ -1897,7 +1898,7 @@ modulation_again:
if (setting.mode == M_LOW && !setting.tracking && S_STATE(setting.below_IF)) // if in low input mode and below IF if (setting.mode == M_LOW && !setting.tracking && S_STATE(setting.below_IF)) // if in low input mode and below IF
target_f = local_IF-lf; // set LO SI4432 to below IF frequency target_f = local_IF-lf; // set LO SI4432 to below IF frequency
else else
target_f = local_IF+lf; // otherwise to above IF target_f = local_IF+lf; // otherwise to above IF, local_IF == 0 in high mode
#ifdef __SI4432__ #ifdef __SI4432__
set_freq (SI4432_LO, target_f); // otherwise to above IF set_freq (SI4432_LO, target_f); // otherwise to above IF
#endif #endif
@ -1918,7 +1919,7 @@ modulation_again:
ADF4351_R_counter(1); ADF4351_R_counter(1);
} }
#endif #endif
#if 0
uint32_t target_f; uint32_t target_f;
if (!setting.tracking && S_STATE(setting.below_IF)) { // if in low input mode and below IF if (!setting.tracking && S_STATE(setting.below_IF)) { // if in low input mode and below IF
if (lf > local_IF + 138000000) if (lf > local_IF + 138000000)
@ -1927,6 +1928,7 @@ modulation_again:
target_f = local_IF-lf; // set LO SI4432 to below IF frequency target_f = local_IF-lf; // set LO SI4432 to below IF frequency
} else } else
target_f = local_IF+lf; // otherwise to above IF target_f = local_IF+lf; // otherwise to above IF
#endif
set_freq(ADF4351_LO, target_f); set_freq(ADF4351_LO, target_f);
#if 1 // Compensate frequency ADF4350 error with SI4468 #if 1 // Compensate frequency ADF4350 error with SI4468
int32_t error_f = 0; int32_t error_f = 0;
@ -1941,9 +1943,7 @@ modulation_again:
local_IF += error_f; local_IF += error_f;
} }
#endif #endif
if (!tracking) } else if (MODE_HIGH(setting.mode)) {
set_freq (SI4463_RX, local_IF); // compensate ADF error with SI446x when not in tracking mode
} else if (setting.mode == M_HIGH || setting.mode == M_GENHIGH) {
set_freq (SI4463_RX, lf); // sweep RX, local_IF = 0 in high mode set_freq (SI4463_RX, lf); // sweep RX, local_IF = 0 in high mode
} }
// STOP_PROFILE; // STOP_PROFILE;
@ -1952,10 +1952,13 @@ modulation_again:
// ----------- Set IF ------------------ // ----------- Set IF ------------------
if (local_IF != 0) if (local_IF != 0) // When not in one of the high modes
{ {
#ifdef __SI4432__ #ifdef __SI4432__
set_freq (SI4432_RX , local_IF); set_freq (SI4432_RX , local_IF);
#endif
#ifdef __SI4463__
set_freq (SI4463_RX, local_IF); // including compensating ADF error with SI446x when not in tracking mode
#endif #endif
} }
@ -2095,13 +2098,14 @@ static bool sweep(bool break_on_operation)
{ {
float RSSI; float RSSI;
int16_t downslope; int16_t downslope;
#ifdef __SI4432__
uint32_t agc_peak_freq = 0; uint32_t agc_peak_freq = 0;
float agc_peak_rssi = -150; float agc_peak_rssi = -150;
float agc_prev_rssi = -150; float agc_prev_rssi = -150;
int last_AGC_value = 0; int last_AGC_value = 0;
uint8_t last_AGC_direction_up = false; uint8_t last_AGC_direction_up = false;
int AGC_flip_count = 0; int AGC_flip_count = 0;
#endif
// if (setting.mode== -1) // if (setting.mode== -1)
// return; // return;
// START_PROFILE; // START_PROFILE;
@ -3683,7 +3687,7 @@ void self_test(int test)
setting.frequency_step = 30000; setting.frequency_step = 30000;
if (setting.test_argument > 0) if (setting.test_argument > 0)
setting.frequency_step=setting.test_argument; setting.frequency_step=setting.test_argument;
int f = 400000; // Start search at 400kHz uint32_t f = 400000; // Start search at 400kHz
// int i = 0; // Index in spur table (temp_t) // int i = 0; // Index in spur table (temp_t)
set_RBW(setting.frequency_step/100); set_RBW(setting.frequency_step/100);
last_spur = 0; last_spur = 0;

@ -54,7 +54,7 @@ static uint32_t new_port_moder;
#define CS_SI0_HIGH palSetPad(GPIOB, GPIOB_RX_SEL) #define CS_SI0_HIGH palSetPad(GPIOB, GPIOB_RX_SEL)
#define CS_SI1_HIGH palSetPad(GPIOB, GPIOB_LO_SEL) #define CS_SI1_HIGH palSetPad(GPIOB, GPIOB_LO_SEL)
#define CS_PE_HIGH palSetPad(GPIOA, GPIOA_PE_SEL) //#define CS_PE_HIGH palSetPad(GPIOA, GPIOA_PE_SEL)
#define RF_POWER_HIGH palSetPad(GPIOB, GPIOB_RF_PWR) #define RF_POWER_HIGH palSetPad(GPIOB, GPIOB_RF_PWR)
//#define SPI2_CLK_HIGH palSetPad(GPIOB, GPIO_SPI2_CLK) //#define SPI2_CLK_HIGH palSetPad(GPIOB, GPIO_SPI2_CLK)
@ -62,7 +62,7 @@ static uint32_t new_port_moder;
#define CS_SI0_LOW palClearPad(GPIOB, GPIOB_RX_SEL) #define CS_SI0_LOW palClearPad(GPIOB, GPIOB_RX_SEL)
#define CS_SI1_LOW palClearPad(GPIOB, GPIOB_LO_SEL) #define CS_SI1_LOW palClearPad(GPIOB, GPIOB_LO_SEL)
#define CS_PE_LOW palClearPad(GPIOA, GPIOA_PE_SEL) //#define CS_PE_LOW palClearPad(GPIOA, GPIOA_PE_SEL)
#define SPI1_CLK_HIGH palSetPad(GPIOB, GPIOB_SPI_SCLK) #define SPI1_CLK_HIGH palSetPad(GPIOB, GPIOB_SPI_SCLK)
#define SPI1_CLK_LOW palClearPad(GPIOB, GPIOB_SPI_SCLK) #define SPI1_CLK_LOW palClearPad(GPIOB, GPIOB_SPI_SCLK)
@ -1121,6 +1121,13 @@ uint32_t ADF4351_prep_frequency(int channel, unsigned long freq, int drive) //
// Serial.println( "MOD/FRAC reduced"); // Serial.println( "MOD/FRAC reduced");
} }
#endif #endif
uint32_t reduce = gcd(MOD, FRAC);
if (reduce) {
FRAC /= reduce;
MOD /= reduce;
if (MOD == 1)
MOD=2;
}
uint32_t actual_freq = PFDR *(INTA * MOD +FRAC)/OutputDivider / MOD; uint32_t actual_freq = PFDR *(INTA * MOD +FRAC)/OutputDivider / MOD;
volatile int max_delta = 1000000 * PFDRFout[channel]/OutputDivider/MOD; volatile int max_delta = 1000000 * PFDRFout[channel]/OutputDivider/MOD;
if (actual_freq < freq - max_delta || actual_freq > freq + max_delta ){ if (actual_freq < freq - max_delta || actual_freq > freq + max_delta ){
@ -1174,8 +1181,8 @@ uint32_t ADF4351_prep_frequency(int channel, unsigned long freq, int drive) //
int SI4463_frequency_changed = false; int SI4463_frequency_changed = false;
static int SI4463_band = -1; static int SI4463_band = -1;
static int64_t SI4463_outdiv = -1; static int64_t SI4463_outdiv = -1;
static uint32_t SI4463_prev_freq = 0; //static uint32_t SI4463_prev_freq = 0;
static float SI4463_step_size = 100; // Will be recalculated once used //static float SI4463_step_size = 100; // Will be recalculated once used
static uint8_t SI4463_channel = 0; static uint8_t SI4463_channel = 0;
static uint8_t SI4463_in_tx_mode = false; static uint8_t SI4463_in_tx_mode = false;
int SI4463_R = 5; int SI4463_R = 5;
@ -1307,6 +1314,7 @@ void SI4463_do_api(void* data, uint8_t len, void* out, uint8_t outLen)
} }
} }
#ifdef notused
static void SI4463_set_properties(uint16_t prop, void* values, uint8_t len) static void SI4463_set_properties(uint16_t prop, void* values, uint8_t len)
{ {
// len must not be greater than 12 // len must not be greater than 12
@ -1323,6 +1331,7 @@ static void SI4463_set_properties(uint16_t prop, void* values, uint8_t len)
SI4463_do_api(data, len + 4, NULL, 0); SI4463_do_api(data, len + 4, NULL, 0);
} }
#endif
#include "SI446x_cmd.h" #include "SI446x_cmd.h"
@ -1332,7 +1341,7 @@ static const uint8_t SI4463_config[] = RADIO_CONFIGURATION_DATA_ARRAY;
#endif #endif
#ifdef __SI4468__ #ifdef __SI4468__
#undef RADIO_CONFIG_H_ #include "radio_config_Si4468_undef.h"
#undef RADIO_CONFIGURATION_DATA_ARRAY #undef RADIO_CONFIGURATION_DATA_ARRAY
#include "radio_config_Si4468_default.h" #include "radio_config_Si4468_default.h"
@ -1344,6 +1353,7 @@ static const uint8_t SI4463_config[] = RADIO_CONFIGURATION_DATA_ARRAY;
//#undef RF_MODEM_AGC_CONTROL_1 //#undef RF_MODEM_AGC_CONTROL_1
//#define RF_MODEM_AGC_CONTROL_1 0x11, 0x20, 0x01, 0x35, 0x92 // Override AGC gain increase //#define RF_MODEM_AGC_CONTROL_1 0x11, 0x20, 0x01, 0x35, 0x92 // Override AGC gain increase
#undef RF_MODEM_AGC_CONTROL_1
#define RF_MODEM_AGC_CONTROL_1 0x11, 0x20, 0x01, 0x35, 0xE0 + 0x10 + 0x08 // slow AGC #define RF_MODEM_AGC_CONTROL_1 0x11, 0x20, 0x01, 0x35, 0xE0 + 0x10 + 0x08 // slow AGC
//#undef RF_MODEM_RSSI_JUMP_THRESH_4 //#undef RF_MODEM_RSSI_JUMP_THRESH_4
//#define RF_MODEM_RSSI_JUMP_THRESH_4 0x11, 0x20, 0x04, 0x4B, 0x06, 0x09, 0x10, 0x45 // Increase RSSI reported value with 2.5dB //#define RF_MODEM_RSSI_JUMP_THRESH_4 0x11, 0x20, 0x04, 0x4B, 0x06, 0x09, 0x10, 0x45 // Increase RSSI reported value with 2.5dB
@ -1409,7 +1419,7 @@ void SI4463_set_output_level(int t)
} }
void SI4463_start_tx(uint8_t CHANNEL) void SI4463_start_tx(uint8_t CHANNEL)
{ {
volatile si446x_state_t s; // volatile si446x_state_t s;
#if 0 #if 0
s = SI4463_get_state(); s = SI4463_get_state();
if (s == SI446X_STATE_RX){ if (s == SI446X_STATE_RX){
@ -1444,7 +1454,7 @@ void SI4463_start_tx(uint8_t CHANNEL)
SI4463_do_api(data, sizeof(data), NULL, 0); SI4463_do_api(data, sizeof(data), NULL, 0);
} }
#endif #endif
retry: // retry:
{ {
uint8_t data[] = uint8_t data[] =
{ {
@ -1498,7 +1508,7 @@ void SI4463_start_rx(uint8_t CHANNEL)
0,// SI446X_CMD_START_RX_ARG_NEXT_STATE2_RXVALID_STATE_ENUM_RX, 0,// SI446X_CMD_START_RX_ARG_NEXT_STATE2_RXVALID_STATE_ENUM_RX,
0, //SI446X_CMD_START_RX_ARG_NEXT_STATE3_RXINVALID_STATE_ENUM_RX 0, //SI446X_CMD_START_RX_ARG_NEXT_STATE3_RXINVALID_STATE_ENUM_RX
}; };
retry: //retry:
SI4463_do_api(data, sizeof(data), NULL, 0); SI4463_do_api(data, sizeof(data), NULL, 0);
#if 0 #if 0
@ -1518,12 +1528,11 @@ void SI4463_short_start_rx(void)
uint8_t data[] = { uint8_t data[] = {
SI446X_CMD_ID_START_RX, SI446X_CMD_ID_START_RX,
}; };
retry:
SI4463_do_api(data, sizeof(data), NULL, 0); SI4463_do_api(data, sizeof(data), NULL, 0);
SI4463_in_tx_mode = false; SI4463_in_tx_mode = false;
} }
void SI4463_clear_int_status() void SI4463_clear_int_status(void)
{ {
uint8_t data[9] = { uint8_t data[9] = {
SI446X_CMD_ID_GET_INT_STATUS SI446X_CMD_ID_GET_INT_STATUS
@ -1584,7 +1593,7 @@ void Si446x_getInfo(si446x_info_t* info)
info->patch = (data[3]<<8) | data[4]; info->patch = (data[3]<<8) | data[4];
info->func = data[5]; info->func = data[5];
} }
#ifdef notused
static uint8_t SI4463_get_device_status(void) static uint8_t SI4463_get_device_status(void)
{ {
uint8_t data[2] = uint8_t data[2] =
@ -1594,7 +1603,7 @@ static uint8_t SI4463_get_device_status(void)
SI4463_do_api(data, 1, data, SI446X_CMD_REPLY_COUNT_REQUEST_DEVICE_STATE); SI4463_do_api(data, 1, data, SI446X_CMD_REPLY_COUNT_REQUEST_DEVICE_STATE);
return(data[0]); return(data[0]);
} }
#endif
// Read a fast response register // Read a fast response register
@ -1666,7 +1675,7 @@ void set_RSSI_comp(void)
int16_t Si446x_RSSI(void) int16_t Si446x_RSSI(void)
{ {
volatile uint8_t data[3] = { uint8_t data[3] = {
SI446X_CMD_GET_MODEM_STATUS, SI446X_CMD_GET_MODEM_STATUS,
0xFF 0xFF
}; };
@ -1737,7 +1746,7 @@ void SI446x_set_AGC_LNA(uint8_t v)
} }
#ifdef notused
// Do an ADC conversion // Do an ADC conversion
static uint16_t getADC(uint8_t adc_en, uint8_t adc_cfg, uint8_t part) static uint16_t getADC(uint8_t adc_en, uint8_t adc_cfg, uint8_t part)
{ {
@ -1749,6 +1758,7 @@ static uint16_t getADC(uint8_t adc_en, uint8_t adc_cfg, uint8_t part)
SI4463_do_api(data, 3, data, 6); SI4463_do_api(data, 3, data, 6);
return (data[part]<<8 | data[part + 1]); return (data[part]<<8 | data[part + 1]);
} }
#endif
#ifndef __SI4468__ #ifndef __SI4468__
// -------------- 0.2 kHz ---------------------------- // -------------- 0.2 kHz ----------------------------
@ -1933,7 +1943,7 @@ uint8_t SI4463_RBW_850kHz[] =
#else #else
// -------------- 0.2 kHz ---------------------------- // -------------- 0.2 kHz ----------------------------
#undef RADIO_CONFIG_H_ #include "radio_config_Si4468_undef.h"
#include "radio_config_Si4468_200Hz.h" #include "radio_config_Si4468_200Hz.h"
#include "radio_config_Si4468_short.h" #include "radio_config_Si4468_short.h"
@ -1942,7 +1952,7 @@ static const uint8_t SI4463_RBW_02kHz[] =
// -------------- 1kHz ---------------------------- // -------------- 1kHz ----------------------------
#undef RADIO_CONFIG_H_ #include "radio_config_Si4468_undef.h"
#include "radio_config_Si4468_1kHz.h" #include "radio_config_Si4468_1kHz.h"
#include "radio_config_Si4468_short.h" #include "radio_config_Si4468_short.h"
@ -1950,7 +1960,7 @@ static const uint8_t SI4463_RBW_1kHz[] =
RADIO_CONFIGURATION_DATA_ARRAY; RADIO_CONFIGURATION_DATA_ARRAY;
// -------------- 3 kHz ---------------------------- // -------------- 3 kHz ----------------------------
#undef RADIO_CONFIG_H_ #include "radio_config_Si4468_undef.h"
#include "radio_config_Si4468_3kHz.h" #include "radio_config_Si4468_3kHz.h"
#include "radio_config_Si4468_short.h" #include "radio_config_Si4468_short.h"
@ -1958,7 +1968,7 @@ static const uint8_t SI4463_RBW_3kHz[] =
RADIO_CONFIGURATION_DATA_ARRAY; RADIO_CONFIGURATION_DATA_ARRAY;
// -------------- 10 kHz ---------------------------- // -------------- 10 kHz ----------------------------
#undef RADIO_CONFIG_H_ #include "radio_config_Si4468_undef.h"
#include "radio_config_Si4468_10kHz.h" #include "radio_config_Si4468_10kHz.h"
#include "radio_config_Si4468_short.h" #include "radio_config_Si4468_short.h"
@ -1966,7 +1976,7 @@ static const uint8_t SI4463_RBW_10kHz[] =
RADIO_CONFIGURATION_DATA_ARRAY; RADIO_CONFIGURATION_DATA_ARRAY;
// -------------- 30 kHz ---------------------------- // -------------- 30 kHz ----------------------------
#undef RADIO_CONFIG_H_ #include "radio_config_Si4468_undef.h"
#include "radio_config_Si4468_30kHz.h" #include "radio_config_Si4468_30kHz.h"
#include "radio_config_Si4468_short.h" #include "radio_config_Si4468_short.h"
@ -1974,7 +1984,7 @@ static const uint8_t SI4463_RBW_30kHz[] =
RADIO_CONFIGURATION_DATA_ARRAY; RADIO_CONFIGURATION_DATA_ARRAY;
// -------------- 100kHz ---------------------------- // -------------- 100kHz ----------------------------
#undef RADIO_CONFIG_H_ #include "radio_config_Si4468_undef.h"
#include "radio_config_Si4468_100kHz.h" #include "radio_config_Si4468_100kHz.h"
#include "radio_config_Si4468_short.h" #include "radio_config_Si4468_short.h"
@ -1983,7 +1993,7 @@ static const uint8_t SI4463_RBW_100kHz[] =
// -------------- 300kHz ---------------------------- // -------------- 300kHz ----------------------------
#undef RADIO_CONFIG_H_ #include "radio_config_Si4468_undef.h"
#include "radio_config_Si4468_300kHz.h" #include "radio_config_Si4468_300kHz.h"
#include "radio_config_Si4468_short.h" #include "radio_config_Si4468_short.h"
@ -1992,7 +2002,7 @@ static const uint8_t SI4463_RBW_300kHz[] =
// -------------- 850kHz ---------------------------- // -------------- 850kHz ----------------------------
#undef RADIO_CONFIG_H_ #include "radio_config_Si4468_undef.h"
#include "radio_config_Si4468_850kHz.h" #include "radio_config_Si4468_850kHz.h"
#include "radio_config_Si4468_short.h" #include "radio_config_Si4468_short.h"
@ -2005,7 +2015,7 @@ static const uint8_t SI4463_RBW_850kHz[] =
// Return the first entry of the following triple for the RBW actually achieved // Return the first entry of the following triple for the RBW actually achieved
#define IF_BW(dwn3, ndec, filset) (((dwn3)<<7)|((ndec)<<4)|(filset)) #define IF_BW(dwn3, ndec, filset) (((dwn3)<<7)|((ndec)<<4)|(filset))
typedef struct { typedef struct {
uint8_t *reg; // IF_BW(dwn3, ndec, filset) const uint8_t *reg; // IF_BW(dwn3, ndec, filset)
int16_t RSSI_correction_x_10; // Correction * 10 int16_t RSSI_correction_x_10; // Correction * 10
int16_t RBWx10; // RBW in kHz int16_t RBWx10; // RBW in kHz
}RBW_t; // sizeof(RBW_t) = 8 bytes }RBW_t; // sizeof(RBW_t) = 8 bytes
@ -2034,7 +2044,7 @@ uint16_t force_rbw(int f)
if (SI4463_in_tx_mode) if (SI4463_in_tx_mode)
return(0); return(0);
SI4463_set_state(SI446X_STATE_READY); SI4463_set_state(SI446X_STATE_READY);
uint8_t *config = RBW_choices[f].reg; const uint8_t *config = RBW_choices[f].reg;
uint16_t i=0; uint16_t i=0;
while(config[i] != 0) while(config[i] != 0)
{ {
@ -2204,7 +2214,7 @@ void SI4463_set_freq(uint32_t freq)
void SI4463_init_rx(void) void SI4463_init_rx(void)
{ {
reset: // reset:
SI_SDN_LOW; SI_SDN_LOW;
my_microsecond_delay(100); my_microsecond_delay(100);
SI_SDN_HIGH; SI_SDN_HIGH;
@ -2241,7 +2251,7 @@ again:
#if 0 #if 0
#undef RADIO_CONFIG_H_ #include "radio_config_Si4468_undef.h"
#include "radio_config_Si4468_tx.h" #include "radio_config_Si4468_tx.h"
static const uint8_t SI4463_config_tx[] = static const uint8_t SI4463_config_tx[] =

Loading…
Cancel
Save

Powered by TurnKey Linux.