From 1da836e2d8b2e9ec74c574d409ee7d9c23af1ed6 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Wed, 14 Dec 2022 14:06:40 +0100 Subject: [PATCH] Touch defaults and M->Ref --- main.c | 2 +- nanovna.h | 2 +- ui.c | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index a5f369a..3db6d22 100644 --- a/main.c +++ b/main.c @@ -963,7 +963,7 @@ config_t config = { .touch_cal = { 347, 495, 160, 205 }, // 2.8 inch LCD panel #endif #ifdef TINYSA4 - .touch_cal = { 278, 513, 115, 154 }, // 4 inch panel + .touch_cal = { 444, 715, 3552, 3499 }, // 4 inch panel #endif ._mode = _MODE_USB | _MODE_AUTO_FILENAME, ._serial_speed = SERIAL_DEFAULT_BITRATE, diff --git a/nanovna.h b/nanovna.h index 6851b05..d50b145 100644 --- a/nanovna.h +++ b/nanovna.h @@ -1384,7 +1384,7 @@ typedef struct properties { //sizeof(properties_t) == 0x1200 -#define CONFIG_MAGIC 0x434f4e5C /* 'CONF' */ +#define CONFIG_MAGIC 0x434f4e5D /* 'CONF' */ extern int16_t lastsaveid; //extern properties_t *active_props; diff --git a/ui.c b/ui.c index cea7a43..2b21b78 100644 --- a/ui.c +++ b/ui.c @@ -764,8 +764,12 @@ static UI_FUNCTION_CALLBACK(menu_marker_op_cb) case 4: // marker -> ref level { float l = actual_t[markers[active_marker].index]; +#if 1 + user_set_reflevel(l); +#else float s_max = value(l)/setting.scale; user_set_reflevel(setting.scale*(floorf(s_max)+2)); +#endif } break; #ifdef __VNA__