summaryrefslogtreecommitdiff
path: root/ports/esp32/machine_timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/esp32/machine_timer.c')
-rw-r--r--ports/esp32/machine_timer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ports/esp32/machine_timer.c b/ports/esp32/machine_timer.c
index 83fe81f6e..c66cb2a48 100644
--- a/ports/esp32/machine_timer.c
+++ b/ports/esp32/machine_timer.c
@@ -189,6 +189,9 @@ STATIC void machine_timer_enable(machine_timer_obj_t *self) {
config.divider = TIMER_DIVIDER;
config.intr_type = TIMER_INTR_LEVEL;
config.counter_en = TIMER_PAUSE;
+ #if SOC_TIMER_GROUP_SUPPORT_XTAL
+ config.clk_src = TIMER_SRC_CLK_APB;
+ #endif
check_esp_err(timer_init(self->group, self->index, &config));
check_esp_err(timer_set_counter_value(self->group, self->index, 0x00000000));