From 585a71eddb8efda33034fcb47be4ef91d5a05c94 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Mon, 13 Nov 2023 19:47:50 +0800 Subject: [PATCH] update --- ...o_computer_module_device_script_cmder_paser.cpp | 28 ++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp b/components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp index 266db8e..0a49321 100644 --- a/components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp +++ b/components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp @@ -64,20 +64,24 @@ void MicroComputerModuleDeviceScriptCmderPaser::app_dump_reg(int32_t paramN, con } void MicroComputerModuleDeviceScriptCmderPaser::app_dump_reg(int32_t moduleId, int32_t regid) { -#define DUMP_CONFIG(tag, configid) \ - if (regid == 0 || regid == configid) { \ - ecode = m_deviceManager->module_get_reg(moduleId, configid, &configval); \ - if (ecode == 0) { \ - ZLOGI(TAG, "%s(%d) :%d", tag, configid, configval); \ - } \ +#define DUMP_CONFIG(tag, configid) \ + if (regid == 0 || regid == configid) { \ + ecode = m_deviceManager->module_get_reg(moduleId, configid, &configval); \ + if (ecode == 0) { \ + ZLOGI(TAG, "%s(%d) :%d", tag, configid, configval); \ + } else if (ecode != err::kmodule_not_find_config_index) { \ + ZLOGI(TAG, "%s(%d) :read_error %s(%d)", tag, configid, err::error2str(ecode), ecode); \ + } \ } -#define DUMP_CONFIG_BIT(tag, configid) \ - if (regid == 0 || regid == configid) { \ - ecode = m_deviceManager->module_get_reg(moduleId, configid, &configval); \ - if (ecode == 0) { \ - ZLOGI(TAG, "%s(%d) :%s", tag, configid, dumpbit(configval)); \ - } \ +#define DUMP_CONFIG_BIT(tag, configid) \ + if (regid == 0 || regid == configid) { \ + ecode = m_deviceManager->module_get_reg(moduleId, configid, &configval); \ + if (ecode == 0) { \ + ZLOGI(TAG, "%s(%d) :%s", tag, configid, dumpbit(configval)); \ + } else if (ecode != err::kmodule_not_find_config_index) { \ + ZLOGI(TAG, "%s(%d) :read_error %s(%d)", tag, configid, err::error2str(ecode), ecode); \ + } \ } int32_t configval = 0; int32_t ecode = 0;