diff --git a/components/esp_hw_support/port/esp32c5/pmu_pvt.c b/components/esp_hw_support/port/esp32c5/pmu_pvt.c index 9f81f95832d..06d432dfffa 100644 --- a/components/esp_hw_support/port/esp32c5/pmu_pvt.c +++ b/components/esp_hw_support/port/esp32c5/pmu_pvt.c @@ -44,9 +44,13 @@ static uint8_t get_lp_hp_gap(void) lp_hp_gap = gap_abs_value; } lp_hp_gap = lp_hp_gap - 8; - assert((lp_hp_gap >= -15) && (lp_hp_gap <= 7)); - if (lp_hp_gap < 0 ) { - lp_hp_gap = 16 - lp_hp_gap; + if (lp_hp_gap < 0) { + if (lp_hp_gap >= -15) { + lp_hp_gap = 16 - lp_hp_gap; + } else { + // pvt offset value only has 4 bit + lp_hp_gap = 31; + } } } return lp_hp_gap; diff --git a/components/esp_hw_support/port/esp32c6/pmu_pvt.c b/components/esp_hw_support/port/esp32c6/pmu_pvt.c index 33fb41edea4..ea2bd3e2f98 100644 --- a/components/esp_hw_support/port/esp32c6/pmu_pvt.c +++ b/components/esp_hw_support/port/esp32c6/pmu_pvt.c @@ -44,9 +44,13 @@ static uint8_t get_lp_hp_gap(void) pvt_offset = offset_value; } pvt_offset = pvt_offset - 2; - assert((pvt_offset >= -15) && (pvt_offset <= 13)); - if (pvt_offset < 0 ) { - pvt_offset = 16 - pvt_offset; + if (pvt_offset < 0) { + if (pvt_offset >= -15) { + pvt_offset = 16 - pvt_offset; + } else { + // pvt offset value only has 4 bit + pvt_offset = 31; + } } } return pvt_offset; diff --git a/components/esp_hw_support/port/esp32c61/pmu_pvt.c b/components/esp_hw_support/port/esp32c61/pmu_pvt.c index 4258f77155b..b71cf2648e1 100644 --- a/components/esp_hw_support/port/esp32c61/pmu_pvt.c +++ b/components/esp_hw_support/port/esp32c61/pmu_pvt.c @@ -43,9 +43,13 @@ static uint8_t get_lp_hp_gap(void) lp_hp_gap = gap_abs_value; } lp_hp_gap = lp_hp_gap - 8; - assert((lp_hp_gap >= -15) && (lp_hp_gap <= 7)); - if (lp_hp_gap < 0 ) { - lp_hp_gap = 16 - lp_hp_gap; + if (lp_hp_gap < 0) { + if (lp_hp_gap >= -15) { + lp_hp_gap = 16 - lp_hp_gap; + } else { + // pvt offset value only has 4 bit + lp_hp_gap = 31; + } } } return lp_hp_gap;