kopia lustrzana https://github.com/Hamlib/Hamlib
pcr.c, pcr1500.c: Add DSP support
"[This patch] allows PCR radios to use DSP units correctly for the first time under Hamlib. We're all familiar with a typical DSP presentation on a radio -- you can turn it on and off, you can adjust the degree of noise processing, and you can sometimes even enable a notch filter. In the PCR radios that have a DSP installed, none of this worked until now. I corrected the code in pcr.c, changes that apply to all the PCR radios, and in pcr1500.c, the radio I have, but someone else will have to edit the files for the radios I don't own so the user interface works right. I decided it would be unwise to try to edit files for radios I couldn't test. I just re-read the above, and I need to add that the changes to prc.c shouldn't adversely affect the PCR models other than the one I own." Signed-off-by: Nate Bargmann <n0nb@n0nb.us>Hamlib-3.0
rodzic
92a80da264
commit
fb63c3b6f1
25
pcr/pcr.c
25
pcr/pcr.c
|
@ -144,7 +144,7 @@ static int pcr_set_bfo_shift(RIG *rig, vfo_t vfo, int level); // J4Axx
|
||||||
static int pcr_set_vsc(RIG *rig, vfo_t vfo, int level); // J50xx
|
static int pcr_set_vsc(RIG *rig, vfo_t vfo, int level); // J50xx
|
||||||
static int pcr_set_dsp(RIG *rig, vfo_t vfo, int level); // J80xx
|
static int pcr_set_dsp(RIG *rig, vfo_t vfo, int level); // J80xx
|
||||||
static int pcr_set_dsp_state(RIG *rig, vfo_t vfo, int level); // J8100=off J8101=on
|
static int pcr_set_dsp_state(RIG *rig, vfo_t vfo, int level); // J8100=off J8101=on
|
||||||
#if 0 /* unused; re-enabled as needed. */
|
#if 1 /* unused; re-enabled as needed. */
|
||||||
static int pcr_set_dsp_noise_reducer(RIG *rig, vfo_t vfo, int level); // J82xx
|
static int pcr_set_dsp_noise_reducer(RIG *rig, vfo_t vfo, int level); // J82xx
|
||||||
#endif /* unused */
|
#endif /* unused */
|
||||||
static int pcr_set_dsp_auto_notch(RIG *rig, vfo_t vfo, int level); // J83xx
|
static int pcr_set_dsp_auto_notch(RIG *rig, vfo_t vfo, int level); // J83xx
|
||||||
|
@ -955,12 +955,14 @@ pcr_set_level(RIG * rig, vfo_t vfo, setting_t level, value_t val)
|
||||||
{
|
{
|
||||||
int err = -RIG_ENIMPL;
|
int err = -RIG_ENIMPL;
|
||||||
|
|
||||||
if (RIG_LEVEL_IS_FLOAT(level))
|
if (RIG_LEVEL_IS_FLOAT(level)) {
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: level = %d, val = %f\n",
|
rig_debug(RIG_DEBUG_VERBOSE, "%s: level = %d, val = %f\n",
|
||||||
__func__, level, val.f);
|
__func__, level, val.f);
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: level = %d, val = %d\n",
|
rig_debug(RIG_DEBUG_VERBOSE, "%s: level = %d, val = %d\n",
|
||||||
__func__, level, val.i);
|
__func__, level, val.i);
|
||||||
|
}
|
||||||
|
|
||||||
switch (level) {
|
switch (level) {
|
||||||
case RIG_LEVEL_ATT:
|
case RIG_LEVEL_ATT:
|
||||||
|
@ -1005,7 +1007,8 @@ pcr_set_level(RIG * rig, vfo_t vfo, setting_t level, value_t val)
|
||||||
*
|
*
|
||||||
* Later on we can set if the DSP features are on or off in set_func
|
* Later on we can set if the DSP features are on or off in set_func
|
||||||
*/
|
*/
|
||||||
return pcr_set_dsp(rig, vfo, (int) val.f);
|
/* return pcr_set_dsp(rig, vfo, (int) val.f); */
|
||||||
|
return pcr_set_dsp_noise_reducer(rig, vfo, val.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
@ -1095,13 +1098,17 @@ pcr_set_func(RIG * rig, vfo_t vfo, setting_t func, int status)
|
||||||
switch (func) {
|
switch (func) {
|
||||||
case RIG_FUNC_NR: /* sets DSP noise reduction on or off */
|
case RIG_FUNC_NR: /* sets DSP noise reduction on or off */
|
||||||
/* status = 00 for off or 01 for on
|
/* status = 00 for off or 01 for on
|
||||||
* Note that the user should switch the DSP unit on first
|
* always enable the DSP unit
|
||||||
* using the set level function RIG_LEVEL_NR
|
* even if only to turn it off
|
||||||
*/
|
*/
|
||||||
if (status == 1)
|
if (status == 1) {
|
||||||
|
pcr_set_dsp(rig, vfo, 1);
|
||||||
return pcr_set_dsp_state(rig, vfo, 1);
|
return pcr_set_dsp_state(rig, vfo, 1);
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
|
pcr_set_dsp(rig, vfo, 1);
|
||||||
return pcr_set_dsp_state(rig, vfo, 0);
|
return pcr_set_dsp_state(rig, vfo, 0);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RIG_FUNC_ANF: /* DSP auto notch filter */
|
case RIG_FUNC_ANF: /* DSP auto notch filter */
|
||||||
|
@ -1499,7 +1506,7 @@ pcr_set_dsp_state(RIG * rig, vfo_t vfo, int level)
|
||||||
* the level of NR set by values 0x01 to 0x10 (1 to 16 inclusive)
|
* the level of NR set by values 0x01 to 0x10 (1 to 16 inclusive)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if 0 /* unused; re-enabled as needed. */
|
#if 1 /* unused; re-enabled as needed. */
|
||||||
int
|
int
|
||||||
pcr_set_dsp_noise_reducer(RIG * rig, vfo_t vfo, int level)
|
pcr_set_dsp_noise_reducer(RIG * rig, vfo_t vfo, int level)
|
||||||
{
|
{
|
||||||
|
|
|
@ -85,7 +85,8 @@ const struct rig_caps pcr1500_caps = {
|
||||||
.has_set_parm = RIG_PARM_NONE,
|
.has_set_parm = RIG_PARM_NONE,
|
||||||
|
|
||||||
.level_gran = {
|
.level_gran = {
|
||||||
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
|
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 }, .step = { .i = 1 } },
|
||||||
|
[LVL_NR] = { .min = { .f = 0 }, .max = { .f = 16.0 }, .step = { .f = 1.0 } },
|
||||||
/* XXX check this */
|
/* XXX check this */
|
||||||
[LVL_IF] = { .min = { .i = -1270 }, .max = { .i = 1270 }, .step = { .i = 10 } },
|
[LVL_IF] = { .min = { .i = -1270 }, .max = { .i = 1270 }, .step = { .i = 10 } },
|
||||||
},
|
},
|
||||||
|
|
Ładowanie…
Reference in New Issue