From 072803bab3dc3d804d62120a0982512142e6ae91 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Sun, 29 Mar 2020 19:05:43 +0200 Subject: [PATCH] Updated stepdelay's --- sa_core.c | 33 ++++++++++++++++++++------------- si4432.c | 2 +- ui_sa.c | 6 +++--- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/sa_core.c b/sa_core.c index f091dbe..d1fa976 100644 --- a/sa_core.c +++ b/sa_core.c @@ -470,8 +470,8 @@ void update_rbw(uint32_t delta_f) } //static int spur_old_stepdelay = 0; -static int spur_IF = 433900000; -static int spur_alternate_IF = 433700000; +static const int spur_IF = 433900000; +static const int spur_alternate_IF = 433700000; static const int spur_table[] = { 470000, @@ -545,14 +545,21 @@ float perform(bool break_on_operation, int i, int32_t f, int extraV) if (i == 0 && dirty) { if (settingStepDelay == 0){ - if (rbw < 10.0) - actualStepDelay = 2500; - else if (rbw <30.0) - actualStepDelay = 2000; - else if (rbw <100.0) - actualStepDelay = 1000; - else - actualStepDelay = 500; + if (MODE_LOW(settingMode)) { + if (rbw >300.0) actualStepDelay = 400; + else if (rbw >100.0) actualStepDelay = 500; + else if (rbw > 30.0) actualStepDelay = 900; + else if (rbw > 10.0) actualStepDelay = 900; + else if (rbw > 3.0) actualStepDelay = 1000; + else actualStepDelay = 1500; + } else { + if (rbw >300.0) actualStepDelay = 900; + else if (rbw >100.0) actualStepDelay = 900; + else if (rbw > 30.0) actualStepDelay = 900; + else if (rbw > 10.0) actualStepDelay = 1800; + else if (rbw > 3.0) actualStepDelay = 6000; + else actualStepDelay = 8000; + } } else actualStepDelay = settingStepDelay; @@ -766,9 +773,9 @@ void PeakSearch() } #endif -char *averageText[] = { "OFF", "MIN", "MAX", "2", "4", "8"}; -char *dBText[] = { "1dB/", "2dB/", "5dB/", "10dB/", "20dB/"}; -int refMHz[] = { 30, 15, 10, 4, 3, 2, 1 }; +const char *averageText[] = { "OFF", "MIN", "MAX", "2", "4", "8"}; +const char *dBText[] = { "1dB/", "2dB/", "5dB/", "10dB/", "20dB/"}; +const int refMHz[] = { 30, 15, 10, 4, 3, 2, 1 }; void draw_cal_status(void) { diff --git a/si4432.c b/si4432.c index cd42d04..89c0f3a 100644 --- a/si4432.c +++ b/si4432.c @@ -172,7 +172,7 @@ void SI4432_Receive(void) // User asks for an RBW of WISH, go through table finding the last triple // for which WISH is greater than the first entry, use those values, // Return the first entry of the following triple for the RBW actually achieved -static short RBW_choices[] = { // Each triple is: ndec, fils, WISH*10 +static const short RBW_choices[] = { // Each triple is: ndec, fils, WISH*10 0, 5,1,26, 5,2,28, 5,3,31, 5,4,32, 5,5,37, 5,6,42, 5,7, 45,4,1, 49,4,2, 54,4,3, 59,4,4, 61,4,5, 72,4,6, 82,4,7, 88,3,1, 95,3,2, 106,3,3, 115,3,4, 121,3,5, 142,3,6, 162,3,7, diff --git a/ui_sa.c b/ui_sa.c index a985769..52eccee 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -298,8 +298,8 @@ static void menu_modulation_cb(int item, uint8_t data) } -int menu_reffer_value[]={-1,0,1,2,3,4,5,6}; -char *menu_reffer_text[]={"OFF","30MHz","15MHz","10MHz","4MHz","3MHz","2MHz","1MHz"}; +const int menu_reffer_value[]={-1,0,1,2,3,4,5,6}; +const char *menu_reffer_text[]={"OFF","30MHz","15MHz","10MHz","4MHz","3MHz","2MHz","1MHz"}; static void menu_reffer_cb(int item, uint8_t data) { (void)data; @@ -384,7 +384,7 @@ static void menu_marker_type_cb(int item, uint8_t data) } -int rbwsel[]={0,3,10,30,100,300}; +const int rbwsel[]={0,3,10,30,100,300}; static void menu_rbw_cb(int item, uint8_t data) {