Merge optimizations and update modulation freq

Removed_REF_marker
erikkaashoek 5 years ago
parent bbe055e995
commit bd409ec577

@ -991,9 +991,9 @@ config_t config = {
.high_correction_frequency = { 240000000, 280000000, 300000000, 400000000, 500000000, 600000000, 700000000, 800000000, 900000000, 960000000 }, .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 }, .high_correction_value = { 0, 0, 0, 0, 0.0, 0, 0, 0, 0, 0 },
.setting_frequency_10mhz = 10000000, .setting_frequency_10mhz = 10000000,
.cor_am = -14, .cor_am = -8,
.cor_wfm = -17, .cor_wfm = -15,
.cor_nfm = -17, .cor_nfm = -15,
.ext_zero_level = 128, .ext_zero_level = 128,
#endif #endif
#ifdef TINYSA4 #ifdef TINYSA4

@ -1077,7 +1077,7 @@ typedef struct properties {
//sizeof(properties_t) == 0x1200 //sizeof(properties_t) == 0x1200
#define CONFIG_MAGIC 0x434f4e49 /* 'CONF' */ #define CONFIG_MAGIC 0x434f4e4A /* 'CONF' */
extern int16_t lastsaveid; extern int16_t lastsaveid;
//extern properties_t *active_props; //extern properties_t *active_props;

@ -35,7 +35,7 @@
#endif #endif
#endif #endif
// uint8_t dirty = true; // uint8_t dirty = true;
int scandirty = true; uint8_t scandirty = true;
setting_t setting; setting_t setting;
freq_t frequencies[POINTS_COUNT]; freq_t frequencies[POINTS_COUNT];
@ -565,7 +565,7 @@ void set_modulation(int m)
void set_modulation_frequency(int f) void set_modulation_frequency(int f)
{ {
if (50 <= f && f <= 6000) { if (50 <= f && f <= 7000) {
setting.modulation_frequency = f; setting.modulation_frequency = f;
dirty = true; dirty = true;
} }
@ -1074,7 +1074,7 @@ void set_unit(int u)
if (S_IS_AUTO(setting.lna)) if (S_IS_AUTO(setting.lna))
setting.lna = S_AUTO_OFF; setting.lna = S_AUTO_OFF;
} else { } else {
r = 10 * round((r*1.2)/10.0); r = 10 * roundf((r*1.2)/10.0);
set_reflevel(r); set_reflevel(r);
set_scale(10); set_scale(10);
if (S_IS_AUTO(setting.agc)) if (S_IS_AUTO(setting.agc))
@ -1303,7 +1303,8 @@ static void calculate_step_delay(void)
SI4432_step_delay = 0; SI4432_step_delay = 0;
} else { } else {
// Search index in table depend from RBW // Search index in table depend from RBW
volatile uint16_t i=0; uint16_t i=0;
for (i=0;i<ARRAY_COUNT(step_delay_table)-1;i++) for (i=0;i<ARRAY_COUNT(step_delay_table)-1;i++)
if (actual_rbw_x10 >= step_delay_table[i].rbw_x10) if (actual_rbw_x10 >= step_delay_table[i].rbw_x10)
break; break;

@ -1129,7 +1129,7 @@ void ADF4351_prep_frequency(int channel, unsigned long freq, int drive) // freq
MOD = (PFDRFout[channel] / OutputChannelSpacing) + 0.01; MOD = (PFDRFout[channel] / OutputChannelSpacing) + 0.01;
// MOD = 3125; // MOD = 3125;
FRACF = (((RFout * OutputDivider) / PFDRFout[channel]) - INTA) * MOD; FRACF = (((RFout * OutputDivider) / PFDRFout[channel]) - INTA) * MOD;
FRAC = round(FRACF); FRAC = roundf(FRACF);
while (FRAC > 4095 || MOD > 4095) { while (FRAC > 4095 || MOD > 4095) {
FRAC = FRAC >> 1; FRAC = FRAC >> 1;

28
ui.c

@ -1592,19 +1592,6 @@ menu_is_multiline(const char *label)
return n; 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 static void
draw_numeric_input(const char *buf) 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); 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) { if (buf[0] == 0 && kp_help_text != NULL) {
int lines = menu_is_multiline(kp_help_text); 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); 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__ #ifdef __VNA__
static void static void
menu_item_modify_attribute(const menuitem_t *menu, int item, menu_item_modify_attribute(const menuitem_t *menu, int item,

Loading…
Cancel
Save

Powered by TurnKey Linux.