ch32v10x_it.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /********************************** (C) COPYRIGHT *******************************
  2. * File Name : ch32v10x_it.c
  3. * Author : WCH
  4. * Version : V1.0.0
  5. * Date : 2020/04/30
  6. * Description : Main Interrupt Service Routines.
  7. * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
  8. * SPDX-License-Identifier: Apache-2.0
  9. *******************************************************************************/
  10. #include "ch32v10x_it.h"
  11. #include "board.h"
  12. #include <rtthread.h>
  13. void NMI_Handler(void) __attribute__((interrupt()));
  14. void HardFault_Handler(void) __attribute__((interrupt()));
  15. /*********************************************************************
  16. * @fn NMI_Handler
  17. *
  18. * @brief This function handles NMI exception.
  19. *
  20. * @return none
  21. */
  22. void NMI_Handler(void)
  23. {
  24. GET_INT_SP();
  25. rt_interrupt_enter();
  26. rt_kprintf(" NMI Handler\r\n");
  27. rt_interrupt_leave();
  28. FREE_INT_SP();
  29. }
  30. /*********************************************************************
  31. * @fn HardFault_Handler
  32. *
  33. * @brief This function handles Hard Fault exception.
  34. *
  35. * @return none
  36. */
  37. void HardFault_Handler(void)
  38. {
  39. GET_INT_SP();
  40. rt_interrupt_enter();
  41. rt_kprintf(" hardfult\r\n");
  42. rt_interrupt_leave();
  43. FREE_INT_SP();
  44. }