mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
fix(esp_hw_support): update LACT clock prescale immediately when APB changes on esp32
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -7,6 +7,24 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#if CONFIG_ESP_TIMER_IMPL_TG0_LAC
|
||||
/* Selects which Timer Group peripheral to use */
|
||||
#define LACT_MODULE 0
|
||||
|
||||
/* Desired number of timer ticks per microsecond.
|
||||
* This value should be small enough so that all possible APB frequencies
|
||||
* could be divided by it without remainder.
|
||||
* On the other hand, the smaller this value is, the longer we need to wait
|
||||
* after setting UPDATE_REG before the timer value can be read.
|
||||
* If LACT_TICKS_PER_US == 1, then we need to wait up to 1 microsecond, which
|
||||
* makes esp_timer_impl_get_time function take too much time.
|
||||
* The value LACT_TICKS_PER_US == 2 allows for most of the APB frequencies, and
|
||||
* allows reading the counter quickly enough.
|
||||
*/
|
||||
#define LACT_TICKS_PER_US 2
|
||||
#endif
|
||||
|
||||
// we assign the systimer resources statically
|
||||
#define SYSTIMER_COUNTER_ESPTIMER 0 // Counter used by esptimer, to generate the system level wall clock
|
||||
|
||||
Reference in New Issue
Block a user