From: luozheng <1732036298@qq.com> Date: Thu, 31 Oct 2024 03:27:41 +0000 (+0800) Subject: #1112,手表,手表断开连接一天后,概率出现时间比北京时间慢5分钟的情况 (根据海思提供方案优化,需要一起验证) X-Git-Tag: fd230_release_V1.3.102~152^2~3 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=c83a110768c54cf106d4b628cbe661c3dc584259;p=mirrors%2FFD230.git #1112,手表,手表断开连接一天后,概率出现时间比北京时间慢5分钟的情况 (根据海思提供方案优化,需要一起验证) --- diff --git a/code/sdk/drivers/chips/brandy/porting/liteos/riscv70/tick_timer.c b/code/sdk/drivers/chips/brandy/porting/liteos/riscv70/tick_timer.c index 9e9712c1e..da092c196 100755 --- a/code/sdk/drivers/chips/brandy/porting/liteos/riscv70/tick_timer.c +++ b/code/sdk/drivers/chips/brandy/porting/liteos/riscv70/tick_timer.c @@ -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