Index: format/app_mouse.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Only2.4G/MingAo_Only2.4G_LRpair/format/app_mouse.format	(revision 621)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Only2.4G/MingAo_Only2.4G_LRpair/format/app_mouse.format	(working copy)
@@ -328,6 +328,8 @@
 1 mem_mouse_logo_led_gpio
 1 mem_mouse_logo_led_on_check_count
 2 mem_mouse_logo_led_on_timer
+1 mem_power_on_flag
+
 )
 
 
Index: output/eeprom.dat
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Only2.4G/MingAo_Only2.4G_LRpair/output/eeprom.dat	(revision 621)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Only2.4G/MingAo_Only2.4G_LRpair/output/eeprom.dat	(working copy)
@@ -2,7 +2,7 @@
 02
 aa
 55
-6a
+06
 04
 c2
 84
@@ -11,59 +11,63 @@
 c0
 00
 00
-10
+11
 c0
 45
-01
-14
+00
+fb
 c0
 45
 80
-66
+49
 c0
 4f
 80
-64
+47
 c0
 57
 00
-14
+15
 c0
 61
 80
-28
+8d
 c0
 64
 80
-79
+5c
 c0
 65
 00
-89
+6c
 c0
 67
 00
-b9
+9c
 c0
 68
 00
-d3
+b6
 c0
 6b
 00
-9f
+82
 c0
 6c
 80
-e4
+c7
 20
 20
 13
 7c
 c0
 10
-81
-12
+80
+f9
+c0
+43
+80
+f5
 20
 20
 13
@@ -91,15 +95,15 @@
 20
 40
 00
-1c
+1d
 20
 40
 00
-46
+29
 20
 40
 00
-24
+25
 20
 40
 41
@@ -164,126 +168,6 @@
 20
 5c
 af
-6f
-e0
-c9
-38
-c0
-00
-00
-2d
-20
-40
-3d
-65
-24
-34
-42
-eb
-20
-20
-3d
-59
-6f
-e4
-4b
-ab
-c3
-08
-c8
-03
-6f
-e4
-4b
-ab
-c2
-98
-48
-0c
-c3
-18
-c8
-0c
-20
-40
-00
-41
-1f
-e1
-7e
-07
-68
-48
-cb
-cb
-98
-46
-7c
-00
-20
-22
-c8
-27
-20
-20
-48
-0c
-df
-20
-00
-02
-d8
-c0
-49
-93
-20
-40
-7e
-54
-58
-00
-ff
-ff
-e8
-41
-00
-06
-98
-46
-7c
-00
-24
-42
-fe
-56
-c2
-00
-00
-3c
-20
-60
-00
-00
-20
-40
-41
-21
-20
-40
-41
-15
-d8
-40
-00
-00
-60
-49
-cb
-8e
-20
-60
-00
-00
 20
 75
 80
@@ -307,7 +191,7 @@
 20
 40
 00
-50
+33
 68
 48
 c9
@@ -319,7 +203,7 @@
 20
 40
 00
-60
+43
 20
 20
 3b
@@ -459,7 +343,7 @@
 c0
 84
 00
-73
+56
 70
 8a
 08
@@ -482,8 +366,8 @@
 03
 20
 40
-01
-17
+00
+fe
 20
 20
 12
@@ -507,7 +391,7 @@
 c0
 7f
 80
-82
+65
 68
 48
 c9
@@ -547,7 +431,7 @@
 20
 40
 00
-f6
+d9
 20
 20
 3e
@@ -645,74 +529,14 @@
 7e
 00
 c0
-1d
-00
-a3
-c0
 1e
 00
-b1
+85
 20
 20
 43
 36
 6f
-e0
-c8
-a5
-24
-3a
-47
-e1
-6f
-e0
-c8
-8b
-c0
-01
-00
-aa
-c0
-02
-48
-44
-c0
-01
-c8
-49
-20
-20
-48
-39
-6f
-e4
-4b
-ab
-c2
-97
-80
-ae
-c2
-98
-48
-11
-20
-20
-48
-06
-20
-40
-00
-38
-20
-34
-48
-12
-20
-20
-48
-06
-6f
 e2
 48
 3c
@@ -727,7 +551,7 @@
 20
 22
 80
-b7
+8b
 67
 e2
 48
@@ -744,6 +568,66 @@
 20
 48
 4e
+6f
+e4
+4b
+ab
+c2
+97
+c8
+0a
+6f
+e0
+c9
+38
+c0
+00
+00
+92
+20
+20
+3d
+57
+6f
+e4
+4b
+ab
+c3
+08
+c8
+03
+20
+40
+3d
+65
+20
+34
+48
+06
+6f
+e4
+4b
+ab
+c2
+98
+48
+0c
+c3
+18
+c8
+0c
+20
+40
+41
+10
+1a
+21
+7e
+07
+20
+20
+47
+ff
 78
 54
 7c
@@ -791,7 +675,7 @@
 24
 34
 00
-c8
+ab
 20
 40
 47
@@ -799,7 +683,7 @@
 20
 40
 00
-cb
+ae
 20
 20
 45
@@ -855,7 +739,7 @@
 20
 40
 00
-d6
+b9
 20
 20
 40
@@ -907,7 +791,7 @@
 20
 3a
 00
-fd
+e0
 67
 e0
 cb
@@ -943,11 +827,11 @@
 20
 40
 00
-fa
+dd
 20
 40
 00
-ed
+d0
 20
 20
 44
@@ -983,7 +867,7 @@
 da
 40
 00
-f6
+d9
 20
 20
 31
@@ -1011,7 +895,7 @@
 da
 40
 00
-fd
+e0
 20
 20
 31
@@ -1066,12 +950,12 @@
 03
 20
 41
-01
-0c
+00
+ef
 24
 41
-01
-10
+00
+f3
 20
 20
 48
@@ -1100,6 +984,22 @@
 60
 00
 00
+6f
+e0
+cb
+e7
+24
+5a
+78
+61
+70
+4b
+e7
+00
+20
+20
+78
+51
 70
 44
 84
@@ -1114,8 +1014,8 @@
 e8
 c0
 4f
-81
-17
+80
+fe
 20
 20
 12
@@ -1132,8 +1032,8 @@
 20
 12
 2a
-b3
-99
+e2
+54
 aa
 55
 40
@@ -1188,7 +1088,7 @@
 00
 00
 00
-00
+80
 00
 00
 00
@@ -1281,7 +1181,7 @@
 4a
 00
 00
-80
+00
 02
 03
 aa
@@ -1382,6 +1282,13 @@
 01
 aa
 55
+01
+00
+e7
+4b
+01
+aa
+55
 02
 00
 b3
@@ -2295,8 +2202,14 @@
 e8
 41
 01
-3d
-33
+55
+aa
+aa
+55
+07
+5a
+c1
+62
 ff
 ff
 ff
@@ -8188,5 +8101,92 @@
 ff
 ff
 ff
-90
-12
+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
+03
+3c
Index: output/memmap.format
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Only2.4G/MingAo_Only2.4G_LRpair/output/memmap.format	(revision 621)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Only2.4G/MingAo_Only2.4G_LRpair/output/memmap.format	(working copy)
@@ -2207,6 +2207,7 @@
 0x4be3 mem_mouse_logo_led_gpio
 0x4be4 mem_mouse_logo_led_on_check_count
 0x4be5 mem_mouse_logo_led_on_timer
+0x4be7 mem_power_on_flag
 0x48d0 mem_remote_car_hard_soft_switch
 0x48d1 mem_remote_car_queue_each_size
 0x48d2 mem_remote_car_queue_length
Index: output/program.lis
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Only2.4G/MingAo_Only2.4G_LRpair/output/program.lis	(revision 621)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Only2.4G/MingAo_Only2.4G_LRpair/output/program.lis	(working copy)
@@ -1,375 +1,336 @@
               include "bt_format "
               org 0x0000
 0000 c284000e bbit1 8 ,pf_patch_ext 
-0001 c0000010 beq patch00_0 ,p_soft_reset 
-0002 c0450114 beq patch11_2 ,p_txon 
-0003 c0458066 beq patch11_3 ,p_initialize_radio_cont 
-0004 c04f8064 beq patch13_7 ,p_init_param 
-0005 c0570014 beq patch15_6 ,p_app_init 
-0006 c0618028 beq patch18_3 ,p_mouse_start_work 
-0007 c0648079 beq patch19_1 ,p_mouse_setgpio_hibernate 
-0008 c0650089 beq patch19_2 ,p_mouse_lpm_before_common 
-0009 c06700b9 beq patch19_6 ,p_mouse_motion 
-000a c06800d3 beq patch1a_0 ,p_mouse_seting_dpi 
-000b c06b009f beq patch1a_6 ,p_mouse_priority_bb_event 
-000c c06c80e4 beq patch1b_1 ,p_mouse_bb_event_timer 
+0001 c0000011 beq patch00_0 ,p_soft_reset 
+0002 c04500fb beq patch11_2 ,p_txon 
+0003 c0458049 beq patch11_3 ,p_initialize_radio_cont 
+0004 c04f8047 beq patch13_7 ,p_init_param 
+0005 c0570015 beq patch15_6 ,p_app_init 
+0006 c061808d beq patch18_3 ,p_mouse_start_work 
+0007 c064805c beq patch19_1 ,p_mouse_setgpio_hibernate 
+0008 c065006c beq patch19_2 ,p_mouse_lpm_before_common 
+0009 c067009c beq patch19_6 ,p_mouse_motion 
+000a c06800b6 beq patch1a_0 ,p_mouse_seting_dpi 
+000b c06b0082 beq patch1a_6 ,p_mouse_priority_bb_event 
+000c c06c80c7 beq patch1b_1 ,p_mouse_bb_event_timer 
 000d 2020137c branch loop 
 
 pf_patch_ext:
-000e c0108112 beq patch24_1 ,p_spid_init 
-000f 2020137c branch loop 
+000e c01080f9 beq patch24_1 ,p_spid_init 
+000f c04380f5 beq patch30_7 ,p_ui_timer_check 
+0010 2020137c branch loop 
 
 p_soft_reset:
-0010 20800000 clear_stack 
-0011 204030f3 call app_param_init 
-0012 20403bfd call mouse_xtal_init 
-0013 20200804 branch soft_reset + 3 
+0011 20800000 clear_stack 
+0012 204030f3 call app_param_init 
+0013 20403bfd call mouse_xtal_init 
+0014 20200804 branch soft_reset + 3 
 
 p_app_init:
 
 p_mouse_init:
-0014 20406df3 call enable_authrom 
-0015 2040001c call p_mouse_wheel_set_wakeup 
-0016 20400046 call p_mouse_setting_config 
-0017 20400024 call p_lpm_write_ice_disable 
-0018 204041a7 call mouse_init_sunt 
-0019 20758000 rtn wake 
-001a 2040408e call mouse_dpi_config 
-001b 20203bc5 branch mouse_init + 4 
+0015 20406df3 call enable_authrom 
+0016 2040001d call p_mouse_wheel_set_wakeup 
+0017 20400029 call p_mouse_setting_config 
+0018 20400025 call p_lpm_write_ice_disable 
+0019 204041a7 call mouse_init_sunt 
+001a 20758000 rtn wake 
+001b 2040408e call mouse_dpi_config 
+001c 20203bc5 branch mouse_init + 4 
 
 p_mouse_wheel_set_wakeup:
-001c 6fe0cbe1 fetch 1 ,mem_sensor_shutdown_flag 
-001d 207a0000 rtn blank 
-001e 6fe0c913 fetch 1 ,mem_whee_a_data_gpio 
-001f d8400040 arg gpcfg_pullup ,temp 
-0020 20406093 call gpio_config_function_int 
-0021 6fe0c914 fetch 1 ,mem_whee_b_data_gpio 
-0022 d8400040 arg gpcfg_pullup ,temp 
-0023 20206093 branch gpio_config_function_int 
+001d 6fe0cbe1 fetch 1 ,mem_sensor_shutdown_flag 
+001e 207a0000 rtn blank 
+001f 6fe0c913 fetch 1 ,mem_whee_a_data_gpio 
+0020 d8400040 arg gpcfg_pullup ,temp 
+0021 20406093 call gpio_config_function_int 
+0022 6fe0c914 fetch 1 ,mem_whee_b_data_gpio 
+0023 d8400040 arg gpcfg_pullup ,temp 
+0024 20206093 branch gpio_config_function_int 
 
 p_lpm_write_ice_disable:
-0024 6ff10120 fetch 2 ,core_ucode_flag 
-0025 793ffe0e set0 lpmreg_ice_mode_bit ,pdata 
-0026 67f2004c store 4 ,core_lpm_reg 
-0027 20205caf branch lpm_write2_ctrl_option 
-
-p_mouse_start_work:
-0028 6fe0c938 fetch 1 ,mem_device_flag 
-0029 c000002d beq mode_24g_device ,p_mouse_24g_start_mode 
-002a 20403d65 call mouse_wakeup_from_power_check 
-002b 243442eb nbranch mouse_buletooth_fast_conn_init ,user 
-002c 20203d59 branch mouse_start_reconnect_device 
-
-p_mouse_24g_start_mode:
-002d 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-002e c308c803 bbit0 mouse_enable_24g ,mouse_24g_mode_setup_error 
-002f 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-0030 c298480c bbit1 mouse_enable_auto_24g_paring ,mouse_24g_reconn_general_dongle 
-0031 c318c80c bbit0 mouse_enable_24g_power_on_pairing ,mouse_24g_reconn_general_dongle 
-0032 20400041 call p_mouse_key_check_once 
-0033 1fe17e07 and pdata ,0x07 ,pdata 
-0034 6848cbcb fetcht 1 ,mem_mouse_commbination_key_24g 
-0035 98467c00 isub temp ,null 
-0036 2022c827 branch mouse_24g_start_pair_mode ,zero 
-0037 2020480c branch mouse_24g_reconn_general_dongle 
-
-p_g24_factory_check:
-0038 df200002 arg 2 ,loopcnt 
-0039 d8c04993 arg mem_mouse_24g_addr ,contr 
-
-p_pdata_0xff_check:
-003a 20407e54 call enable_user 
-003b 5800ffff setarg 0xffff 
-
-p_pdata_0xff_check_loop:
-003c e8410006 ifetcht 2 ,contr 
-003d 98467c00 isub temp ,null 
-003e 2442fe56 ncall disable_user ,zero 
-003f c200003c loop p_pdata_0xff_check_loop 
-0040 20600000 rtn 
-
-p_mouse_key_check_once:
-0041 20404121 call mouse_check_key_gpio_once 
-0042 20404115 call mouse_check_key_gpio 
-0043 d8400000 arg 0 ,temp 
-0044 6049cb8e storet 3 ,mem_mouse_lkey_press_status 
-0045 20600000 rtn 
+0025 6ff10120 fetch 2 ,core_ucode_flag 
+0026 793ffe0e set0 lpmreg_ice_mode_bit ,pdata 
+0027 67f2004c store 4 ,core_lpm_reg 
+0028 20205caf branch lpm_write2_ctrl_option 
 
 p_mouse_setting_config:
-0046 20758000 rtn wake 
-0047 20402607 call g24_transmit_init 
-0048 204022ff call g24_chmap_param_init 
-0049 20403f1e call mouse_gpio_init 
-004a 20403d13 call mouse_param_init 
-004b 20400050 call p_mouse_sensor_set_angle 
-004c 6848c920 fetcht 1 ,mem_mouse_sensor_sdio_gpio 
-004d 20406050 call gpio_config_input 
-004e 20400060 call p_ice_gpio_set_float 
-004f 20203bf5 branch mouse_setting_config_next 
+0029 20758000 rtn wake 
+002a 20402607 call g24_transmit_init 
+002b 204022ff call g24_chmap_param_init 
+002c 20403f1e call mouse_gpio_init 
+002d 20403d13 call mouse_param_init 
+002e 20400033 call p_mouse_sensor_set_angle 
+002f 6848c920 fetcht 1 ,mem_mouse_sensor_sdio_gpio 
+0030 20406050 call gpio_config_input 
+0031 20400043 call p_ice_gpio_set_float 
+0032 20203bf5 branch mouse_setting_config_next 
 
 p_mouse_sensor_set_angle:
-0050 6fe0c924 fetch 1 ,mem_sensor_angle_default 
-0051 67e0c928 store 1 ,mem_config_sensor_angle 
-0052 6fe0c917 fetch 1 ,mem_select_sensor_angle_gpio 
-0053 c17f8000 rtneq gpio_disable 
-0054 6fe0c917 fetch 1 ,mem_select_sensor_angle_gpio 
-0055 d840003e arg gpcfg_output_low ,temp 
-0056 20406093 call gpio_config_function_int 
-0057 6fe0cbe2 fetch 1 ,mem_mouse_reuse_2ice_gpio 
-0058 d840003e arg gpcfg_output_low ,temp 
-0059 20406093 call gpio_config_function_int 
-005a 6848c920 fetcht 1 ,mem_mouse_sensor_sdio_gpio 
-005b 20403f56 call mouse_gpio_config_input_pu 
-005c 6848c920 fetcht 1 ,mem_mouse_sensor_sdio_gpio 
-005d 20406059 call gpio_get_bit 
-005e 2440c2aa ncall mouse_sensor_switch_angle ,true 
-005f 20203f54 branch mouse_gpio_config_input_pd 
+0033 6fe0c924 fetch 1 ,mem_sensor_angle_default 
+0034 67e0c928 store 1 ,mem_config_sensor_angle 
+0035 6fe0c917 fetch 1 ,mem_select_sensor_angle_gpio 
+0036 c17f8000 rtneq gpio_disable 
+0037 6fe0c917 fetch 1 ,mem_select_sensor_angle_gpio 
+0038 d840003e arg gpcfg_output_low ,temp 
+0039 20406093 call gpio_config_function_int 
+003a 6fe0cbe2 fetch 1 ,mem_mouse_reuse_2ice_gpio 
+003b d840003e arg gpcfg_output_low ,temp 
+003c 20406093 call gpio_config_function_int 
+003d 6848c920 fetcht 1 ,mem_mouse_sensor_sdio_gpio 
+003e 20403f56 call mouse_gpio_config_input_pu 
+003f 6848c920 fetcht 1 ,mem_mouse_sensor_sdio_gpio 
+0040 20406059 call gpio_get_bit 
+0041 2440c2aa ncall mouse_sensor_switch_angle ,true 
+0042 20203f54 branch mouse_gpio_config_input_pd 
 
 p_ice_gpio_set_float:
-0060 6848c917 fetcht 1 ,mem_select_sensor_angle_gpio 
-0061 2040607f call gpio_set_high_impedance 
-0062 6848cbe2 fetcht 1 ,mem_mouse_reuse_2ice_gpio 
-0063 2020607f branch gpio_set_high_impedance 
+0043 6848c917 fetcht 1 ,mem_select_sensor_angle_gpio 
+0044 2040607f call gpio_set_high_impedance 
+0045 6848cbe2 fetcht 1 ,mem_mouse_reuse_2ice_gpio 
+0046 2020607f branch gpio_set_high_impedance 
 
 p_init_param:
-0064 70008000 jam 0 ,mem_lmo_tid2 
-0065 202013b7 branch init_param_next + 1 
+0047 70008000 jam 0 ,mem_lmo_tid2 
+0048 202013b7 branch init_param_next + 1 
 
 p_initialize_radio_cont:
-0066 708a8be6 jam 0xe6 ,core_syn_aac_cfg1 
-0067 2040126a call initialize_syn_afc_cfg1 
-0068 20401271 call initialize_rf_ldo_cfg1 
-0069 20401277 call initialize_rc_cal 
-006a 708a6d09 jam 0x09 ,core_rx_bq_cfg0 
-006b 708a0305 jam 5 ,core_clkpll_cfg0 
-006c 708a7a94 jam 0x94 ,core_rx_iqadc_cfg 
-006d 708a0e0b jam 0x0b ,core_rf_ldo_cfg2 
-006e 708a0f05 jam 0x05 ,core_rf_ldo_cfg3 
-006f 708a8390 jam 0x90 ,core_syn_pfd_lkd_cfg 
-0070 6fe0c0c5 fetch 1 ,mem_fcomp_div 
-0071 c0840073 bne xtal_16m ,p_initialize_radio_cont_next 
-0072 708a0834 jam 0x34 ,core_clkpll_cfg5 
+0049 708a8be6 jam 0xe6 ,core_syn_aac_cfg1 
+004a 2040126a call initialize_syn_afc_cfg1 
+004b 20401271 call initialize_rf_ldo_cfg1 
+004c 20401277 call initialize_rc_cal 
+004d 708a6d09 jam 0x09 ,core_rx_bq_cfg0 
+004e 708a0305 jam 5 ,core_clkpll_cfg0 
+004f 708a7a94 jam 0x94 ,core_rx_iqadc_cfg 
+0050 708a0e0b jam 0x0b ,core_rf_ldo_cfg2 
+0051 708a0f05 jam 0x05 ,core_rf_ldo_cfg3 
+0052 708a8390 jam 0x90 ,core_syn_pfd_lkd_cfg 
+0053 6fe0c0c5 fetch 1 ,mem_fcomp_div 
+0054 c0840056 bne xtal_16m ,p_initialize_radio_cont_next 
+0055 708a0834 jam 0x34 ,core_clkpll_cfg5 
 
 p_initialize_radio_cont_next:
-0073 708a01ff jam 0xff ,core_clkpll_ctrl1 
-0074 20000064 nop 100 
-0075 708a020e jam 0x0e ,core_clkpll_ctrl2 
-0076 708a0003 jam 0x03 ,core_clkpll_ctrl0 
-0077 20400117 call p_set_tx_power_pair 
-0078 20201265 branch initialize_radio_cont_next2 
+0056 708a01ff jam 0xff ,core_clkpll_ctrl1 
+0057 20000064 nop 100 
+0058 708a020e jam 0x0e ,core_clkpll_ctrl2 
+0059 708a0003 jam 0x03 ,core_clkpll_ctrl0 
+005a 204000fe call p_set_tx_power_pair 
+005b 20201265 branch initialize_radio_cont_next2 
 
 p_mouse_setgpio_hibernate:
-0079 204042e9 call mouse_set_sdio_high 
-007a 20407fdc call clear_wake 
-007b 20404015 call mouse_before_hibernate_wheel_gpio_set 
-007c 6fe0c910 fetch 1 ,mem_matrix_public_gpio 
-007d c07f8082 beq gpio_disable ,p_mouse_setgpio_hibernate_skip_public_gpio 
-007e 6848c910 fetcht 1 ,mem_matrix_public_gpio 
-007f 20406069 call gpio_out_active 
-0080 6848c910 fetcht 1 ,mem_matrix_public_gpio 
-0081 20406042 call gpio_clr_wake 
+005c 204042e9 call mouse_set_sdio_high 
+005d 20407fdc call clear_wake 
+005e 20404015 call mouse_before_hibernate_wheel_gpio_set 
+005f 6fe0c910 fetch 1 ,mem_matrix_public_gpio 
+0060 c07f8065 beq gpio_disable ,p_mouse_setgpio_hibernate_skip_public_gpio 
+0061 6848c910 fetcht 1 ,mem_matrix_public_gpio 
+0062 20406069 call gpio_out_active 
+0063 6848c910 fetcht 1 ,mem_matrix_public_gpio 
+0064 20406042 call gpio_clr_wake 
 
 p_mouse_setgpio_hibernate_skip_public_gpio:
-0082 6848cbe2 fetcht 1 ,mem_mouse_reuse_2ice_gpio 
-0083 20403f56 call mouse_gpio_config_input_pu 
-0084 6fe0c920 fetch 1 ,mem_mouse_sensor_sdio_gpio 
-0085 d840003f arg gpcfg_output_high ,temp 
-0086 20406093 call gpio_config_function_int 
-0087 204000f6 call p_mouse_logo_led_on_timeout 
-0088 20203e36 branch mouse_setgpio_hibernate + 3 
+0065 6848cbe2 fetcht 1 ,mem_mouse_reuse_2ice_gpio 
+0066 20403f56 call mouse_gpio_config_input_pu 
+0067 6fe0c920 fetch 1 ,mem_mouse_sensor_sdio_gpio 
+0068 d840003f arg gpcfg_output_high ,temp 
+0069 20406093 call gpio_config_function_int 
+006a 204000d9 call p_mouse_logo_led_on_timeout 
+006b 20203e36 branch mouse_setgpio_hibernate + 3 
 
 p_mouse_lpm_before_common:
-0089 20403f88 call mouse_wheel_check 
-008a 6fe0c91f fetch 1 ,mem_mouse_sensor_sclk_gpio 
-008b d840003f arg gpcfg_output_high ,temp 
-008c 20406093 call gpio_config_function_int 
-008d 6fe080a1 fetch 1 ,mem_gpio_wakeup_low + 2 
-008e 793ffe03 set0 3 ,pdata 
-008f 67e080a1 store 1 ,mem_gpio_wakeup_low + 2 
-0090 6848c920 fetcht 1 ,mem_mouse_sensor_sdio_gpio 
-0091 20406042 call gpio_clr_wake 
-0092 20405b04 call twspi_disable 
-0093 6848c918 fetcht 1 ,mem_lbutton_gpio 
-0094 20406036 call gpio_set_wake 
-0095 6848c919 fetcht 1 ,mem_rbutton_gpio 
-0096 20406036 call gpio_set_wake 
-0097 6848c91a fetcht 1 ,mem_mbutton_gpio 
-0098 20406036 call gpio_set_wake 
-0099 6848c90d fetcht 1 ,mem_bk_button_gpio 
-009a 20406036 call gpio_set_wake 
-009b 6848c90e fetcht 1 ,mem_fw_button_gpio 
-009c 20406036 call gpio_set_wake 
-009d 6848c90f fetcht 1 ,mem_dpi_button_gpio 
-009e 20206036 branch gpio_set_wake 
+006c 20403f88 call mouse_wheel_check 
+006d 6fe0c91f fetch 1 ,mem_mouse_sensor_sclk_gpio 
+006e d840003f arg gpcfg_output_high ,temp 
+006f 20406093 call gpio_config_function_int 
+0070 6fe080a1 fetch 1 ,mem_gpio_wakeup_low + 2 
+0071 793ffe03 set0 3 ,pdata 
+0072 67e080a1 store 1 ,mem_gpio_wakeup_low + 2 
+0073 6848c920 fetcht 1 ,mem_mouse_sensor_sdio_gpio 
+0074 20406042 call gpio_clr_wake 
+0075 20405b04 call twspi_disable 
+0076 6848c918 fetcht 1 ,mem_lbutton_gpio 
+0077 20406036 call gpio_set_wake 
+0078 6848c919 fetcht 1 ,mem_rbutton_gpio 
+0079 20406036 call gpio_set_wake 
+007a 6848c91a fetcht 1 ,mem_mbutton_gpio 
+007b 20406036 call gpio_set_wake 
+007c 6848c90d fetcht 1 ,mem_bk_button_gpio 
+007d 20406036 call gpio_set_wake 
+007e 6848c90e fetcht 1 ,mem_fw_button_gpio 
+007f 20406036 call gpio_set_wake 
+0080 6848c90f fetcht 1 ,mem_dpi_button_gpio 
+0081 20206036 branch gpio_set_wake 
 
 p_mouse_priority_bb_event:
-009f 1a627e00 copy regc ,pdata 
-00a0 c01d00a3 beq bt_evt_24g_attempt_fail ,p_mouse_24g_attempt_fail 
-00a1 c01e00b1 beq bt_evt_24g_attempt_success ,p_mouse_24g_attempt_success 
-00a2 20204336 branch mouse_priority_bb_event + 2 
-
-p_mouse_24g_attempt_fail:
-00a3 6fe0c8a5 fetch 1 ,mem_24g_attempt_fail_flag 
-00a4 243a47e1 nbranch mouse_24g_hibernate_set ,blank 
-
-p_mouse_24g_attempt_fail_next:
-00a5 6fe0c88b fetch 1 ,mem_24g_reconn_type 
-00a6 c00100aa beq fast_conn_and_3_0_addr ,p_mouse_24g_fast_conn_attempt_fail 
-00a7 c0024844 beq pair_and_3_0_addr ,mouse_24g_auto_pair_attempt_fail 
-00a8 c001c849 beq receiver_and_3_0_addr ,mouse_reconn_dongle_attempt_fail 
-00a9 20204839 branch mouse_24g_attempt_fail_enter_hibernate 
-
-p_mouse_24g_fast_conn_attempt_fail:
-00aa 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-00ab c29780ae bbit1 mouse_enable_24g_first_auto_pairing ,p_mouse_24g_start_auto_pair 
-00ac c2984811 bbit1 mouse_enable_auto_24g_paring ,mouse_24g_start_auto_pair 
-00ad 20204806 branch mouse_24g_reconn_dongle_start 
-
-p_mouse_24g_start_auto_pair:
-00ae 20400038 call p_g24_factory_check 
-00af 20344812 branch mouse_24g_start_auto_pair_next ,user 
-00b0 20204806 branch mouse_24g_reconn_dongle_start 
+0082 1a627e00 copy regc ,pdata 
+0083 c01e0085 beq bt_evt_24g_attempt_success ,p_mouse_24g_attempt_success 
+0084 20204336 branch mouse_priority_bb_event + 2 
 
 p_mouse_24g_attempt_success:
-00b1 6fe2483c fetch 4 ,mem_24g_addr 
-00b2 684a488d fetcht 4 ,mem_24g_fast_conn_addr 
-00b3 98467c00 isub temp ,null 
-00b4 202280b7 branch p_mouse_24g_attempt_success_skip_store_addr ,zero 
-00b5 67e24891 store 4 ,mem_24g_receiver_addr 
-00b6 67e24993 store 4 ,mem_mouse_24g_addr 
+0085 6fe2483c fetch 4 ,mem_24g_addr 
+0086 684a488d fetcht 4 ,mem_24g_fast_conn_addr 
+0087 98467c00 isub temp ,null 
+0088 2022808b branch p_mouse_24g_attempt_success_skip_store_addr ,zero 
+0089 67e24891 store 4 ,mem_24g_receiver_addr 
+008a 67e24993 store 4 ,mem_mouse_24g_addr 
 
 p_mouse_24g_attempt_success_skip_store_addr:
-00b7 204048c6 call mouse_device_poweron_timer_init 
-00b8 2020484e branch mouse_24g_attempt_success 
+008b 204048c6 call mouse_device_poweron_timer_init 
+008c 2020484e branch mouse_24g_attempt_success 
+
+p_mouse_start_work:
+008d 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+008e c297c80a bbit1 mouse_enable_24g_first_auto_pairing ,mouse_24g_first_start_auto_pair_mode 
+008f 6fe0c938 fetch 1 ,mem_device_flag 
+0090 c0000092 beq mode_24g_device ,p_mouse_24g_start_mode 
+0091 20203d57 branch mouse_start_work + 5 
+
+p_mouse_24g_start_mode:
+0092 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+0093 c308c803 bbit0 mouse_enable_24g ,mouse_24g_mode_setup_error 
+0094 20403d65 call mouse_wakeup_from_power_check 
+0095 20344806 branch mouse_24g_reconn_dongle_start ,user 
+0096 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+0097 c298480c bbit1 mouse_enable_auto_24g_paring ,mouse_24g_reconn_general_dongle 
+0098 c318c80c bbit0 mouse_enable_24g_power_on_pairing ,mouse_24g_reconn_general_dongle 
+0099 20404110 call mouse_key_check_once 
+009a 1a217e07 and rega ,0x07 ,pdata 
+009b 202047ff branch mouse_24g_start_mode + 9 
 
 p_mouse_motion:
-00b9 78547c00 disable user 
-00ba 58000000 setarg 0 
-00bb 67e348d1 store 6 ,mem_mouse_x 
-00bc 20404240 call mouse_check_sensor_data 
-00bd 2040408e call mouse_dpi_config 
-00be 20403f7e call mouse_zwheel 
-00bf 20403f83 call mouse_t_zwheel 
-00c0 204040dc call mouse_key 
-00c1 6fe0c8d0 fetch 1 ,mem_mouse_key 
-00c2 1fe17e1f and_into 0x1f ,pdata 
-00c3 67e0c8d0 store 1 ,mem_mouse_key 
-00c4 243400c8 nbranch p_mouse_motion_nodata ,user 
-00c5 2040471a call mouse_drawing_optima 
-00c6 204000cb call p_mouse_logo_led_on_check 
-00c7 20204544 branch mouse_no_data_timer_init 
+009c 78547c00 disable user 
+009d 58000000 setarg 0 
+009e 67e348d1 store 6 ,mem_mouse_x 
+009f 20404240 call mouse_check_sensor_data 
+00a0 2040408e call mouse_dpi_config 
+00a1 20403f7e call mouse_zwheel 
+00a2 20403f83 call mouse_t_zwheel 
+00a3 204040dc call mouse_key 
+00a4 6fe0c8d0 fetch 1 ,mem_mouse_key 
+00a5 1fe17e1f and_into 0x1f ,pdata 
+00a6 67e0c8d0 store 1 ,mem_mouse_key 
+00a7 243400ab nbranch p_mouse_motion_nodata ,user 
+00a8 2040471a call mouse_drawing_optima 
+00a9 204000ae call p_mouse_logo_led_on_check 
+00aa 20204544 branch mouse_no_data_timer_init 
 
 p_mouse_motion_nodata:
-00c8 20404728 call mouse_drawing_optima_init 
-00c9 704be400 jam 0 ,mem_mouse_logo_led_on_check_count 
-00ca 20600000 rtn 
+00ab 20404728 call mouse_drawing_optima_init 
+00ac 704be400 jam 0 ,mem_mouse_logo_led_on_check_count 
+00ad 20600000 rtn 
 
 p_mouse_logo_led_on_check:
-00cb 6fe0cbe4 fetch 1 ,mem_mouse_logo_led_on_check_count 
-00cc 1fe0fe01 increase 1 ,pdata 
-00cd 67e0cbe4 store 1 ,mem_mouse_logo_led_on_check_count 
-00ce 1fe67c08 sub pdata ,low_voltage_led_count ,null 
-00cf 20610000 rtn positive 
+00ae 6fe0cbe4 fetch 1 ,mem_mouse_logo_led_on_check_count 
+00af 1fe0fe01 increase 1 ,pdata 
+00b0 67e0cbe4 store 1 ,mem_mouse_logo_led_on_check_count 
+00b1 1fe67c08 sub pdata ,low_voltage_led_count ,null 
+00b2 20610000 rtn positive 
 
 p_mouse_logo_led_on:
-00d0 58000258 setarg 0x0258 
-00d1 67e14be5 store 2 ,mem_mouse_logo_led_on_timer 
-00d2 20600000 rtn 
+00b3 58000258 setarg 0x0258 
+00b4 67e14be5 store 2 ,mem_mouse_logo_led_on_timer 
+00b5 20600000 rtn 
 
 p_mouse_seting_dpi:
-00d3 2040408f call mouse_setting_dpi_4_level 
-00d4 204000d6 call p_mouse_dpi_led_blink_delay 
-00d5 20204098 branch mouse_seting_sensor_type 
+00b6 2040408f call mouse_setting_dpi_4_level 
+00b7 204000b9 call p_mouse_dpi_led_blink_delay 
+00b8 20204098 branch mouse_seting_sensor_type 
 
 p_mouse_dpi_led_blink_delay:
-00d6 6fe0c923 fetch 1 ,mem_dpi_led_gpio 
-00d7 c17f8000 rtneq gpio_disable 
-00d8 6fe14ac2 fetch 2 ,mem_mouse_discovery_timer 
-00d9 247a0000 nrtn blank 
-00da 6fe14883 fetch 2 ,mem_24g_pair_timeout 
-00db 247a0000 nrtn blank 
-00dc 6fe14887 fetch 2 ,mem_24g_reconn_timeout 
-00dd 247a0000 nrtn blank 
-00de 6fe0cba7 fetch 1 ,mem_mouse_device_poweron_timer_count 
-00df 247a0000 nrtn blank 
-00e0 6fe0cbc1 fetch 1 ,mem_mouse_dpi_led_delay_count_init 
-00e1 203a00fd branch p_mouse_dpi_led_blink_init ,blank 
-00e2 67e0cba8 store 1 ,mem_mouse_dpi_led_delay_count 
-00e3 20600000 rtn 
+00b9 6fe0c923 fetch 1 ,mem_dpi_led_gpio 
+00ba c17f8000 rtneq gpio_disable 
+00bb 6fe14ac2 fetch 2 ,mem_mouse_discovery_timer 
+00bc 247a0000 nrtn blank 
+00bd 6fe14883 fetch 2 ,mem_24g_pair_timeout 
+00be 247a0000 nrtn blank 
+00bf 6fe14887 fetch 2 ,mem_24g_reconn_timeout 
+00c0 247a0000 nrtn blank 
+00c1 6fe0cba7 fetch 1 ,mem_mouse_device_poweron_timer_count 
+00c2 247a0000 nrtn blank 
+00c3 6fe0cbc1 fetch 1 ,mem_mouse_dpi_led_delay_count_init 
+00c4 203a00e0 branch p_mouse_dpi_led_blink_init ,blank 
+00c5 67e0cba8 store 1 ,mem_mouse_dpi_led_delay_count 
+00c6 20600000 rtn 
 
 p_mouse_bb_event_timer:
-00e4 20403e9b call mouse_adc_read 
-00e5 20404956 call mouse_low_voltage_led_timer 
-00e6 2040232b call g24_pair_timeout_timer 
-00e7 20402556 call g24_reconn_timeout_timer 
-00e8 204047cd call mouse_24g_long_sleep_param_update_timer 
-00e9 204048be call mouse_device_poweron_timer 
-00ea 204000fa call p_mouse_dpi_led_blink_delay_timer 
-00eb 204000ed call p_mouse_logo_led_on_timer 
-00ec 202044bd branch mouse_bb_event_timer + 8 
+00c7 20403e9b call mouse_adc_read 
+00c8 20404956 call mouse_low_voltage_led_timer 
+00c9 2040232b call g24_pair_timeout_timer 
+00ca 20402556 call g24_reconn_timeout_timer 
+00cb 204047cd call mouse_24g_long_sleep_param_update_timer 
+00cc 204048be call mouse_device_poweron_timer 
+00cd 204000dd call p_mouse_dpi_led_blink_delay_timer 
+00ce 204000d0 call p_mouse_logo_led_on_timer 
+00cf 202044bd branch mouse_bb_event_timer + 8 
 
 p_mouse_logo_led_on_timer:
-00ed 6fe0cbe3 fetch 1 ,mem_mouse_logo_led_gpio 
-00ee c17f8000 rtneq gpio_disable 
-00ef 6fe14be5 fetch 2 ,mem_mouse_logo_led_on_timer 
-00f0 207a0000 rtn blank 
-00f1 6848cbe3 fetcht 1 ,mem_mouse_logo_led_gpio 
-00f2 20406069 call gpio_out_active 
-00f3 da604be5 arg mem_mouse_logo_led_on_timer ,regc 
-00f4 da4000f6 arg p_mouse_logo_led_on_timeout ,regb 
-00f5 20203191 branch timer_single_step_2b 
+00d0 6fe0cbe3 fetch 1 ,mem_mouse_logo_led_gpio 
+00d1 c17f8000 rtneq gpio_disable 
+00d2 6fe14be5 fetch 2 ,mem_mouse_logo_led_on_timer 
+00d3 207a0000 rtn blank 
+00d4 6848cbe3 fetcht 1 ,mem_mouse_logo_led_gpio 
+00d5 20406069 call gpio_out_active 
+00d6 da604be5 arg mem_mouse_logo_led_on_timer ,regc 
+00d7 da4000d9 arg p_mouse_logo_led_on_timeout ,regb 
+00d8 20203191 branch timer_single_step_2b 
 
 p_mouse_logo_led_on_timeout:
-00f6 58000000 setarg 0 
-00f7 67e14be5 store 2 ,mem_mouse_logo_led_on_timer 
-00f8 6848cbe3 fetcht 1 ,mem_mouse_logo_led_gpio 
-00f9 20206065 branch gpio_out_inactive 
+00d9 58000000 setarg 0 
+00da 67e14be5 store 2 ,mem_mouse_logo_led_on_timer 
+00db 6848cbe3 fetcht 1 ,mem_mouse_logo_led_gpio 
+00dc 20206065 branch gpio_out_inactive 
 
 p_mouse_dpi_led_blink_delay_timer:
-00fa da604ba8 arg mem_mouse_dpi_led_delay_count ,regc 
-00fb da4000fd arg p_mouse_dpi_led_blink_init ,regb 
-00fc 2020318a branch timer_single_step 
+00dd da604ba8 arg mem_mouse_dpi_led_delay_count ,regc 
+00de da4000e0 arg p_mouse_dpi_led_blink_init ,regb 
+00df 2020318a branch timer_single_step 
 
 p_mouse_dpi_led_blink_init:
-00fd 6fe0c927 fetch 1 ,mem_config_sensor_type 
-00fe c001c8f2 beq p3212 ,mouse_dpi_led_blink_init 
-00ff c005c8f2 beq ka8g2 ,mouse_dpi_led_blink_init 
-0100 6fe0c923 fetch 1 ,mem_dpi_led_gpio 
-0101 67e0c92f store 1 ,mem_mouse_struct_led_gpio 
-0102 6fe14bc2 fetch 2 ,mem_mouse_dpi_led_blink_time 
-0103 67e14930 store 2 ,mem_mouse_on_time 
-0104 67e14932 store 2 ,mem_mouse_off_time 
-0105 da200000 arg 0 ,rega 
-0106 6848c992 fetcht 1 ,mem_mouse_dpi 
-0107 18408402 increase 2 ,temp 
-0108 18467c03 sub temp ,3 ,null 
-0109 2041010c call p_mouse_dpi_led_blink_init_level_4 ,positive 
-010a 24410110 ncall p_mouse_dpi_led_blink_count_clean ,positive 
-010b 202048ff branch mouse_dpi_led_blink_init_end 
+00e0 6fe0c927 fetch 1 ,mem_config_sensor_type 
+00e1 c001c8f2 beq p3212 ,mouse_dpi_led_blink_init 
+00e2 c005c8f2 beq ka8g2 ,mouse_dpi_led_blink_init 
+00e3 6fe0c923 fetch 1 ,mem_dpi_led_gpio 
+00e4 67e0c92f store 1 ,mem_mouse_struct_led_gpio 
+00e5 6fe14bc2 fetch 2 ,mem_mouse_dpi_led_blink_time 
+00e6 67e14930 store 2 ,mem_mouse_on_time 
+00e7 67e14932 store 2 ,mem_mouse_off_time 
+00e8 da200000 arg 0 ,rega 
+00e9 6848c992 fetcht 1 ,mem_mouse_dpi 
+00ea 18408402 increase 2 ,temp 
+00eb 18467c03 sub temp ,3 ,null 
+00ec 204100ef call p_mouse_dpi_led_blink_init_level_4 ,positive 
+00ed 244100f3 ncall p_mouse_dpi_led_blink_count_clean ,positive 
+00ee 202048ff branch mouse_dpi_led_blink_init_end 
 
 p_mouse_dpi_led_blink_init_level_4:
-010c 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-010d c40e0000 rtnbit0 mouse_enable_dpi_level_4 
-010e 18408401 increase 1 ,temp 
-010f 20600000 rtn 
+00ef 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+00f0 c40e0000 rtnbit0 mouse_enable_dpi_level_4 
+00f1 18408401 increase 1 ,temp 
+00f2 20600000 rtn 
 
 p_mouse_dpi_led_blink_count_clean:
-0110 184085fd increase -3 ,temp 
-0111 20600000 rtn 
+00f3 184085fd increase -3 ,temp 
+00f4 20600000 rtn 
+
+p_ui_timer_check:
+00f5 6fe0cbe7 fetch 1 ,mem_power_on_flag 
+00f6 245a7861 ncall ui_timer_init ,blank 
+00f7 704be700 jam 0 ,mem_power_on_flag 
+00f8 20207851 branch ui_timer_check + 1 
 
 p_spid_init:
-0112 70448476 jam 0x76 ,mem_spi_init_clk 
-0113 20205cb6 branch spid_init_common 
+00f9 70448476 jam 0x76 ,mem_spi_init_clk 
+00fa 20205cb6 branch spid_init_common 
 
 p_txon:
-0114 6fe0c1e8 fetch 1 ,mem_tx_power 
-0115 c04f8117 beq tx_power_pair ,p_set_tx_power_pair 
-0116 2020121f branch txon_next 
+00fb 6fe0c1e8 fetch 1 ,mem_tx_power 
+00fc c04f80fe beq tx_power_pair ,p_set_tx_power_pair 
+00fd 2020121f branch txon_next 
 
 p_set_tx_power_pair:
-0117 708a3905 jam 0x05 ,core_tx_pwr_ctrl0 
-0118 708a3a00 jam 0x00 ,core_tx_pwr_ctrl1 
-0119 2020122a branch set_rf_ldo_cfg89 
+00fe 708a3905 jam 0x05 ,core_tx_pwr_ctrl0 
+00ff 708a3a00 jam 0x00 ,core_tx_pwr_ctrl1 
+0100 2020122a branch set_rf_ldo_cfg89 
               org 0x800
 
 start:
Index: program/patch.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Only2.4G/MingAo_Only2.4G_LRpair/program/patch.prog	(revision 621)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Only2.4G/MingAo_Only2.4G_LRpair/program/patch.prog	(working copy)
@@ -1,4 +1,7 @@
 
+//define G24_AUTO_PAIR_NERVER_BEEN_PAIRED
+
+
 	bbit1 8,pf_patch_ext
 	beq patch00_0,p_soft_reset
 	beq patch11_2,p_txon
@@ -16,6 +19,7 @@
 
 pf_patch_ext:
 	beq patch24_1,p_spid_init
+	beq patch30_7,p_ui_timer_check			
 	branch loop
 
 p_soft_reset:
@@ -52,49 +56,6 @@
 	store 4,core_lpm_reg
 	branch lpm_write2_ctrl_option
 	
-p_mouse_start_work:
-//	fetch MOUSE_FLAG_LEN,mem_mouse_flag
-//	bbit1 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING, mouse_24g_first_start_auto_pair_mode
-	fetch 1,mem_device_flag
-	beq MODE_24G_DEVICE,p_mouse_24g_start_mode
-	call mouse_wakeup_from_power_check	// wake from hibernate :enble user
-	nbranch mouse_buletooth_fast_conn_init,user
-	branch mouse_start_reconnect_device
-
-p_mouse_24g_start_mode:
-	fetch MOUSE_FLAG_LEN,mem_mouse_flag
-	bbit0 MOUSE_ENABLE_24G,mouse_24g_mode_setup_error
-//	call mouse_wakeup_from_power_check	// wake from hibernate :enble user
-//	branch mouse_24g_reconn_dongle_start,user
-	fetch MOUSE_FLAG_LEN,mem_mouse_flag
-	bbit1 MOUSE_ENABLE_AUTO_24G_PARING,mouse_24g_reconn_general_dongle
-	bbit0 MOUSE_ENABLE_24G_POWER_ON_PAIRING,mouse_24g_reconn_general_dongle
-	call p_mouse_key_check_once
-	and pdata,0x07,pdata
-	fetcht 1,mem_mouse_commbination_key_24g
-	isub temp,null
-	branch mouse_24g_start_pair_mode,zero
-	branch mouse_24g_reconn_general_dongle
-
-p_g24_factory_check:
-	arg 2,loopcnt
-	arg mem_mouse_24g_addr,contr
-p_pdata_0xff_check:
-	call enable_user
-	setarg 0xffff
-p_pdata_0xff_check_loop:
-	ifetcht 2,contr
-	isub temp,null
-	ncall disable_user,zero
-	loop p_pdata_0xff_check_loop
-	rtn
-
-p_mouse_key_check_once:
-	call mouse_check_key_gpio_once
-	call mouse_check_key_gpio
-	arg 0,temp
-	storet 3,mem_mouse_lkey_press_status
-	rtn
 
 p_mouse_setting_config:
 	rtn wake
@@ -216,43 +177,69 @@
 	fetcht 1,mem_dpi_button_gpio
 	branch gpio_set_wake
 
+
+
+
 p_mouse_priority_bb_event:
 	copy regc,pdata
+ifdef define G24_AUTO_PAIR_NERVER_BEEN_PAIRED	
 	beq BT_EVT_24G_ATTEMPT_FAIL,p_mouse_24g_attempt_fail
+endif
 	beq BT_EVT_24G_ATTEMPT_SUCCESS,p_mouse_24g_attempt_success
 	branch mouse_priority_bb_event+2
 
+p_mouse_24g_attempt_success:
+	fetch 4,mem_24g_addr
+	fetcht 4,mem_24g_fast_conn_addr
+	isub temp,null
+	branch p_mouse_24g_attempt_success_skip_store_addr,zero
+	store 4,mem_24g_receiver_addr
+	store 4,mem_mouse_24g_addr		// if need store 24g address to eeprom/flash,need get mem_24g_addr
+p_mouse_24g_attempt_success_skip_store_addr:
+	call mouse_device_poweron_timer_init
+	branch mouse_24g_attempt_success
+
+ifdef define G24_AUTO_PAIR_NERVER_BEEN_PAIRED
 p_mouse_24g_attempt_fail:
 	fetch 1,mem_24g_attempt_fail_flag
 	nbranch mouse_24g_hibernate_set,blank
-p_mouse_24g_attempt_fail_next:
 	fetch 1,mem_24g_reconn_type
 	beq FAST_CONN_AND_3_0_ADDR,p_mouse_24g_fast_conn_attempt_fail
-	beq PAIR_AND_3_0_ADDR,mouse_24g_auto_pair_attempt_fail
-	beq RECEIVER_AND_3_0_ADDR,mouse_reconn_dongle_attempt_fail
-	branch mouse_24g_attempt_fail_enter_hibernate
+	branch mouse_24g_attempt_fail+4
 
 p_mouse_24g_fast_conn_attempt_fail:
 	fetch MOUSE_FLAG_LEN,mem_mouse_flag 
-	bbit1 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING,p_mouse_24g_start_auto_pair
+	bbit1 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING,mouse_24g_start_auto_pair
 	bbit1 MOUSE_ENABLE_AUTO_24G_PARING,mouse_24g_start_auto_pair
+	fetch 4,mem_mouse_24g_addr		// auto pair first time
+	fetcht 4,mem_mouse_compare_addr_ff
+	isub temp,null
+	branch mouse_24g_start_pair_mode,zero
 	branch mouse_24g_reconn_dongle_start
+endif
+
+
+p_mouse_start_work:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING, mouse_24g_first_start_auto_pair_mode
+	fetch 1,mem_device_flag
+	beq MODE_24G_DEVICE,p_mouse_24g_start_mode
+	branch mouse_start_work+5
+
+p_mouse_24g_start_mode:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_24G,mouse_24g_mode_setup_error
+	call mouse_wakeup_from_power_check	// wake from hibernate :enble user
+	branch mouse_24g_reconn_dongle_start,user
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_AUTO_24G_PARING,mouse_24g_reconn_general_dongle
+	bbit0 MOUSE_ENABLE_24G_POWER_ON_PAIRING,mouse_24g_reconn_general_dongle
+	call mouse_key_check_once		// pdata output:00
+	and rega,0x07,pdata
+	branch mouse_24g_start_mode+9
+
 
-p_mouse_24g_start_auto_pair:
-	call p_g24_factory_check
-	branch mouse_24g_start_auto_pair_next,user
-	branch mouse_24g_reconn_dongle_start
 
-p_mouse_24g_attempt_success:
-	fetch 4,mem_24g_addr
-	fetcht 4,mem_24g_fast_conn_addr
-	isub temp,null
-	branch p_mouse_24g_attempt_success_skip_store_addr,zero
-	store 4,mem_24g_receiver_addr
-	store 4,mem_mouse_24g_addr		// if need store 24g address to eeprom/flash,need get mem_24g_addr
-p_mouse_24g_attempt_success_skip_store_addr:
-	call mouse_device_poweron_timer_init
-	branch mouse_24g_attempt_success
 
 p_mouse_motion:
 	disable user
@@ -371,6 +358,13 @@
 	rtn
 /////////////////////////////////////////////////////////////////////////////////////////////////
 
+p_ui_timer_check:		// 100ms timer will return 4 or 5 times when power on
+	fetch 1,mem_power_on_flag
+	ncall ui_timer_init,blank
+	jam 0,mem_power_on_flag
+	branch ui_timer_check+1
+
+
 p_spid_init:
 	jam 0x76,mem_spi_init_clk
 	branch spid_init_common
Index: sched/mouse.dat
===================================================================
--- /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Only2.4G/MingAo_Only2.4G_LRpair/sched/mouse.dat	(revision 621)
+++ /YC1308AC/branch/mouse_project/YJX_Project/1011-T_Project/Only2.4G/MingAo_Only2.4G_LRpair/sched/mouse.dat	(working copy)
@@ -102,7 +102,7 @@
 00 #poweron
 
 #mode switch+pair/discovery  2byte 
-80 02 #dip(matrix)+2.4 first
+00 02 #dip(matrix)+2.4 first
 
 #updata 1byte
 03
@@ -166,7 +166,7 @@
 00 00 00 00 00 00 00 00 00#STANDARD KEY RELEASE
 
 mem_lpm_mode:01
-
+mem_power_on_flag:01
 
 mem_mouse_bluetooth_type:00	#03 bt3.0+ble   #02 ble   #01 bt3.0
 mem_device_number:01  #max device number   value:01,02,03
