ch32v00X_it.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /********************************** (C) COPYRIGHT *******************************
  2. * File Name : ch32v00X_it.c
  3. * Author : WCH
  4. * Version : V1.0.0
  5. * Date : 2024/11/04
  6. * Description : Main Interrupt Service Routines.
  7. *********************************************************************************
  8. * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
  9. * Attention: This software (modified or not) and binary are used for
  10. * microcontroller manufactured by Nanjing Qinheng Microelectronics.
  11. *******************************************************************************/
  12. #include <ch32v00X_it.h>
  13. #include "user_check.h"
  14. #include "download.h"
  15. #include "upload.h"
  16. void NMI_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
  17. void HardFault_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
  18. void SysTick_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
  19. /*********************************************************************
  20. * @fn NMI_Handler
  21. *
  22. * @brief This function handles NMI exception.
  23. *
  24. * @return none
  25. */
  26. void NMI_Handler(void)
  27. {
  28. while (1)
  29. {
  30. }
  31. }
  32. /*********************************************************************
  33. * @fn HardFault_Handler
  34. *
  35. * @brief This function handles Hard Fault exception.
  36. *
  37. * @return none
  38. */
  39. void HardFault_Handler(void)
  40. {
  41. NVIC_SystemReset();
  42. while (1)
  43. {
  44. }
  45. }
  46. /*********************************************************************
  47. * @fn ADC1_IRQHandler
  48. *
  49. * @brief ADC1_2 Interrupt Service Function.
  50. *
  51. * @return none
  52. */
  53. void SysTick_Handler(void)
  54. {
  55. // printf("Systick\r\n");
  56. SysTick->SR = 0;
  57. vUser_check_tick();
  58. vDownload_tick();
  59. vUpload_tick();
  60. }