已裁剪掉逗猫棒的业务程序,原有的蓝牙转USB功能不受影响

This commit is contained in:
2026-07-24 12:26:52 +08:00
parent b3f06697a6
commit c843fb24e0
61 changed files with 2195 additions and 7393 deletions
+17 -77
View File
@@ -49,18 +49,13 @@ extern int bt_get_low_latency_mode();
extern void bt_set_low_latency_mode(int enable);
extern void usr_goto_pair_mode();
extern void usr_write_device_sta();
extern u16 usr_get_conn_service();
extern void usr_ble_adv_init();
extern void usr_le_notify_data();
extern void usr_clear_up();
void audio_aec_pitch_change_ctrl();
void audio_surround_voice_ctrl();
extern void start_streamer_test(void);
extern int jl_kws_voice_event_handle(struct key_event *key);
extern void usr_app_ota_init();
extern void usr_intterupt_close();
u8 poweroff_sametime_flag = 0;
@@ -377,109 +372,54 @@ int app_earphone_key_event_handler(struct sys_event *event)
switch (key_event) {
case KEY_MUSIC_PP:
//extern void usr_le_low_power_notify();
//usr_le_low_power_notify();
if(_usr_module_cfg.power_on_flag==0)break;
if(usr_var.usr_goto_pair)break;
if(usr_var.usr_power_charge_flag==1)break;
usr_var.usr_auto_off_cnt=0;
usr_var.usr_allow_to_sleep_cnt=8;
if(_usr_module_cfg.local_moto_mode==2)_usr_module_cfg.local_moto_mode=1;
else _usr_module_cfg.local_moto_mode=2;
usr_clear_up();
usr_write_device_sta();
printf("_usr_module_cfg.local_moto_mode = %d\n",_usr_module_cfg.local_moto_mode);
/* cat-toy moto mode switch removed */
break;
case KEY_IR_NUM_0:
// tone_play_by_path(TONE_POWER_ON, 0);
break;
case KEY_IR_NUM_1:
// tone_play_by_path(TONE_RING, 0);
break;
case KEY_IR_NUM_2:
// tone_play_by_path(TONE_RING, 0);
if(_usr_module_cfg.power_on_flag==0)break;
if(usr_var.usr_goto_pair)break;
if(usr_var.usr_power_charge_flag==1)break;
usr_var.usr_allow_to_sleep_cnt=8;
if (usr_var.usr_goto_pair) {
break;
}
usr_app_ota_init();
break;
case KEY_POWEROFF:
if(usr_var.usr_power_charge_flag==1)break;
goto_poweroff_cnt = 0;
poweroff_sametime_flag = 0;
goto_poweroff_flag = 1;
usr_var.usr_allow_to_sleep_cnt=8;
user_send_cmd_prepare(USER_CTRL_ALL_SNIFF_EXIT, 0, NULL);
break;
case KEY_POWEROFF_HOLD:
if(usr_var.usr_power_charge_flag==1)break;
#if (TCFG_USER_TWS_ENABLE && CONFIG_TWS_POWEROFF_SAME_TIME == 0)
if ((u32)event->arg == KEY_EVENT_FROM_TWS) {
break;
}
#endif
log_info("power flag cnt:%d cnt:%d\n", goto_poweroff_flag, goto_poweroff_cnt);
usr_var.usr_allow_to_sleep_cnt=12;
if (goto_poweroff_flag) {
if(goto_poweroff_cnt<(POWER_OFF_CNT*3))goto_poweroff_cnt++;
if (goto_poweroff_cnt < (POWER_OFF_CNT * 3)) {
goto_poweroff_cnt++;
}
if (goto_poweroff_cnt == POWER_OFF_CNT) {
//goto_poweroff_cnt = 0;
//sys_enter_soft_poweroff(NULL);
if(_usr_module_cfg.power_on_flag==0)
{
_usr_module_cfg.power_on_flag=1;
usr_var.usr_can_pair=1;
}
else
{
usr_var.usr_intterupt_reinit_falg=1;
usr_intterupt_close();
if((usr_auth_data.paired_flag==0)&&(_usr_module_cfg.zhengdong_kaiji==0))
{
sys_enter_soft_poweroff(NULL);
}
else
{
_usr_module_cfg.power_on_flag=0;
_usr_module_cfg.local_moto_mode=0;
usr_clear_up();
usr_le_notify_data();
}
if (_usr_module_cfg.power_on_flag == 0) {
_usr_module_cfg.power_on_flag = 1;
usr_var.usr_can_pair = 1;
} else {
usr_var.usr_can_pair = 1;
}
}
if(usr_var.usr_can_pair)
{
if(goto_poweroff_cnt==(POWER_OFF_CNT*3))
{
usr_var.usr_can_pair=0;
//goto_poweroff_cnt=0;
if (usr_var.usr_can_pair) {
if (goto_poweroff_cnt == (POWER_OFF_CNT * 3)) {
usr_var.usr_can_pair = 0;
usr_goto_pair_mode();
}
}
}
break;
case KEY_POWEROFF_HOLD_UP:
if((usr_var.usr_can_pair)&&(goto_poweroff_cnt<(POWER_OFF_CNT*3)))
{
usr_clear_up();
_usr_module_cfg.local_moto_mode=2;
if(usr_get_conn_service()==0)
{
usr_ble_adv_init();
}
else
{
usr_le_notify_data();
}
}
usr_var.usr_can_pair=0;
goto_poweroff_cnt=0;
usr_var.usr_allow_to_sleep_cnt=12;
usr_var.usr_can_pair = 0;
goto_poweroff_cnt = 0;
break;
case KEY_MUSIC_PREV:
//user_send_cmd_prepare(USER_CTRL_AVCTP_OPID_PREV, 0, NULL);