[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. v4.0rc1-60-g6dbbe4a8
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2020-07-26 20:29:39
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 6dbbe4a8ff55c3121f8736cf9c9582ba08c243a0 (commit) via 83249fb36a365863ff71ec0d535b13d32e934711 (commit) from 31115b6a161fe147f8f70e6528051aaf1d82e6cb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6dbbe4a8ff55c3121f8736cf9c9582ba08c243a0 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jul 26 15:17:42 2020 -0500 Fix FT1000MP set_rit https://github.com/Hamlib/Hamlib/issues/353 diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index b4608d87..6a60f38a 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -1170,8 +1170,10 @@ int ft1000mp_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) */ memcpy(&priv->p_cmd, &ncmd[FT1000MP_NATIVE_RIT_ON].nseq, YAESU_CMD_LENGTH); - to_bcd(priv->p_cmd, labs(rit) / 10, 4); /* store bcd format in in p_cmd */ - priv->p_cmd[2] = rit >= 0 ? 0x00 : 0xff; + // scaled 2's complement + rit = ((~(rit*16/10))&0xffff)+1; + priv->p_cmd[0] = rit>>8; + priv->p_cmd[1] = rit&0xff; cmd = priv->p_cmd; /* get native sequence */ write_block(&rs->rigport, (char *) cmd, YAESU_CMD_LENGTH); commit 83249fb36a365863ff71ec0d535b13d32e934711 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jul 26 15:07:52 2020 -0500 Fix FT1000MP RIT read for negative numbers Fix FT1000MP debug statement https://github.com/Hamlib/Hamlib/issues/353 https://github.com/Hamlib/Hamlib/issues/352 diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index e7ab1097..b4608d87 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -711,8 +711,6 @@ int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq) struct ft1000mp_priv_data *p; unsigned char *cmd; /* points to sequence to send */ int cmd_index = 0; - // cppcheck-suppress * - char *fmt = "%s: requested freq after conversion = %"PRIll" Hz\n"; rig_debug(RIG_DEBUG_TRACE, "%s: ft1000mp_set_freq called\n", __func__); @@ -756,7 +754,10 @@ int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq) to_bcd(p->p_cmd, freq / 10, 8); /* store bcd format in in p_cmd */ /* TODO -- fix 10Hz resolution -- FS */ - rig_debug(RIG_DEBUG_TRACE, fmt, __func__, (int64_t)from_bcd(p->p_cmd, 8) * 10); + // cppcheck-suppress * + rig_debug(RIG_DEBUG_TRACE, + "%s: requested freq after conversion = %"PRIll" Hz\n", __func__, + (int64_t)from_bcd(p->p_cmd, 8) * 10); cmd = p->p_cmd; /* get native sequence */ write_block(&rig_s->rigport, (char *) cmd, YAESU_CMD_LENGTH); @@ -1231,12 +1232,11 @@ int ft1000mp_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) p = &priv->update_data[FT1000MP_SUMO_VFO_A_CLAR]; /* CURR_VFO has VFOA offset */ } - /* big endian integer, kinda */ - f = ((p[0] & 0x7f) << 8) + p[1]; + f = (p[0] << 8) + p[1]; if (p[0] & 0x80) { - f *= -1; + f = ~(f - 1) & 0x7fff; // two's complement } f = f * 10 / 16; ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft1000mp.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |