diff --git a/main.c b/main.c index 0065daa..47e1d3b 100644 --- a/main.c +++ b/main.c @@ -991,9 +991,9 @@ config_t config = { .high_correction_frequency = { 240000000, 280000000, 300000000, 400000000, 500000000, 600000000, 700000000, 800000000, 900000000, 960000000 }, .high_correction_value = { 0, 0, 0, 0, 0.0, 0, 0, 0, 0, 0 }, .setting_frequency_10mhz = 10000000, - .cor_am = -14, - .cor_wfm = -17, - .cor_nfm = -17, + .cor_am = -8, + .cor_wfm = -15, + .cor_nfm = -15, .ext_zero_level = 128, #endif #ifdef TINYSA4 diff --git a/nanovna.h b/nanovna.h index e082c4d..02903e0 100644 --- a/nanovna.h +++ b/nanovna.h @@ -1077,7 +1077,7 @@ typedef struct properties { //sizeof(properties_t) == 0x1200 -#define CONFIG_MAGIC 0x434f4e49 /* 'CONF' */ +#define CONFIG_MAGIC 0x434f4e4A /* 'CONF' */ extern int16_t lastsaveid; //extern properties_t *active_props; diff --git a/sa_core.c b/sa_core.c index 52d7176..e8e723d 100644 --- a/sa_core.c +++ b/sa_core.c @@ -35,7 +35,7 @@ #endif #endif // uint8_t dirty = true; -int scandirty = true; +uint8_t scandirty = true; setting_t setting; freq_t frequencies[POINTS_COUNT]; @@ -565,7 +565,7 @@ void set_modulation(int m) void set_modulation_frequency(int f) { - if (50 <= f && f <= 6000) { + if (50 <= f && f <= 7000) { setting.modulation_frequency = f; dirty = true; } @@ -1074,7 +1074,7 @@ void set_unit(int u) if (S_IS_AUTO(setting.lna)) setting.lna = S_AUTO_OFF; } else { - r = 10 * round((r*1.2)/10.0); + r = 10 * roundf((r*1.2)/10.0); set_reflevel(r); set_scale(10); if (S_IS_AUTO(setting.agc)) @@ -1303,7 +1303,8 @@ static void calculate_step_delay(void) SI4432_step_delay = 0; } else { // Search index in table depend from RBW - volatile uint16_t i=0; + uint16_t i=0; + for (i=0;i= step_delay_table[i].rbw_x10) break; diff --git a/si4432.c b/si4432.c index b645193..fe817b6 100644 --- a/si4432.c +++ b/si4432.c @@ -1129,7 +1129,7 @@ void ADF4351_prep_frequency(int channel, unsigned long freq, int drive) // freq MOD = (PFDRFout[channel] / OutputChannelSpacing) + 0.01; // MOD = 3125; FRACF = (((RFout * OutputDivider) / PFDRFout[channel]) - INTA) * MOD; - FRAC = round(FRACF); + FRAC = roundf(FRACF); while (FRAC > 4095 || MOD > 4095) { FRAC = FRAC >> 1; diff --git a/ui.c b/ui.c index 242601f..31b06d5 100644 --- a/ui.c +++ b/ui.c @@ -1592,19 +1592,6 @@ menu_is_multiline(const char *label) return n; } -static void -draw_numeric_area_frame(void) -{ - ili9341_set_foreground(LCD_INPUT_TEXT_COLOR); - ili9341_set_background(LCD_INPUT_BG_COLOR); - - ili9341_fill(0, LCD_HEIGHT-NUM_INPUT_HEIGHT, LCD_WIDTH, NUM_INPUT_HEIGHT); - char *name = keypads_mode_tbl[keypad_mode].name; - int lines = menu_is_multiline(name); - ili9341_drawstring_7x13(name, 10, LCD_HEIGHT-NUM_INPUT_HEIGHT + (NUM_INPUT_HEIGHT-lines*bFONT_STR_HEIGHT)/2); - //ili9341_drawfont(KP_KEYPAD, 300, 216); -} - static void draw_numeric_input(const char *buf) { @@ -1634,10 +1621,25 @@ draw_numeric_input(const char *buf) ili9341_fill(x, LCD_HEIGHT-NUM_INPUT_HEIGHT+4, LCD_WIDTH-x-1, NUM_FONT_GET_WIDTH+2+8); if (buf[0] == 0 && kp_help_text != NULL) { int lines = menu_is_multiline(kp_help_text); + ili9341_set_foreground(LCD_INPUT_TEXT_COLOR); ili9341_drawstring_7x13(kp_help_text, 64+NUM_FONT_GET_WIDTH+2, LCD_HEIGHT-(lines*bFONT_GET_HEIGHT+NUM_INPUT_HEIGHT)/2); } } +static void +draw_numeric_area_frame(void) +{ + ili9341_set_foreground(LCD_INPUT_TEXT_COLOR); + ili9341_set_background(LCD_INPUT_BG_COLOR); + + ili9341_fill(0, LCD_HEIGHT-NUM_INPUT_HEIGHT, LCD_WIDTH, NUM_INPUT_HEIGHT); + char *name = keypads_mode_tbl[keypad_mode].name; + int lines = menu_is_multiline(name); + ili9341_drawstring_7x13(name, 10, LCD_HEIGHT-NUM_INPUT_HEIGHT + (NUM_INPUT_HEIGHT-lines*bFONT_STR_HEIGHT)/2); + //ili9341_drawfont(KP_KEYPAD, 300, 216); + draw_numeric_input(""); +} + #ifdef __VNA__ static void menu_item_modify_attribute(const menuitem_t *menu, int item,