diff --git a/flash.c b/flash.c index 29c916b..1731f16 100644 --- a/flash.c +++ b/flash.c @@ -162,7 +162,7 @@ caldata_save(int id) } /* after saving data, make active configuration points to flash */ - active = (properties_t*)saveareas[id]; + active_props = (properties_t*)saveareas[id]; lastsaveid = id; return 0; @@ -186,7 +186,7 @@ caldata_recall(int id) return -1; /* active configuration points to save data on flash memory */ - active = src; + active_props = src; lastsaveid = id; /* duplicated saved data onto sram to be able to modify marker/trace */ diff --git a/main.c b/main.c index c4e5728..3dd7e35 100644 --- a/main.c +++ b/main.c @@ -331,7 +331,7 @@ config_t config = { properties_t current_props = { /* magic */ CONFIG_MAGIC, /* frequency0 */ 1000000, - /* frequency1 */ 300000000, + /* frequency1 */ 300000000, /* sweep_points */ 101, /* cal_status */ 0, /* frequencies */ {}, @@ -340,8 +340,8 @@ properties_t current_props = { {/*enable, type, channel, polar, scale*/ { 1, TRC_LOGMAG, 0, 0, 1.0, 7.0 }, { 1, TRC_LOGMAG, 1, 0, 1.0, 7.0 }, - { 1, TRC_SMITH, 0, 1, 1.0, 0.0 }, - { 1, TRC_PHASE, 1, 0, 1.0, 4.0 } + { 1, TRC_SMITH, 0, 1, 1.0, 0.0 }, + { 1, TRC_PHASE, 1, 0, 1.0, 4.0 } }, /* markers[4] */ { { 1, 30 }, { 0, 40 }, { 0, 60 }, { 0, 80 } @@ -349,16 +349,16 @@ properties_t current_props = { /* active_marker */ 0, /* checksum */ 0 }; -properties_t *active = ¤t_props; +properties_t *active_props = ¤t_props; void ensure_edit_config(void) { - if (active == ¤t_props) + if (active_props == ¤t_props) return; - //memcpy(¤t_props, active, sizeof(config_t)); - active = ¤t_props; + //memcpy(¤t_props, active_props, sizeof(config_t)); + active_props = ¤t_props; // move to uncal state cal_status = 0; } diff --git a/nanovna.h b/nanovna.h index e9d6917..e23372a 100644 --- a/nanovna.h +++ b/nanovna.h @@ -266,7 +266,7 @@ typedef struct { #define CONFIG_MAGIC 0x436f4e45 /* 'CoNF' */ extern int16_t lastsaveid; -extern properties_t *active; +extern properties_t *active_props; extern properties_t current_props; #define frequency0 current_props._frequency0 @@ -274,7 +274,7 @@ extern properties_t current_props; #define sweep_points current_props._sweep_points #define cal_status current_props._cal_status #define frequencies current_props._frequencies -#define cal_data active->_cal_data +#define cal_data active_props->_cal_data #define trace current_props._trace #define markers current_props._markers diff --git a/plot.c b/plot.c index bedcd52..a941701 100644 --- a/plot.c +++ b/plot.c @@ -1322,7 +1322,7 @@ draw_cal_status(void) ili9341_fill(0, y, 10, 6*YSTEP, 0x0000); if (cal_status & CALSTAT_APPLY) { char c[3] = "C0"; - if (active == ¤t_props) + if (active_props == ¤t_props) c[1] = '*'; else c[1] += lastsaveid;