trap.c 609 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2020, Shenzhen Academy of Aerospace Technology
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-10-16 Dystopia the first version
  9. */
  10. #include <rtthread.h>
  11. #include <rthw.h>
  12. extern struct rt_irq_desc isr_table[];
  13. void rt_hw_trap(int tt, unsigned int *sp)
  14. {
  15. void *param;
  16. rt_isr_handler_t isr_func;
  17. /* get interrupt service routine */
  18. isr_func = isr_table[tt].handler;
  19. param = isr_table[tt].param;
  20. /* turn to interrupt service routine */
  21. if (isr_func != RT_NULL)
  22. isr_func(tt, param);
  23. }