UI improvements

Removed_REF_marker
erikkaashoek 5 years ago
parent dd5ca921ea
commit cb2fe5403b

@ -171,6 +171,28 @@ caldata_save(uint16_t id)
return 0;
}
setting_t *
caldata_pointer(uint16_t id)
{
setting_t *src;
if (id >= SAVEAREA_MAX)
return NULL;
// point to saved area on the flash memory
src = (setting_t*)(SAVE_PROP_CONFIG_ADDR + id * SAVE_PROP_CONFIG_SIZE);
if (src->magic != CONFIG_MAGIC)
return NULL;
// if (SDU1.config->usbp->state == USB_ACTIVE) shell_printf("Checksum %x\r\n", src->checksum);
if (checksum(src,
// (sizeof (setting)) - sizeof src->checksum
(void *)&setting.checksum - (void *) &setting
) != src->checksum)
return NULL;
return src;
}
int
caldata_recall(uint16_t id)
{

@ -18,7 +18,7 @@
*/
#include "ch.h"
//#ifdef TINYSA_F303
#ifdef TINYSA_F303
#include "adc_F303.h"
#ifdef TINYSA_F072
#error "Remove comment for #ifdef TINYSA_F303"
@ -27,7 +27,7 @@
#define TINYSA4
#endif
#define TINYSA4_PROTO
//#endif
#endif
#ifdef TINYSA_F072
#ifdef TINYSA_F303
@ -1217,6 +1217,7 @@ int caldata_save(uint16_t id);
//const properties_t *caldata_ref(int id);
int config_save(void);
int config_recall(void);
setting_t * caldata_pointer(uint16_t id);
void clear_all_config_prop_data(void);

File diff suppressed because it is too large Load Diff

@ -454,17 +454,9 @@ static setting_t saved_setting;
void set_measurement(int m)
{
#if 0
if (m != M_OFF && setting.measurement == M_OFF ) {
saved_setting = setting;
} else if (m == M_OFF && setting.measurement != M_OFF ) {
setting = saved_setting;
}
#endif
setting.measurement = m;
setting.measurement = m;
#ifdef __LINEARITY__
if (m == M_LINEARITY) {
TRACE_ENABLE(TRACE_STORED_FLAG);
for (int j = 0; j < setting._sweep_points; j++)
stored_t[j] = -150;
setting.linearity_step = 0;
@ -1448,6 +1440,7 @@ static const struct {
} step_delay_table[]={
// RBWx10 step_delay offset_delay spur_gate (value divided by 1000)
{ 8500, 150, 50, 400, -90},
{ 6000, 150, 50, 300, -95},
{ 3000, 150, 50, 200, -95},
{ 1000, 600, 100, 100, -105},
{ 300, 800, 120, 100, -110},

@ -1491,6 +1491,15 @@ static const uint8_t SI4463_RBW_100kHz[] =
static const uint8_t SI4463_RBW_300kHz[] =
RADIO_CONFIGURATION_DATA_ARRAY;
// -------------- 600kHz ----------------------------
#include "radio_config_Si4468_undef.h"
#include "radio_config_Si4468_600kHz.h"
#include "radio_config_Si4468_short.h"
static const uint8_t SI4463_RBW_600kHz[] =
RADIO_CONFIGURATION_DATA_ARRAY;
// -------------- 850kHz ----------------------------
#include "radio_config_Si4468_undef.h"
@ -1520,6 +1529,7 @@ static const RBW_t RBW_choices[] =
{SI4463_RBW_30kHz, 0,300},
{SI4463_RBW_100kHz,0,1000},
{SI4463_RBW_300kHz,1,3000},
{SI4463_RBW_600kHz,11,6000},
{SI4463_RBW_850kHz,11,8500},
};

10
ui.c

@ -64,7 +64,7 @@ static uint16_t last_button = 0b0000;
static uint32_t last_button_down_ticks;
static uint32_t last_button_repeat_ticks;
static uint16_t menu_button_height = MENU_BUTTON_HEIGHT_N(MENU_BUTTON_MIN);
//static uint16_t menu_button_height = MENU_BUTTON_HEIGHT_N(MENU_BUTTON_MIN);
volatile uint8_t operation_requested = OP_NONE;
int8_t previous_marker = MARKER_INVALID;
@ -820,7 +820,7 @@ ensure_selection(void)
if (MT_MASK(menu[0].type) == MT_TITLE && selection == 0) selection = 1;
if (i < MENU_BUTTON_MIN) i = MENU_BUTTON_MIN;
if (i >= MENU_BUTTON_MAX) i = MENU_BUTTON_MAX;
menu_button_height = MENU_BUTTON_HEIGHT_N(i);
// menu_button_height = MENU_BUTTON_HEIGHT_N(i);
}
static void
@ -1343,6 +1343,12 @@ static const uint8_t check_box[] = {
static const char *step_text[5] = {"-10dB", "-1dB", "set", "+1dB", "+10dB"};
static char step_text_freq[5][10] = { "-100MHz", "-10MHz", "set", "+10MHz", "+100MHz" };
#ifdef TINYS4
#define menu_button_height ((menu[i].type & MT_FORM) || menu_is_multiline(menu[i].label) == 2 ? LCD_HEIGHT/10 : LCD_HEIGHT/12 )
#else
#define menu_button_height ((menu[i].type & MT_FORM) || menu_is_multiline(menu[i].label) == 2 ? LCD_HEIGHT/8 : LCD_HEIGHT/10 )
#endif
static void
draw_menu_buttons(const menuitem_t *menu, int only)
{

@ -746,7 +746,13 @@ static UI_FUNCTION_ADV_CALLBACK(menu_load_preset_acb)
{
(void)item;
if(b){
b->param_1.u = data;
setting_t *p = caldata_pointer(data);
char *t = (char *)spi_buffer;
if (p)
plot_printf(t, 64, "%.6FHz\n%.6FHz", (float)p->frequency0, (float)p->frequency1);//\n%d-drstx8
else
plot_printf(t, 64, "EMPTY %d", (int)data);
b->param_1.text = t;
return;
}
if (caldata_recall(data) == -1) {
@ -1131,19 +1137,28 @@ static UI_FUNCTION_ADV_CALLBACK(menu_measure_acb)
return;
}
menu_move_back(false);
#ifdef __MEASURE__
// set_measurement(data);
if ((data != M_OFF && setting.measurement != M_OFF) || data == M_OFF )
{
// reset_settings(setting.mode);
if (0) {
no_measurement:
data = M_OFF;
}
if (setting.measurement == M_LINEARITY) {
TRACE_DISABLE(TRACE_STORED_FLAG);
}
for (int i = 0; i< MARKERS_MAX; i++) {
markers[i].enabled = M_DISABLED;
markers[i].mtype = M_NORMAL;
}
markers[0].enabled = M_ENABLED;
markers[0].mtype = M_REFERENCE | M_TRACKING;
set_average(AV_OFF);
}
switch(data) {
case M_OFF: // Off
// reset_settings(setting.mode);
no_measurement:
for (int i = 0; i< MARKERS_MAX; i++) {
markers[i].enabled = M_DISABLED;
markers[i].mtype = M_NORMAL;
}
markers[0].enabled = M_ENABLED;
markers[0].mtype = M_REFERENCE | M_TRACKING;
set_average(AV_OFF);
// set_measurement(M_OFF);
break;
case M_IMD: // IMD
@ -1237,6 +1252,7 @@ static UI_FUNCTION_ADV_CALLBACK(menu_measure_acb)
break;
#ifdef __LINEARITY__
case M_LINEARITY:
TRACE_ENABLE(TRACE_STORED_FLAG);
// set_measurement(M_LINEARITY);
break;
#endif
@ -1544,8 +1560,8 @@ static UI_FUNCTION_CALLBACK(menu_limit_disable_cb)
#endif
#ifdef TINYSA4
static const uint16_t rbwsel_x10[]={0,3,10,30,100,300,1000,3000,8500};
static const char* rbwsel_text[]={"auto","300","1k","3k","10k","30k","100k","300k","850k"};
static const uint16_t rbwsel_x10[]={0,3,10,30,100,300,1000,3000,6000,8500};
static const char* rbwsel_text[]={"auto","300","1k","3k","10k","30k","100k","300k","600k","850k"};
#else
static const uint16_t rbwsel_x10[]={0,30,100,300,1000,3000,6000};
#endif
@ -1961,9 +1977,9 @@ static const menuitem_t menu_store_preset_high[8] =
static const menuitem_t menu_load_preset_high[] =
{
{ MT_ADV_CALLBACK, 0, "LOAD\nSTARTUP",menu_load_preset_acb},
{ MT_ADV_CALLBACK, 5, "LOAD %d", menu_load_preset_acb},
{ MT_ADV_CALLBACK, 6, "LOAD %d", menu_load_preset_acb},
{ MT_ADV_CALLBACK, 7, "LOAD %d", menu_load_preset_acb},
{ MT_ADV_CALLBACK, 5, "LOAD %s", menu_load_preset_acb},
{ MT_ADV_CALLBACK, 6, "LOAD %s", menu_load_preset_acb},
{ MT_ADV_CALLBACK, 7, "LOAD %s", menu_load_preset_acb},
{ MT_ADV_CALLBACK, 8, "LOAD %s", menu_load_preset_acb},
{ MT_SUBMENU, 0, "STORE" , menu_store_preset_high},
{ MT_CANCEL, 255, S_LARROW" BACK", NULL },
@ -1986,10 +2002,10 @@ static const menuitem_t menu_store_preset[] =
static const menuitem_t menu_load_preset[] =
{
{ MT_ADV_CALLBACK, 0, "LOAD\nSTARTUP",menu_load_preset_acb},
{ MT_ADV_CALLBACK, 1, "LOAD %d" , menu_load_preset_acb},
{ MT_ADV_CALLBACK, 2, "LOAD %d" , menu_load_preset_acb},
{ MT_ADV_CALLBACK, 3, "LOAD %d" , menu_load_preset_acb},
{ MT_ADV_CALLBACK, 4, "LOAD %d" , menu_load_preset_acb},
{ MT_ADV_CALLBACK, 1, "%s" , menu_load_preset_acb},
{ MT_ADV_CALLBACK, 2, "%s" , menu_load_preset_acb},
{ MT_ADV_CALLBACK, 3, "%s" , menu_load_preset_acb},
{ MT_ADV_CALLBACK, 4, "%s" , menu_load_preset_acb},
{ MT_SUBMENU, 0, "STORE" , menu_store_preset},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel
@ -2099,6 +2115,7 @@ static const menuitem_t menu_rbw[] = {
{ MT_ADV_CALLBACK, 6, "%sHz", menu_rbw_acb},
{ MT_ADV_CALLBACK, 7, "%sHz", menu_rbw_acb},
{ MT_ADV_CALLBACK, 8, "%sHz", menu_rbw_acb},
{ MT_ADV_CALLBACK, 9, "%sHz", menu_rbw_acb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel
#else
@ -3507,15 +3524,15 @@ redraw_cal_status:
y += YSTEP + YSTEP/2 ;
#ifdef TINYSA4
strncpy(buf,&TINYSA_VERSION[9], BLEN+1);
#else
strncpy(buf,&TINYSA_VERSION[8], BLEN+1);
#endif
if (buf[7]=='-') {
buf[3] = buf[4];
buf[4] = buf[5];
buf[5] = buf[6];
}
buf[6] = 0;
#else
strncpy(buf,&TINYSA_VERSION[8], BLEN-1);
#endif
ili9341_drawstring(buf, x, y);
if (y >= BATTERY_START && item_space > 0) {

Loading…
Cancel
Save

Powered by TurnKey Linux.