From 2f2d2e776c60d236b2df71c898239822ba1a0367 Mon Sep 17 00:00:00 2001 From: Li Hang Fan Date: Wed, 2 Mar 2022 18:05:59 +0800 Subject: [PATCH] MCPWM/deadtime: fix and sync preset deadtime modes with well-known definition (backport v4.1) --- components/soc/esp32/include/hal/mcpwm_ll.h | 10 +++++----- components/soc/include/hal/mcpwm_types.h | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/components/soc/esp32/include/hal/mcpwm_ll.h b/components/soc/esp32/include/hal/mcpwm_ll.h index 3388b77969..c018b7925f 100644 --- a/components/soc/esp32/include/hal/mcpwm_ll.h +++ b/components/soc/esp32/include/hal/mcpwm_ll.h @@ -512,12 +512,12 @@ static inline void mcpwm_ll_set_deadtime_mode(mcpwm_dev_t *mcpwm, MCPWM_DT0_A_OUTBYPASS_M | MCPWM_DT0_B_OUTBYPASS_M) static uint32_t deadtime_mode_settings[MCPWM_DEADTIME_TYPE_MAX] = { - [MCPWM_BYPASS_RED] = 0b010010000 << MCPWM_DT0_DEB_MODE_S, + [MCPWM_BYPASS_RED] = 0b010000000 << MCPWM_DT0_DEB_MODE_S, [MCPWM_BYPASS_FED] = 0b100000000 << MCPWM_DT0_DEB_MODE_S, - [MCPWM_ACTIVE_HIGH_MODE] = 0b000010000 << MCPWM_DT0_DEB_MODE_S, - [MCPWM_ACTIVE_LOW_MODE] = 0b001110000 << MCPWM_DT0_DEB_MODE_S, - [MCPWM_ACTIVE_HIGH_COMPLIMENT_MODE] = 0b001010000 << MCPWM_DT0_DEB_MODE_S, - [MCPWM_ACTIVE_LOW_COMPLIMENT_MODE] = 0b000101000 << MCPWM_DT0_DEB_MODE_S, + [MCPWM_ACTIVE_HIGH_MODE] = 0b000000000 << MCPWM_DT0_DEB_MODE_S, + [MCPWM_ACTIVE_LOW_MODE] = 0b001100000 << MCPWM_DT0_DEB_MODE_S, + [MCPWM_ACTIVE_HIGH_COMPLIMENT_MODE] = 0b001000000 << MCPWM_DT0_DEB_MODE_S, + [MCPWM_ACTIVE_LOW_COMPLIMENT_MODE] = 0b000100000 << MCPWM_DT0_DEB_MODE_S, [MCPWM_ACTIVE_RED_FED_FROM_PWMXA] = 0b000000011 << MCPWM_DT0_DEB_MODE_S, [MCPWM_ACTIVE_RED_FED_FROM_PWMXB] = 0b000001011 << MCPWM_DT0_DEB_MODE_S, [MCPWM_DEADTIME_BYPASS] = 0b110000000 << MCPWM_DT0_DEB_MODE_S, diff --git a/components/soc/include/hal/mcpwm_types.h b/components/soc/include/hal/mcpwm_types.h index ca9052de49..c493f18bc4 100644 --- a/components/soc/include/hal/mcpwm_types.h +++ b/components/soc/include/hal/mcpwm_types.h @@ -57,14 +57,14 @@ typedef enum { */ typedef enum { MCPWM_DEADTIME_BYPASS = 0, /*!