From 9cb4bd6d0fc7dab6ea40141b0d660c3717bfefcf Mon Sep 17 00:00:00 2001 From: zhaohe Date: Mon, 8 Jul 2024 14:47:45 +0800 Subject: [PATCH] update --- CMakeLists.txt | 4 ++-- iflytop_canbus/iflytop_canbus_master.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f5fc85..7b3f399 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED) # find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets PrintSupport SerialPort Charts Concurrent REQUIRED) -find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets SerialPort Charts Concurrent REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets SerialPort Concurrent REQUIRED) # 加入 PrintSupport库之后,EnigmaVirtual打包的文件会出现无法使用try...catch的问题,具体表现为,即便捕获了异常,程序依然会卡死。 include_directories(libxsync/include) @@ -94,7 +94,7 @@ add_executable(a8000_pc_upper WIN32 target_link_options(a8000_pc_upper PRIVATE -static -static-libgcc -static-libstdc++) # target_link_libraries(a8000_pc_upper PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::PrintSupport Qt${QT_VERSION_MAJOR}::SerialPort Qt${QT_VERSION_MAJOR}::Charts Qt${QT_VERSION_MAJOR}::Concurrent wsock32) -target_link_libraries(a8000_pc_upper PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::SerialPort Qt${QT_VERSION_MAJOR}::Charts Qt${QT_VERSION_MAJOR}::Concurrent wsock32) +target_link_libraries(a8000_pc_upper PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::SerialPort Qt${QT_VERSION_MAJOR}::Concurrent wsock32) set_target_properties(a8000_pc_upper PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com diff --git a/iflytop_canbus/iflytop_canbus_master.cpp b/iflytop_canbus/iflytop_canbus_master.cpp index e4a078e..203cd7b 100644 --- a/iflytop_canbus/iflytop_canbus_master.cpp +++ b/iflytop_canbus/iflytop_canbus_master.cpp @@ -105,7 +105,7 @@ void IflytopCanbusMaster::ping(int32_t device_id) { void IflytopCanbusMaster::readreg(int32_t device_id, int32_t regaddr, int32_t *val) { int32_t param[4]; param[0] = regaddr; - callcmd(device_id, kmodule_get_reg, (uint8_t *)param, 4, 10); + callcmd(device_id, kmodule_get_reg, (uint8_t *)param, 4, 200); *val = *(int32_t *)(&m_receipt_frame->data[0]); } @@ -137,7 +137,7 @@ void IflytopCanbusMaster::callcmd3(int32_t device_id, int32_t cmdid, int32_t par param[2] = param2; callcmd(device_id, cmdid, (uint8_t *)param, 12, G_OVERTIME); } -void IflytopCanbusMaster::callcmd4(int32_t device_id, int32_t cmdid, int32_t param0, int32_t param1, int32_t param2,int32_t param3) { +void IflytopCanbusMaster::callcmd4(int32_t device_id, int32_t cmdid, int32_t param0, int32_t param1, int32_t param2, int32_t param3) { int32_t param[4]; param[0] = param0; param[1] = param1; @@ -154,7 +154,7 @@ void IflytopCanbusMaster::callcmd(int32_t device_id, int32_t cmdid, uint8_t *par } frame->packetindex = m_txindex; - frame->moduleid = device_id; + frame->moduleid = device_id; frame->packetType = kptv2_cmd; if (paramLen != 0) memcpy(frame->data, param, paramLen);