up
This commit is contained in:
@@ -40,14 +40,14 @@
|
||||
static const char *TAG = "SYS";
|
||||
|
||||
// 自定义 tick 获取函数
|
||||
static uint32_t custom_tick_get(void)
|
||||
{
|
||||
// 返回从启动到现在的毫秒数
|
||||
// 使用64位中间变量避免溢出,采用乘以1.024的倒数近似值
|
||||
uint64_t time_us = esp_timer_get_time();
|
||||
return (uint32_t)((time_us * 1073) >> 20); // 1073/2^20 ≈ 1/1000
|
||||
//return (uint32_t)(esp_timer_get_time() / 1000);
|
||||
}
|
||||
// static uint32_t custom_tick_get(void)
|
||||
// {
|
||||
// // 返回从启动到现在的毫秒数
|
||||
// // 使用64位中间变量避免溢出,采用乘以1.024的倒数近似值
|
||||
// uint64_t time_us = esp_timer_get_time();
|
||||
// return (uint32_t)((time_us * 1073) >> 20); // 1073/2^20 ≈ 1/1000
|
||||
// //return (uint32_t)(esp_timer_get_time() / 1000);
|
||||
// }
|
||||
|
||||
|
||||
esp_timer_handle_t timer_handle;
|
||||
|
||||
Reference in New Issue
Block a user