耳机检测方式为ACCDET_SUPPORT = TRUE,要实现按耳机hook键控制FM调频功能
[SOLUTION]
实现步骤:
1,在uem_msg_hdlr.c(ps\l4\uem\src)文件中先extern void mmi_fmrdo_main_goto_next_channel(void);
2,再定义static void hook_earphone_press(void)
{
mmi_fmrdo_main_goto_next_channel();
}
3,在uem_msg_hdlr.c文件中函数uemdrv_aux_id_hdlr里
void uemdrv_aux_id_hdlr(local_para_struct *local_para_ptr, peer_buff_struct *peer_buff_ptr)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
aux_id_struct *p_aux_id_struct = (aux_id_struct*) local_para_ptr;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
switch (p_aux_id_struct->aux_id)
{
case AUX_ID_PLUGOUT:
{
uemdrv_gpio_detect_ind(EXT_DEV_NONE);
break;
}
case AUX_ID_EARPHONE:
{
uemdrv_gpio_detect_ind(EXT_DEV_EARPHONE);
break;
}
case AUX_ID_KEY_PRESS:
hook_earphone_press();
uemdrv_gpio_detect_ind(EXT_DEV_KEY_1);
break;
...
网友评论