mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 05:04:33 +02:00
legacy_timer: fix converting count value into time second
This commit is contained in:
@@ -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:
|
||||||
|
Reference in New Issue
Block a user