Merge #204 into sdk602patch0521 from refs/changes/204/head 206/target/1
authorsnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Fri, 31 May 2024 06:59:06 +0000 (06:59 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Fri, 31 May 2024 06:59:06 +0000 (06:59 +0000)
AT^PMMODEGET中直接打印出PM_ID的名字

* refs/changes/204/head: (2 commits squashed)

  - AT^PMMODEGET中直接打印出PM_ID的名字

  - 添加补丁解决trace无法用工具解析问题

Signed-off-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Reviewed-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Merged-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/204
code/sdk/application/wstp/at_service/app/app_at_process.c
code/sdk/middleware/chips/brandy/pm/include/pm_definition.h
code/sdk/middleware/chips/brandy/pm/pm.c
code/sdk/middleware/chips/brandy/pm/pm_adapt/pm_core.c

index 800d1b6..546f281 100755 (executable)
@@ -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,\r
                pm_veto_ptr->veto_counts.total_counts);\r
     for (i = 0; i < PM_ID_MAX; i++) {\r
-        wstp_print("sub_counts[%d] = %d\r\n", i, pm_veto_ptr->veto_counts.sub_counts[i]);\r
+        // wstp_print("sub_counts[%d] = %d\r\n", i, pm_veto_ptr->veto_counts.sub_counts[i]);\r
+        wstp_print("sub_counts[%d] %s = %d\r\n", i,get_pm_id_name(i), pm_veto_ptr->veto_counts.sub_counts[i]);\r
     }\r
 }\r
 \r
index d8b0f2b..f38b4b8 100755 (executable)
@@ -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.
index ae3d610..55c841f 100755 (executable)
@@ -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];
+}
index a67bea2..e6d5261 100755 (executable)
@@ -272,6 +272,7 @@ void pm_core_resume(void)
     clocks_system_resume_clock();
     uapi_dma_init();
     uapi_dma_open();
+    cpu_trace_enable_mcpu_repeat();
     storage_device_resume();
 #if defined(ENABLE_UIKIT) || defined(ENABLE_LVGL)
     hal_pmu1_dig_pg_l2m_gmmu_pwr_en(true); // The GMMU memory is set to the normal state.