kopia lustrzana https://github.com/Hamlib/Hamlib
Remove overlapping union references in rx331.c
rodzic
7bae5bbd3d
commit
d9db709963
|
@ -646,6 +646,7 @@ int rx331_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||||
int rx331_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
int rx331_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||||
{
|
{
|
||||||
int retval, lvl_len;
|
int retval, lvl_len;
|
||||||
|
double f;
|
||||||
char lvlbuf[BUFSZ];
|
char lvlbuf[BUFSZ];
|
||||||
|
|
||||||
switch (level)
|
switch (level)
|
||||||
|
@ -779,8 +780,8 @@ int rx331_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||||
{
|
{
|
||||||
return -RIG_EPROTO;
|
return -RIG_EPROTO;
|
||||||
}
|
}
|
||||||
|
f = val->i / 120.0;
|
||||||
val->f = 1.0 - (float)(val->i / 120.0);
|
val->f = 1.0 - f;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -805,7 +806,8 @@ int rx331_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||||
return -RIG_EPROTO;
|
return -RIG_EPROTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
val->i = (int)(val->f * 1000.0);
|
f = val->f * 1000.0;
|
||||||
|
val->i = (int)f;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -830,7 +832,8 @@ int rx331_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||||
return -RIG_EPROTO;
|
return -RIG_EPROTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
val->f = 1.0 - (val->i / 120.0);
|
f = val->i / 120.0;
|
||||||
|
val->f = 1.0 - f;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -855,7 +858,8 @@ int rx331_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||||
return -RIG_EPROTO;
|
return -RIG_EPROTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
val->i = (val->f * 1000.0);
|
f = val->f * 1000.0;
|
||||||
|
val->i = f;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -880,7 +884,8 @@ int rx331_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||||
return -RIG_EPROTO;
|
return -RIG_EPROTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
val->i = (val->f * 1000.0);
|
f = val->f * 1000.0;
|
||||||
|
val->i = f;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue