Auto rebuild and small fixes

pull/168/head
erikkaashoek 2 months ago
parent a34ae49a63
commit d039205b63

@ -70,8 +70,21 @@ endif
# or va.b-nnn-gxxxxxxx
# or ...
VERSION_FILE = version.txt
GIT_VERSION = $(strip $(shell git describe --tags --long --always --dirty 2>/dev/null))
ifeq ($(GIT_VERSION),)
GIT_VERSION = unknown
endif
FILE_VERSION = $(strip $(shell cat $(VERSION_FILE) 2>/dev/null))
ifneq ($(FILE_VERSION),$(GIT_VERSION))
$(shell printf '%s\n' '$(GIT_VERSION)' > $(VERSION_FILE))
endif
ifeq ($(VERSION),)
VERSION="$(PROJECT)_$(shell git describe --tags --long)"
VERSION="$(PROJECT)_$(GIT_VERSION)"
endif
##############################################################################
@ -296,6 +309,8 @@ RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
include $(RULESPATH)/rules.mk
#include $(CHIBIOS)/memory.mk
$(OBJS): $(VERSION_FILE)
ifeq ($(TARGET),F303)
clean:

@ -1835,7 +1835,7 @@ int plot_printf(char *str, int, const char *fmt, ...);
#define define_to_STR(x) STR1(x)
// sa_core.c
#define MIN_RSSI_VALUE ( -150 )
typedef uint8_t deviceRSSI_t;
typedef int16_t pureRSSI_t;
extern int current_index;

@ -71,7 +71,7 @@ freq_t frequency_step_x10 = 0;
uint16_t vbwSteps = 1;
freq_t minFreq = 0;
freq_t maxFreq = 520000000;
static float prev_output_level_dBm = -150; // cached output level to reduce redundant hardware writes
static float prev_output_level_dBm = MIN_RSSI_VALUE; // cached output level to reduce redundant hardware writes
int spur_gate = 100;
#ifdef __BANDS__
@ -710,7 +710,7 @@ void reset_settings(int m)
setting.trigger_mode = T_MID;
setting.fast_speedup = 0;
setting.faster_speedup = 0;
setting.trigger_level = -150.0;
setting.trigger_level = MIN_RSSI_VALUE;
#ifdef __TRIGGER_TRACE__
setting.trigger_trace = 255;
#endif
@ -930,7 +930,7 @@ void set_measurement(int m)
setting.stored[TRACE_STORED] = true;
if (m == M_LINEARITY) {
for (int j = 0; j < setting._sweep_points; j++)
stored_t[j] = -150;
stored_t[j] = MIN_RSSI_VALUE;
setting.linearity_step = 0;
setting.attenuate_x2 = 29*2;
setting.auto_attenuation = false;
@ -3418,7 +3418,7 @@ int avoid_spur(freq_t f) // find if this frequency should be a
static uint16_t max_index[MAX_MAX];
static uint16_t cur_max = 0;
float temppeakLevel = -150;
float temppeakLevel = MIN_RSSI_VALUE;
int16_t downslope = true;
int peak_finding_index;
float peak_finding_level;
@ -3672,7 +3672,7 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) /
set_calibration_freq(setting.refer);
update_rbw();
calculate_step_delay();
prev_output_level_dBm = -150; // clear cached level setting
prev_output_level_dBm = MIN_RSSI_VALUE; // clear cached level setting
// Initialize HW
scandirty = true; // This is the first pass with new settings
for (int t=0;t<TRACES_MAX;t++)
@ -4101,7 +4101,7 @@ modulation_again:
my_veryfast_delay(modulation_delay);
}
// -------------------------------- Acquisition loop for one requested frequency covering spur avoidance and vbwsteps ------------------------
pureRSSI_t RSSI = float_TO_PURE_RSSI(-150);
pureRSSI_t RSSI = float_TO_PURE_RSSI(MIN_RSSI_VALUE);
if (debug_avoid){ // For debugging the spur avoidance control
stored_t[i] = -90.0; // Display when to do spur shift in the stored trace
}
@ -5070,12 +5070,11 @@ void reset_band(void) {
static bool sweep(bool break_on_operation)
{
float RSSI;
// float local_peakLevel = -150.0;
// int local_peakIndex = 0;
// float local_peakLevel = MIN_RSSI_VALUE;
#ifdef __SI4432__
freq_t agc_peak_freq = 0;
float agc_peak_rssi = -150;
float agc_prev_rssi = -150;
float agc_peak_rssi = MIN_RSSI_VALUE;
float agc_prev_rssi = MIN_RSSI_VALUE;
int last_AGC_value = 0;
uint8_t last_AGC_direction_up = false;
int AGC_flip_count = 0;
@ -5274,7 +5273,7 @@ static bool sweep(bool break_on_operation)
agc_peak_rssi = agc_prev_rssi = local_rssi;
}
if (local_rssi < AGC_RSSI_THRESHOLD)
agc_prev_rssi = -150;
agc_prev_rssi = MIN_RSSI_VALUE;
freq_t delta_freq = current_freq - agc_peak_freq;
if (agc_peak_freq != 0 && delta_freq < 2000000) {
int max_gain = (-25 - agc_peak_rssi ) / 4;
@ -5356,7 +5355,7 @@ static bool sweep(bool break_on_operation)
m = temp_t[i];
real[i] = 0;
imag[i] = 0;
actual_t[i] = -150;
actual_t[i] = MIN_RSSI_VALUE;
}
for (int i=0;i<sweep_points;i++) {
real[i] = temp_t[i] - m;
@ -5427,7 +5426,7 @@ static bool sweep(bool break_on_operation)
imag[i] = 0;
real2[0] = 0.000000000001;
imag2[i] = 0;
actual_t[i] = -150;
actual_t[i] = MIN_RSSI_VALUE;
}
for (int i=0;i<sweep_points;i++) {
if (temp_t[i] > m+25)
@ -5612,8 +5611,8 @@ static volatile int dummy;
#endif
break;
#ifdef __QUASI_PEAK__
case AV_QUASI:
{ static float old_RSSI = -150.0;
case AV_QUASI:
{ static float old_RSSI = MIN_RSSI_VALUE;
if (setting.frequency_step == 0) {
if (i == 0) old_RSSI = trace_data[sweep_points-1];
@ -6489,7 +6488,7 @@ void determine_direct_test_freq(void) {
}
int old_ultra = config.ultra;
config.ultra = true;
float max_level = -150;
float max_level = MIN_RSSI_VALUE;
set_refer_output(0);
for (freq_t test_freq = test_start; test_freq < test_stop; test_freq += 30000000) {
dirty = true;

Loading…
Cancel
Save

Powered by TurnKey Linux.