mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-12 01:18:22 +00:00
Merge branch 'fix/fix_esp_timer_accuracy_when_do_dfs_v5.3' into 'release/v5.3'
fix(esp_hw_support): improve esp timer accuracy on DFS for esp32 & esp32s2 (v5.3) See merge request espressif/esp-idf!39341
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -10,6 +10,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "esp_attr.h"
|
||||
#include "hal/assert.h"
|
||||
#include "hal/misc.h"
|
||||
#include "hal/timer_types.h"
|
||||
@@ -329,6 +330,19 @@ static inline volatile void *timer_ll_get_intr_status_reg(timg_dev_t *hw)
|
||||
return &hw->int_st_timers.val;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set clock prescale for LACT timer
|
||||
*
|
||||
* @param hw Timer Group register base address
|
||||
* @param timer_num Timer number in the group
|
||||
* @param divider Prescale value (0 and 1 are not valid)
|
||||
*/
|
||||
FORCE_INLINE_ATTR void timer_ll_set_lact_clock_prescale(timg_dev_t *hw, uint32_t divider)
|
||||
{
|
||||
HAL_ASSERT(divider>=2);
|
||||
HAL_FORCE_MODIFY_U32_REG_FIELD(hw->lactconfig, lact_divider, divider);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user