#include "main.h"
//按键处理函数
void KeyProcess()
{
if(bsp_key_read_key1()== BSP_KEY1_PRESS)
{
led_operate(0, LED_ON);
led_operate(1, LED_ON);
}
if(bsp_key_read_key1()== BSP_KEY1_RELEASE)
{
led_operate(0, LED_OFF);
led_operate(1, LED_OFF);
}
}
int main()
{
led_module_init(); //LED初始化
bsp_key_init(); //按键初始化
while (1)
{
KeyProcess(); //按键处理函数
}
}
#ifndef __MAIN_H__
#define __MAIN_H__
#include "bsp_led.h"
#include "bsp_key.h"
#endif
|