From 3e7d5f39e2ed20d28ac87f26f55316f5d073c396 Mon Sep 17 00:00:00 2001 From: SnickerSun Date: Thu, 30 May 2024 17:19:15 +0800 Subject: [PATCH] =?utf8?q?AT^PMMODEGET=E4=B8=AD=E7=9B=B4=E6=8E=A5=E6=89=93?= =?utf8?q?=E5=8D=B0=E5=87=BAPM=5FID=E7=9A=84=E5=90=8D=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../wstp/at_service/app/app_at_process.c | 3 +- .../chips/brandy/pm/include/pm_definition.h | 7 ++++ code/sdk/middleware/chips/brandy/pm/pm.c | 39 +++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/code/sdk/application/wstp/at_service/app/app_at_process.c b/code/sdk/application/wstp/at_service/app/app_at_process.c index 800d1b66b..546f281bc 100755 --- a/code/sdk/application/wstp/at_service/app/app_at_process.c +++ b/code/sdk/application/wstp/at_service/app/app_at_process.c @@ -1258,7 +1258,8 @@ static void pm_print_veto_info(void) pm_veto_ptr->last_veto_id, pm_veto_ptr->last_veto_lr, pm_veto_ptr->veto_timeout_timestamp, pm_veto_ptr->veto_counts.total_counts); for (i = 0; i < PM_ID_MAX; i++) { - wstp_print("sub_counts[%d] = %d\r\n", i, pm_veto_ptr->veto_counts.sub_counts[i]); + // wstp_print("sub_counts[%d] = %d\r\n", i, pm_veto_ptr->veto_counts.sub_counts[i]); + wstp_print("sub_counts[%d] %s = %d\r\n", i,get_pm_id_name(i), pm_veto_ptr->veto_counts.sub_counts[i]); } } diff --git a/code/sdk/middleware/chips/brandy/pm/include/pm_definition.h b/code/sdk/middleware/chips/brandy/pm/include/pm_definition.h index d8b0f2ba8..f38b4b82b 100755 --- a/code/sdk/middleware/chips/brandy/pm/include/pm_definition.h +++ b/code/sdk/middleware/chips/brandy/pm/include/pm_definition.h @@ -48,6 +48,13 @@ typedef enum { PM_ID_MAX, } pm_id_t; +/** + * 通过pm_id_t 获取pm_id名字 +*/ +char* get_pm_id_name(int pmid); + + + /** * @if Eng * @brief Key running status of the system. diff --git a/code/sdk/middleware/chips/brandy/pm/pm.c b/code/sdk/middleware/chips/brandy/pm/pm.c index ae3d61093..55c841f22 100755 --- a/code/sdk/middleware/chips/brandy/pm/pm.c +++ b/code/sdk/middleware/chips/brandy/pm/pm.c @@ -208,3 +208,42 @@ void uapi_sys_shipmode(uint32_t arg) writew(0x570040e0, 0x1); osal_irq_restore(irq); } + + +const char* pm_id_name_arr[] ={ + "PM_ID_BSP", + "PM_ID_SYS", + "PM_ID_BTH", + "PM_ID_BTC", + "PM_ID_AUDIO", + "PM_ID_VIDEO", + "PM_ID_DMA", + "PM_ID_DPU", + "PM_ID_VAU", + "PM_ID_BUTTON", + "PM_ID_DEBUG", + "PM_ID_ADC", + "PM_ID_DFX", + "PM_ID_SCREEN", + "PM_ID_STORAGE", + "PM_ID_TOUCH", + "PM_ID_JPEG", + "PM_ID_JS", + "PM_ID_MSGCENTER", + "PM_ID_HEART",//新增,心率芯片 + "PM_ID_MOTOR",//新增,马达 + "PM_ID_GSENSOR",//新增,加速计 + "PM_ID_CAT1",//Cat1 communication + "PM_ID_MAX" +}; + +char* get_pm_id_name(int pmid) +{ + + int count = sizeof(pm_id_name_arr)/sizeof(char*); + if (pmid> count -1) + pmid = count -1; + if (pmid< PM_ID_BSP) + pmid = PM_ID_BSP; + return pm_id_name_arr[pmid]; +} -- 2.17.1