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.
|
|
|
#include "L3_task_btn_handler.h"
|
|
|
|
#include "../bsp/bsp_btn.h"
|
|
|
|
#include "../bsp/bsp_config.h"
|
|
|
|
#include "../msp/UART0.h"
|
|
|
|
#include "../app/app_data_save.h"
|
|
|
|
|
|
|
|
|
|
|
|
void L3_task_btn_handler(void)
|
|
|
|
{
|
|
|
|
switch(g_Key)
|
|
|
|
{
|
|
|
|
case KEY_UP:
|
|
|
|
if(g_KeyActionFlag == LONG_KEY)
|
|
|
|
{
|
|
|
|
L0_uart0_uc('#');
|
|
|
|
L0_uart0_uchex(g_Key);
|
|
|
|
L0_uart0_0d0a();
|
|
|
|
g_Key = KEY_NULL;
|
|
|
|
g_KeyActionFlag = NULL_KEY;
|
|
|
|
data_save_push(0xab);
|
|
|
|
}
|
|
|
|
else if(g_KeyActionFlag == SHORT_KEY)
|
|
|
|
{
|
|
|
|
L0_uart0_uc('@');
|
|
|
|
L0_uart0_uchex(g_Key);
|
|
|
|
L0_uart0_0d0a();
|
|
|
|
LED1 = ~LED1;
|
|
|
|
g_Key = KEY_NULL;
|
|
|
|
g_KeyActionFlag = NULL_KEY;
|
|
|
|
data_save_push(0xcd);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case KEY_DOWN:
|
|
|
|
BULE_LED = ~BULE_LED;
|
|
|
|
L0_uart0_uchex(g_Key);
|
|
|
|
L0_uart0_0d0a();
|
|
|
|
g_Key = KEY_NULL;
|
|
|
|
break;
|
|
|
|
case KEY_PWR:
|
|
|
|
LED4 = ~LED4;
|
|
|
|
L0_uart0_uchex(g_Key);
|
|
|
|
L0_uart0_0d0a();
|
|
|
|
g_Key = KEY_NULL;
|
|
|
|
break;
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|