Index: output/eeprom.dat
===================================================================
--- /YC1308AC/branch/mouse_project/XZR/mouse_public_xzr_branch/PB_3mode_3ch_M5DM/output/eeprom.dat	(revision 1728)
+++ /YC1308AC/branch/mouse_project/XZR/mouse_public_xzr_branch/PB_3mode_3ch_M5DM/output/eeprom.dat	(working copy)
@@ -2,7 +2,7 @@
 02
 aa
 55
-16
+3a
 16
 c2
 84
@@ -79,7 +79,7 @@
 c0
 67
 85
-4d
+56
 c0
 68
 02
@@ -187,7 +187,7 @@
 c0
 76
 85
-7d
+86
 20
 20
 13
@@ -5082,16 +5082,52 @@
 36
 20
 40
+05
+01
+20
+40
 04
 f8
 20
-40
-05
-0c
+20
+46
+50
+6f
+e4
+4b
+ab
+c2
+94
+84
+fc
+c2
+9b
+84
+fc
+20
+60
+00
+00
+6f
+e1
+47
+8c
+c2
+83
+04
+ff
 20
 20
 46
-4f
+5a
+70
+4b
+94
+03
+20
+20
+01
+d0
 6f
 e4
 4b
@@ -5123,7 +5159,7 @@
 20
 40
 05
-01
+0a
 20
 20
 40
@@ -5151,7 +5187,7 @@
 c0
 7f
 85
-08
+11
 20
 20
 40
@@ -5187,7 +5223,7 @@
 24
 3a
 05
-15
+1e
 6f
 e0
 cc
@@ -5199,7 +5235,7 @@
 20
 40
 05
-25
+2e
 68
 48
 cc
@@ -5239,11 +5275,11 @@
 20
 40
 05
-3e
+47
 20
 40
 05
-29
+32
 68
 48
 cc
@@ -5287,7 +5323,7 @@
 20
 40
 05
-34
+3d
 67
 e0
 cc
@@ -5299,7 +5335,7 @@
 20
 3a
 05
-30
+39
 6f
 e0
 cc
@@ -5363,11 +5399,11 @@
 c0
 03
 85
-49
+52
 c0
 00
 05
-4b
+54
 20
 60
 00
@@ -5407,11 +5443,11 @@
 c0
 03
 85
-49
+52
 c0
 00
 05
-4b
+54
 20
 60
 00
@@ -5455,7 +5491,7 @@
 c2
 9e
 85
-59
+62
 18
 42
 7e
@@ -5487,7 +5523,7 @@
 24
 3a
 05
-76
+7f
 6f
 e4
 4b
@@ -5495,7 +5531,7 @@
 c2
 8e
 05
-6a
+73
 18
 42
 7e
@@ -5507,11 +5543,11 @@
 c0
 00
 05
-66
+6f
 c0
 01
 05
-64
+6d
 20
 60
 00
@@ -5523,7 +5559,7 @@
 20
 20
 05
-56
+5f
 58
 00
 00
@@ -5531,7 +5567,7 @@
 20
 20
 05
-56
+5f
 58
 00
 00
@@ -5539,7 +5575,7 @@
 20
 20
 05
-56
+5f
 58
 00
 00
@@ -5547,7 +5583,7 @@
 20
 20
 05
-56
+5f
 18
 42
 7e
@@ -5559,15 +5595,15 @@
 c0
 00
 05
-66
+6f
 c0
 01
 05
-68
+71
 c0
 01
 85
-64
+6d
 20
 60
 00
@@ -5583,15 +5619,15 @@
 c0
 00
 05
-68
+71
 c0
 00
 85
-64
+6d
 c0
 01
 85
-62
+6b
 20
 60
 00
@@ -5603,7 +5639,7 @@
 c2
 8e
 05
-70
+79
 18
 42
 7e
@@ -5615,11 +5651,11 @@
 c0
 00
 05
-62
+6b
 c0
 00
 85
-64
+6d
 20
 60
 00
@@ -5656,8 +5692,8 @@
 20
 26
 f6
-a0
-f6
+c0
+15
 aa
 55
 40
@@ -6982,52 +7018,16 @@
 02
 40
 00
-53
+77
 1b
 55
 aa
 aa
 55
-ee
-8b
-05
-2e
-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
+8c
+b8
+12
 ff
 ff
 ff
@@ -8188,5 +8188,5 @@
 ff
 ff
 ff
-71
-d4
+95
+ed
Index: output/program.lis
===================================================================
--- /YC1308AC/branch/mouse_project/XZR/mouse_public_xzr_branch/PB_3mode_3ch_M5DM/output/program.lis	(revision 1725)
+++ /YC1308AC/branch/mouse_project/XZR/mouse_public_xzr_branch/PB_3mode_3ch_M5DM/output/program.lis	(working copy)
@@ -18,7 +18,7 @@
 000f c0650224 beq patch19_2 ,p_mouse_lpm_before_common 
 0010 c06600c5 beq patch19_4 ,p_mouse_adc_read_start 
 0011 c067044f beq patch19_6 ,p_mouse_motion 
-0012 c067854d beq patch19_7 ,p_mouse_dpi_process 
+0012 c0678556 beq patch19_7 ,p_mouse_dpi_process 
 0013 c06802fb beq patch1a_0 ,p_mouse_seting_dpi 
 0014 c0688480 beq patch1a_1 ,p_mouse_check_key_gpio 
 0015 c06a0460 beq patch1a_4 ,p_mouse_sensor_poweron 
@@ -47,7 +47,7 @@
 002a c07482bb beq patch3d_1 ,p_g24_reconn_dispatch 
 002b c075018b beq patch3d_2 ,p_g24_transmit_no_interrupt 
 002c c0760442 beq patch3d_4 ,p_g24_lpm_wait 
-002d c076857d beq patch3d_5 ,p_power_ctrl_start 
+002d c0768586 beq patch3d_5 ,p_power_ctrl_start 
 002e 2020137c branch loop 
 
 p_soft_reset:
@@ -1713,210 +1713,225 @@
 p_mouse_idle:
 04f3 20404990 call mouse_low_voltage_led_no_enter_lpm 
 04f4 20407936 call ui_check_paring_button 
-04f5 204004f8 call p_mouse_dpi_check 
-04f6 2040050c call p_mouse_dpi_another_gpio_check 
-04f7 2020464f branch mouse_idle + 4 
+04f5 20400501 call p_mouse_dpi_check 
+04f6 204004f8 call p_mouse_select_device_check 
+04f7 20204650 branch mouse_idle + 5 
 
-p_mouse_dpi_check:
+p_mouse_select_device_check:
 04f8 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-04f9 c2974036 bbit1 mouse_enable_dpi_key_connect_adc ,mouse_dpi_check_connect_adc 
-04fa 6fe0c90f fetch 1 ,mem_dpi_button_gpio 
-04fb c17f8000 rtneq gpio_disable 
-04fc da200000 arg 0 ,rega 
-04fd 704b9605 jam mouse_dpi_key ,mem_mouse_key_temp 
-04fe 6848c90f fetcht 1 ,mem_dpi_button_gpio 
-04ff 20400501 call p_mouse_dpi_key_check 
-0500 2020402f branch mouse_dpi_check_next 
+04f9 c29484fc bbit1 mouse_enable_select_device_by_pb_button ,p_mouse_select_device_by_pb_button_check_judge 
+04fa c29b84fc bbit1 mouse_enable_pb_button_long_press_disconvery ,p_mouse_select_device_by_pb_button_check_judge 
+04fb 20600000 rtn 
+
+p_mouse_select_device_by_pb_button_check_judge:
+04fc 6fe1478c fetch 2 ,mem_ui_state_map 
+04fd c28304ff bbit1 ui_state_bt_discovery ,p_mouse_select_device_by_pb_button_check_once 
+04fe 2020465a branch mouse_select_device_by_pb_button 
+
+p_mouse_select_device_by_pb_button_check_once:
+04ff 704b9403 jam 0x03 ,mem_mouse_pbkey_press_status 
+0500 202001d0 branch p_mouse_select_device_by_pb_button 
 
-p_mouse_dpi_key_check:
+p_mouse_dpi_check:
 0501 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-0502 c2964048 bbit1 mouse_enable_dpi_key_connect_gnd ,mouse_dpi_key_connect_gnd 
-0503 6fe0cb93 fetch 1 ,mem_mouse_dpikey_press_status 
-0504 1fe22600 copy pdata ,regc 
-0505 6fe0c910 fetch 1 ,mem_matrix_public_gpio 
-0506 c07f8508 beq gpio_disable ,p_mouse_3io6key_dpi_check 
-0507 2020403f branch mouse_dpi_key_check_next 
+0502 c2974036 bbit1 mouse_enable_dpi_key_connect_adc ,mouse_dpi_check_connect_adc 
+0503 6fe0c90f fetch 1 ,mem_dpi_button_gpio 
+0504 c17f8000 rtneq gpio_disable 
+0505 da200000 arg 0 ,rega 
+0506 704b9605 jam mouse_dpi_key ,mem_mouse_key_temp 
+0507 6848c90f fetcht 1 ,mem_dpi_button_gpio 
+0508 2040050a call p_mouse_dpi_key_check 
+0509 2020402f branch mouse_dpi_check_next 
+
+p_mouse_dpi_key_check:
+050a 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+050b c2964048 bbit1 mouse_enable_dpi_key_connect_gnd ,mouse_dpi_key_connect_gnd 
+050c 6fe0cb93 fetch 1 ,mem_mouse_dpikey_press_status 
+050d 1fe22600 copy pdata ,regc 
+050e 6fe0c910 fetch 1 ,mem_matrix_public_gpio 
+050f c07f8511 beq gpio_disable ,p_mouse_3io6key_dpi_check 
+0510 2020403f branch mouse_dpi_key_check_next 
 
 p_mouse_3io6key_dpi_check:
-0508 6fe0c90f fetch 1 ,mem_dpi_button_gpio 
-0509 204004b6 call p_mouse_gpio_config_output_low 
-050a 6848c90f fetcht 1 ,mem_dpi_button_gpio 
-050b 20204195 branch mouse_3io6key_check 
+0511 6fe0c90f fetch 1 ,mem_dpi_button_gpio 
+0512 204004b6 call p_mouse_gpio_config_output_low 
+0513 6848c90f fetcht 1 ,mem_dpi_button_gpio 
+0514 20204195 branch mouse_3io6key_check 
 
 p_mouse_dpi_another_gpio_check:
-050c 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-050d c41e8000 rtnbit0 mouse_enable_double_dpi_key 
-050e 6fe0cc3a fetch 1 ,mem_mouse_another_dpi_connect_vin_flag 
-050f 243a0515 nbranch p_mouse_dpi_another_gpio_connect_vin_check ,blank 
+0515 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+0516 c41e8000 rtnbit0 mouse_enable_double_dpi_key 
+0517 6fe0cc3a fetch 1 ,mem_mouse_another_dpi_connect_vin_flag 
+0518 243a051e nbranch p_mouse_dpi_another_gpio_connect_vin_check ,blank 
 
 p_mouse_dpi_another_gpio_connect_gnd_check:
-0510 6fe0cc3b fetch 1 ,mem_dpi_another_button_gpio 
-0511 204004b3 call p_mouse_gpio_config_output_high 
-0512 20400525 call p_mouse_dpi_another_check 
-0513 6848cc3b fetcht 1 ,mem_dpi_another_button_gpio 
-0514 20203f56 branch mouse_gpio_config_input_pu 
+0519 6fe0cc3b fetch 1 ,mem_dpi_another_button_gpio 
+051a 204004b3 call p_mouse_gpio_config_output_high 
+051b 2040052e call p_mouse_dpi_another_check 
+051c 6848cc3b fetcht 1 ,mem_dpi_another_button_gpio 
+051d 20203f56 branch mouse_gpio_config_input_pu 
 
 p_mouse_dpi_another_gpio_connect_vin_check:
-0515 6fe0cc3b fetch 1 ,mem_dpi_another_button_gpio 
-0516 793ffe07 set0 gpio_active_bit ,pdata 
-0517 67e0cc3b store 1 ,mem_dpi_another_button_gpio 
-0518 204004b6 call p_mouse_gpio_config_output_low 
-0519 704c3f00 jam mouse_dpi_another_key ,mem_mouse_key_temp_patch 
-051a 6848cc3b fetcht 1 ,mem_dpi_another_button_gpio 
-051b 6fe0cc3c fetch 1 ,mem_dpi_another_press_status 
-051c 2040053e call p_mouse_check_key_connect_vin_new 
-051d 20400529 call p_mouse_dpi_another_state_check 
-051e 6848cc3b fetcht 1 ,mem_dpi_another_button_gpio 
-051f 20203f56 branch mouse_gpio_config_input_pu 
+051e 6fe0cc3b fetch 1 ,mem_dpi_another_button_gpio 
+051f 793ffe07 set0 gpio_active_bit ,pdata 
+0520 67e0cc3b store 1 ,mem_dpi_another_button_gpio 
+0521 204004b6 call p_mouse_gpio_config_output_low 
+0522 704c3f00 jam mouse_dpi_another_key ,mem_mouse_key_temp_patch 
+0523 6848cc3b fetcht 1 ,mem_dpi_another_button_gpio 
+0524 6fe0cc3c fetch 1 ,mem_dpi_another_press_status 
+0525 20400547 call p_mouse_check_key_connect_vin_new 
+0526 20400532 call p_mouse_dpi_another_state_check 
+0527 6848cc3b fetcht 1 ,mem_dpi_another_button_gpio 
+0528 20203f56 branch mouse_gpio_config_input_pu 
 
 p_mouse_dpi_another_down_new:
-0520 20403f56 call mouse_gpio_config_input_pu 
-0521 6fe0cc3d fetch 1 ,mem_dpi_another_button_state 
-0522 c1008000 rtneq dpi_button_state_down 
-0523 704c3d01 jam dpi_button_state_down ,mem_dpi_another_button_state 
-0524 20204069 branch mouse_dpi_process 
+0529 20403f56 call mouse_gpio_config_input_pu 
+052a 6fe0cc3d fetch 1 ,mem_dpi_another_button_state 
+052b c1008000 rtneq dpi_button_state_down 
+052c 704c3d01 jam dpi_button_state_down ,mem_dpi_another_button_state 
+052d 20204069 branch mouse_dpi_process 
 
 p_mouse_dpi_another_check:
-0525 704c3f00 jam mouse_dpi_another_key ,mem_mouse_key_temp_patch 
-0526 6848cc3b fetcht 1 ,mem_dpi_another_button_gpio 
-0527 6fe0cc3c fetch 1 ,mem_dpi_another_press_status 
-0528 20400534 call p_mouse_check_key_connect_gnd_new 
+052e 704c3f00 jam mouse_dpi_another_key ,mem_mouse_key_temp_patch 
+052f 6848cc3b fetcht 1 ,mem_dpi_another_button_gpio 
+0530 6fe0cc3c fetch 1 ,mem_dpi_another_press_status 
+0531 2040053d call p_mouse_check_key_connect_gnd_new 
 
 p_mouse_dpi_another_state_check:
-0529 67e0cc3c store 1 ,mem_dpi_another_press_status 
-052a 6fe0cc3e fetch 1 ,mem_dpi_another_button_down_enable 
-052b 203a0530 branch p_mouse_dpi_another_up ,blank 
+0532 67e0cc3c store 1 ,mem_dpi_another_press_status 
+0533 6fe0cc3e fetch 1 ,mem_dpi_another_button_down_enable 
+0534 203a0539 branch p_mouse_dpi_another_up ,blank 
 
 p_mouse_dpi_another_down:
-052c 6fe0cc3d fetch 1 ,mem_dpi_another_button_state 
-052d c1008000 rtneq dpi_button_state_down 
-052e 704c3d01 jam dpi_button_state_down ,mem_dpi_another_button_state 
-052f 20204069 branch mouse_dpi_process 
+0535 6fe0cc3d fetch 1 ,mem_dpi_another_button_state 
+0536 c1008000 rtneq dpi_button_state_down 
+0537 704c3d01 jam dpi_button_state_down ,mem_dpi_another_button_state 
+0538 20204069 branch mouse_dpi_process 
 
 p_mouse_dpi_another_up:
-0530 6fe0cc3d fetch 1 ,mem_dpi_another_button_state 
-0531 c1000000 rtneq dpi_button_state_up 
-0532 704c3d00 jam dpi_button_state_up ,mem_dpi_another_button_state 
-0533 20600000 rtn 
+0539 6fe0cc3d fetch 1 ,mem_dpi_another_button_state 
+053a c1000000 rtneq dpi_button_state_up 
+053b 704c3d00 jam dpi_button_state_up ,mem_dpi_another_button_state 
+053c 20600000 rtn 
 
 p_mouse_check_key_connect_gnd_new:
-0534 1fe3fe00 lshift pdata ,pdata 
-0535 1fe22400 copy pdata ,regb 
-0536 20406059 call gpio_get_bit 
-0537 7920a400 setflag true ,0 ,regb 
-0538 1a417e07 and regb ,0x07 ,pdata 
-0539 6848cc3f fetcht 1 ,mem_mouse_key_temp_patch 
-053a 18420e00 copy temp ,queue 
-053b c0038549 beq 0x07 ,p_mouse_key_press 
-053c c000054b beq 0x00 ,p_mouse_key_release 
-053d 20600000 rtn 
+053d 1fe3fe00 lshift pdata ,pdata 
+053e 1fe22400 copy pdata ,regb 
+053f 20406059 call gpio_get_bit 
+0540 7920a400 setflag true ,0 ,regb 
+0541 1a417e07 and regb ,0x07 ,pdata 
+0542 6848cc3f fetcht 1 ,mem_mouse_key_temp_patch 
+0543 18420e00 copy temp ,queue 
+0544 c0038552 beq 0x07 ,p_mouse_key_press 
+0545 c0000554 beq 0x00 ,p_mouse_key_release 
+0546 20600000 rtn 
 
 p_mouse_check_key_connect_vin_new:
-053e 1fe3fe00 lshift pdata ,pdata 
-053f 1fe22400 copy pdata ,regb 
-0540 20403f54 call mouse_gpio_config_input_pd 
-0541 20406059 call gpio_get_bit 
-0542 7920a400 setflag true ,0 ,regb 
-0543 1a417e07 and regb ,0x07 ,pdata 
-0544 6848cc3f fetcht 1 ,mem_mouse_key_temp_patch 
-0545 18420e00 copy temp ,queue 
-0546 c0038549 beq 0x07 ,p_mouse_key_press 
-0547 c000054b beq 0x00 ,p_mouse_key_release 
-0548 20600000 rtn 
+0547 1fe3fe00 lshift pdata ,pdata 
+0548 1fe22400 copy pdata ,regb 
+0549 20403f54 call mouse_gpio_config_input_pd 
+054a 20406059 call gpio_get_bit 
+054b 7920a400 setflag true ,0 ,regb 
+054c 1a417e07 and regb ,0x07 ,pdata 
+054d 6848cc3f fetcht 1 ,mem_mouse_key_temp_patch 
+054e 18420e00 copy temp ,queue 
+054f c0038552 beq 0x07 ,p_mouse_key_press 
+0550 c0000554 beq 0x00 ,p_mouse_key_release 
+0551 20600000 rtn 
 
 p_mouse_key_press:
-0549 704c3e01 jam 1 ,mem_dpi_another_button_down_enable 
-054a 20600000 rtn 
+0552 704c3e01 jam 1 ,mem_dpi_another_button_down_enable 
+0553 20600000 rtn 
 
 p_mouse_key_release:
-054b 704c3e00 jam 0 ,mem_dpi_another_button_down_enable 
-054c 20600000 rtn 
+0554 704c3e00 jam 0 ,mem_dpi_another_button_down_enable 
+0555 20600000 rtn 
 
 p_mouse_dpi_process:
-054d 20404072 call mouse_dpi_ghost_check 
-054e 20740000 rtn user 
-054f 6fe0c992 fetch 1 ,mem_mouse_dpi 
-0550 1fe20400 copy pdata ,temp 
-0551 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-0552 c29e8559 bbit1 mouse_enable_double_dpi_key ,p_mouse_double_dpi_check 
-0553 18427e00 copy temp ,pdata 
-0554 1fe0fe01 increase 1 ,pdata 
-0555 1fe17e03 and pdata ,0x03 ,pdata 
+0556 20404072 call mouse_dpi_ghost_check 
+0557 20740000 rtn user 
+0558 6fe0c992 fetch 1 ,mem_mouse_dpi 
+0559 1fe20400 copy pdata ,temp 
+055a 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+055b c29e8562 bbit1 mouse_enable_double_dpi_key ,p_mouse_double_dpi_check 
+055c 18427e00 copy temp ,pdata 
+055d 1fe0fe01 increase 1 ,pdata 
+055e 1fe17e03 and pdata ,0x03 ,pdata 
 
 p_mouse_dpi_store:
-0556 67e0c992 store 1 ,mem_mouse_dpi 
-0557 20404095 call mouse_seting_dpi 
-0558 202045ee branch mouse_store_device_info_delay 
+055f 67e0c992 store 1 ,mem_mouse_dpi 
+0560 20404095 call mouse_seting_dpi 
+0561 202045ee branch mouse_store_device_info_delay 
 
 p_mouse_double_dpi_check:
-0559 6fe0cc3e fetch 1 ,mem_dpi_another_button_down_enable 
-055a 243a0576 nbranch p_mouse_another_dpi_button_down ,blank 
+0562 6fe0cc3e fetch 1 ,mem_dpi_another_button_down_enable 
+0563 243a057f nbranch p_mouse_another_dpi_button_down ,blank 
 
 p_mouse_dpi_increase:
-055b 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-055c c28e056a bbit1 mouse_enable_dpi_level_4 ,p_mouse_dpi_increase_level_4 
-055d 18427e00 copy temp ,pdata 
-055e c1008000 rtneq mouse_dpi_level2 
+0564 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+0565 c28e0573 bbit1 mouse_enable_dpi_level_4 ,p_mouse_dpi_increase_level_4 
+0566 18427e00 copy temp ,pdata 
+0567 c1008000 rtneq mouse_dpi_level2 
 
 p_mouse_dpi_increase_level:
-055f c0000566 beq mouse_dpi_level1 ,p_mouse_dpi_level_3 
-0560 c0010564 beq mouse_dpi_level3 ,p_mouse_dpi_level_2 
-0561 20600000 rtn 
+0568 c000056f beq mouse_dpi_level1 ,p_mouse_dpi_level_3 
+0569 c001056d beq mouse_dpi_level3 ,p_mouse_dpi_level_2 
+056a 20600000 rtn 
 
 p_mouse_dpi_level_1:
-0562 58000002 setarg 2 
-0563 20200556 branch p_mouse_dpi_store 
+056b 58000002 setarg 2 
+056c 2020055f branch p_mouse_dpi_store 
 
 p_mouse_dpi_level_2:
-0564 58000000 setarg 0 
-0565 20200556 branch p_mouse_dpi_store 
+056d 58000000 setarg 0 
+056e 2020055f branch p_mouse_dpi_store 
 
 p_mouse_dpi_level_3:
-0566 58000001 setarg 1 
-0567 20200556 branch p_mouse_dpi_store 
+056f 58000001 setarg 1 
+0570 2020055f branch p_mouse_dpi_store 
 
 p_mouse_dpi_level_4:
-0568 58000003 setarg 3 
-0569 20200556 branch p_mouse_dpi_store 
+0571 58000003 setarg 3 
+0572 2020055f branch p_mouse_dpi_store 
 
 p_mouse_dpi_increase_level_4:
-056a 18427e00 copy temp ,pdata 
-056b c1008000 rtneq mouse_dpi_level2 
-056c c0000566 beq mouse_dpi_level1 ,p_mouse_dpi_level_3 
-056d c0010568 beq mouse_dpi_level3 ,p_mouse_dpi_level_4 
-056e c0018564 beq mouse_dpi_level4 ,p_mouse_dpi_level_2 
-056f 20600000 rtn 
+0573 18427e00 copy temp ,pdata 
+0574 c1008000 rtneq mouse_dpi_level2 
+0575 c000056f beq mouse_dpi_level1 ,p_mouse_dpi_level_3 
+0576 c0010571 beq mouse_dpi_level3 ,p_mouse_dpi_level_4 
+0577 c001856d beq mouse_dpi_level4 ,p_mouse_dpi_level_2 
+0578 20600000 rtn 
 
 p_mouse_dpi_decrease_level_4:
-0570 18427e00 copy temp ,pdata 
-0571 c1010000 rtneq mouse_dpi_level3 
-0572 c0000568 beq mouse_dpi_level1 ,p_mouse_dpi_level_4 
-0573 c0008564 beq mouse_dpi_level2 ,p_mouse_dpi_level_2 
-0574 c0018562 beq mouse_dpi_level4 ,p_mouse_dpi_level_1 
-0575 20600000 rtn 
+0579 18427e00 copy temp ,pdata 
+057a c1010000 rtneq mouse_dpi_level3 
+057b c0000571 beq mouse_dpi_level1 ,p_mouse_dpi_level_4 
+057c c000856d beq mouse_dpi_level2 ,p_mouse_dpi_level_2 
+057d c001856b beq mouse_dpi_level4 ,p_mouse_dpi_level_1 
+057e 20600000 rtn 
 
 p_mouse_another_dpi_button_down:
 
 p_mouse_dpi_decrease:
-0576 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-0577 c28e0570 bbit1 mouse_enable_dpi_level_4 ,p_mouse_dpi_decrease_level_4 
-0578 18427e00 copy temp ,pdata 
-0579 c1010000 rtneq mouse_dpi_level3 
+057f 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+0580 c28e0579 bbit1 mouse_enable_dpi_level_4 ,p_mouse_dpi_decrease_level_4 
+0581 18427e00 copy temp ,pdata 
+0582 c1010000 rtneq mouse_dpi_level3 
 
 p_mouse_dpi_decrease_level:
-057a c0000562 beq mouse_dpi_level1 ,p_mouse_dpi_level_1 
-057b c0008564 beq mouse_dpi_level2 ,p_mouse_dpi_level_2 
-057c 20600000 rtn 
+0583 c000056b beq mouse_dpi_level1 ,p_mouse_dpi_level_1 
+0584 c000856d beq mouse_dpi_level2 ,p_mouse_dpi_level_2 
+0585 20600000 rtn 
 
 p_power_ctrl_start:
-057d 6fe1478c fetch 2 ,mem_ui_state_map 
-057e c3858000 rtnbit1 ui_state_ble_adv 
-057f c3838000 rtnbit1 ui_state_bt_reconnect 
-0580 c3830000 rtnbit1 ui_state_bt_discovery 
-0581 6a214899 fetchr rega ,2 ,mem_rssi_signal_buf_ptr 
-0582 204025cb call rssi_average 
-0583 6048c8c7 storet 1 ,mem_rssi_avg_received 
-0584 202026f6 branch power_ctrl_rssi_avg_compare 
+0586 6fe1478c fetch 2 ,mem_ui_state_map 
+0587 c3858000 rtnbit1 ui_state_ble_adv 
+0588 c3838000 rtnbit1 ui_state_bt_reconnect 
+0589 c3830000 rtnbit1 ui_state_bt_discovery 
+058a 6a214899 fetchr rega ,2 ,mem_rssi_signal_buf_ptr 
+058b 204025cb call rssi_average 
+058c 6048c8c7 storet 1 ,mem_rssi_avg_received 
+058d 202026f6 branch power_ctrl_rssi_avg_compare 
               org 0x3bc1
 
 mouse_init:
Index: program/patch.prog
===================================================================
--- /YC1308AC/branch/mouse_project/XZR/mouse_public_xzr_branch/PB_3mode_3ch_M5DM/program/patch.prog	(revision 1725)
+++ /YC1308AC/branch/mouse_project/XZR/mouse_public_xzr_branch/PB_3mode_3ch_M5DM/program/patch.prog	(working copy)
@@ -1780,8 +1780,24 @@
 	call mouse_low_voltage_led_no_enter_lpm
 	call ui_check_paring_button
 	call p_mouse_dpi_check
-	call p_mouse_dpi_another_gpio_check
-	branch mouse_idle+4
+	call p_mouse_select_device_check
+	branch mouse_idle+5
+
+p_mouse_select_device_check:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_SELECT_DEVICE_BY_PB_BUTTON,p_mouse_select_device_by_pb_button_check_judge
+	bbit1 MOUSE_ENABLE_PB_BUTTON_LONG_PRESS_DISCONVERY,p_mouse_select_device_by_pb_button_check_judge
+	rtn
+	
+p_mouse_select_device_by_pb_button_check_judge:
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_DISCOVERY,p_mouse_select_device_by_pb_button_check_once
+	branch mouse_select_device_by_pb_button
+	
+p_mouse_select_device_by_pb_button_check_once:
+	jam 0x03,mem_mouse_pbkey_press_status
+	branch p_mouse_select_device_by_pb_button
+	
 p_mouse_dpi_check:
 	fetch MOUSE_FLAG_LEN,mem_mouse_flag
 	bbit1 MOUSE_ENABLE_DPI_KEY_CONNECT_ADC,mouse_dpi_check_connect_adc
