Repaired marker bug

Removed_REF_marker
erikkaashoek 5 years ago
parent 4f9c9aad73
commit eda12805a1

@ -48,7 +48,7 @@
* @details Frequency of the system timer that drives the system ticks. This * @details Frequency of the system timer that drives the system ticks. This
* setting also defines the system tick time unit. * setting also defines the system tick time unit.
*/ */
#define CH_CFG_ST_FREQUENCY 10000 #define CH_CFG_ST_FREQUENCY 2000
/** /**
* @brief Time delta constant for the tick-less mode. * @brief Time delta constant for the tick-less mode.

@ -883,7 +883,7 @@ config_t config = {
.harmonic_freq_threshold = 300000000, .harmonic_freq_threshold = 300000000,
#endif #endif
.lcd_palette = LCD_DEFAULT_PALETTE, .lcd_palette = LCD_DEFAULT_PALETTE,
.vbat_offset = 500, .vbat_offset = 220,
#ifdef TINYSA4 #ifdef TINYSA4
.frequency_IF1 = DEFAULT_IF, .frequency_IF1 = DEFAULT_IF,
.frequency_IF2 = 0, .frequency_IF2 = 0,

@ -300,7 +300,7 @@ extern int32_t frequencyExtra;
void set_10mhz(uint32_t f); void set_10mhz(uint32_t f);
void set_modulation(int); void set_modulation(int);
void set_modulation_frequency(int); void set_modulation_frequency(int);
int search_maximum(int m, int center, int span); int search_maximum(int m, uint32_t center, int span);
//extern int setting.modulation; //extern int setting.modulation;
void set_measurement(int); void set_measurement(int);
// extern int settingSpeed; // extern int settingSpeed;

@ -1657,17 +1657,17 @@ void update_rbw(void) // calculate the actual_rbw and the vbwSteps (#
#define frequency_seatch_gate 60 // 120% of the RBW #define frequency_seatch_gate 60 // 120% of the RBW
int binary_search_frequency(int f) // Search which index in the frequency tabled matches with frequency f using actual_rbw int binary_search_frequency(uint32_t f) // Search which index in the frequency tabled matches with frequency f using actual_rbw
{ {
int L = 0; int L = 0;
int R = (sizeof frequencies)/sizeof(int) - 1; int R = (sizeof frequencies)/sizeof(int) - 1;
int fmin = f - actual_rbw_x10 * frequency_seatch_gate; uint32_t fmin = f - actual_rbw_x10 * frequency_seatch_gate;
int fplus = f + actual_rbw_x10 * frequency_seatch_gate; uint32_t fplus = f + actual_rbw_x10 * frequency_seatch_gate;
while (L <= R) { while (L <= R) {
int m = (L + R) / 2; int m = (L + R) / 2;
if ((int)frequencies[m] < fmin) if (frequencies[m] < fmin)
L = m + 1; L = m + 1;
else if ((int)frequencies[m] > fplus) else if (frequencies[m] > fplus)
R = m - 1; R = m - 1;
else else
return m; // index is m return m; // index is m
@ -1693,14 +1693,12 @@ void interpolate_maximum(int m)
#define MAX_MAX 4 #define MAX_MAX 4
int int
search_maximum(int m, int center, int span) search_maximum(int m, uint32_t center, int span)
{ {
center = binary_search_frequency(center); int center_index = binary_search_frequency(center);
if (center < 0) int from = center_index - span/2;
return false;
int from = center - span/2;
int found = false; int found = false;
int to = center + span/2; int to = center_index + span/2;
int cur_max = 0; // Always at least one maximum int cur_max = 0; // Always at least one maximum
int max_index[4]; int max_index[4];
if (from<0) if (from<0)

Loading…
Cancel
Save

Powered by TurnKey Linux.