File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 15
15
#include "esp32-hal-timer.h"
16
16
#include "driver/gptimer.h"
17
17
#include "soc/soc_caps.h"
18
+ #if defined __has_include && __has_include ("clk_tree .h ")
18
19
#include "clk_tree.h"
20
+ #else
21
+ #include "esp_clk_tree.h"
22
+ #endif
19
23
20
24
typedef void (* voidFuncPtr )(void );
21
25
typedef void (* voidFuncPtrArg )(void * );
@@ -81,7 +85,11 @@ hw_timer_t * timerBegin(uint32_t frequency){
81
85
soc_periph_gptimer_clk_src_t gptimer_clks [] = SOC_GPTIMER_CLKS ;
82
86
for (size_t i = 0 ; i < sizeof (gptimer_clks ) / sizeof (gptimer_clks [0 ]); i ++ ){
83
87
clk = gptimer_clks [i ];
88
+ #if defined __has_include && __has_include ("clk_tree .h ")
84
89
clk_tree_src_get_freq_hz (clk , CLK_TREE_SRC_FREQ_PRECISION_CACHED , & counter_src_hz );
90
+ #else
91
+ esp_clk_tree_src_get_freq_hz (clk , CLK_TREE_SRC_FREQ_PRECISION_CACHED , & counter_src_hz );
92
+ #endif
85
93
divider = counter_src_hz / frequency ;
86
94
if ((divider >= 2 ) && (divider <= 65536 )){
87
95
break ;
You can’t perform that action at this time.
0 commit comments