From 3bb83fcbda38f88bd0da132da44001a26c17807e Mon Sep 17 00:00:00 2001 From: dragonmux Date: Tue, 26 Sep 2023 21:45:21 +0100 Subject: [PATCH 1/2] misc: Bumped the commit for libopencm3 we look to to make the new timer functions available --- libopencm3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libopencm3 b/libopencm3 index 0c6c7c2895c..834a4184a3c 160000 --- a/libopencm3 +++ b/libopencm3 @@ -1 +1 @@ -Subproject commit 0c6c7c2895c1c2b81c157242a754f99964de828d +Subproject commit 834a4184a3c8fe8495f8013f0b9649e93f57ef33 From 76a01c23866676697528aa781b34a2ea8013cfe4 Mon Sep 17 00:00:00 2001 From: dragonmux Date: Tue, 26 Sep 2023 21:46:38 +0100 Subject: [PATCH 2/2] native/platform: Switched `timer_set_oc_mode` to `timer_set_oc3_mode` for a nice Flash saving --- src/platforms/native/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/native/platform.c b/src/platforms/native/platform.c index d35c1357fc2..b8ee57be851 100644 --- a/src/platforms/native/platform.c +++ b/src/platforms/native/platform.c @@ -225,7 +225,7 @@ void platform_init(void) */ timer_set_mode(TIM1, TIM_CR1_CKD_CK_INT, TIM_CR1_CMS_EDGE, TIM_CR1_DIR_UP); /* Use PWM mode 1 so that the signal generated is low till it exceeds the set value */ - timer_set_oc_mode(TIM1, TIM_OC3, TIM_OCM_PWM1); + timer_set_oc3_mode(TIM1, TIM_OCM_PWM1); /* Mark the output active-low due to how this drives the target pin */ timer_set_oc_polarity_low(TIM1, TIM_OC3N); timer_enable_oc_output(TIM1, TIM_OC3N);