change from active to active_props

pull/4/head
TT 9 years ago
parent 407d802a9c
commit 4845bde486

@ -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 */

@ -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 = &current_props;
properties_t *active_props = &current_props;
void
ensure_edit_config(void)
{
if (active == &current_props)
if (active_props == &current_props)
return;
//memcpy(&current_props, active, sizeof(config_t));
active = &current_props;
//memcpy(&current_props, active_props, sizeof(config_t));
active_props = &current_props;
// move to uncal state
cal_status = 0;
}

@ -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

@ -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 == &current_props)
if (active_props == &current_props)
c[1] = '*';
else
c[1] += lastsaveid;

Loading…
Cancel
Save

Powered by TurnKey Linux.