Alarm callbacks in hal_st_lld.c wrong indexing Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
User avatar
FXCoder
Posts: 363
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 168 times
Been thanked: 120 times

Alarm callbacks in hal_st_lld.c wrong indexing  Topic is solved

Postby FXCoder » Wed Feb 17, 2021 2:16 am

Hi,
Fix required in 20.3.x for incorrect indexing of ALAM callbacks.
The code in trunk is correct.
--
Bob

Code: Select all

Index: ChibiOS (20.3.x)/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.c
===================================================================
--- ChibiOS (20.3.x)/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.c   (revision 14019)
+++ ChibiOS (20.3.x)/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.c   (working copy)
@@ -465,7 +465,7 @@
 #if OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING
 #if ST_LLD_NUM_ALARMS > 1
   if ((sr & TIM_SR_CC2IF) != 0U) {
-    if (st_callbacks[2] != NULL) {
+    if (st_callbacks[0] != NULL) {
       st_callbacks[0](1U);
     }
   }
@@ -472,7 +472,7 @@
 #endif
 #if ST_LLD_NUM_ALARMS > 2
   if ((sr & TIM_SR_CC3IF) != 0U) {
-    if (st_callbacks[2] != NULL) {
+    if (st_callbacks[1] != NULL) {
       st_callbacks[1](2U);
     }
   }

User avatar
Giovanni
Site Admin
Posts: 13520
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 861 times
Been thanked: 743 times
Contact:

Re: Alarm callbacks in hal_st_lld.c wrong indexing

Postby Giovanni » Sun Mar 07, 2021 10:32 am

Fixed thanks. No ticket because it was an unused feature.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 5 guests