#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: LED2 = ~LED2; 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; } }