76 lines
1.3 KiB
C
76 lines
1.3 KiB
C
#include <stdint.h>
|
|
|
|
#if !MMI_WIN32_SIM
|
|
//
|
|
//#include "os_task.h"
|
|
//#include "os_msg_q.h"
|
|
//#include "co_printf.h"
|
|
#include "button.h"
|
|
//#include "driver_gpio.h"
|
|
//#include "SEGGER_RTT.h"
|
|
//#include "window_manager.h"
|
|
//#include "driver_exti.h"
|
|
//#include "driver_cst816d.h"
|
|
//#include "input_driver.h"
|
|
#include "hal_key_handle.h"
|
|
//#include "user_main.h"
|
|
#include "lvgl.h"
|
|
//#include "../engtest/eng_mode.h"
|
|
|
|
static uint8_t key_code_type_bit;
|
|
static uint8_t key_code;
|
|
|
|
extern void hal_keypad_msg_handle(uint8_t button_index, uint8_t button_type)
|
|
{
|
|
key_event_msg_t *key_msg_param;
|
|
e_key_event_type key_event_type;
|
|
|
|
printf("hal_keypad_msg_handle btn %d \r\n",button_index);
|
|
|
|
switch(button_type)
|
|
{
|
|
case BUTTON_COMB_SHORT_PRESSED:
|
|
case BUTTON_SHORT_PRESSED:
|
|
key_code_type_bit=SHORT_KEY_BIT;
|
|
break;
|
|
|
|
case BUTTON_MULTI_PRESSED:
|
|
key_code_type_bit=MULTI_KEY_BIT;
|
|
break;
|
|
|
|
case BUTTON_COMB_LONG_PRESSED:
|
|
case BUTTON_LONG_PRESSED:
|
|
key_code_type_bit=LONG_KEY_BIT;
|
|
break;
|
|
|
|
default:
|
|
key_code_type_bit=0;
|
|
break;
|
|
|
|
}
|
|
//init
|
|
key_code|=button_index;
|
|
key_code|=key_code_type_bit;
|
|
printf("key_code_bit:%d\r\n",key_code);
|
|
|
|
}
|
|
|
|
uint8_t get_keycode_type_bit()
|
|
{
|
|
return key_code_type_bit;
|
|
}
|
|
|
|
uint8_t get_keycode()
|
|
{
|
|
return key_code;
|
|
}
|
|
|
|
void reset_keycode()
|
|
{
|
|
key_code=0;
|
|
}
|
|
|
|
|
|
|
|
#endif
|