Skip to content

Commit 2d65f49

Browse files
Merge pull request #4954 from c1728p9/fix_isr_clear
Fix ISR powerdown in mbed_application.c
2 parents 82f5ce2 + 29ad5bb commit 2d65f49

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

platform/mbed_application.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ void mbed_start_application(uintptr_t address)
4444

4545
static void powerdown_nvic()
4646
{
47-
int isr_count;
47+
int isr_groups_32;
4848
int i;
4949
int j;
5050

51-
isr_count = (SCnSCB->ICTR & SCnSCB_ICTR_INTLINESNUM_Msk) >> SCnSCB_ICTR_INTLINESNUM_Pos;
52-
for (i = 0; i < isr_count; i++) {
51+
isr_groups_32 = ((SCnSCB->ICTR & SCnSCB_ICTR_INTLINESNUM_Msk) >> SCnSCB_ICTR_INTLINESNUM_Pos) + 1;
52+
for (i = 0; i < isr_groups_32; i++) {
5353
NVIC->ICER[i] = 0xFFFFFFFF;
5454
NVIC->ICPR[i] = 0xFFFFFFFF;
5555
for (j = 0; j < 8; j++) {

0 commit comments

Comments
 (0)