#1112,手表,手表断开连接一天后,概率出现时间比北京时间慢5分钟的情况 (根据海思提供方案优化,需要一起验证)
authorluozheng <1732036298@qq.com>
Thu, 31 Oct 2024 03:27:41 +0000 (11:27 +0800)
committerluozheng <1732036298@qq.com>
Thu, 31 Oct 2024 03:27:41 +0000 (11:27 +0800)
code/sdk/drivers/chips/brandy/porting/liteos/riscv70/tick_timer.c

index 9e9712c..da092c1 100755 (executable)
@@ -143,18 +143,19 @@ uint64_t HalClockGetCycles(void)
     lock_int_save = LOS_IntLock();
 
 #ifdef SUPPORT_RC_CALIBRATION
-    if (g_pre_count == 0) {
-        tick_count = (uapi_systick_get_count() * OS_SYS_MS_PER_SECOND) / CLOCK_32K_CALI_FREQ;
-        g_pre_count = uapi_systick_get_count();
-        g_pre_msec = tick_count;
-    } else {
-        now_count = uapi_systick_get_count();
-        msec = (double)((now_count - g_pre_count) * OS_SYS_MS_PER_SECOND) / CLOCK_32K_CALI_FREQ;
-        tick_count = g_pre_msec + msec;
-
-        g_pre_count = now_count;
-        g_pre_msec = tick_count;
-    }
+    // if (g_pre_count == 0) {
+    //     tick_count = (uapi_systick_get_count() * OS_SYS_MS_PER_SECOND) / CLOCK_32K_CALI_FREQ;
+    //     g_pre_count = uapi_systick_get_count();
+    //     g_pre_msec = tick_count;
+    // } else {
+    //     now_count = uapi_systick_get_count();
+    //     msec = (double)((now_count - g_pre_count) * OS_SYS_MS_PER_SECOND) / CLOCK_32K_CALI_FREQ;
+    //     tick_count = g_pre_msec + msec;
+
+    //     g_pre_count = now_count;
+    //     g_pre_msec = tick_count;
+    // }
+    tick_count = uapi_systick_get_ms();
 #else
     tick_count = uapi_systick_get_ms();
 #endif