Index: output/eeprom.dat
===================================================================
--- /YC1308AC/branch/mouse_project/XZR/Standard_2.4G_First/output/eeprom.dat	(revision 416)
+++ /YC1308AC/branch/mouse_project/XZR/Standard_2.4G_First/output/eeprom.dat	(working copy)
@@ -2,8 +2,8 @@
 02
 aa
 55
-da
-02
+6e
+03
 c2
 84
 00
@@ -15,11 +15,11 @@
 c0
 45
 80
-2d
+2a
 c0
 4f
 80
-38
+35
 c0
 57
 00
@@ -27,27 +27,27 @@
 c0
 62
 00
-18
+15
 c0
 64
 80
-3a
+37
 c0
 65
 00
-45
+42
 c0
 68
 00
-67
+64
 c0
 6b
 00
-4e
+4b
 c0
 6c
 80
-78
+75
 20
 20
 13
@@ -55,11 +55,11 @@
 c0
 50
 80
-98
+bd
 c0
 60
 00
-a2
+c7
 20
 20
 13
@@ -85,18 +85,6 @@
 6d
 f3
 20
-40
-00
-29
-d8
-40
-00
-13
-20
-40
-60
-7f
-20
 20
 3b
 c1
@@ -131,7 +119,7 @@
 c0
 19
 80
-22
+1f
 c0
 1a
 3d
@@ -323,19 +311,19 @@
 c0
 1e
 00
-62
+5f
 c0
 02
 00
-5b
+58
 c0
 09
 80
-5b
+58
 c0
 19
 00
-54
+51
 20
 20
 43
@@ -347,7 +335,7 @@
 c0
 00
 80
-58
+55
 70
 4b
 76
@@ -423,7 +411,7 @@
 20
 40
 00
-6a
+67
 20
 20
 40
@@ -513,9 +501,21 @@
 00
 80
 20
+40
+00
+98
 20
+40
 44
-bd
+cc
+20
+40
+00
+a3
+20
+20
+44
+c0
 da
 60
 4b
@@ -613,6 +613,154 @@
 00
 00
 6f
+e4
+4b
+ab
+c2
+94
+40
+80
+c2
+9b
+00
+9c
+20
+60
+00
+00
+6f
+e0
+c9
+dd
+c1
+80
+80
+00
+da
+60
+4b
+9b
+da
+40
+00
+a1
+20
+20
+31
+8a
+70
+49
+de
+01
+20
+20
+00
+b5
+6f
+e4
+4b
+ab
+c4
+1a
+80
+00
+68
+48
+cb
+ca
+60
+48
+cb
+9d
+20
+40
+41
+15
+1f
+e1
+7e
+07
+68
+48
+cb
+9d
+98
+46
+7c
+00
+20
+22
+80
+ad
+20
+20
+44
+eb
+20
+40
+00
+af
+20
+20
+44
+f2
+da
+60
+4b
+a0
+da
+40
+00
+b5
+20
+40
+31
+8a
+6f
+e0
+cb
+a0
+c0
+00
+c6
+e2
+20
+60
+00
+00
+70
+49
+38
+01
+70
+4b
+77
+00
+20
+40
+42
+3c
+20
+40
+78
+f4
+70
+41
+ca
+00
+20
+40
+43
+16
+20
+40
+45
+ee
+20
+20
+44
+d4
+6f
 e0
 c3
 dd
@@ -659,7 +807,7 @@
 c0
 02
 00
-a5
+ca
 20
 20
 19
@@ -675,7 +823,7 @@
 c0
 05
 00
-a9
+ce
 20
 20
 1c
@@ -695,7 +843,7 @@
 c2
 81
 80
-b1
+d6
 6f
 e1
 44
@@ -723,17 +871,17 @@
 24
 22
 80
-ad
+d2
 24
 34
 00
-ad
+d2
 20
 20
 1e
 10
-c5
-e3
+6a
+47
 aa
 55
 40
@@ -894,7 +1042,7 @@
 04
 08
 00
-32
+50
 05
 94
 85
@@ -1898,158 +2046,10 @@
 aa
 aa
 55
-33
+51
 58
-50
-c5
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
+12
+9b
 ff
 ff
 ff
@@ -8188,5 +8188,5 @@
 ff
 ff
 ff
-71
-bb
+d2
+39
Index: output/program.lis
===================================================================
--- /YC1308AC/branch/mouse_project/XZR/Standard_2.4G_First/output/program.lis	(revision 416)
+++ /YC1308AC/branch/mouse_project/XZR/Standard_2.4G_First/output/program.lis	(working copy)
@@ -2,20 +2,20 @@
               org 0x0000
 0000 c284000c bbit1 8 ,pf_patch_ext 
 0001 c000000f beq patch00_0 ,p_soft_reset 
-0002 c045802d beq patch11_3 ,p_initialize_radio_cont 
-0003 c04f8038 beq patch13_7 ,p_init_param 
+0002 c045802a beq patch11_3 ,p_initialize_radio_cont 
+0003 c04f8035 beq patch13_7 ,p_init_param 
 0004 c0570013 beq patch15_6 ,p_app_init 
-0005 c0620018 beq patch18_4 ,p_mouse_start_reconnect_device 
-0006 c064803a beq patch19_1 ,p_mouse_setgpio_hibernate 
-0007 c0650045 beq patch19_2 ,p_mouse_lpm_before_common 
-0008 c0680067 beq patch1a_0 ,p_mouse_seting_dpi 
-0009 c06b004e beq patch1a_6 ,p_mouse_priority_bb_event 
-000a c06c8078 beq patch1b_1 ,p_mouse_bb_event_timer 
+0005 c0620015 beq patch18_4 ,p_mouse_start_reconnect_device 
+0006 c0648037 beq patch19_1 ,p_mouse_setgpio_hibernate 
+0007 c0650042 beq patch19_2 ,p_mouse_lpm_before_common 
+0008 c0680064 beq patch1a_0 ,p_mouse_seting_dpi 
+0009 c06b004b beq patch1a_6 ,p_mouse_priority_bb_event 
+000a c06c8075 beq patch1b_1 ,p_mouse_bb_event_timer 
 000b 2020137c branch loop 
 
 pf_patch_ext:
-000c c0508098 beq patch34_1 ,p_le_slave_match 
-000d c06000a2 beq patch38_0 ,p_le_parse_l2cap 
+000c c05080bd beq patch34_1 ,p_le_slave_match 
+000d c06000c7 beq patch38_0 ,p_le_parse_l2cap 
 000e 2020137c branch loop 
 
 p_soft_reset:
@@ -28,144 +28,144 @@
 
 p_mouse_init:
 0013 20406df3 call enable_authrom 
-0014 20400029 call p_lpm_write_ice_disable 
-0015 d8400013 arg 19 ,temp 
-0016 2040607f call gpio_set_high_impedance 
-0017 20203bc1 branch mouse_init 
+0014 20203bc1 branch mouse_init 
 
 p_mouse_start_reconnect_device:
-0018 da204939 arg mem_device1_type ,rega 
-0019 6fe0c938 fetch 1 ,mem_device_flag 
-001a 1fe0ffff increase -1 ,pdata 
-001b 1feffe1d mul32 pdata ,29 ,pdata 
-001c 9a20a200 iadd rega ,rega 
-001d efe08011 ifetch 1 ,rega 
-001e 67e0c482 store 1 ,mem_xrecord_mode 
-001f c0198022 beq rec_3_mode ,p_mouse3_0_check_reconn_target 
-0020 c01a3d7b beq rec_4_mode ,mouse4_0_check_reconn_target 
-0021 20204553 branch mouse_start_discovery 
+0015 da204939 arg mem_device1_type ,rega 
+0016 6fe0c938 fetch 1 ,mem_device_flag 
+0017 1fe0ffff increase -1 ,pdata 
+0018 1feffe1d mul32 pdata ,29 ,pdata 
+0019 9a20a200 iadd rega ,rega 
+001a efe08011 ifetch 1 ,rega 
+001b 67e0c482 store 1 ,mem_xrecord_mode 
+001c c019801f beq rec_3_mode ,p_mouse3_0_check_reconn_target 
+001d c01a3d7b beq rec_4_mode ,mouse4_0_check_reconn_target 
+001e 20204553 branch mouse_start_discovery 
 
 p_mouse3_0_check_reconn_target:
-0022 68494bb8 fetcht 2 ,mem_mouse_fast_page_to 
-0023 6fe0cac1 fetch 1 ,mem_mouse_bluetooth_fast_conn_flag 
-0024 c07fbd73 beq 0xff ,mouse3_0_check_reconn_target_next 
-0025 6848c902 fetcht 1 ,mem_mouse_direct_timeout 
-0026 6048cb77 storet 1 ,mem_mouse_direct_timer 
-0027 68494bb5 fetcht 2 ,mem_mouse_page_to 
-0028 20203d73 branch mouse3_0_check_reconn_target_next 
+001f 68494bb8 fetcht 2 ,mem_mouse_fast_page_to 
+0020 6fe0cac1 fetch 1 ,mem_mouse_bluetooth_fast_conn_flag 
+0021 c07fbd73 beq 0xff ,mouse3_0_check_reconn_target_next 
+0022 6848c902 fetcht 1 ,mem_mouse_direct_timeout 
+0023 6048cb77 storet 1 ,mem_mouse_direct_timer 
+0024 68494bb5 fetcht 2 ,mem_mouse_page_to 
+0025 20203d73 branch mouse3_0_check_reconn_target_next 
 
 p_lpm_write_ice_disable:
-0029 6ff10120 fetch 2 ,core_ucode_flag 
-002a 793ffe0e set0 lpmreg_ice_mode_bit ,pdata 
-002b 67f2004c store 4 ,core_lpm_reg 
-002c 20205caf branch lpm_write2_ctrl_option 
+0026 6ff10120 fetch 2 ,core_ucode_flag 
+0027 793ffe0e set0 lpmreg_ice_mode_bit ,pdata 
+0028 67f2004c store 4 ,core_lpm_reg 
+0029 20205caf branch lpm_write2_ctrl_option 
 
 p_initialize_radio_cont:
-002d 708a8be6 jam 0xe6 ,core_syn_aac_cfg1 
-002e 2040126a call initialize_syn_afc_cfg1 
-002f 20401271 call initialize_rf_ldo_cfg1 
-0030 20401277 call initialize_rc_cal 
-0031 708a6d09 jam 0x09 ,core_rx_bq_cfg0 
-0032 708a0305 jam 5 ,core_clkpll_cfg0 
-0033 708a7a94 jam 0x94 ,core_rx_iqadc_cfg 
-0034 708a0e0b jam 0x0b ,core_rf_ldo_cfg2 
-0035 708a0f05 jam 0x05 ,core_rf_ldo_cfg3 
-0036 708a8390 jam 0x90 ,core_syn_pfd_lkd_cfg 
-0037 2020125d branch initialize_radio_cont + 8 
+002a 708a8be6 jam 0xe6 ,core_syn_aac_cfg1 
+002b 2040126a call initialize_syn_afc_cfg1 
+002c 20401271 call initialize_rf_ldo_cfg1 
+002d 20401277 call initialize_rc_cal 
+002e 708a6d09 jam 0x09 ,core_rx_bq_cfg0 
+002f 708a0305 jam 5 ,core_clkpll_cfg0 
+0030 708a7a94 jam 0x94 ,core_rx_iqadc_cfg 
+0031 708a0e0b jam 0x0b ,core_rf_ldo_cfg2 
+0032 708a0f05 jam 0x05 ,core_rf_ldo_cfg3 
+0033 708a8390 jam 0x90 ,core_syn_pfd_lkd_cfg 
+0034 2020125d branch initialize_radio_cont + 8 
 
 p_init_param:
-0038 70008000 jam 0 ,mem_lmo_tid2 
-0039 202013b7 branch init_param_next + 1 
+0035 70008000 jam 0 ,mem_lmo_tid2 
+0036 202013b7 branch init_param_next + 1 
 
 p_mouse_setgpio_hibernate:
-003a 204042e9 call mouse_set_sdio_high 
-003b 20407fdc call clear_wake 
-003c 20404015 call mouse_before_hibernate_wheel_gpio_set 
-003d 6848c910 fetcht 1 ,mem_matrix_public_gpio 
-003e 20406069 call gpio_out_active 
-003f 6848c910 fetcht 1 ,mem_matrix_public_gpio 
-0040 20406042 call gpio_clr_wake 
-0041 6fe0c920 fetch 1 ,mem_mouse_sensor_sdio_gpio 
-0042 d840003f arg gpcfg_output_high ,temp 
-0043 20406093 call gpio_config_function_int 
-0044 20203e36 branch mouse_setgpio_hibernate + 3 
+0037 204042e9 call mouse_set_sdio_high 
+0038 20407fdc call clear_wake 
+0039 20404015 call mouse_before_hibernate_wheel_gpio_set 
+003a 6848c910 fetcht 1 ,mem_matrix_public_gpio 
+003b 20406069 call gpio_out_active 
+003c 6848c910 fetcht 1 ,mem_matrix_public_gpio 
+003d 20406042 call gpio_clr_wake 
+003e 6fe0c920 fetch 1 ,mem_mouse_sensor_sdio_gpio 
+003f d840003f arg gpcfg_output_high ,temp 
+0040 20406093 call gpio_config_function_int 
+0041 20203e36 branch mouse_setgpio_hibernate + 3 
 
 p_mouse_lpm_before_common:
-0045 6848c913 fetcht 1 ,mem_whee_a_data_gpio 
-0046 20406050 call gpio_config_input 
-0047 6848c914 fetcht 1 ,mem_whee_b_data_gpio 
-0048 20406050 call gpio_config_input 
-0049 20403f88 call mouse_wheel_check 
-004a 6fe0c91f fetch 1 ,mem_mouse_sensor_sclk_gpio 
-004b d840003f arg gpcfg_output_high ,temp 
-004c 20406093 call gpio_config_function_int 
-004d 20203e44 branch mouse_lpm_before_common_next 
+0042 6848c913 fetcht 1 ,mem_whee_a_data_gpio 
+0043 20406050 call gpio_config_input 
+0044 6848c914 fetcht 1 ,mem_whee_b_data_gpio 
+0045 20406050 call gpio_config_input 
+0046 20403f88 call mouse_wheel_check 
+0047 6fe0c91f fetch 1 ,mem_mouse_sensor_sclk_gpio 
+0048 d840003f arg gpcfg_output_high ,temp 
+0049 20406093 call gpio_config_function_int 
+004a 20203e44 branch mouse_lpm_before_common_next 
 
 p_mouse_priority_bb_event:
-004e 1a627e00 copy regc ,pdata 
-004f c01e0062 beq bt_evt_24g_attempt_success ,p_mouse_24g_attempt_success 
-0050 c002005b beq bt_evt_reconn_failed ,p_mouse_bb_event_reconn_failed 
-0051 c009805b beq bt_evt_reconn_page_timeout ,p_mouse_bb_event_reconn_failed 
-0052 c0190054 beq bt_evt_le_start_enc ,p_mouse_le_ll_start_encryt 
-0053 20204336 branch mouse_priority_bb_event + 2 
+004b 1a627e00 copy regc ,pdata 
+004c c01e005f beq bt_evt_24g_attempt_success ,p_mouse_24g_attempt_success 
+004d c0020058 beq bt_evt_reconn_failed ,p_mouse_bb_event_reconn_failed 
+004e c0098058 beq bt_evt_reconn_page_timeout ,p_mouse_bb_event_reconn_failed 
+004f c0190051 beq bt_evt_le_start_enc ,p_mouse_le_ll_start_encryt 
+0050 20204336 branch mouse_priority_bb_event + 2 
 
 p_mouse_le_ll_start_encryt:
-0054 6fe0cac7 fetch 1 ,mem_mouse_le_reconnect_flag 
-0055 c0008058 beq 1 ,p_mouse_le_ll_reconn_start_encryt 
-0056 704b7614 jam 20 ,mem_le_start_encrypt_timer 
-0057 20204373 branch mouse_le_ll_enable_start_enc_flag 
+0051 6fe0cac7 fetch 1 ,mem_mouse_le_reconnect_flag 
+0052 c0008055 beq 1 ,p_mouse_le_ll_reconn_start_encryt 
+0053 704b7614 jam 20 ,mem_le_start_encrypt_timer 
+0054 20204373 branch mouse_le_ll_enable_start_enc_flag 
 
 p_mouse_le_ll_reconn_start_encryt:
-0058 2040436c call mouse_updata_le_param 
-0059 704b7605 jam 5 ,mem_le_start_encrypt_timer 
-005a 20204373 branch mouse_le_ll_enable_start_enc_flag 
+0055 2040436c call mouse_updata_le_param 
+0056 704b7605 jam 5 ,mem_le_start_encrypt_timer 
+0057 20204373 branch mouse_le_ll_enable_start_enc_flag 
 
 p_mouse_bb_event_reconn_failed:
-005b 6fe0cac1 fetch 1 ,mem_mouse_bluetooth_fast_conn_flag 
-005c c07fc2f8 beq 0xff ,mouse_buletooth_fast_conn_end 
-005d 6fe1478c fetch 2 ,mem_ui_state_map 
-005e c3860000 rtnbit1 ui_state_btn_down 
-005f c3830000 rtnbit1 ui_state_bt_discovery 
-0060 c3858000 rtnbit1 ui_state_ble_adv 
-0061 20203e20 branch mouse_app_enter_hibernate 
+0058 6fe0cac1 fetch 1 ,mem_mouse_bluetooth_fast_conn_flag 
+0059 c07fc2f8 beq 0xff ,mouse_buletooth_fast_conn_end 
+005a 6fe1478c fetch 2 ,mem_ui_state_map 
+005b c3860000 rtnbit1 ui_state_btn_down 
+005c c3830000 rtnbit1 ui_state_bt_discovery 
+005d c3858000 rtnbit1 ui_state_ble_adv 
+005e 20203e20 branch mouse_app_enter_hibernate 
 
 p_mouse_24g_attempt_success:
-0062 6fe2483c fetch 4 ,mem_24g_addr 
-0063 67e24891 store 4 ,mem_24g_receiver_addr 
-0064 67e24993 store 4 ,mem_mouse_24g_addr 
-0065 204048c6 call mouse_device_poweron_timer_init 
-0066 2020484e branch mouse_24g_attempt_success 
+005f 6fe2483c fetch 4 ,mem_24g_addr 
+0060 67e24891 store 4 ,mem_24g_receiver_addr 
+0061 67e24993 store 4 ,mem_mouse_24g_addr 
+0062 204048c6 call mouse_device_poweron_timer_init 
+0063 2020484e branch mouse_24g_attempt_success 
 
 p_mouse_seting_dpi:
-0067 2040408f call mouse_setting_dpi_4_level 
-0068 2040006a call p_mouse_dpi_led_blink_delay 
-0069 20204098 branch mouse_seting_sensor_type 
+0064 2040408f call mouse_setting_dpi_4_level 
+0065 20400067 call p_mouse_dpi_led_blink_delay 
+0066 20204098 branch mouse_seting_sensor_type 
 
 p_mouse_dpi_led_blink_delay:
-006a 6fe0c923 fetch 1 ,mem_dpi_led_gpio 
-006b c17f8000 rtneq gpio_disable 
-006c 6fe14ac2 fetch 2 ,mem_mouse_discovery_timer 
-006d 247a0000 nrtn blank 
-006e 6fe14883 fetch 2 ,mem_24g_pair_timeout 
-006f 247a0000 nrtn blank 
-0070 6fe14887 fetch 2 ,mem_24g_reconn_timeout 
-0071 247a0000 nrtn blank 
-0072 6fe0cba7 fetch 1 ,mem_mouse_device_poweron_timer_count 
-0073 247a0000 nrtn blank 
-0074 6fe0cbc1 fetch 1 ,mem_mouse_dpi_led_delay_count_init 
-0075 203a0083 branch p_mouse_dpi_led_blink_init ,blank 
-0076 67e0cba8 store 1 ,mem_mouse_dpi_led_delay_count 
-0077 20600000 rtn 
+0067 6fe0c923 fetch 1 ,mem_dpi_led_gpio 
+0068 c17f8000 rtneq gpio_disable 
+0069 6fe14ac2 fetch 2 ,mem_mouse_discovery_timer 
+006a 247a0000 nrtn blank 
+006b 6fe14883 fetch 2 ,mem_24g_pair_timeout 
+006c 247a0000 nrtn blank 
+006d 6fe14887 fetch 2 ,mem_24g_reconn_timeout 
+006e 247a0000 nrtn blank 
+006f 6fe0cba7 fetch 1 ,mem_mouse_device_poweron_timer_count 
+0070 247a0000 nrtn blank 
+0071 6fe0cbc1 fetch 1 ,mem_mouse_dpi_led_delay_count_init 
+0072 203a0083 branch p_mouse_dpi_led_blink_init ,blank 
+0073 67e0cba8 store 1 ,mem_mouse_dpi_led_delay_count 
+0074 20600000 rtn 
 
 p_mouse_bb_event_timer:
-0078 20403e9b call mouse_adc_read 
-0079 20404956 call mouse_low_voltage_led_timer 
-007a 2040232b call g24_pair_timeout_timer 
-007b 20402556 call g24_reconn_timeout_timer 
-007c 204047cd call mouse_24g_long_sleep_param_update_timer 
-007d 204048be call mouse_device_poweron_timer 
-007e 20400080 call p_mouse_dpi_led_blink_delay_timer 
-007f 202044bd branch mouse_bb_event_timer + 8 
+0075 20403e9b call mouse_adc_read 
+0076 20404956 call mouse_low_voltage_led_timer 
+0077 2040232b call g24_pair_timeout_timer 
+0078 20402556 call g24_reconn_timeout_timer 
+0079 204047cd call mouse_24g_long_sleep_param_update_timer 
+007a 204048be call mouse_device_poweron_timer 
+007b 20400080 call p_mouse_dpi_led_blink_delay_timer 
+007c 20400098 call p_mouse_dpi_key_check_long_press 
+007d 204044cc call mouse_bt_discovery_check 
+007e 204000a3 call p_mouse_commbination_key_process 
+007f 202044c0 branch mouse_bb_event_timer + 11 
 
 p_mouse_dpi_led_blink_delay_timer:
 0080 da604ba8 arg mem_mouse_dpi_led_delay_count ,regc 
@@ -199,47 +199,98 @@
 0096 184085fd increase -3 ,temp 
 0097 20600000 rtn 
 
+p_mouse_dpi_key_check_long_press:
+0098 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+0099 c2944080 bbit1 mouse_enable_select_device_by_dpi_button ,mouse_select_device_by_dpi_button 
+009a c29b009c bbit1 mouse_enable_dpi_key_long_press_disconvery ,p_mouse_discovery_by_dpi_button 
+009b 20600000 rtn 
+
+p_mouse_discovery_by_dpi_button:
+009c 6fe0c9dd fetch 1 ,mem_mouse_dpi_button_state 
+009d c1808000 rtnne dpi_button_state_down 
+009e da604b9b arg mem_bt_discovery_count ,regc 
+009f da4000a1 arg p_mouse_long_dpi_button_bt_discovery ,regb 
+00a0 2020318a branch timer_single_step 
+
+p_mouse_long_dpi_button_bt_discovery:
+00a1 7049de01 jam 1 ,mem_mouse_dpi_long_press_flag 
+00a2 202000b5 branch p_mouse_long_button_bt_discovery 
+
+p_mouse_commbination_key_process:
+00a3 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+00a4 c41a8000 rtnbit0 mouse_enable_commbination_key_by_bt_discovery 
+00a5 6848cbca fetcht 1 ,mem_mouse_commbination_key_bt 
+00a6 6048cb9d storet 1 ,mem_mouse_commbination_key 
+00a7 20404115 call mouse_check_key_gpio 
+00a8 1fe17e07 and pdata ,0x07 ,pdata 
+00a9 6848cb9d fetcht 1 ,mem_mouse_commbination_key 
+00aa 98467c00 isub temp ,null 
+00ab 202280ad branch p_mouse_commbination_key_down ,zero 
+00ac 202044eb branch mouse_commbination_key_up 
+
+p_mouse_commbination_key_down:
+00ad 204000af call p_mouse_combination_ui_timer 
+00ae 202044f2 branch mouse_commbination_key_down + 1 
+
+p_mouse_combination_ui_timer:
+00af da604ba0 arg mem_combination_ui_button_count ,regc 
+00b0 da4000b5 arg p_mouse_long_button_bt_discovery ,regb 
+00b1 2040318a call timer_single_step 
+00b2 6fe0cba0 fetch 1 ,mem_combination_ui_button_count 
+00b3 c000c6e2 beq 1 ,mouse_bt_discovery_button_down_enable 
+00b4 20600000 rtn 
+
+p_mouse_long_button_bt_discovery:
+00b5 70493801 jam mode_bt_device1 ,mem_device_flag 
+00b6 704b7700 jam 0 ,mem_mouse_direct_timer 
+00b7 2040423c call mouse_sensor_powerdown 
+00b8 204078f4 call check_51cmd_stop_adv 
+00b9 7041ca00 jam 0 ,mem_link_key_exists 
+00ba 20404316 call mouse_stop_bluetooth_mode 
+00bb 204045ee call mouse_store_device_info_delay 
+00bc 202044d4 branch mouse_long_button_bt_discovery 
+
 p_le_slave_match:
-0098 6fe0c3dd fetch 1 ,mem_le_md_count 
-0099 1fe0fe01 pincrease 1 
-009a 67e0c3dd store 1 ,mem_le_md_count 
-009b c006165a beq le_md_max_count ,le_slave_cont 
-009c 2040191b call le_acknowledge 
-009d 2040196a call le_prepare_tx 
-009e 6fe082bd fetch 1 ,mem_le_tx_phy 
-009f 2040168b call le_enable_phy_by_pdata 
-00a0 20401838 call le_transmit 
-00a1 20201655 branch le_slave_match + 10 
+00bd 6fe0c3dd fetch 1 ,mem_le_md_count 
+00be 1fe0fe01 pincrease 1 
+00bf 67e0c3dd store 1 ,mem_le_md_count 
+00c0 c006165a beq le_md_max_count ,le_slave_cont 
+00c1 2040191b call le_acknowledge 
+00c2 2040196a call le_prepare_tx 
+00c3 6fe082bd fetch 1 ,mem_le_tx_phy 
+00c4 2040168b call le_enable_phy_by_pdata 
+00c5 20401838 call le_transmit 
+00c6 20201655 branch le_slave_match + 10 
 
 p_le_parse_l2cap:
-00a2 efe10006 ifetch 2 ,contr 
-00a3 c00200a5 beq le_l2cap_cid_att ,p_le_parse_att 
-00a4 202019e4 branch le_parse_l2cap2 + 3 
+00c7 efe10006 ifetch 2 ,contr 
+00c8 c00200ca beq le_l2cap_cid_att ,p_le_parse_att 
+00c9 202019e4 branch le_parse_l2cap2 + 3 
 
 p_le_parse_att:
-00a5 efe18006 ifetch 3 ,contr 
-00a6 67e1c436 store 3 ,mem_le_att_opcode 
-00a7 c00500a9 beq attop_read_request ,p_le_parse_att_read_request 
-00a8 20201cd3 branch le_parse_att + 2 
+00ca efe18006 ifetch 3 ,contr 
+00cb 67e1c436 store 3 ,mem_le_att_opcode 
+00cc c00500ce beq attop_read_request ,p_le_parse_att_read_request 
+00cd 20201cd3 branch le_parse_att + 2 
 
 p_le_parse_att_read_request:
-00a9 20401e8d call le_check_encrypt_state 
-00aa 68494437 fetcht 2 ,mem_le_att_handle 
-00ab 6fe0c3c0 fetch 1 ,mem_le_configuration 
-00ac c28180b1 bbit1 bit_ble_read_auth ,p_le_send_att_read_response_check_auth 
+00ce 20401e8d call le_check_encrypt_state 
+00cf 68494437 fetcht 2 ,mem_le_att_handle 
+00d0 6fe0c3c0 fetch 1 ,mem_le_configuration 
+00d1 c28180d6 bbit1 bit_ble_read_auth ,p_le_send_att_read_response_check_auth 
 
 p_le_send_att_read_response:
-00ad 6fe14437 fetch 2 ,mem_le_att_handle 
-00ae c0181ec8 beq 0x30 ,le_send_att_error_response_notfound 
-00af 68494437 fetcht 2 ,mem_le_att_handle 
-00b0 20201deb branch le_send_att_read_response 
+00d2 6fe14437 fetch 2 ,mem_le_att_handle 
+00d3 c0181ec8 beq 0x30 ,le_send_att_error_response_notfound 
+00d4 68494437 fetcht 2 ,mem_le_att_handle 
+00d5 20201deb branch le_send_att_read_response 
 
 p_le_send_att_read_response_check_auth:
-00b1 6fe143d1 fetch 2 ,mem_le_pairing_handle 
-00b2 98467c00 isub temp ,null 
-00b3 242280ad nbranch p_le_send_att_read_response ,zero 
-00b4 243400ad nbranch p_le_send_att_read_response ,user 
-00b5 20201e10 branch le_send_att_read_response_error_insufficient_auth 
+00d6 6fe143d1 fetch 2 ,mem_le_pairing_handle 
+00d7 98467c00 isub temp ,null 
+00d8 242280d2 nbranch p_le_send_att_read_response ,zero 
+00d9 243400d2 nbranch p_le_send_att_read_response ,user 
+00da 20201e10 branch le_send_att_read_response_error_insufficient_auth 
               org 0x800
 
 start:
Index: program/patch.prog
===================================================================
--- /YC1308AC/branch/mouse_project/XZR/Standard_2.4G_First/program/patch.prog	(revision 416)
+++ /YC1308AC/branch/mouse_project/XZR/Standard_2.4G_First/program/patch.prog	(working copy)
@@ -28,9 +28,9 @@
 p_app_init:
 p_mouse_init:
 	call enable_authrom
-	call p_lpm_write_ice_disable
-	arg 19,temp
-	call gpio_set_high_impedance
+//	call p_lpm_write_ice_disable
+//	arg 19,temp
+//	call gpio_set_high_impedance
 	branch mouse_init
 	
 p_mouse_start_reconnect_device:
@@ -180,7 +180,12 @@
 	//led
 	call mouse_device_poweron_timer
 	call p_mouse_dpi_led_blink_delay_timer
-	branch mouse_bb_event_timer+8
+
+	call p_mouse_dpi_key_check_long_press
+	call mouse_bt_discovery_check
+	call p_mouse_commbination_key_process
+
+	branch mouse_bb_event_timer+11
 
 p_mouse_dpi_led_blink_delay_timer:
 	arg mem_mouse_dpi_led_delay_count,regc
@@ -213,6 +218,56 @@
 p_mouse_dpi_led_blink_count_clean:
 	increase -3,temp		// 4-->1  5-->2
 	rtn
+
+p_mouse_dpi_key_check_long_press:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_SELECT_DEVICE_BY_DPI_BUTTON,mouse_select_device_by_dpi_button
+	bbit1 MOUSE_ENABLE_DPI_KEY_LONG_PRESS_DISCONVERY,p_mouse_discovery_by_dpi_button
+	rtn
+p_mouse_discovery_by_dpi_button:
+	fetch 1,mem_mouse_dpi_button_state
+	rtnne DPI_BUTTON_STATE_DOWN	
+	arg mem_bt_discovery_count,regc
+	arg p_mouse_long_dpi_button_bt_discovery,regb
+	branch timer_single_step
+p_mouse_long_dpi_button_bt_discovery:
+	jam 1,mem_mouse_dpi_long_press_flag
+	branch p_mouse_long_button_bt_discovery
+
+p_mouse_commbination_key_process:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit0 MOUSE_ENABLE_COMMBINATION_KEY_BY_BT_DISCOVERY
+	fetcht 1,mem_mouse_commbination_key_bt
+	storet 1,mem_mouse_commbination_key
+	call mouse_check_key_gpio
+	and pdata,0x07,pdata
+	fetcht 1,mem_mouse_commbination_key
+	isub temp,null
+	branch p_mouse_commbination_key_down,zero
+	branch mouse_commbination_key_up
+		
+p_mouse_commbination_key_down:
+	call p_mouse_combination_ui_timer
+	branch mouse_commbination_key_down+1
+
+
+p_mouse_combination_ui_timer:
+	arg mem_combination_ui_button_count,regc
+	arg p_mouse_long_button_bt_discovery,regb
+	call timer_single_step
+	fetch 1,mem_combination_ui_button_count
+	beq 1,mouse_bt_discovery_button_down_enable	// ble release key press
+	rtn
+p_mouse_long_button_bt_discovery:
+	jam MODE_BT_DEVICE1,mem_device_flag
+	jam 0,mem_mouse_direct_timer
+	call mouse_sensor_powerdown
+	call check_51cmd_stop_adv
+	jam 0,mem_link_key_exists
+	call mouse_stop_bluetooth_mode
+	call mouse_store_device_info_delay
+	branch mouse_long_button_bt_discovery
+	
 /////////////////////////////////////////////////////////////////////////////////////////////////
 p_le_slave_match:
 	fetch 1,mem_le_md_count
Index: sched/mouse.dat
===================================================================
--- /YC1308AC/branch/mouse_project/XZR/Standard_2.4G_First/sched/mouse.dat	(revision 416)
+++ /YC1308AC/branch/mouse_project/XZR/Standard_2.4G_First/sched/mouse.dat	(working copy)
@@ -94,7 +94,7 @@
 
 mem_mouse_discovery_timeout:b0 04	#2min
 mem_mouse_24g_pair_timeout_init:08 00  #1min	    24g reconn timer&pair timer
-mem_mouse_direct_timeout:32  #05s
+mem_mouse_direct_timeout:50  #05s
 mem_mouse_24g_reconn_timeout_init:05 #500ms
 
 mem_mouse_24g_pair_tx_power:94 #-20dBm
