Index: format/app_mouse.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/PB_3mode_3ch_1IO2LED_907/format/app_mouse.format	(revision 4649)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/PB_3mode_3ch_1IO2LED_907/format/app_mouse.format	(working copy)
@@ -397,6 +397,7 @@
 0X06 MOUSE_RM_BUTTON
 0X07 MOUSE_LMR_BUTTON
 0x09 MOUSE_L_BK_BUTTON
+0x0a MOUSE_R_BK_BUTTON
 0x14 MOUSE_M_FW_BUTTON
 0X18 MOUSE_BK_FW_BUTTON
 //mouse default gpio
Index: output/eeprom.dat
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/PB_3mode_3ch_1IO2LED_907/output/eeprom.dat	(revision 4654)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/PB_3mode_3ch_1IO2LED_907/output/eeprom.dat	(working copy)
@@ -2,7 +2,7 @@
 02
 aa
 55
-2e
+aa
 14
 c2
 84
@@ -67,7 +67,7 @@
 c0
 67
 84
-db
+f5
 c0
 68
 02
@@ -75,7 +75,7 @@
 c0
 68
 84
-3c
+50
 c0
 6a
 04
@@ -103,7 +103,7 @@
 c0
 6f
 04
-72
+86
 c0
 6f
 80
@@ -4335,11 +4335,91 @@
 20
 40
 04
-3c
+50
+20
+40
+04
+3d
 20
 20
 40
-dd
+de
+70
+4b
+98
+00
+70
+4b
+99
+00
+70
+4b
+9a
+00
+1f
+e2
+04
+00
+20
+40
+41
+00
+20
+40
+04
+4d
+20
+40
+41
+03
+20
+40
+41
+06
+6f
+e0
+cb
+99
+20
+7a
+00
+00
+6f
+e0
+cb
+98
+20
+7a
+00
+00
+70
+4b
+9a
+01
+6f
+e0
+c8
+d8
+1f
+e2
+22
+00
+20
+60
+00
+00
+18
+41
+7e
+0a
+c0
+05
+41
+0e
+20
+60
+00
+00
 6f
 e0
 cb
@@ -4355,23 +4435,23 @@
 20
 40
 04
-45
+59
 20
 40
 04
-4a
+5e
 20
 40
 04
-4f
+63
 20
 40
 04
-54
+68
 20
 40
 04
-61
+75
 20
 20
 41
@@ -4383,7 +4463,7 @@
 20
 40
 04
-6e
+82
 20
 40
 41
@@ -4403,7 +4483,7 @@
 20
 40
 04
-6e
+82
 20
 40
 41
@@ -4423,7 +4503,7 @@
 20
 40
 04
-6e
+82
 20
 40
 41
@@ -4467,7 +4547,7 @@
 c0
 7f
 84
-5d
+71
 20
 20
 41
@@ -4479,7 +4559,7 @@
 20
 40
 04
-70
+84
 68
 48
 c9
@@ -4519,7 +4599,7 @@
 c0
 7f
 84
-6a
+7e
 20
 20
 41
@@ -4531,7 +4611,7 @@
 20
 40
 04
-70
+84
 68
 48
 c9
@@ -4567,19 +4647,43 @@
 20
 40
 04
-85
+8b
 20
 40
 04
-99
+92
+20
+20
+46
+50
+d8
+e0
+00
+0c
+20
+40
+7d
+74
+24
+7a
+00
+00
 20
 40
 04
-78
+9f
+d8
+e0
+00
+0c
+58
+00
+00
 20
 20
-46
-50
+20
+7d
+66
 6f
 e4
 4b
@@ -4587,11 +4691,11 @@
 c2
 94
 84
-7c
+96
 c2
 9b
 84
-7c
+96
 20
 60
 00
@@ -4603,7 +4707,7 @@
 c2
 83
 04
-83
+9d
 6f
 e0
 c9
@@ -4633,14 +4737,6 @@
 01
 7e
 6f
-e4
-4b
-ab
-c2
-97
-40
-36
-6f
 e0
 c9
 0f
@@ -4648,6 +4744,14 @@
 7f
 80
 00
+20
+40
+05
+08
+20
+74
+00
+00
 da
 20
 00
@@ -4663,7 +4767,7 @@
 20
 40
 04
-8e
+a8
 20
 20
 40
@@ -4691,7 +4795,7 @@
 c0
 7f
 84
-95
+af
 20
 20
 40
@@ -4703,7 +4807,7 @@
 20
 40
 04
-70
+84
 68
 48
 c9
@@ -4727,7 +4831,7 @@
 24
 3a
 04
-a2
+bc
 6f
 e0
 cc
@@ -4735,11 +4839,11 @@
 20
 40
 04
-6e
+82
 20
 40
 04
-b3
+cd
 68
 48
 cc
@@ -4767,7 +4871,7 @@
 20
 40
 04
-70
+84
 70
 4c
 3f
@@ -4783,11 +4887,11 @@
 20
 40
 04
-cc
+e6
 20
 40
 04
-b7
+d1
 68
 48
 cc
@@ -4831,7 +4935,7 @@
 20
 40
 04
-c2
+dc
 67
 e0
 cc
@@ -4843,7 +4947,7 @@
 20
 3a
 04
-be
+d8
 6f
 e0
 cc
@@ -4907,11 +5011,11 @@
 c0
 03
 84
-d7
+f1
 c0
 00
 04
-d9
+f3
 20
 60
 00
@@ -4951,11 +5055,11 @@
 c0
 03
 84
-d7
+f1
 c0
 00
 04
-d9
+f3
 20
 60
 00
@@ -4976,14 +5080,6 @@
 60
 00
 00
-20
-40
-40
-72
-20
-74
-00
-00
 6f
 e0
 c9
@@ -4999,7 +5095,7 @@
 c2
 9e
 84
-e7
+ff
 18
 42
 7e
@@ -5022,8 +5118,8 @@
 95
 20
 20
-45
-ee
+46
+43
 6f
 e0
 cc
@@ -5031,15 +5127,15 @@
 24
 3a
 05
-04
+23
 6f
 e4
 4b
 ab
 c2
 8e
-04
-f8
+05
+17
 18
 42
 7e
@@ -5050,16 +5146,44 @@
 00
 c0
 00
-04
-f4
+05
+13
 c0
 01
-04
-f2
+05
+11
 20
 60
 00
 00
+78
+54
+7c
+00
+6f
+e4
+4b
+ab
+c3
+96
+00
+00
+6f
+e1
+cb
+8e
+20
+7a
+00
+00
+70
+4b
+93
+00
+20
+20
+7e
+54
 58
 00
 00
@@ -5067,7 +5191,7 @@
 20
 20
 04
-e4
+fc
 58
 00
 00
@@ -5075,7 +5199,7 @@
 20
 20
 04
-e4
+fc
 58
 00
 00
@@ -5083,7 +5207,7 @@
 20
 20
 04
-e4
+fc
 58
 00
 00
@@ -5091,7 +5215,7 @@
 20
 20
 04
-e4
+fc
 18
 42
 7e
@@ -5102,16 +5226,16 @@
 00
 c0
 00
-04
-f4
+05
+13
 c0
 01
-04
-f6
+05
+15
 c0
 01
-84
-f2
+85
+11
 20
 60
 00
@@ -5126,16 +5250,16 @@
 00
 c0
 00
-04
-f6
+05
+15
 c0
 00
-84
-f2
+85
+11
 c0
 01
-84
-f0
+85
+0f
 20
 60
 00
@@ -5146,8 +5270,8 @@
 ab
 c2
 8e
-04
-fe
+05
+1d
 18
 42
 7e
@@ -5158,18 +5282,18 @@
 00
 c0
 00
-04
-f0
+05
+0f
 c0
 00
-84
-f2
+85
+11
 20
 60
 00
 00
-9c
-57
+95
+b0
 aa
 55
 40
@@ -5493,7 +5617,7 @@
 00
 b3
 4b
-02
+03
 03
 aa
 55
@@ -6496,140 +6620,16 @@
 02
 40
 00
-6d
+e9
 19
 55
 aa
 aa
 55
-bd
-8a
-b5
-3c
-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
+3a
+8b
+f3
+f4
 ff
 ff
 ff
@@ -8188,5 +8188,5 @@
 ff
 ff
 ff
-4d
-c0
+a1
+ec
Index: output/program.lis
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/PB_3mode_3ch_1IO2LED_907/output/program.lis	(revision 4649)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/PB_3mode_3ch_1IO2LED_907/output/program.lis	(working copy)
@@ -15,16 +15,16 @@
 000c c06501cd beq patch19_2 ,p_mouse_lpm_before_common 
 000d c066009d beq patch19_4 ,p_mouse_adc_read_start 
 000e c067040f beq patch19_6 ,p_mouse_motion 
-000f c06784db beq patch19_7 ,p_mouse_dpi_process 
+000f c06784f5 beq patch19_7 ,p_mouse_dpi_process 
 0010 c06802d0 beq patch1a_0 ,p_mouse_seting_dpi 
-0011 c068843c beq patch1a_1 ,p_mouse_check_key_gpio 
+0011 c0688450 beq patch1a_1 ,p_mouse_check_key_gpio 
 0012 c06a0420 beq patch1a_4 ,p_mouse_sensor_poweron 
 0013 c06b01f8 beq patch1a_6 ,p_mouse_priority_bb_event 
 0014 c06c82e1 beq patch1b_1 ,p_mouse_bb_event_timer 
 0015 c06d038d beq patch1b_2 ,p_mouse_start_discovery 
 0016 c06d83ba beq patch1b_3 ,p_mouse_stop_discovery 
 0017 c06e0027 beq patch1b_4 ,p_mouse_store_remote_bdaddr 
-0018 c06f0472 beq patch1b_6 ,p_mouse_idle 
+0018 c06f0486 beq patch1b_6 ,p_mouse_idle 
 0019 c06f802d beq patch1b_7 ,p_mouse_ready_reconnection_by_button 
 001a c07403c1 beq patch1d_0 ,p_hid_rx_process 
 001b 2020137c branch loop 
@@ -1412,303 +1412,344 @@
 0439 20205b0c branch twspi_write 
 
 p_mouse_key:
-043a 2040043c call p_mouse_check_key_gpio 
-043b 202040dd branch mouse_key + 1 
+043a 20400450 call p_mouse_check_key_gpio 
+043b 2040043d call p_mouse_ghost_key_check 
+043c 202040de branch mouse_key + 2 
+
+p_mouse_ghost_key_check:
+043d 704b9800 jam 0 ,mem_mouse_matrix_key_cow_count 
+043e 704b9900 jam 0 ,mem_mouse_matrix_key_row_count 
+043f 704b9a00 jam 0 ,mem_mouse_ghost_flag 
+0440 1fe20400 copy pdata ,temp 
+0441 20404100 call mouse_ghost_key_check_m_fw 
+0442 2040044d call p_mouse_ghost_key_check_r_bk 
+0443 20404103 call mouse_ghost_key_check_bk_fw 
+0444 20404106 call mouse_ghost_key_check_lmr 
+0445 6fe0cb99 fetch 1 ,mem_mouse_matrix_key_row_count 
+0446 207a0000 rtn blank 
+0447 6fe0cb98 fetch 1 ,mem_mouse_matrix_key_cow_count 
+0448 207a0000 rtn blank 
+0449 704b9a01 jam 1 ,mem_mouse_ghost_flag 
+044a 6fe0c8d8 fetch 1 ,mem_mouse_key_last 
+044b 1fe22200 copy pdata ,rega 
+044c 20600000 rtn 
+
+p_mouse_ghost_key_check_r_bk:
+044d 18417e0a and temp ,mouse_r_bk_button ,pdata 
+044e c005410e beq mouse_r_bk_button ,mouse_matrix_cow_more_than_one_key 
+044f 20600000 rtn 
 
 p_mouse_check_key_gpio:
-043c 6fe0cbe1 fetch 1 ,mem_sensor_shutdown_flag 
-043d 245a4121 ncall mouse_check_key_gpio_once ,blank 
-043e da200000 arg 0 ,rega 
-043f 20400445 call p_mouse_check_lkey_gpio 
-0440 2040044a call p_mouse_check_rkey_gpio 
-0441 2040044f call p_mouse_check_mkey_gpio 
-0442 20400454 call p_mouse_check_bkkey_gpio 
-0443 20400461 call p_mouse_check_fwkey_gpio 
-0444 2020411e branch mouse_check_key_gpio_next 
+0450 6fe0cbe1 fetch 1 ,mem_sensor_shutdown_flag 
+0451 245a4121 ncall mouse_check_key_gpio_once ,blank 
+0452 da200000 arg 0 ,rega 
+0453 20400459 call p_mouse_check_lkey_gpio 
+0454 2040045e call p_mouse_check_rkey_gpio 
+0455 20400463 call p_mouse_check_mkey_gpio 
+0456 20400468 call p_mouse_check_bkkey_gpio 
+0457 20400475 call p_mouse_check_fwkey_gpio 
+0458 2020411e branch mouse_check_key_gpio_next 
 
 p_mouse_check_lkey_gpio:
-0445 6fe0c918 fetch 1 ,mem_lbutton_gpio 
-0446 2040046e call p_mouse_gpio_config_output_high 
-0447 20404124 call mouse_check_lkey_gpio 
-0448 6848c918 fetcht 1 ,mem_lbutton_gpio 
-0449 20203f56 branch mouse_gpio_config_input_pu 
+0459 6fe0c918 fetch 1 ,mem_lbutton_gpio 
+045a 20400482 call p_mouse_gpio_config_output_high 
+045b 20404124 call mouse_check_lkey_gpio 
+045c 6848c918 fetcht 1 ,mem_lbutton_gpio 
+045d 20203f56 branch mouse_gpio_config_input_pu 
 
 p_mouse_check_rkey_gpio:
-044a 6fe0c919 fetch 1 ,mem_rbutton_gpio 
-044b 2040046e call p_mouse_gpio_config_output_high 
-044c 2040412a call mouse_check_rkey_gpio 
-044d 6848c919 fetcht 1 ,mem_rbutton_gpio 
-044e 20203f56 branch mouse_gpio_config_input_pu 
+045e 6fe0c919 fetch 1 ,mem_rbutton_gpio 
+045f 20400482 call p_mouse_gpio_config_output_high 
+0460 2040412a call mouse_check_rkey_gpio 
+0461 6848c919 fetcht 1 ,mem_rbutton_gpio 
+0462 20203f56 branch mouse_gpio_config_input_pu 
 
 p_mouse_check_mkey_gpio:
-044f 6fe0c91a fetch 1 ,mem_mbutton_gpio 
-0450 2040046e call p_mouse_gpio_config_output_high 
-0451 20404130 call mouse_check_mkey_gpio 
-0452 6848c91a fetcht 1 ,mem_mbutton_gpio 
-0453 20203f56 branch mouse_gpio_config_input_pu 
+0463 6fe0c91a fetch 1 ,mem_mbutton_gpio 
+0464 20400482 call p_mouse_gpio_config_output_high 
+0465 20404130 call mouse_check_mkey_gpio 
+0466 6848c91a fetcht 1 ,mem_mbutton_gpio 
+0467 20203f56 branch mouse_gpio_config_input_pu 
 
 p_mouse_check_bkkey_gpio:
-0454 6fe0c90d fetch 1 ,mem_bk_button_gpio 
-0455 c17f8000 rtneq gpio_disable 
-0456 704b9603 jam mouse_bk_key ,mem_mouse_key_temp 
-0457 6fe0cb91 fetch 1 ,mem_mouse_bkkey_press_status 
-0458 1fe22600 copy pdata ,regc 
-0459 6848c90d fetcht 1 ,mem_bk_button_gpio 
-045a 6fe0c910 fetch 1 ,mem_matrix_public_gpio 
-045b c07f845d beq gpio_disable ,p_mouse_3io6key_bk_check 
-045c 2020413e branch mouse_check_bkkey_gpio_next 
+0468 6fe0c90d fetch 1 ,mem_bk_button_gpio 
+0469 c17f8000 rtneq gpio_disable 
+046a 704b9603 jam mouse_bk_key ,mem_mouse_key_temp 
+046b 6fe0cb91 fetch 1 ,mem_mouse_bkkey_press_status 
+046c 1fe22600 copy pdata ,regc 
+046d 6848c90d fetcht 1 ,mem_bk_button_gpio 
+046e 6fe0c910 fetch 1 ,mem_matrix_public_gpio 
+046f c07f8471 beq gpio_disable ,p_mouse_3io6key_bk_check 
+0470 2020413e branch mouse_check_bkkey_gpio_next 
 
 p_mouse_3io6key_bk_check:
-045d 6fe0c90d fetch 1 ,mem_bk_button_gpio 
-045e 20400470 call p_mouse_gpio_config_output_low 
-045f 6848c90d fetcht 1 ,mem_bk_button_gpio 
-0460 2020414b branch mouse_3io6key_bk_check 
+0471 6fe0c90d fetch 1 ,mem_bk_button_gpio 
+0472 20400484 call p_mouse_gpio_config_output_low 
+0473 6848c90d fetcht 1 ,mem_bk_button_gpio 
+0474 2020414b branch mouse_3io6key_bk_check 
 
 p_mouse_check_fwkey_gpio:
-0461 6fe0c90e fetch 1 ,mem_fw_button_gpio 
-0462 c17f8000 rtneq gpio_disable 
-0463 704b9604 jam mouse_fw_key ,mem_mouse_key_temp 
-0464 6fe0cb92 fetch 1 ,mem_mouse_fwkey_press_status 
-0465 1fe22600 copy pdata ,regc 
-0466 6848c90e fetcht 1 ,mem_fw_button_gpio 
-0467 6fe0c910 fetch 1 ,mem_matrix_public_gpio 
-0468 c07f846a beq gpio_disable ,p_mouse_3io6key_fw_check 
-0469 20204157 branch mouse_check_fwkey_gpio_next 
+0475 6fe0c90e fetch 1 ,mem_fw_button_gpio 
+0476 c17f8000 rtneq gpio_disable 
+0477 704b9604 jam mouse_fw_key ,mem_mouse_key_temp 
+0478 6fe0cb92 fetch 1 ,mem_mouse_fwkey_press_status 
+0479 1fe22600 copy pdata ,regc 
+047a 6848c90e fetcht 1 ,mem_fw_button_gpio 
+047b 6fe0c910 fetch 1 ,mem_matrix_public_gpio 
+047c c07f847e beq gpio_disable ,p_mouse_3io6key_fw_check 
+047d 20204157 branch mouse_check_fwkey_gpio_next 
 
 p_mouse_3io6key_fw_check:
-046a 6fe0c90e fetch 1 ,mem_fw_button_gpio 
-046b 20400470 call p_mouse_gpio_config_output_low 
-046c 6848c90e fetcht 1 ,mem_fw_button_gpio 
-046d 20204164 branch mouse_3io6key_fw_check 
+047e 6fe0c90e fetch 1 ,mem_fw_button_gpio 
+047f 20400484 call p_mouse_gpio_config_output_low 
+0480 6848c90e fetcht 1 ,mem_fw_button_gpio 
+0481 20204164 branch mouse_3io6key_fw_check 
 
 p_mouse_gpio_config_output_high:
-046e d840003f arg gpcfg_output_high ,temp 
-046f 20206093 branch gpio_config_function_int 
+0482 d840003f arg gpcfg_output_high ,temp 
+0483 20206093 branch gpio_config_function_int 
 
 p_mouse_gpio_config_output_low:
-0470 d840003e arg gpcfg_output_low ,temp 
-0471 20206093 branch gpio_config_function_int 
+0484 d840003e arg gpcfg_output_low ,temp 
+0485 20206093 branch gpio_config_function_int 
 
 p_mouse_idle:
-0472 20404990 call mouse_low_voltage_led_no_enter_lpm 
-0473 20407936 call ui_check_paring_button 
-0474 20400485 call p_mouse_dpi_check 
-0475 20400499 call p_mouse_dpi_another_gpio_check 
-0476 20400478 call p_mouse_select_device_check 
-0477 20204650 branch mouse_idle + 5 
+0486 20404990 call mouse_low_voltage_led_no_enter_lpm 
+0487 20407936 call ui_check_paring_button 
+0488 2040048b call p_mouse_20ms_event_timer 
+0489 20400492 call p_mouse_select_device_check 
+048a 20204650 branch mouse_idle + 5 
+
+p_mouse_20ms_event_timer:
+048b d8e0000c arg 12 ,queue 
+048c 20407d74 call timer_check 
+048d 247a0000 nrtn blank 
+048e 2040049f call p_mouse_dpi_check 
+
+p_mouse_g24_retransmit_100ms_timer_init:
+048f d8e0000c arg 12 ,queue 
+0490 58000020 setarg 32 
+0491 20207d66 branch timer_init 
 
 p_mouse_select_device_check:
-0478 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-0479 c294847c bbit1 mouse_enable_select_device_by_pb_button ,p_mouse_select_device_by_pb_button_check_judge 
-047a c29b847c bbit1 mouse_enable_pb_button_long_press_disconvery ,p_mouse_select_device_by_pb_button_check_judge 
-047b 20600000 rtn 
+0492 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+0493 c2948496 bbit1 mouse_enable_select_device_by_pb_button ,p_mouse_select_device_by_pb_button_check_judge 
+0494 c29b8496 bbit1 mouse_enable_pb_button_long_press_disconvery ,p_mouse_select_device_by_pb_button_check_judge 
+0495 20600000 rtn 
 
 p_mouse_select_device_by_pb_button_check_judge:
-047c 6fe1478c fetch 2 ,mem_ui_state_map 
-047d c2830483 bbit1 ui_state_bt_discovery ,p_mouse_select_device_by_pb_button_check_once 
+0496 6fe1478c fetch 2 ,mem_ui_state_map 
+0497 c283049d bbit1 ui_state_bt_discovery ,p_mouse_select_device_by_pb_button_check_once 
 
 p_mouse_idle_select_device_by_pb_button:
-047e 6fe0c91b fetch 1 ,mem_config_select_device_button_gpio 
-047f c17f8000 rtneq gpio_disable 
-0480 6fe0c9bf fetch 1 ,mem_store_information_delay_timer 
-0481 247a0000 nrtn blank 
-0482 2020465c branch mouse_select_device_by_pb_button + 2 
+0498 6fe0c91b fetch 1 ,mem_config_select_device_button_gpio 
+0499 c17f8000 rtneq gpio_disable 
+049a 6fe0c9bf fetch 1 ,mem_store_information_delay_timer 
+049b 247a0000 nrtn blank 
+049c 2020465c branch mouse_select_device_by_pb_button + 2 
 
 p_mouse_select_device_by_pb_button_check_once:
-0483 704b9403 jam 0x03 ,mem_mouse_pbkey_press_status 
-0484 2020017e branch p_mouse_select_device_by_pb_button 
+049d 704b9403 jam 0x03 ,mem_mouse_pbkey_press_status 
+049e 2020017e branch p_mouse_select_device_by_pb_button 
 
 p_mouse_dpi_check:
-0485 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-0486 c2974036 bbit1 mouse_enable_dpi_key_connect_adc ,mouse_dpi_check_connect_adc 
-0487 6fe0c90f fetch 1 ,mem_dpi_button_gpio 
-0488 c17f8000 rtneq gpio_disable 
-0489 da200000 arg 0 ,rega 
-048a 704b9605 jam mouse_dpi_key ,mem_mouse_key_temp 
-048b 6848c90f fetcht 1 ,mem_dpi_button_gpio 
-048c 2040048e call p_mouse_dpi_key_check 
-048d 2020402f branch mouse_dpi_check_next 
+049f 6fe0c90f fetch 1 ,mem_dpi_button_gpio 
+04a0 c17f8000 rtneq gpio_disable 
+04a1 20400508 call p_mouse_dpi_ghost_check 
+04a2 20740000 rtn user 
+04a3 da200000 arg 0 ,rega 
+04a4 704b9605 jam mouse_dpi_key ,mem_mouse_key_temp 
+04a5 6848c90f fetcht 1 ,mem_dpi_button_gpio 
+04a6 204004a8 call p_mouse_dpi_key_check 
+04a7 2020402f branch mouse_dpi_check_next 
 
 p_mouse_dpi_key_check:
-048e 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-048f c2964048 bbit1 mouse_enable_dpi_key_connect_gnd ,mouse_dpi_key_connect_gnd 
-0490 6fe0cb93 fetch 1 ,mem_mouse_dpikey_press_status 
-0491 1fe22600 copy pdata ,regc 
-0492 6fe0c910 fetch 1 ,mem_matrix_public_gpio 
-0493 c07f8495 beq gpio_disable ,p_mouse_3io6key_dpi_check 
-0494 2020403f branch mouse_dpi_key_check_next 
+04a8 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+04a9 c2964048 bbit1 mouse_enable_dpi_key_connect_gnd ,mouse_dpi_key_connect_gnd 
+04aa 6fe0cb93 fetch 1 ,mem_mouse_dpikey_press_status 
+04ab 1fe22600 copy pdata ,regc 
+04ac 6fe0c910 fetch 1 ,mem_matrix_public_gpio 
+04ad c07f84af beq gpio_disable ,p_mouse_3io6key_dpi_check 
+04ae 2020403f branch mouse_dpi_key_check_next 
 
 p_mouse_3io6key_dpi_check:
-0495 6fe0c90f fetch 1 ,mem_dpi_button_gpio 
-0496 20400470 call p_mouse_gpio_config_output_low 
-0497 6848c90f fetcht 1 ,mem_dpi_button_gpio 
-0498 20204195 branch mouse_3io6key_check 
+04af 6fe0c90f fetch 1 ,mem_dpi_button_gpio 
+04b0 20400484 call p_mouse_gpio_config_output_low 
+04b1 6848c90f fetcht 1 ,mem_dpi_button_gpio 
+04b2 20204195 branch mouse_3io6key_check 
 
 p_mouse_dpi_another_gpio_check:
-0499 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-049a c41e8000 rtnbit0 mouse_enable_double_dpi_key 
-049b 6fe0cc3a fetch 1 ,mem_mouse_another_dpi_connect_vin_flag 
-049c 243a04a2 nbranch p_mouse_dpi_another_gpio_connect_vin_check ,blank 
+04b3 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+04b4 c41e8000 rtnbit0 mouse_enable_double_dpi_key 
+04b5 6fe0cc3a fetch 1 ,mem_mouse_another_dpi_connect_vin_flag 
+04b6 243a04bc nbranch p_mouse_dpi_another_gpio_connect_vin_check ,blank 
 
 p_mouse_dpi_another_gpio_connect_gnd_check:
-049d 6fe0cc3b fetch 1 ,mem_dpi_another_button_gpio 
-049e 2040046e call p_mouse_gpio_config_output_high 
-049f 204004b3 call p_mouse_dpi_another_check 
-04a0 6848cc3b fetcht 1 ,mem_dpi_another_button_gpio 
-04a1 20203f56 branch mouse_gpio_config_input_pu 
+04b7 6fe0cc3b fetch 1 ,mem_dpi_another_button_gpio 
+04b8 20400482 call p_mouse_gpio_config_output_high 
+04b9 204004cd call p_mouse_dpi_another_check 
+04ba 6848cc3b fetcht 1 ,mem_dpi_another_button_gpio 
+04bb 20203f56 branch mouse_gpio_config_input_pu 
 
 p_mouse_dpi_another_gpio_connect_vin_check:
-04a2 6fe0cc3b fetch 1 ,mem_dpi_another_button_gpio 
-04a3 793ffe07 set0 gpio_active_bit ,pdata 
-04a4 67e0cc3b store 1 ,mem_dpi_another_button_gpio 
-04a5 6fe0cc3b fetch 1 ,mem_dpi_another_button_gpio 
-04a6 20400470 call p_mouse_gpio_config_output_low 
-04a7 704c3f00 jam mouse_dpi_another_key ,mem_mouse_key_temp_patch 
-04a8 6848cc3b fetcht 1 ,mem_dpi_another_button_gpio 
-04a9 6fe0cc3c fetch 1 ,mem_dpi_another_press_status 
-04aa 204004cc call p_mouse_check_key_connect_vin_new 
-04ab 204004b7 call p_mouse_dpi_another_state_check 
-04ac 6848cc3b fetcht 1 ,mem_dpi_another_button_gpio 
-04ad 20203f56 branch mouse_gpio_config_input_pu 
+04bc 6fe0cc3b fetch 1 ,mem_dpi_another_button_gpio 
+04bd 793ffe07 set0 gpio_active_bit ,pdata 
+04be 67e0cc3b store 1 ,mem_dpi_another_button_gpio 
+04bf 6fe0cc3b fetch 1 ,mem_dpi_another_button_gpio 
+04c0 20400484 call p_mouse_gpio_config_output_low 
+04c1 704c3f00 jam mouse_dpi_another_key ,mem_mouse_key_temp_patch 
+04c2 6848cc3b fetcht 1 ,mem_dpi_another_button_gpio 
+04c3 6fe0cc3c fetch 1 ,mem_dpi_another_press_status 
+04c4 204004e6 call p_mouse_check_key_connect_vin_new 
+04c5 204004d1 call p_mouse_dpi_another_state_check 
+04c6 6848cc3b fetcht 1 ,mem_dpi_another_button_gpio 
+04c7 20203f56 branch mouse_gpio_config_input_pu 
 
 p_mouse_dpi_another_down_new:
-04ae 20403f56 call mouse_gpio_config_input_pu 
-04af 6fe0cc3d fetch 1 ,mem_dpi_another_button_state 
-04b0 c1008000 rtneq dpi_button_state_down 
-04b1 704c3d01 jam dpi_button_state_down ,mem_dpi_another_button_state 
-04b2 20204069 branch mouse_dpi_process 
+04c8 20403f56 call mouse_gpio_config_input_pu 
+04c9 6fe0cc3d fetch 1 ,mem_dpi_another_button_state 
+04ca c1008000 rtneq dpi_button_state_down 
+04cb 704c3d01 jam dpi_button_state_down ,mem_dpi_another_button_state 
+04cc 20204069 branch mouse_dpi_process 
 
 p_mouse_dpi_another_check:
-04b3 704c3f00 jam mouse_dpi_another_key ,mem_mouse_key_temp_patch 
-04b4 6848cc3b fetcht 1 ,mem_dpi_another_button_gpio 
-04b5 6fe0cc3c fetch 1 ,mem_dpi_another_press_status 
-04b6 204004c2 call p_mouse_check_key_connect_gnd_new 
+04cd 704c3f00 jam mouse_dpi_another_key ,mem_mouse_key_temp_patch 
+04ce 6848cc3b fetcht 1 ,mem_dpi_another_button_gpio 
+04cf 6fe0cc3c fetch 1 ,mem_dpi_another_press_status 
+04d0 204004dc call p_mouse_check_key_connect_gnd_new 
 
 p_mouse_dpi_another_state_check:
-04b7 67e0cc3c store 1 ,mem_dpi_another_press_status 
-04b8 6fe0cc3e fetch 1 ,mem_dpi_another_button_down_enable 
-04b9 203a04be branch p_mouse_dpi_another_up ,blank 
+04d1 67e0cc3c store 1 ,mem_dpi_another_press_status 
+04d2 6fe0cc3e fetch 1 ,mem_dpi_another_button_down_enable 
+04d3 203a04d8 branch p_mouse_dpi_another_up ,blank 
 
 p_mouse_dpi_another_down:
-04ba 6fe0cc3d fetch 1 ,mem_dpi_another_button_state 
-04bb c1008000 rtneq dpi_button_state_down 
-04bc 704c3d01 jam dpi_button_state_down ,mem_dpi_another_button_state 
-04bd 20204069 branch mouse_dpi_process 
+04d4 6fe0cc3d fetch 1 ,mem_dpi_another_button_state 
+04d5 c1008000 rtneq dpi_button_state_down 
+04d6 704c3d01 jam dpi_button_state_down ,mem_dpi_another_button_state 
+04d7 20204069 branch mouse_dpi_process 
 
 p_mouse_dpi_another_up:
-04be 6fe0cc3d fetch 1 ,mem_dpi_another_button_state 
-04bf c1000000 rtneq dpi_button_state_up 
-04c0 704c3d00 jam dpi_button_state_up ,mem_dpi_another_button_state 
-04c1 20600000 rtn 
+04d8 6fe0cc3d fetch 1 ,mem_dpi_another_button_state 
+04d9 c1000000 rtneq dpi_button_state_up 
+04da 704c3d00 jam dpi_button_state_up ,mem_dpi_another_button_state 
+04db 20600000 rtn 
 
 p_mouse_check_key_connect_gnd_new:
-04c2 1fe3fe00 lshift pdata ,pdata 
-04c3 1fe22400 copy pdata ,regb 
-04c4 20406059 call gpio_get_bit 
-04c5 7920a400 setflag true ,0 ,regb 
-04c6 1a417e07 and regb ,0x07 ,pdata 
-04c7 6848cc3f fetcht 1 ,mem_mouse_key_temp_patch 
-04c8 18420e00 copy temp ,queue 
-04c9 c00384d7 beq 0x07 ,p_mouse_key_press 
-04ca c00004d9 beq 0x00 ,p_mouse_key_release 
-04cb 20600000 rtn 
+04dc 1fe3fe00 lshift pdata ,pdata 
+04dd 1fe22400 copy pdata ,regb 
+04de 20406059 call gpio_get_bit 
+04df 7920a400 setflag true ,0 ,regb 
+04e0 1a417e07 and regb ,0x07 ,pdata 
+04e1 6848cc3f fetcht 1 ,mem_mouse_key_temp_patch 
+04e2 18420e00 copy temp ,queue 
+04e3 c00384f1 beq 0x07 ,p_mouse_key_press 
+04e4 c00004f3 beq 0x00 ,p_mouse_key_release 
+04e5 20600000 rtn 
 
 p_mouse_check_key_connect_vin_new:
-04cc 1fe3fe00 lshift pdata ,pdata 
-04cd 1fe22400 copy pdata ,regb 
-04ce 20403f54 call mouse_gpio_config_input_pd 
-04cf 20406059 call gpio_get_bit 
-04d0 7920a400 setflag true ,0 ,regb 
-04d1 1a417e07 and regb ,0x07 ,pdata 
-04d2 6848cc3f fetcht 1 ,mem_mouse_key_temp_patch 
-04d3 18420e00 copy temp ,queue 
-04d4 c00384d7 beq 0x07 ,p_mouse_key_press 
-04d5 c00004d9 beq 0x00 ,p_mouse_key_release 
-04d6 20600000 rtn 
+04e6 1fe3fe00 lshift pdata ,pdata 
+04e7 1fe22400 copy pdata ,regb 
+04e8 20403f54 call mouse_gpio_config_input_pd 
+04e9 20406059 call gpio_get_bit 
+04ea 7920a400 setflag true ,0 ,regb 
+04eb 1a417e07 and regb ,0x07 ,pdata 
+04ec 6848cc3f fetcht 1 ,mem_mouse_key_temp_patch 
+04ed 18420e00 copy temp ,queue 
+04ee c00384f1 beq 0x07 ,p_mouse_key_press 
+04ef c00004f3 beq 0x00 ,p_mouse_key_release 
+04f0 20600000 rtn 
 
 p_mouse_key_press:
-04d7 704c3e01 jam 1 ,mem_dpi_another_button_down_enable 
-04d8 20600000 rtn 
+04f1 704c3e01 jam 1 ,mem_dpi_another_button_down_enable 
+04f2 20600000 rtn 
 
 p_mouse_key_release:
-04d9 704c3e00 jam 0 ,mem_dpi_another_button_down_enable 
-04da 20600000 rtn 
+04f3 704c3e00 jam 0 ,mem_dpi_another_button_down_enable 
+04f4 20600000 rtn 
 
 p_mouse_dpi_process:
-04db 20404072 call mouse_dpi_ghost_check 
-04dc 20740000 rtn user 
-04dd 6fe0c992 fetch 1 ,mem_mouse_dpi 
-04de 1fe20400 copy pdata ,temp 
-04df 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-04e0 c29e84e7 bbit1 mouse_enable_double_dpi_key ,p_mouse_double_dpi_check 
-04e1 18427e00 copy temp ,pdata 
-04e2 1fe0fe01 increase 1 ,pdata 
-04e3 1fe17e03 and pdata ,0x03 ,pdata 
+04f5 6fe0c992 fetch 1 ,mem_mouse_dpi 
+04f6 1fe20400 copy pdata ,temp 
+04f7 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+04f8 c29e84ff bbit1 mouse_enable_double_dpi_key ,p_mouse_double_dpi_check 
+04f9 18427e00 copy temp ,pdata 
+04fa 1fe0fe01 increase 1 ,pdata 
+04fb 1fe17e03 and pdata ,0x03 ,pdata 
 
 p_mouse_dpi_store:
-04e4 67e0c992 store 1 ,mem_mouse_dpi 
-04e5 20404095 call mouse_seting_dpi 
-04e6 202045ee branch mouse_store_device_info_delay 
+04fc 67e0c992 store 1 ,mem_mouse_dpi 
+04fd 20404095 call mouse_seting_dpi 
+04fe 20204643 branch mouse_store_eerpom_dpi 
 
 p_mouse_double_dpi_check:
-04e7 6fe0cc3e fetch 1 ,mem_dpi_another_button_down_enable 
-04e8 243a0504 nbranch p_mouse_another_dpi_button_down ,blank 
+04ff 6fe0cc3e fetch 1 ,mem_dpi_another_button_down_enable 
+0500 243a0523 nbranch p_mouse_another_dpi_button_down ,blank 
 
 p_mouse_dpi_increase:
-04e9 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-04ea c28e04f8 bbit1 mouse_enable_dpi_level_4 ,p_mouse_dpi_increase_level_4 
-04eb 18427e00 copy temp ,pdata 
-04ec c1008000 rtneq mouse_dpi_level2 
+0501 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+0502 c28e0517 bbit1 mouse_enable_dpi_level_4 ,p_mouse_dpi_increase_level_4 
+0503 18427e00 copy temp ,pdata 
+0504 c1008000 rtneq mouse_dpi_level2 
 
 p_mouse_dpi_increase_level:
-04ed c00004f4 beq mouse_dpi_level1 ,p_mouse_dpi_level_3 
-04ee c00104f2 beq mouse_dpi_level3 ,p_mouse_dpi_level_2 
-04ef 20600000 rtn 
+0505 c0000513 beq mouse_dpi_level1 ,p_mouse_dpi_level_3 
+0506 c0010511 beq mouse_dpi_level3 ,p_mouse_dpi_level_2 
+0507 20600000 rtn 
+
+p_mouse_dpi_ghost_check:
+0508 78547c00 disable user 
+0509 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+050a c3960000 rtnbit1 mouse_enable_dpi_key_connect_gnd 
+050b 6fe1cb8e fetch 3 ,mem_mouse_lkey_press_status 
+050c 207a0000 rtn blank 
+050d 704b9300 jam 0 ,mem_mouse_dpikey_press_status 
+050e 20207e54 branch enable_user 
 
 p_mouse_dpi_level_1:
-04f0 58000002 setarg 2 
-04f1 202004e4 branch p_mouse_dpi_store 
+050f 58000002 setarg 2 
+0510 202004fc branch p_mouse_dpi_store 
 
 p_mouse_dpi_level_2:
-04f2 58000000 setarg 0 
-04f3 202004e4 branch p_mouse_dpi_store 
+0511 58000000 setarg 0 
+0512 202004fc branch p_mouse_dpi_store 
 
 p_mouse_dpi_level_3:
-04f4 58000001 setarg 1 
-04f5 202004e4 branch p_mouse_dpi_store 
+0513 58000001 setarg 1 
+0514 202004fc branch p_mouse_dpi_store 
 
 p_mouse_dpi_level_4:
-04f6 58000003 setarg 3 
-04f7 202004e4 branch p_mouse_dpi_store 
+0515 58000003 setarg 3 
+0516 202004fc branch p_mouse_dpi_store 
 
 p_mouse_dpi_increase_level_4:
-04f8 18427e00 copy temp ,pdata 
-04f9 c1008000 rtneq mouse_dpi_level2 
-04fa c00004f4 beq mouse_dpi_level1 ,p_mouse_dpi_level_3 
-04fb c00104f6 beq mouse_dpi_level3 ,p_mouse_dpi_level_4 
-04fc c00184f2 beq mouse_dpi_level4 ,p_mouse_dpi_level_2 
-04fd 20600000 rtn 
+0517 18427e00 copy temp ,pdata 
+0518 c1008000 rtneq mouse_dpi_level2 
+0519 c0000513 beq mouse_dpi_level1 ,p_mouse_dpi_level_3 
+051a c0010515 beq mouse_dpi_level3 ,p_mouse_dpi_level_4 
+051b c0018511 beq mouse_dpi_level4 ,p_mouse_dpi_level_2 
+051c 20600000 rtn 
 
 p_mouse_dpi_decrease_level_4:
-04fe 18427e00 copy temp ,pdata 
-04ff c1010000 rtneq mouse_dpi_level3 
-0500 c00004f6 beq mouse_dpi_level1 ,p_mouse_dpi_level_4 
-0501 c00084f2 beq mouse_dpi_level2 ,p_mouse_dpi_level_2 
-0502 c00184f0 beq mouse_dpi_level4 ,p_mouse_dpi_level_1 
-0503 20600000 rtn 
+051d 18427e00 copy temp ,pdata 
+051e c1010000 rtneq mouse_dpi_level3 
+051f c0000515 beq mouse_dpi_level1 ,p_mouse_dpi_level_4 
+0520 c0008511 beq mouse_dpi_level2 ,p_mouse_dpi_level_2 
+0521 c001850f beq mouse_dpi_level4 ,p_mouse_dpi_level_1 
+0522 20600000 rtn 
 
 p_mouse_another_dpi_button_down:
 
 p_mouse_dpi_decrease:
-0504 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-0505 c28e04fe bbit1 mouse_enable_dpi_level_4 ,p_mouse_dpi_decrease_level_4 
-0506 18427e00 copy temp ,pdata 
-0507 c1010000 rtneq mouse_dpi_level3 
+0523 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+0524 c28e051d bbit1 mouse_enable_dpi_level_4 ,p_mouse_dpi_decrease_level_4 
+0525 18427e00 copy temp ,pdata 
+0526 c1010000 rtneq mouse_dpi_level3 
 
 p_mouse_dpi_decrease_level:
-0508 c00004f0 beq mouse_dpi_level1 ,p_mouse_dpi_level_1 
-0509 c00084f2 beq mouse_dpi_level2 ,p_mouse_dpi_level_2 
-050a 20600000 rtn 
+0527 c000050f beq mouse_dpi_level1 ,p_mouse_dpi_level_1 
+0528 c0008511 beq mouse_dpi_level2 ,p_mouse_dpi_level_2 
+0529 20600000 rtn 
               org 0x800
 
 start:
Index: output/ramcode.rom
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/PB_3mode_3ch_1IO2LED_907/output/ramcode.rom	(revision 4649)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/PB_3mode_3ch_1IO2LED_907/output/ramcode.rom	(working copy)
@@ -13,16 +13,16 @@
 c06501cd
 c066009d
 c067040f
-c06784db
+c06784f5
 c06802d0
-c068843c
+c0688450
 c06a0420
 c06b01f8
 c06c82e1
 c06d038d
 c06d83ba
 c06e0027
-c06f0472
+c06f0486
 c06f802d
 c07403c1
 2020137c
@@ -1080,29 +1080,49 @@
 20205b0c
 58001f06
 20205b0c
-2040043c
-202040dd
+20400450
+2040043d
+202040de
+704b9800
+704b9900
+704b9a00
+1fe20400
+20404100
+2040044d
+20404103
+20404106
+6fe0cb99
+207a0000
+6fe0cb98
+207a0000
+704b9a01
+6fe0c8d8
+1fe22200
+20600000
+18417e0a
+c005410e
+20600000
 6fe0cbe1
 245a4121
 da200000
-20400445
-2040044a
-2040044f
-20400454
-20400461
+20400459
+2040045e
+20400463
+20400468
+20400475
 2020411e
 6fe0c918
-2040046e
+20400482
 20404124
 6848c918
 20203f56
 6fe0c919
-2040046e
+20400482
 2040412a
 6848c919
 20203f56
 6fe0c91a
-2040046e
+20400482
 20404130
 6848c91a
 20203f56
@@ -1113,10 +1133,10 @@
 1fe22600
 6848c90d
 6fe0c910
-c07f845d
+c07f8471
 2020413e
 6fe0c90d
-20400470
+20400484
 6848c90d
 2020414b
 6fe0c90e
@@ -1126,10 +1146,10 @@
 1fe22600
 6848c90e
 6fe0c910
-c07f846a
+c07f847e
 20204157
 6fe0c90e
-20400470
+20400484
 6848c90e
 20204164
 d840003f
@@ -1138,16 +1158,22 @@
 20206093
 20404990
 20407936
-20400485
-20400499
-20400478
+2040048b
+20400492
 20204650
+d8e0000c
+20407d74
+247a0000
+2040049f
+d8e0000c
+58000020
+20207d66
 6fe44bab
-c294847c
-c29b847c
+c2948496
+c29b8496
 20600000
 6fe1478c
-c2830483
+c283049d
 6fe0c91b
 c17f8000
 6fe0c9bf
@@ -1155,45 +1181,45 @@
 2020465c
 704b9403
 2020017e
-6fe44bab
-c2974036
 6fe0c90f
 c17f8000
+20400508
+20740000
 da200000
 704b9605
 6848c90f
-2040048e
+204004a8
 2020402f
 6fe44bab
 c2964048
 6fe0cb93
 1fe22600
 6fe0c910
-c07f8495
+c07f84af
 2020403f
 6fe0c90f
-20400470
+20400484
 6848c90f
 20204195
 6fe44bab
 c41e8000
 6fe0cc3a
-243a04a2
+243a04bc
 6fe0cc3b
-2040046e
-204004b3
+20400482
+204004cd
 6848cc3b
 20203f56
 6fe0cc3b
 793ffe07
 67e0cc3b
 6fe0cc3b
-20400470
+20400484
 704c3f00
 6848cc3b
 6fe0cc3c
-204004cc
-204004b7
+204004e6
+204004d1
 6848cc3b
 20203f56
 20403f56
@@ -1204,10 +1230,10 @@
 704c3f00
 6848cc3b
 6fe0cc3c
-204004c2
+204004dc
 67e0cc3c
 6fe0cc3e
-203a04be
+203a04d8
 6fe0cc3d
 c1008000
 704c3d01
@@ -1223,8 +1249,8 @@
 1a417e07
 6848cc3f
 18420e00
-c00384d7
-c00004d9
+c00384f1
+c00004f3
 20600000
 1fe3fe00
 1fe22400
@@ -1234,58 +1260,63 @@
 1a417e07
 6848cc3f
 18420e00
-c00384d7
-c00004d9
+c00384f1
+c00004f3
 20600000
 704c3e01
 20600000
 704c3e00
 20600000
-20404072
-20740000
 6fe0c992
 1fe20400
 6fe44bab
-c29e84e7
+c29e84ff
 18427e00
 1fe0fe01
 1fe17e03
 67e0c992
 20404095
-202045ee
+20204643
 6fe0cc3e
-243a0504
+243a0523
 6fe44bab
-c28e04f8
+c28e0517
 18427e00
 c1008000
-c00004f4
-c00104f2
+c0000513
+c0010511
 20600000
+78547c00
+6fe44bab
+c3960000
+6fe1cb8e
+207a0000
+704b9300
+20207e54
 58000002
-202004e4
+202004fc
 58000000
-202004e4
+202004fc
 58000001
-202004e4
+202004fc
 58000003
-202004e4
+202004fc
 18427e00
 c1008000
-c00004f4
-c00104f6
-c00184f2
+c0000513
+c0010515
+c0018511
 20600000
 18427e00
 c1010000
-c00004f6
-c00084f2
-c00184f0
+c0000515
+c0008511
+c001850f
 20600000
 6fe44bab
-c28e04fe
+c28e051d
 18427e00
 c1010000
-c00004f0
-c00084f2
+c000050f
+c0008511
 20600000
Index: output/sched.rom
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/PB_3mode_3ch_1IO2LED_907/output/sched.rom	(revision 4654)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/PB_3mode_3ch_1IO2LED_907/output/sched.rom	(working copy)
@@ -240,7 +240,7 @@
 mem_lpm_mode:01
 
 
-mem_mouse_bluetooth_type:02	#03 bt3.0+ble   #02 ble   #01 bt3.0
+mem_mouse_bluetooth_type:03	#03 bt3.0+ble   #02 ble   #01 bt3.0
 mem_device_number:03  #max device number   value:01,02,03
 
 mem_device_flag:
Index: program/patch.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/PB_3mode_3ch_1IO2LED_907/program/patch.prog	(revision 4649)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/PB_3mode_3ch_1IO2LED_907/program/patch.prog	(working copy)
@@ -1,7 +1,7 @@
 
 //define G24_OTA
 //define FIRE_KEY
-//define BT1_BT2_select_mode
+// define BT1_BT2_select_mode
 define BT1_BT2_DIFFERENT_NAME
 
 	bbit1 8,pf_patch_ext
@@ -1319,8 +1319,8 @@
 ifdef BT1_BT2_select_mode
 p_mouse_select_bt_adv_mode:
 	fetch 1,mem_device_flag
-	beq MODE_BT_DEVICE1,p_mouse_current_ble_mode
-	beq MODE_BT_DEVICE2,p_mouse_current_classic_mode
+	beq MODE_BT_DEVICE2,p_mouse_current_ble_mode
+	beq MODE_BT_DEVICE1,p_mouse_current_classic_mode
 	rtn
 p_mouse_current_classic_mode:
 	branch check_51cmd_start_discovery
@@ -1507,8 +1507,30 @@
 	nbranch p_fire_key_process,blank
 endif
 	call p_mouse_check_key_gpio
-	branch mouse_key+1
+	call p_mouse_ghost_key_check
+	branch mouse_key+2
 
+p_mouse_ghost_key_check:
+	jam 0,mem_mouse_matrix_key_cow_count
+	jam 0,mem_mouse_matrix_key_row_count
+	jam 0,mem_mouse_ghost_flag
+	copy pdata,temp
+	call mouse_ghost_key_check_M_FW
+	call p_mouse_ghost_key_check_R_BK
+	call mouse_ghost_key_check_BK_FW
+	call mouse_ghost_key_check_LMR
+	fetch 1,mem_mouse_matrix_key_row_count
+	rtn blank
+	fetch 1,mem_mouse_matrix_key_cow_count
+	rtn blank
+	jam 1,mem_mouse_ghost_flag
+	fetch 1,mem_mouse_key_last		// matrix have ghost key
+	copy pdata,rega
+	rtn
+p_mouse_ghost_key_check_R_BK:
+	and temp,MOUSE_R_BK_BUTTON,pdata
+	beq MOUSE_R_BK_BUTTON,mouse_matrix_cow_more_than_one_key
+	rtn
 p_mouse_check_key_gpio:	//when mem_matrix_public_gpio=0xff
 	fetch 1,mem_sensor_shutdown_flag
 	ncall mouse_check_key_gpio_once,blank
@@ -1676,10 +1698,20 @@
 p_mouse_idle:
 	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
+	call p_mouse_20ms_event_timer
+	// call p_mouse_dpi_check
+	// call p_mouse_dpi_another_gpio_check
 	call p_mouse_select_device_check
 	branch mouse_idle+5
+p_mouse_20ms_event_timer:
+	arg 12,queue
+	call timer_check
+	nrtn blank
+	call p_mouse_dpi_check
+p_mouse_g24_retransmit_100ms_timer_init:
+	arg 12,queue
+	setarg 32
+	branch timer_init
 
 p_mouse_select_device_check:
 	fetch MOUSE_FLAG_LEN,mem_mouse_flag
@@ -1701,10 +1733,12 @@
 	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
+	// fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	// bbit1 MOUSE_ENABLE_DPI_KEY_CONNECT_ADC,mouse_dpi_check_connect_adc
 	fetch 1,mem_dpi_button_gpio
 	rtneq GPIO_DISABLE
+	call p_mouse_dpi_ghost_check
+	rtn user
 	arg 0,rega
 	jam MOUSE_DPI_KEY,mem_mouse_key_temp
 	fetcht 1,mem_dpi_button_gpio
@@ -1821,8 +1855,8 @@
 	rtn
 
 p_mouse_dpi_process:
-	call mouse_dpi_ghost_check
-	rtn user
+	// call mouse_dpi_ghost_check
+	// rtn user
 	fetch 1,mem_mouse_dpi
 	copy pdata,temp
 	fetch MOUSE_FLAG_LEN,mem_mouse_flag
@@ -1833,7 +1867,7 @@
 p_mouse_dpi_store:
 	store 1,mem_mouse_dpi
 	call mouse_seting_dpi
-	branch mouse_store_device_info_delay
+	branch mouse_store_eerpom_dpi
 
 p_mouse_double_dpi_check:
 	fetch 1,mem_dpi_another_button_down_enable
@@ -1847,7 +1881,14 @@
 	beq MOUSE_DPI_LEVEL1,p_mouse_dpi_level_3	//1600
 	beq MOUSE_DPI_LEVEL3,p_mouse_dpi_level_2 	//1200
 	rtn
-
+p_mouse_dpi_ghost_check:
+	disable user
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	rtnbit1 MOUSE_ENABLE_DPI_KEY_CONNECT_GND
+	fetch 3,mem_mouse_lkey_press_status
+	rtn blank
+	jam 0,mem_mouse_dpikey_press_status
+	branch enable_user
 p_mouse_dpi_level_1:		//800
 	setarg 2
 	branch p_mouse_dpi_store
Index: sched/mouse.dat
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/PB_3mode_3ch_1IO2LED_907/sched/mouse.dat	(revision 4654)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Multimode/PB_3mode_3ch_1IO2LED_907/sched/mouse.dat	(working copy)
@@ -173,7 +173,7 @@
 mem_lpm_mode:01
 
 
-mem_mouse_bluetooth_type:02	#03 bt3.0+ble   #02 ble   #01 bt3.0
+mem_mouse_bluetooth_type:03	#03 bt3.0+ble   #02 ble   #01 bt3.0
 mem_device_number:03  #max device number   value:01,02,03
 
 mem_device_flag:
