Skip to content

Commit 0d76d55

Browse files
Merge branch 'fix/modify_bldc_ledc' into 'master'
fix: modify bldc_ledc conf for ESP32H2 and ESP32C6 See merge request ae_group/esp-iot-solution!1404
2 parents 59a708e + d234863 commit 0d76d55

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

components/motor/esp_sensorless_bldc_control/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# ChangeLog
22

3+
## v1.0.2 - 2025-10-24
4+
5+
### Bug fix:
6+
7+
* Change the default clock source for the LEDC timer to utilise the LEDC_USE_XTAL_CLK source when the target platform is H2、C6、P4.
8+
39
## v1.0.1 - 2025-10-22
410

511
### Enhancements

components/motor/esp_sensorless_bldc_control/hardware_driver/include/bldc_ledc.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -16,6 +16,16 @@ extern "C" {
1616
#define BLDC_LEDC_MODE LEDC_LOW_SPEED_MODE
1717
#define BLDC_LEDC_DUTY_RES LEDC_TIMER_11_BIT
1818

19+
#if CONFIG_IDF_TARGET_ESP32H2 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32P4
20+
#define LEDC_TIMER_CONFIG_DEFAULT() \
21+
{ \
22+
.speed_mode = BLDC_LEDC_MODE, \
23+
.duty_resolution = BLDC_LEDC_DUTY_RES, \
24+
.timer_num = LEDC_TIMER_0, \
25+
.freq_hz = FREQ_HZ, \
26+
.clk_cfg = LEDC_USE_XTAL_CLK, \
27+
}
28+
#else
1929
#define LEDC_TIMER_CONFIG_DEFAULT() \
2030
{ \
2131
.speed_mode = BLDC_LEDC_MODE, \
@@ -24,6 +34,7 @@ extern "C" {
2434
.freq_hz = FREQ_HZ, \
2535
.clk_cfg = LEDC_USE_APB_CLK, \
2636
}
37+
#endif
2738

2839
#define LEDC_CHANNEL_CONFIG_DEFAULT() \
2940
{ \

components/motor/esp_sensorless_bldc_control/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 1.0.1
1+
version: 1.0.2
22
targets:
33
- esp32
44
- esp32s3

0 commit comments

Comments
 (0)