#include "wbzd.h"
#include "oled.h"
#include "delay.h"


void EXTI_Init(void)
{

    RCC->APB2ENR|=1<<2;     //使能PORTA时钟
	GPIOA->CRL&=0XFFFFFF0F;	//PA1设置成输入	  
	GPIOA->CRL|=0X00000080;   		 
	GPIOA->ODR|=1<<1;		//PA1 上拉
Ex_NVIC_Config(GPIO_A,1,FTIR); 		//下降沿触发
MY_NVIC_Init(2,2,EXTI1_IRQn,2);    	//抢占2，子优先级2，组2	
	
	}
	
	
	//外部中断1服务程序
void EXTI1_IRQHandler(void)
{
	static u16 i;
delay_ms(10);	//消抖
	i++;
	OLED_ShowNum(20,20,i,2,16,1);
	OLED_Refresh();
	EXTI->PR=1<<1;  //清除LINE1上的中断标志位  
}



