mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
legacy_timer: fix converting count value into time second
This commit is contained in:
parent
a0c2252756
commit
4b26a5d340
@ -90,12 +90,12 @@ esp_err_t timer_get_counter_time_sec(timer_group_t group_num, timer_idx_t timer_
|
|||||||
#endif
|
#endif
|
||||||
#if SOC_TIMER_GROUP_SUPPORT_AHB
|
#if SOC_TIMER_GROUP_SUPPORT_AHB
|
||||||
case TIMER_SRC_CLK_AHB:
|
case TIMER_SRC_CLK_AHB:
|
||||||
*time = (double)timer_val * div / 48 * 1000 * 1000;
|
*time = (double)timer_val * div / (48 * 1000 * 1000);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if SOC_TIMER_GROUP_SUPPORT_PLL_F40M
|
#if SOC_TIMER_GROUP_SUPPORT_PLL_F40M
|
||||||
case TIMER_SRC_CLK_PLL_F40M:
|
case TIMER_SRC_CLK_PLL_F40M:
|
||||||
*time = (double)timer_val * div / 40 * 1000 * 1000;
|
*time = (double)timer_val * div / (40 * 1000 * 1000);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user