#include “stm32f10x.h”
#include “led.h”
#include “deep.h”
#include “delay.h”
#include “key.h”
#include “sys.h”
int main(void)
{
vu8 key=0;
delay_init();
BEEP_Init();
LED_Init();
Key_Init();
while(1)
{
key=KEY_S(0);
if(key)
{
switch(key)
{
case Key1_pres:
GPIO_ResetBits(GPIOB,GPIO_Pin_5);
break;
case Key2_pres:
GPIO_ResetBits(GPIOE,GPIO_Pin_5);
break;
case Key0_pres:
{
GPIO_SetBits(GPIOE,GPIO_Pin_5);
GPIO_SetBits(GPIOB,GPIO_Pin_5);
GPIO_ResetBits(GPIOB,GPIO_Pin_8);
}
break;
case Key3_pres:
GPIO_SetBits(GPIOB,GPIO_Pin_8);
break;
}
}else delay_ms(10);
}
}