File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 1515#include "esp32-hal-timer.h"
1616#include "driver/gptimer.h"
1717#include "soc/soc_caps.h"
18+ #if defined __has_include && __has_include ("clk_tree .h ")
1819#include "clk_tree.h"
20+ #else
21+ #include "esp_clk_tree.h"
22+ #endif
1923
2024typedef void (* voidFuncPtr )(void );
2125typedef void (* voidFuncPtrArg )(void * );
@@ -81,7 +85,11 @@ hw_timer_t * timerBegin(uint32_t frequency){
8185 soc_periph_gptimer_clk_src_t gptimer_clks [] = SOC_GPTIMER_CLKS ;
8286 for (size_t i = 0 ; i < sizeof (gptimer_clks ) / sizeof (gptimer_clks [0 ]); i ++ ){
8387 clk = gptimer_clks [i ];
88+ #if defined __has_include && __has_include ("clk_tree .h ")
8489 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
8593 divider = counter_src_hz / frequency ;
8694 if ((divider >= 2 ) && (divider <= 65536 )){
8795 break ;
You can’t perform that action at this time.
0 commit comments