You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.5 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #include "irqhandler.h"
  2. void NMI_IRQHandler(void) {}
  3. void HardFault_IRQHandler(void) {
  4. while (1) {
  5. }
  6. }
  7. void SVC_IRQHandler(void) {}
  8. void PendSV_IRQHandler(void) {}
  9. uint32_t g_sys_sick = 0;
  10. void SysTick_IRQHandler(void) {
  11. g_sys_sick++;
  12. // TimingDelay_Decrement();
  13. // if (GPIO_ReadBit(TARGET_PIN) == 1) {
  14. // LightOn(LED1_PIN);
  15. // } else {
  16. // LightOff(LED1_PIN);
  17. // }
  18. }
  19. extern uint32_t Period;
  20. extern uint32_t dutytab[5];
  21. void PINT1_IRQHandler(void) {
  22. if ((PINT_GetITFlag(GPIO_Pin_A1) == SET) &&
  23. (PINT_GetITStatus(GPIO_Pin_A1) == SET) &&
  24. (PINT_GetPMASK(GPIO_Pin_A1) != SET)) {
  25. // static uint8_t tri_time = 0x0U;
  26. // PINT_ClearITFlag(GPIO_Pin_A1); /* �����˿��жϱ�־λ */
  27. // if (tri_time % 2 == 0) {
  28. // // T16Nx_SetMAT2(T16N0, dutytab[1]); //����ƥ���Ĵ���100
  29. // // T16Nx_SetMAT2(T16N0,0); //����ƥ���Ĵ���0,Ҳ����PWM����Ϊȫ���ߣ�led��
  30. // T16Nx_SetMAT2(T16N0,dutytab[4]/2); //����ƥ���Ĵ���0,Ҳ����PWM����Ϊȫ���ߣ�led��
  31. // T16Nx_SetMAT3(T16N0, dutytab[4]);//����ƥ���Ĵ���
  32. // T16Nx_SetTOP1(T16N0, dutytab[4]); //������ֵ300
  33. // GPIO_WriteBit(GPIO_Pin_B1, 0);
  34. // } else {
  35. // // T16Nx_SetMAT2(T16N0, dutytab[4]);
  36. // // T16Nx_SetTOP1(T16N0, dutytab[4]-1);
  37. // //�豸PWM��������Ҳ����ȫ���͵�ƽ
  38. // T16Nx_SetMAT2(T16N0, dutytab[4]-1);
  39. // T16Nx_SetMAT3(T16N0, dutytab[4]);
  40. // T16Nx_SetTOP1(T16N0, dutytab[4]);
  41. // GPIO_WriteBit(GPIO_Pin_B1, 1);
  42. // }
  43. // tri_time++;
  44. }
  45. }