Initial commit: my SECS2 project
This commit is contained in:
39
usr/bsp/bsp_Key.c
Normal file
39
usr/bsp/bsp_Key.c
Normal file
@@ -0,0 +1,39 @@
|
||||
#include "bsp_Key.h"
|
||||
#include "os_timer.h"
|
||||
#include "bsp_Flash.h"
|
||||
|
||||
#define BSP_KEY_ENTER_NUM 500
|
||||
|
||||
static void bsp_key_init(void);
|
||||
static void bsp_key_task(void);
|
||||
|
||||
bsp_key_t key =
|
||||
{
|
||||
.init = bsp_key_init,
|
||||
.task = bsp_key_task,
|
||||
};
|
||||
|
||||
static bsp_key_t *p_key = &key;
|
||||
|
||||
static void bsp_key_init(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void bsp_key_task(void)
|
||||
{
|
||||
if(GPIO_PIN_RESET == HAL_GPIO_ReadPin(SYS_RESET_GPIO_Port,SYS_RESET_Pin))
|
||||
{
|
||||
p_key->count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
p_key->count = 0;
|
||||
}
|
||||
if(BSP_KEY_ENTER_NUM <= p_key->count)
|
||||
{
|
||||
/*ϵͳ<CFB5><CDB3>λ*/
|
||||
Usr_Flash.Reset();
|
||||
HAL_NVIC_SystemReset();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user