MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / pcr_set_func

Function pcr_set_func

rigs/pcr/pcr.c:1243–1341  ·  view source on GitHub ↗

* pcr_set_func * Assumes rig!=NULL, STATE(rig)->priv!=NULL * * This is missing a way to call the set DSP noise reducer, as we don't have a func to call it * based on the flags in rig.h -> see also missing a flag for setting the BFO. */

Source from the content-addressed store, hash-verified

1241 * based on the flags in rig.h -> see also missing a flag for setting the BFO.
1242 */
1243int
1244pcr_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
1245{
1246 struct pcr_priv_data *priv = (struct pcr_priv_data *) STATE(rig)->priv;
1247 const struct pcr_rcvr *rcvr = is_sub_rcvr(rig,
1248 vfo) ? &priv->sub_rcvr : &priv->main_rcvr;
1249
1250 rig_debug(RIG_DEBUG_VERBOSE, "%s: status = %d, func = %s\n", __func__,
1251 status, rig_strfunc(func));
1252
1253 switch (func)
1254 {
1255 case RIG_FUNC_NR: /* sets DSP noise reduction on or off */
1256
1257 /* status = 00 for off or 01 for on
1258 * always enable the DSP unit
1259 * even if only to turn it off
1260 */
1261 if (status == 1)
1262 {
1263 pcr_set_dsp(rig, vfo, 1);
1264 return pcr_set_dsp_state(rig, vfo, 1);
1265 }
1266 else
1267 {
1268 pcr_set_dsp(rig, vfo, 1);
1269 return pcr_set_dsp_state(rig, vfo, 0);
1270 }
1271
1272 break;
1273
1274 case RIG_FUNC_ANF: /* DSP auto notch filter */
1275 if (status == 1)
1276 {
1277 return pcr_set_dsp_auto_notch(rig, vfo, 1);
1278 }
1279 else
1280 {
1281 return pcr_set_dsp_auto_notch(rig, vfo, 0);
1282 }
1283
1284 break;
1285
1286 case RIG_FUNC_NB: /* noise blanker */
1287 if (status == 0)
1288 {
1289 return pcr_set_nb(rig, vfo, 0);
1290 }
1291 else
1292 {
1293 return pcr_set_nb(rig, vfo, 1);
1294 }
1295
1296 break;
1297
1298 case RIG_FUNC_AFC: /* Tracking Filter */
1299 if (status == 0)
1300 {

Callers

nothing calls this directly

Calls 10

is_sub_rcvrFunction · 0.85
rig_debugFunction · 0.85
rig_strfuncFunction · 0.85
pcr_set_dspFunction · 0.85
pcr_set_dsp_stateFunction · 0.85
pcr_set_dsp_auto_notchFunction · 0.85
pcr_set_nbFunction · 0.85
pcr_set_afcFunction · 0.85
pcr_set_ctcss_sqlFunction · 0.85
pcr_set_vscFunction · 0.85

Tested by

no test coverage detected