Skip to content

Commit

Permalink
Update EXTI isr.
Browse files Browse the repository at this point in the history
  • Loading branch information
wb committed Jul 25, 2024
1 parent 3aa9e4d commit 1578158
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 14 deletions.
23 changes: 16 additions & 7 deletions os/hal/ports/WB32/WB32F3G71xx/wb32_isr.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ OSAL_IRQ_HANDLER(WB32_EXTI0_IRQ_VECTOR) {
OSAL_IRQ_PROLOGUE();

pr = EXTI->PR & EXTI_PR_PR0;
EXTI->PR = pr;

exti_serve_irq(pr, 0);

EXTI->PR = EXTI_PR_PR0;

OSAL_IRQ_EPILOGUE();
}
#endif
Expand All @@ -83,10 +84,11 @@ OSAL_IRQ_HANDLER(WB32_EXTI1_IRQ_VECTOR) {
OSAL_IRQ_PROLOGUE();

pr = EXTI->PR & EXTI_PR_PR1;
EXTI->PR = pr;

exti_serve_irq(pr, 1);

EXTI->PR = EXTI_PR_PR1;

OSAL_IRQ_EPILOGUE();
}
#endif
Expand All @@ -103,9 +105,10 @@ OSAL_IRQ_HANDLER(WB32_EXTI2_IRQ_VECTOR) {
OSAL_IRQ_PROLOGUE();

pr = EXTI->PR & EXTI_PR_PR2;
EXTI->PR = pr;

exti_serve_irq(pr, 2);

EXTI->PR = EXTI_PR_PR2;

OSAL_IRQ_EPILOGUE();
}
Expand All @@ -123,10 +126,11 @@ OSAL_IRQ_HANDLER(WB32_EXTI3_IRQ_VECTOR) {
OSAL_IRQ_PROLOGUE();

pr = EXTI->PR & EXTI_PR_PR3;
EXTI->PR = pr;

exti_serve_irq(pr, 3);

EXTI->PR = EXTI_PR_PR3;

OSAL_IRQ_EPILOGUE();
}
#endif
Expand All @@ -143,10 +147,11 @@ OSAL_IRQ_HANDLER(WB32_EXTI4_IRQ_VECTOR) {
OSAL_IRQ_PROLOGUE();

pr = EXTI->PR & EXTI_PR_PR4;
EXTI->PR = pr;

exti_serve_irq(pr, 4);

EXTI->PR = EXTI_PR_PR4;

OSAL_IRQ_EPILOGUE();
}
#endif
Expand All @@ -164,14 +169,16 @@ OSAL_IRQ_HANDLER(WB32_EXTI9_5_IRQ_VECTOR) {

pr = EXTI->PR & (EXTI_PR_PR5 | EXTI_PR_PR6 | EXTI_PR_PR7 |
EXTI_PR_PR8 | EXTI_PR_PR9);
EXTI->PR = pr;

exti_serve_irq(pr, 5);
exti_serve_irq(pr, 6);
exti_serve_irq(pr, 7);
exti_serve_irq(pr, 8);
exti_serve_irq(pr, 9);

EXTI->PR = EXTI_PR_PR5 | EXTI_PR_PR6 | EXTI_PR_PR7 |
EXTI_PR_PR8 | EXTI_PR_PR9;

OSAL_IRQ_EPILOGUE();
}
#endif
Expand All @@ -189,7 +196,6 @@ OSAL_IRQ_HANDLER(WB32_EXTI15_10_IRQ_VECTOR) {

pr = EXTI->PR & (EXTI_PR_PR10 | EXTI_PR_PR11 | EXTI_PR_PR12 |
EXTI_PR_PR13 | EXTI_PR_PR14 | EXTI_PR_PR15);
EXTI->PR = pr;

exti_serve_irq(pr, 10);
exti_serve_irq(pr, 11);
Expand All @@ -198,6 +204,9 @@ OSAL_IRQ_HANDLER(WB32_EXTI15_10_IRQ_VECTOR) {
exti_serve_irq(pr, 14);
exti_serve_irq(pr, 15);

EXTI->PR = EXTI_PR_PR10 | EXTI_PR_PR11 | EXTI_PR_PR12 |
EXTI_PR_PR13 | EXTI_PR_PR14 | EXTI_PR_PR15;

OSAL_IRQ_EPILOGUE();
}
#endif
Expand Down
23 changes: 16 additions & 7 deletions os/hal/ports/WB32/WB32FQ95xx/wb32_isr.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ OSAL_IRQ_HANDLER(WB32_EXTI0_IRQ_VECTOR) {
OSAL_IRQ_PROLOGUE();

pr = EXTI->PR & EXTI_PR_PR0;
EXTI->PR = pr;

exti_serve_irq(pr, 0);

EXTI->PR = EXTI_PR_PR0;

OSAL_IRQ_EPILOGUE();
}
#endif
Expand All @@ -83,10 +84,11 @@ OSAL_IRQ_HANDLER(WB32_EXTI1_IRQ_VECTOR) {
OSAL_IRQ_PROLOGUE();

pr = EXTI->PR & EXTI_PR_PR1;
EXTI->PR = pr;

exti_serve_irq(pr, 1);

EXTI->PR = EXTI_PR_PR1;

OSAL_IRQ_EPILOGUE();
}
#endif
Expand All @@ -103,9 +105,10 @@ OSAL_IRQ_HANDLER(WB32_EXTI2_IRQ_VECTOR) {
OSAL_IRQ_PROLOGUE();

pr = EXTI->PR & EXTI_PR_PR2;
EXTI->PR = pr;

exti_serve_irq(pr, 2);

EXTI->PR = EXTI_PR_PR2;

OSAL_IRQ_EPILOGUE();
}
Expand All @@ -123,10 +126,11 @@ OSAL_IRQ_HANDLER(WB32_EXTI3_IRQ_VECTOR) {
OSAL_IRQ_PROLOGUE();

pr = EXTI->PR & EXTI_PR_PR3;
EXTI->PR = pr;

exti_serve_irq(pr, 3);

EXTI->PR = EXTI_PR_PR3;

OSAL_IRQ_EPILOGUE();
}
#endif
Expand All @@ -143,10 +147,11 @@ OSAL_IRQ_HANDLER(WB32_EXTI4_IRQ_VECTOR) {
OSAL_IRQ_PROLOGUE();

pr = EXTI->PR & EXTI_PR_PR4;
EXTI->PR = pr;

exti_serve_irq(pr, 4);

EXTI->PR = EXTI_PR_PR4;

OSAL_IRQ_EPILOGUE();
}
#endif
Expand All @@ -164,14 +169,16 @@ OSAL_IRQ_HANDLER(WB32_EXTI9_5_IRQ_VECTOR) {

pr = EXTI->PR & (EXTI_PR_PR5 | EXTI_PR_PR6 | EXTI_PR_PR7 |
EXTI_PR_PR8 | EXTI_PR_PR9);
EXTI->PR = pr;

exti_serve_irq(pr, 5);
exti_serve_irq(pr, 6);
exti_serve_irq(pr, 7);
exti_serve_irq(pr, 8);
exti_serve_irq(pr, 9);

EXTI->PR = EXTI_PR_PR5 | EXTI_PR_PR6 | EXTI_PR_PR7 |
EXTI_PR_PR8 | EXTI_PR_PR9;

OSAL_IRQ_EPILOGUE();
}
#endif
Expand All @@ -189,7 +196,6 @@ OSAL_IRQ_HANDLER(WB32_EXTI15_10_IRQ_VECTOR) {

pr = EXTI->PR & (EXTI_PR_PR10 | EXTI_PR_PR11 | EXTI_PR_PR12 |
EXTI_PR_PR13 | EXTI_PR_PR14 | EXTI_PR_PR15);
EXTI->PR = pr;

exti_serve_irq(pr, 10);
exti_serve_irq(pr, 11);
Expand All @@ -198,6 +204,9 @@ OSAL_IRQ_HANDLER(WB32_EXTI15_10_IRQ_VECTOR) {
exti_serve_irq(pr, 14);
exti_serve_irq(pr, 15);

EXTI->PR = EXTI_PR_PR10 | EXTI_PR_PR11 | EXTI_PR_PR12 |
EXTI_PR_PR13 | EXTI_PR_PR14 | EXTI_PR_PR15;

OSAL_IRQ_EPILOGUE();
}
#endif
Expand Down

0 comments on commit 1578158

Please sign in to comment.