[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 8221961de2e24121482e7
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: n0nb <n0...@us...> - 2024-05-08 21:00:10
|
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 8221961de2e24121482e72959c77c27edaa74740 (commit)
from 02a5f70200e589249bf8958e6d4b4a3aa094e00a (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 8221961de2e24121482e72959c77c27edaa74740
Author: Christoph Nadig <hb...@us...>
Date: Wed May 8 11:02:13 2024 +0200
Fix for setting power on Elecraft TRXs
(currently the power set is off by a factor of 10 if no PA is attached).
I also included a change to k3_max_power to take the current band into
account again. These values have changed in firmware upgrades in the
past but have been stable for quite a while now, so I think they should
be considered again.
Best Regards,
Chris, HB9ZHK
diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c
index 53aab4f94..779fc504a 100644
--- a/rigs/kenwood/k3.c
+++ b/rigs/kenwood/k3.c
@@ -1835,15 +1835,12 @@ static int k3_get_maxpower(RIG *rig)
{
maxpower = 110;
}
-
-// Elecraft makes max power pretty variable
-// So we will stick with 15W or 110W and scale everything to that
-#if 0
else if (RIG_IS_KX2 || RIG_IS_KX3)
{
int bandnum = -1;
- retval = kenwood_safe_transaction(rig, "BN", levelbuf, KENWOOD_MAX_BUF_LEN, 4);
+ char levelbuf[KENWOOD_MAX_BUF_LEN];
+ int retval = kenwood_safe_transaction(rig, "BN", levelbuf, KENWOOD_MAX_BUF_LEN, 4);
if (retval != RIG_OK) { return retval; }
@@ -1877,8 +1874,6 @@ static int k3_get_maxpower(RIG *rig)
}
}
-#endif
-
rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower);
return maxpower;
}
@@ -1899,6 +1894,7 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
char levelbuf[16];
int kenwood_val;
+ float pwr;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@@ -1998,9 +1994,9 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
break;
case RIG_LEVEL_RFPOWER:
- kenwood_val = (int)(val.f * k3_get_maxpower(rig));
- SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03d%s", kenwood_val,
- kenwood_val > 15 ? "1" : "0");
+ pwr = val.f * k3_get_maxpower(rig);
+ SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03.f%c", pwr > 15.0 ? pwr : 10.0 * pwr,
+ pwr > 15.0 ? '1' : '0');
break;
default:
-----------------------------------------------------------------------
Summary of changes:
rigs/kenwood/k3.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|