From d3c2ebcc1f8aee5d3a38305ea8b9e7cccb633b01 Mon Sep 17 00:00:00 2001 From: George Baltz N3GB Date: Tue, 18 Apr 2023 01:13:45 -0400 Subject: [PATCH] Round 4 of level_gran updates. Fill in more holes. This should cover the Kenwood and Elecraft rigs, with most of the callers of kenwood_set_level vetted. Also fills in some other data in rig->caps. Still looking for a way to (programatically) verify that AGC data is checked and processed correctly. --- rigs/kenwood/flex6xxx.c | 8 ++++++-- rigs/kenwood/k2.c | 4 +++- rigs/kenwood/k3.c | 22 ++++++++++++---------- rigs/kenwood/ts590.c | 8 ++------ rigs/kenwood/ts870s.c | 1 + rigs/kenwood/ts930.c | 1 + rigs/kenwood/xg3.c | 4 +++- 7 files changed, 28 insertions(+), 20 deletions(-) diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index d58f67eb7..99f7d55ad 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -1122,7 +1122,9 @@ const struct rig_caps f6k_caps = .has_set_level = F6K_LEVEL_ALL, .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ - .level_gran = {}, /* FIXME: granularity */ + .level_gran = { + [LVL_KEYSPD] = { .min = { .i = 5 }, .max = { .i = 60 }, .step = { .i = 1 } }, + }, /* FIXME: granularity */ .parm_gran = {}, //.extlevels = elecraft_ext_levels, //.extparms = kenwood_cfg_params, @@ -1260,7 +1262,9 @@ const struct rig_caps powersdr_caps = .has_set_level = POWERSDR_LEVEL_SET, .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ - .level_gran = {}, /* FIXME: granularity */ + .level_gran = { + [LVL_KEYSPD] = { .min = { .i = 5 }, .max = { .i = 60 }, .step = { .i = 1 } }, + }, /* FIXME: granularity */ .parm_gran = {}, //.extlevels = elecraft_ext_levels, //.extparms = kenwood_cfg_params, diff --git a/rigs/kenwood/k2.c b/rigs/kenwood/k2.c index 6917cce01..ea9be9ba9 100644 --- a/rigs/kenwood/k2.c +++ b/rigs/kenwood/k2.c @@ -143,7 +143,9 @@ const struct rig_caps k2_caps = .has_set_level = RIG_LEVEL_SET(K2_LEVEL_ALL), .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ - .level_gran = {}, /* FIXME: granularity */ + .level_gran = { +#include "level_gran_elecraft.h" + }, /* FIXME: granularity */ .parm_gran = {}, .extlevels = elecraft_ext_levels, .extparms = kenwood_cfg_params, diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 56466452d..48b14fa24 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -216,8 +216,7 @@ const struct rig_caps k3_caps = .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { // cppcheck-suppress * - [LVL_KEYSPD] = { .min = { .i = 8 }, .max = { .i = 50 }, .step = { .i = 1 } }, - [LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 10 }, .step = { .i = 10 } }, +#include "level_gran_elecraft.h" }, .parm_gran = {}, .extlevels = k3_ext_levels, @@ -369,7 +368,7 @@ const struct rig_caps k3s_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { - [LVL_KEYSPD] = { .min = { .i = 8 }, .max = { .i = 50 }, .step = { .i = 1 } }, +#include "level_gran_elecraft.h" [LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 15 }, .step = { .i = 5 } }, }, .parm_gran = {}, @@ -522,13 +521,16 @@ const struct rig_caps k4_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { - [LVL_KEYSPD] = { .min = { .i = 8 }, .max = { .i = 50 }, .step = { .i = 1 } }, - [LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 15 }, .step = { .i = 5 } }, +#include "level_gran_elecraft.h" + [LVL_CWPITCH] = { .min = { .i = 250 }, .max = { .i = 950 }, .step = { .i = 10 } }, + [LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 15 }, .step = { .i = 5 } }, + [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 255 }, .step = { .i = 10 } }, + [LVL_PREAMP] = { .min = { .i = 0 }, .max = { .i = 30}, .step = { .i = 10 } }, }, .parm_gran = {}, .extlevels = k3_ext_levels, .extparms = kenwood_cfg_params, - .preamp = { 1, RIG_DBLST_END, }, + .preamp = { 10, 20, 30, RIG_DBLST_END, }, .attenuator = { 5, 10, 15, RIG_DBLST_END, }, .max_rit = Hz(9990), .max_xit = Hz(9990), @@ -536,6 +538,8 @@ const struct rig_caps k4_caps = .vfo_ops = K3_VFO_OP, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .transceive = RIG_TRN_RIG, + .agc_level_count = 3, + .agc_levels = { RIG_AGC_OFF, RIG_AGC_SLOW, RIG_AGC_FAST }, .bank_qty = 0, .chan_desc_sz = 0, @@ -674,8 +678,7 @@ const struct rig_caps kx3_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { - [LVL_KEYSPD] = { .min = { .i = 8 }, .max = { .i = 50 }, .step = { .i = 1 } }, - [LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 10 }, .step = { .i = 10 } }, +#include "level_gran_elecraft.h" }, .parm_gran = {}, .extlevels = kx3_ext_levels, @@ -826,8 +829,7 @@ const struct rig_caps kx2_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { - [LVL_KEYSPD] = { .min = { .i = 8 }, .max = { .i = 50 }, .step = { .i = 1 } }, - [LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 10 }, .step = { .i = 10 } }, +#include "level_gran_elecraft.h" }, .parm_gran = {}, .extlevels = kx3_ext_levels, diff --git a/rigs/kenwood/ts590.c b/rigs/kenwood/ts590.c index 47435d3d0..6902e34a6 100644 --- a/rigs/kenwood/ts590.c +++ b/rigs/kenwood/ts590.c @@ -1665,10 +1665,8 @@ const struct rig_caps ts590_caps = #include "level_gran_kenwood.h" [LVL_RF] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } }, [LVL_AF] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } }, - [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 30 }, .step = { .i = 1 } }, - [LVL_KEYSPD] = {.min = {.i = 4}, .max = {.i = 60}, .step = {.i = 1}}, - [LVL_CWPITCH] = {.min = {.i = 400}, .max = {.i = 1000}, .step = {.i = 50}}, + [LVL_CWPITCH] = {.min = {.i = 300}, .max = {.i = 1000}, .step = {.i = 50}}, [LVL_BKIN_DLYMS] = {.min = {.i = 0}, .max = {.i = 1000}, .step = {.i = 50}}, [LVL_SLOPE_LOW] = {.min = {.i = 0}, .max = {.i = 2400}, .step = {.i = 10}}, [LVL_SLOPE_HIGH] = {.min = {.i = 0}, .max = {.i = 5000}, .step = {.i = 10}}, @@ -1862,10 +1860,8 @@ const struct rig_caps ts590sg_caps = #include "level_gran_kenwood.h" [LVL_RF] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } }, [LVL_AF] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } }, - [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 30 }, .step = { .i = 1 } }, - [LVL_KEYSPD] = {.min = {.i = 4}, .max = {.i = 60}, .step = {.i = 1}}, - [LVL_CWPITCH] = {.min = {.i = 400}, .max = {.i = 1000}, .step = {.i = 50}}, + [LVL_CWPITCH] = {.min = {.i = 300}, .max = {.i = 1000}, .step = {.i = 50}}, [LVL_BKIN_DLYMS] = {.min = {.i = 0}, .max = {.i = 1000}, .step = {.i = 50}}, [LVL_SLOPE_LOW] = {.min = {.i = 0}, .max = {.i = 2400}, .step = {.i = 10}}, [LVL_SLOPE_HIGH] = {.min = {.i = 0}, .max = {.i = 5000}, .step = {.i = 10}}, diff --git a/rigs/kenwood/ts870s.c b/rigs/kenwood/ts870s.c index b63105838..da45bff2d 100644 --- a/rigs/kenwood/ts870s.c +++ b/rigs/kenwood/ts870s.c @@ -565,6 +565,7 @@ const struct rig_caps ts870s_caps = .level_gran = { #include "level_gran_kenwood.h" + [LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 18 }, .step = { .i = 6 } }, }, .parm_gran = {}, .ctcss_list = kenwood38_ctcss_list, diff --git a/rigs/kenwood/ts930.c b/rigs/kenwood/ts930.c index 8ccf62e7b..aa839acb0 100644 --- a/rigs/kenwood/ts930.c +++ b/rigs/kenwood/ts930.c @@ -80,6 +80,7 @@ const struct rig_caps ts930_caps = .level_gran = { #include "level_gran_kenwood.h" + [LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 18 }, .step = { .i = 6 } }, }, .parm_gran = {}, .preamp = { RIG_DBLST_END, }, /* FIXME: preamp list */ diff --git a/rigs/kenwood/xg3.c b/rigs/kenwood/xg3.c index 4feef60ec..3b0fb9b7d 100644 --- a/rigs/kenwood/xg3.c +++ b/rigs/kenwood/xg3.c @@ -127,7 +127,9 @@ const struct rig_caps xg3_caps = .has_set_level = RIG_LEVEL_SET(XG3_LEVEL_ALL), .has_get_parm = XG3_PARM_ALL, .has_set_parm = XG3_PARM_ALL, - .level_gran = {}, /* FIXME: granularity */ + .level_gran = { +#include "level_gran_elecraft.h" + }, /* FIXME: granularity */ .parm_gran = {}, .extparms = kenwood_cfg_params, .max_ifshift = Hz(0),