mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-24 21:28:41 -05:00
Disable Hamlib caching while determining rig VFO resolution
This commit is contained in:
parent
f6a7d8c4bd
commit
74c7fade32
@ -846,6 +846,8 @@ endif (APPLE)
|
||||
#
|
||||
# find some useful tools
|
||||
#
|
||||
include (CheckSymbolExists)
|
||||
|
||||
find_program(CTAGS ctags)
|
||||
find_program(ETAGS etags)
|
||||
|
||||
@ -881,6 +883,10 @@ message (STATUS "hamlib_INCLUDE_DIRS: ${hamlib_INCLUDE_DIRS}")
|
||||
message (STATUS "hamlib_LIBRARIES: ${hamlib_LIBRARIES}")
|
||||
message (STATUS "hamlib_LIBRARY_DIRS: ${hamlib_LIBRARY_DIRS}")
|
||||
|
||||
set (CMAKE_REQUIRED_INCLUDES "${hamlib_INCLUDE_DIRS}")
|
||||
set (CMAKE_REQUIRED_LIBRARIES "${hamlib_LIBRARIES}")
|
||||
check_symbol_exists (rig_set_cache_timeout_ms "hamlib/rig.h" HAVE_HAMLIB_CACHING)
|
||||
|
||||
|
||||
#
|
||||
# Qt5 setup
|
||||
|
@ -606,6 +606,13 @@ int HamlibTransceiver::do_start ()
|
||||
}
|
||||
}
|
||||
|
||||
#if HAVE_HAMLIB_CACHING
|
||||
// we must disable Hamlib caching because it lies about frequency
|
||||
// for less than 1 Hz resolution rigs
|
||||
auto orig_cache_timeout = rig_get_cache_timeout_ms (rig_.data (), HAMLIB_CACHE_ALL);
|
||||
rig_set_cache_timeout_ms (rig_.data (), CACHE_ALL, 0);
|
||||
#endif
|
||||
|
||||
int resolution {0};
|
||||
if (freq_query_works_)
|
||||
{
|
||||
@ -646,6 +653,11 @@ int HamlibTransceiver::do_start ()
|
||||
resolution = -1; // best guess
|
||||
}
|
||||
|
||||
#if HAVE_HAMLIB_CACHING
|
||||
// revert Hamlib cache timeout
|
||||
rig_set_cache_timeout_ms (rig_.data (), HAMLIB_CACHE_ALL, orig_cache_timeout);
|
||||
#endif
|
||||
|
||||
do_poll ();
|
||||
|
||||
TRACE_CAT ("HamlibTransceiver", "exit" << state () << "reversed =" << reversed_ << "resolution = " << resolution);
|
||||
|
@ -19,6 +19,8 @@ extern "C" {
|
||||
#cmakedefine PROJECT_SAMPLES_URL "@PROJECT_SAMPLES_URL@"
|
||||
#cmakedefine PROJECT_SUMMARY_DESCRIPTION "@PROJECT_SUMMARY_DESCRIPTION@"
|
||||
|
||||
#cmakedefine01 HAVE_HAMLIB_CACHING
|
||||
|
||||
#cmakedefine01 WSJT_SHARED_RUNTIME
|
||||
#cmakedefine01 WSJT_QDEBUG_TO_FILE
|
||||
#cmakedefine01 WSJT_QDEBUG_IN_RELEASE
|
||||
|
Loading…
Reference in New Issue
Block a user