fix(ledc): clear ledc_mem_force_pd when LEDC peripheral is in use

And enable target test for C5 and P4
This commit is contained in:
Song Ruo Jing
2024-07-01 19:43:40 +08:00
parent f978dd0af9
commit 4cd74f51db
13 changed files with 144 additions and 49 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -46,7 +46,8 @@ extern "C" {
*
* @param enable Enable/Disable
*/
static inline void ledc_ll_enable_bus_clock(bool enable) {
static inline void ledc_ll_enable_bus_clock(bool enable)
{
if (enable) {
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_LEDC_CLK_EN);
} else {
@@ -61,7 +62,8 @@ static inline void ledc_ll_enable_bus_clock(bool enable) {
/**
* @brief Reset whole peripheral register to init value defined by HW design
*/
static inline void ledc_ll_enable_reset_reg(bool enable) {
static inline void ledc_ll_enable_reset_reg(bool enable)
{
if (enable) {
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_LEDC_RST);
} else {
@@ -73,6 +75,14 @@ static inline void ledc_ll_enable_reset_reg(bool enable) {
/// the critical section needs to declare the __DECLARE_RCC_ATOMIC_ENV variable in advance
#define ledc_ll_enable_reset_reg(...) (void)__DECLARE_RCC_ATOMIC_ENV; ledc_ll_enable_reset_reg(__VA_ARGS__)
/**
* @brief Enable the power for LEDC memory block
*/
static inline void ledc_ll_enable_mem_power(bool enable)
{
// No LEDC mem block on ESP32
}
/**
* @brief Enable LEDC function clock
*
@@ -81,7 +91,8 @@ static inline void ledc_ll_enable_reset_reg(bool enable) {
*
* @return None
*/
static inline void ledc_ll_enable_clock(ledc_dev_t *hw, bool en) {
static inline void ledc_ll_enable_clock(ledc_dev_t *hw, bool en)
{
//resolve for compatibility
}