1
0

interrupt.c 708 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2018/10/01 Bernard The first version
  9. */
  10. #include <rthw.h>
  11. #include <board.h>
  12. #include <RV32M1_ri5cy.h>
  13. typedef void (*irq_handler_t)(void);
  14. extern const irq_handler_t isrTable[];
  15. void SystemIrqHandler(uint32_t mcause)
  16. {
  17. uint32_t intNum;
  18. if (mcause & 0x80000000) /* For external interrupt. */
  19. {
  20. intNum = mcause & 0x1FUL;
  21. /* Clear pending flag in EVENT unit .*/
  22. EVENT_UNIT->INTPTPENDCLEAR = (1U << intNum);
  23. /* Now call the real irq handler for intNum */
  24. isrTable[intNum]();
  25. }
  26. }