From a99b03103808c0cabc9bb8216da76b344d082f2c Mon Sep 17 00:00:00 2001 From: Edam Abdelhedi Date: Wed, 6 May 2026 12:01:49 +0200 Subject: [PATCH 1/2] hrtim: fix burst mode cycle count --- zephyr/modules/owntech_hrtim_driver/zephyr/src/hrtim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zephyr/modules/owntech_hrtim_driver/zephyr/src/hrtim.c b/zephyr/modules/owntech_hrtim_driver/zephyr/src/hrtim.c index b0cf8125..c141a466 100644 --- a/zephyr/modules/owntech_hrtim_driver/zephyr/src/hrtim.c +++ b/zephyr/modules/owntech_hrtim_driver/zephyr/src/hrtim.c @@ -1319,11 +1319,11 @@ void hrtim_burst_mode_init(void){ } void hrtim_burst_set(int bm_cmp, int bm_per){ - /* Set the number of period active in burst mode*/ - LL_HRTIM_BM_SetCompare(HRTIM1, bm_cmp); + /* Set the number of period inactive in burst mode*/ + LL_HRTIM_BM_SetCompare(HRTIM1, bm_cmp - 1 ); /* Set the number of period of the burst pattern (active + inactive periods)*/ - LL_HRTIM_BM_SetPeriod(HRTIM1, bm_per); + LL_HRTIM_BM_SetPeriod(HRTIM1, bm_per - 1); } void hrtim_burst_start(void){ From 7b53cf8ab5be9753deeb09341bba14bb42c5db2d Mon Sep 17 00:00:00 2001 From: Jean Alinei Date: Thu, 14 May 2026 20:34:25 +0200 Subject: [PATCH 2/2] Fixed indentation of the comment --- zephyr/modules/owntech_hrtim_driver/zephyr/src/hrtim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zephyr/modules/owntech_hrtim_driver/zephyr/src/hrtim.c b/zephyr/modules/owntech_hrtim_driver/zephyr/src/hrtim.c index c141a466..dada30ab 100644 --- a/zephyr/modules/owntech_hrtim_driver/zephyr/src/hrtim.c +++ b/zephyr/modules/owntech_hrtim_driver/zephyr/src/hrtim.c @@ -1319,7 +1319,7 @@ void hrtim_burst_mode_init(void){ } void hrtim_burst_set(int bm_cmp, int bm_per){ - /* Set the number of period inactive in burst mode*/ + /* Set the number of period inactive in burst mode*/ LL_HRTIM_BM_SetCompare(HRTIM1, bm_cmp - 1 ); /* Set the number of period of the burst pattern (active + inactive periods)*/ @@ -1619,4 +1619,4 @@ uint32_t hrtim_get_max_frequency(hrtim_tu_number_t tu_number) uint32_t hrtim_get_min_frequency(hrtim_tu_number_t tu_number) { return tu_channel[tu_number]->pwm_conf.min_frequency; -} \ No newline at end of file +}