优化心率计算,优化关机函数执行 3214/5 3214/head 3218/target/1 3219/target/1
author1624952103 <pl@DESKTOP-EN9LKR5.localdomain>
Wed, 25 Feb 2026 01:45:02 +0000 (09:45 +0800)
committer1624952103 <pl@DESKTOP-EN9LKR5.localdomain>
Wed, 25 Feb 2026 01:45:02 +0000 (09:45 +0800)
code/sdk/zhihui/drivers/cywee/dml/cywee_dml.c
code/sdk/zhihui/drivers/ppg/hx3695/hx3695.c
code/sdk/zhihui/utils/custom_utils.c

index e32b8c8..7eeb555 100644 (file)
@@ -1411,7 +1411,7 @@ void cywee_get_gsensor_data(uint8_t cnt, gsenson_t t[])
     // 初始化输出数组(避免脏数据)
     memset(t, 0, sizeof(gsenson_t) * cnt);
     // if(g_mutex.mutex != NULL)
-        osal_mutex_lock(&g_mutex);
+        // osal_mutex_lock(&g_mutex);
     uint8_t actual_read = 0; // 实际读取的新数据组数
     // CWM_OS_dbgPrintf("[GET_DATA] 取数前 - num_flag=%d, left_flag=%d, cnt=%d\n", num_flag, left_flag, cnt);
 
@@ -1435,7 +1435,7 @@ void cywee_get_gsensor_data(uint8_t cnt, gsenson_t t[])
         actual_read++;
     }
     // if(g_mutex.mutex != NULL)
-        osal_mutex_unlock(&g_mutex);
+        // osal_mutex_unlock(&g_mutex);
 
     // 2. 数据不足时,复用历史数据补全
     if(actual_read < cnt) {
@@ -1967,7 +1967,7 @@ void CWM_APSensorDataOutput_listen(const dml_sensorData_t * pSdo)
     if(AccdataCount < 25)
     {
         // if(g_mutex.mutex != NULL)
-            osal_mutex_lock(&g_mutex);
+            // osal_mutex_lock(&g_mutex);
 
         if (pSdo->validData & DML_SENSOR_DATA_VALID_DT)
         {
@@ -2031,7 +2031,7 @@ void CWM_APSensorDataOutput_listen(const dml_sensorData_t * pSdo)
             AccdataCount++;
         }     
         // if(g_mutex.mutex != NULL)
-            osal_mutex_unlock(&g_mutex);
+            // osal_mutex_unlock(&g_mutex);
     }    
     
 
@@ -2370,10 +2370,10 @@ int cywee_start(void)
 
     g_sport_timer = osTimerNew((osTimerFunc_t)cywee_service_check_timer_callback, osTimerPeriodic, NULL, NULL);
 
-    int ret = osal_mutex_init(&g_mutex);
-    if (ret != 0) {
-        printf("osal_mutex_init g_mutex failed\n");
-    }
+    // int ret = osal_mutex_init(&g_mutex);
+    // if (ret != 0) {
+    //     printf("osal_mutex_init g_mutex failed\n");
+    // }
     //cywee_inactivity_mode_change(INACTIVITY_MODE_SEDENTARY_AND_NAP);
 
     //cywee_inactivity_mode_change(INACTIVITY_MODE_SLEEPING);
index b914939..879ae6b 100644 (file)
@@ -1367,18 +1367,18 @@ static void get_avg_hrs(uint8_t hrs)
         avg_hrs = (sum_hrs - max_hrs - min_hrs) / valid_count;\r
 \r
 \r
-        if (last_hrs >= 30 && last_hrs <= 210) \r
-        {\r
-            int16_t diff = avg_hrs - last_hrs;\r
-            if (abs(diff) > 10) \r
-            {\r
-                if (diff > 0) \r
-                    avg_hrs = last_hrs + 5;\r
-                else \r
-                    avg_hrs = last_hrs - 5;\r
-            }\r
-        }\r
-        last_hrs = avg_hrs;\r
+        // if (last_hrs >= 30 && last_hrs <= 210) \r
+        // {\r
+        //     int16_t diff = avg_hrs - last_hrs;\r
+        //     if (abs(diff) > 10) \r
+        //     {\r
+        //         if (diff > 0) \r
+        //             avg_hrs = last_hrs + 5;\r
+        //         else \r
+        //             avg_hrs = last_hrs - 5;\r
+        //     }\r
+        // }\r
+        // last_hrs = avg_hrs;\r
         // printf("max_hrs[%d],min_hrs[%d],avg_hrs[%d]\n",max_hrs,min_hrs,avg_hrs);\r
     }\r
 }\r
index a401880..b3fd855 100644 (file)
@@ -483,7 +483,7 @@ void shutdown_reboot_prejobs_task(void)
 
     while(1)
     {
-        LOS_Msleep(10);
+
     }
 }