EXTI bugfix in exti_select_source().
AFIO_EXTICR[1 to 4] registers were not beeing set correctly. You have to force a 0 on the bits that are 0 for the mutex to work. Thanks Linus Casassa <linus@lin.cl> for the patch!
This commit is contained in:
parent
ca53311bfc
commit
1cabc38c3a
@ -129,12 +129,17 @@ void exti_select_source(u32 exti, u32 gpioport)
|
||||
}
|
||||
|
||||
/* Ensure that only valid EXTI lines are used. */
|
||||
if (exti < EXTI4)
|
||||
AFIO_EXTICR1 &= ~(bits << shift);
|
||||
else if (exti < EXTI8)
|
||||
AFIO_EXTICR2 &= ~(bits << shift);
|
||||
else if (exti < EXTI12)
|
||||
AFIO_EXTICR3 &= ~(bits << shift);
|
||||
else if (exti < EXTI16)
|
||||
AFIO_EXTICR4 &= ~(bits << shift);
|
||||
if (exti < EXTI4) {
|
||||
AFIO_EXTICR1 &= ~(0x000F << shift);
|
||||
AFIO_EXTICR1 |= (~bits << shift);
|
||||
} else if (exti < EXTI8) {
|
||||
AFIO_EXTICR2 &= ~(0x000F << shift);
|
||||
AFIO_EXTICR2 |= (~bits << shift);
|
||||
} else if (exti < EXTI12) {
|
||||
AFIO_EXTICR3 &= ~(0x000F << shift);
|
||||
AFIO_EXTICR3 |= (~bits << shift);
|
||||
} else if (exti < EXTI16) {
|
||||
AFIO_EXTICR4 &= ~(0x000F << shift);
|
||||
AFIO_EXTICR4 |= (~bits << shift);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user