I do it as below :
[static struct keys_param button_param[2];
static struct single_key_param *light_button_single;
static struct single_key_param *mist_button_single;
PIN_FUNC_SELECT(LIGHT_BUTTON_IO_MUX, LIGHT_BUTTON_IO_FUNC);
PIN_FUNC_SELECT(MIST_BUTTON_IO_MUX, MIST_BUTTON_IO_FUNC);
light_button_single = key_init_single( LIGHT_BUTTON_IO_NUM, LIGHT_BUTTON_IO_MUX,
LIGHT_BUTTON_IO_FUNC,
&Light_Button_LongPress_Handler,
&Light_Button_ShortPress_Handler );
button_param[0].key_num = 1;
button_param[0].single_key = &light_button_single;
mist_button_single = key_init_single( MIST_BUTTON_IO_NUM, MIST_BUTTON_IO_MUX,
MIST_BUTTON_IO_FUNC,
&Mist_Button_LongPress_Handler,
&Mist_Button_ShortPress_Handler );
button_param[1].key_num = 2;
button_param[1].single_key = &mist_button_single;
key_init( button_param );
PIN_PULLUP_EN(LIGHT_BUTTON_IO_MUX);
PIN_PULLUP_EN(MIST_BUTTON_IO_MUX);
][/code]
but I only can control one key,just don't know why.Statistics: Posted by JacksonLv — Fri Jan 26, 2018 4:55 pm
]]>