• R/O
  • SSH
  • HTTPS

chibios: Commit


Commit MetaInfo

Revision13860 (tree)
Zeit2020-09-20 16:53:48
Autorgdisirio

Log Message

Fixed bug #1123.

Ändern Zusammenfassung

Diff

--- trunk/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti.c (revision 13859)
+++ trunk/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti.c (revision 13860)
@@ -62,36 +62,37 @@
6262 * @api
6363 */
6464 void extiEnableGroup1(uint32_t mask, extimode_t mode) {
65+ uint32_t cmask;
6566
66- /* Masked out lines must not be touched by this driver.*/
67- osalDbgAssert((mask & STM32_EXTI_IMR1_MASK) == 0U, "fixed lines");
67+ /* Mask including only configurable lines.*/
68+ cmask = mask & ~STM32_EXTI_IMR1_MASK;
6869
6970 if ((mode & EXTI_MODE_EDGES_MASK) == 0U) {
7071 /* Disabling channels.*/
7172 EXTI->IMR1 &= ~mask;
7273 EXTI->EMR1 &= ~mask;
73- EXTI->RTSR1 &= ~mask;
74- EXTI->FTSR1 &= ~mask;
74+ EXTI->RTSR1 &= ~cmask;
75+ EXTI->FTSR1 &= ~cmask;
7576 #if STM32_EXTI_SEPARATE_RF == FALSE
76- EXTI->PR1 = mask;
77+ EXTI->PR1 = cmask;
7778 #else
78- EXTI->RPR1 = mask;
79- EXTI->FPR1 = mask;
79+ EXTI->RPR1 = cmask;
80+ EXTI->FPR1 = cmask;
8081 #endif
8182 }
8283 else {
8384 /* Programming edge registers.*/
8485 if (mode & EXTI_MODE_RISING_EDGE) {
85- EXTI->RTSR1 |= mask;
86+ EXTI->RTSR1 |= cmask;
8687 }
8788 else {
88- EXTI->RTSR1 &= ~mask;
89+ EXTI->RTSR1 &= ~cmask;
8990 }
9091 if (mode & EXTI_MODE_FALLING_EDGE) {
91- EXTI->FTSR1 |= mask;
92+ EXTI->FTSR1 |= cmask;
9293 }
9394 else {
94- EXTI->FTSR1 &= ~mask;
95+ EXTI->FTSR1 &= ~cmask;
9596 }
9697
9798 /* Programming interrupt and event registers.*/
@@ -116,36 +117,37 @@
116117 * @api
117118 */
118119 void extiEnableGroup2(uint32_t mask, extimode_t mode) {
120+ uint32_t cmask;
119121
120- /* Masked out lines must not be touched by this driver.*/
121- osalDbgAssert((mask & STM32_EXTI_IMR2_MASK) == 0U, "fixed lines");
122+ /* Mask including only configurable lines.*/
123+ cmask = mask & ~STM32_EXTI_IMR1_MASK;
122124
123125 if ((mode & EXTI_MODE_EDGES_MASK) == 0U) {
124126 /* Disabling channels.*/
125127 EXTI->IMR2 &= ~mask;
126128 EXTI->EMR2 &= ~mask;
127- EXTI->RTSR2 &= ~mask;
128- EXTI->FTSR2 &= ~mask;
129+ EXTI->RTSR2 &= ~cmask;
130+ EXTI->FTSR2 &= ~cmask;
129131 #if STM32_EXTI_SEPARATE_RF == FALSE
130- EXTI->PR2 = mask;
132+ EXTI->PR2 = cmask;
131133 #else
132- EXTI->RPR2 = mask;
133- EXTI->FPR2 = mask;
134+ EXTI->RPR2 = cmask;
135+ EXTI->FPR2 = cmask;
134136 #endif
135137 }
136138 else {
137139 /* Programming edge registers.*/
138140 if (mode & EXTI_MODE_RISING_EDGE) {
139- EXTI->RTSR2 |= mask;
141+ EXTI->RTSR2 |= cmask;
140142 }
141143 else {
142- EXTI->RTSR2 &= ~mask;
144+ EXTI->RTSR2 &= ~cmask;
143145 }
144146 if (mode & EXTI_MODE_FALLING_EDGE) {
145- EXTI->FTSR2 |= mask;
147+ EXTI->FTSR2 |= cmask;
146148 }
147149 else {
148- EXTI->FTSR2 &= ~mask;
150+ EXTI->FTSR2 &= ~cmask;
149151 }
150152
151153 /* Programming interrupt and event registers.*/
--- trunk/readme.txt (revision 13859)
+++ trunk/readme.txt (revision 13860)
@@ -117,6 +117,8 @@
117117 MEMS Accelerometers.
118118 - NEW: Safer messages mechanism for sandboxes (to be backported to 20.3.1).
119119 - NEW: Added latency measurement test application.
120+- FIX: Fixed STM32 EXTIv1 driver unable to enable/disable fixed lines
121+ (bug #1123)(backported to 20.3.3)(backported to 19.1.5).
120122 - FIX: Fixed incorrect STM32 iWDG initialization in windowed mode (bug #1122)
121123 (backported to 20.3.3)(backported to 19.1.5).
122124 - FIX: Fixed ignored HSIDIV setting on STM32G0xx (bug #1121)
Show on old repository browser