diff --git a/icom/ic7300.c b/icom/ic7300.c index c478070ad..833f6e350 100644 --- a/icom/ic7300.c +++ b/icom/ic7300.c @@ -40,7 +40,7 @@ #include "frame.h" #include "misc.h" #include "bandplan.h" - +#include "tones.h" /* AM Data mode needs adding - this would require one more mode 'RIG_MODE_PKTAM' to rig.h */ #define IC7300_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB) @@ -115,7 +115,7 @@ const struct rig_caps ic7300_caps = { [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, -.ctcss_list = NULL, +.ctcss_list = full_ctcss_list, .dcs_list = NULL, .preamp = { 10, RIG_DBLST_END, }, /* FIXME: TBC it's a guess*/ .attenuator = { 20, RIG_DBLST_END, }, /* value taken from p.45 of manual*/ diff --git a/icom/icom.c b/icom/icom.c index f56d39bfd..39a0ec66d 100644 --- a/icom/icom.c +++ b/icom/icom.c @@ -2623,12 +2623,14 @@ int icom_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) caps = rig->caps; - for (i = 0; caps->ctcss_list[i] != 0 && i<52; i++) { - if (caps->ctcss_list[i] == tone) - break; + if (caps->ctcss_list) { + for (i = 0; caps->ctcss_list[i] != 0 && i<52; i++) { + if (caps->ctcss_list[i] == tone) + break; + } + if (caps->ctcss_list[i] != tone) + return -RIG_EINVAL; } - if (caps->ctcss_list[i] != tone) - return -RIG_EINVAL; /* Sent as frequency in tenth of Hz */ @@ -2677,6 +2679,8 @@ int icom_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone) tone_len -= 2; *tone = from_bcd_be(tonebuf+2, tone_len*2); + if (!caps->ctcss_list) return RIG_OK; + /* check this tone exists. That's better than nothing. */ for (i = 0; caps->ctcss_list[i] != 0 && i<52; i++) { if (caps->ctcss_list[i] == *tone)