Index: output/eeprom.dat
===================================================================
--- /YC1308AC/branch/mouse_project/public_3mode/output/eeprom.dat	(revision 392)
+++ /YC1308AC/branch/mouse_project/public_3mode/output/eeprom.dat	(working copy)
@@ -2,7 +2,7 @@
 02
 aa
 55
-0a
+56
 02
 c2
 84
@@ -11,43 +11,47 @@
 c0
 00
 00
-0c
+0d
 c0
 45
 80
-12
+13
 c0
 4f
 80
-1d
+1e
 c0
 57
 00
-10
+11
 c0
 64
 80
-1f
+20
 c0
 65
 00
-2a
+2b
 c0
 68
 00
-44
+4d
 c0
 6b
 00
-33
+34
 c0
 6c
 80
-55
+5e
 20
 20
 13
 7c
+c0
+50
+80
+8b
 20
 20
 13
@@ -215,15 +219,19 @@
 c0
 1e
 00
-3f
+48
 c0
 02
 00
-38
+41
 c0
 09
 80
-38
+41
+c0
+19
+00
+3a
 20
 20
 43
@@ -231,6 +239,34 @@
 6f
 e0
 ca
+c7
+c0
+00
+80
+3e
+70
+4b
+76
+14
+20
+20
+43
+73
+20
+40
+43
+6c
+70
+4b
+76
+05
+20
+20
+43
+73
+6f
+e0
+ca
 c1
 c0
 7f
@@ -283,7 +319,7 @@
 20
 40
 00
-47
+50
 20
 20
 40
@@ -335,7 +371,7 @@
 20
 3a
 00
-65
+6e
 67
 e0
 cb
@@ -371,7 +407,7 @@
 20
 40
 00
-62
+6b
 20
 40
 40
@@ -391,7 +427,7 @@
 20
 40
 00
-7a
+83
 20
 20
 44
@@ -403,7 +439,7 @@
 da
 40
 00
-65
+6e
 20
 20
 31
@@ -459,11 +495,11 @@
 20
 41
 00
-74
+7d
 24
 41
 00
-78
+81
 20
 20
 48
@@ -499,7 +535,7 @@
 da
 40
 00
-7d
+86
 20
 20
 45
@@ -524,8 +560,48 @@
 20
 3e
 20
-b0
+6f
+e0
+c3
+dd
+1f
+e0
+fe
+01
+67
+e0
+c3
+dd
+c0
+06
 16
+5a
+20
+40
+19
+1b
+20
+40
+19
+6a
+6f
+e0
+82
+bd
+20
+40
+16
+8b
+20
+40
+18
+38
+20
+20
+16
+55
+61
+01
 aa
 55
 40
@@ -584,7 +660,7 @@
 00
 00
 00
-00
+02
 00
 00
 00
@@ -611,7 +687,7 @@
 41
 88
 1f
-ca
+ce
 aa
 55
 01
@@ -1679,84 +1755,8 @@
 e8
 41
 01
-55
-aa
-aa
-55
-8e
-55
-5c
-74
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
+51
+fb
 ff
 ff
 ff
@@ -8188,5 +8188,5 @@
 ff
 ff
 ff
-6d
-31
+a4
+e6
Index: output/program.lis
===================================================================
--- /YC1308AC/branch/mouse_project/public_3mode/output/program.lis	(revision 392)
+++ /YC1308AC/branch/mouse_project/public_3mode/output/program.lis	(working copy)
@@ -1,175 +1,200 @@
               include "bt_format "
               org 0x0000
 0000 c284000b bbit1 8 ,pf_patch_ext 
-0001 c000000c beq patch00_0 ,p_soft_reset 
-0002 c0458012 beq patch11_3 ,p_initialize_radio_cont 
-0003 c04f801d beq patch13_7 ,p_init_param 
-0004 c0570010 beq patch15_6 ,p_app_init 
-0005 c064801f beq patch19_1 ,p_mouse_setgpio_hibernate 
-0006 c065002a beq patch19_2 ,p_mouse_lpm_before_common 
-0007 c0680044 beq patch1a_0 ,p_mouse_seting_dpi 
-0008 c06b0033 beq patch1a_6 ,p_mouse_priority_bb_event 
-0009 c06c8055 beq patch1b_1 ,p_mouse_bb_event_timer 
+0001 c000000d beq patch00_0 ,p_soft_reset 
+0002 c0458013 beq patch11_3 ,p_initialize_radio_cont 
+0003 c04f801e beq patch13_7 ,p_init_param 
+0004 c0570011 beq patch15_6 ,p_app_init 
+0005 c0648020 beq patch19_1 ,p_mouse_setgpio_hibernate 
+0006 c065002b beq patch19_2 ,p_mouse_lpm_before_common 
+0007 c068004d beq patch1a_0 ,p_mouse_seting_dpi 
+0008 c06b0034 beq patch1a_6 ,p_mouse_priority_bb_event 
+0009 c06c805e beq patch1b_1 ,p_mouse_bb_event_timer 
 000a 2020137c branch loop 
 
 pf_patch_ext:
-000b 2020137c branch loop 
+000b c050808b beq patch34_1 ,p_le_slave_match 
+000c 2020137c branch loop 
 
 p_soft_reset:
-000c 20800000 clear_stack 
-000d 204030f3 call app_param_init 
-000e 20403bfd call mouse_xtal_init 
-000f 20200804 branch soft_reset + 3 
+000d 20800000 clear_stack 
+000e 204030f3 call app_param_init 
+000f 20403bfd call mouse_xtal_init 
+0010 20200804 branch soft_reset + 3 
 
 p_app_init:
 
 p_mouse_init:
-0010 20406df3 call enable_authrom 
-0011 20203bc1 branch mouse_init 
+0011 20406df3 call enable_authrom 
+0012 20203bc1 branch mouse_init 
 
 p_initialize_radio_cont:
-0012 708a8be6 jam 0xe6 ,core_syn_aac_cfg1 
-0013 2040126a call initialize_syn_afc_cfg1 
-0014 20401271 call initialize_rf_ldo_cfg1 
-0015 20401277 call initialize_rc_cal 
-0016 708a6d09 jam 0x09 ,core_rx_bq_cfg0 
-0017 708a0305 jam 5 ,core_clkpll_cfg0 
-0018 708a7a94 jam 0x94 ,core_rx_iqadc_cfg 
-0019 708a0e0b jam 0x0b ,core_rf_ldo_cfg2 
-001a 708a0f05 jam 0x05 ,core_rf_ldo_cfg3 
-001b 708a8390 jam 0x90 ,core_syn_pfd_lkd_cfg 
-001c 2020125d branch initialize_radio_cont + 8 
+0013 708a8be6 jam 0xe6 ,core_syn_aac_cfg1 
+0014 2040126a call initialize_syn_afc_cfg1 
+0015 20401271 call initialize_rf_ldo_cfg1 
+0016 20401277 call initialize_rc_cal 
+0017 708a6d09 jam 0x09 ,core_rx_bq_cfg0 
+0018 708a0305 jam 5 ,core_clkpll_cfg0 
+0019 708a7a94 jam 0x94 ,core_rx_iqadc_cfg 
+001a 708a0e0b jam 0x0b ,core_rf_ldo_cfg2 
+001b 708a0f05 jam 0x05 ,core_rf_ldo_cfg3 
+001c 708a8390 jam 0x90 ,core_syn_pfd_lkd_cfg 
+001d 2020125d branch initialize_radio_cont + 8 
 
 p_init_param:
-001d 70008000 jam 0 ,mem_lmo_tid2 
-001e 202013b7 branch init_param_next + 1 
+001e 70008000 jam 0 ,mem_lmo_tid2 
+001f 202013b7 branch init_param_next + 1 
 
 p_mouse_setgpio_hibernate:
-001f 204042e9 call mouse_set_sdio_high 
-0020 20407fdc call clear_wake 
-0021 20404015 call mouse_before_hibernate_wheel_gpio_set 
-0022 6848c910 fetcht 1 ,mem_matrix_public_gpio 
-0023 20406069 call gpio_out_active 
-0024 6848c910 fetcht 1 ,mem_matrix_public_gpio 
-0025 20406042 call gpio_clr_wake 
-0026 6fe0c920 fetch 1 ,mem_mouse_sensor_sdio_gpio 
-0027 d840003f arg gpcfg_output_high ,temp 
-0028 20406093 call gpio_config_function_int 
-0029 20203e36 branch mouse_setgpio_hibernate + 3 
+0020 204042e9 call mouse_set_sdio_high 
+0021 20407fdc call clear_wake 
+0022 20404015 call mouse_before_hibernate_wheel_gpio_set 
+0023 6848c910 fetcht 1 ,mem_matrix_public_gpio 
+0024 20406069 call gpio_out_active 
+0025 6848c910 fetcht 1 ,mem_matrix_public_gpio 
+0026 20406042 call gpio_clr_wake 
+0027 6fe0c920 fetch 1 ,mem_mouse_sensor_sdio_gpio 
+0028 d840003f arg gpcfg_output_high ,temp 
+0029 20406093 call gpio_config_function_int 
+002a 20203e36 branch mouse_setgpio_hibernate + 3 
 
 p_mouse_lpm_before_common:
-002a 6848c913 fetcht 1 ,mem_whee_a_data_gpio 
-002b 20406050 call gpio_config_input 
-002c 6848c914 fetcht 1 ,mem_whee_b_data_gpio 
-002d 20406050 call gpio_config_input 
-002e 20403f88 call mouse_wheel_check 
-002f 6fe0c91f fetch 1 ,mem_mouse_sensor_sclk_gpio 
-0030 d840003f arg gpcfg_output_high ,temp 
-0031 20406093 call gpio_config_function_int 
-0032 20203e44 branch mouse_lpm_before_common_next 
+002b 6848c913 fetcht 1 ,mem_whee_a_data_gpio 
+002c 20406050 call gpio_config_input 
+002d 6848c914 fetcht 1 ,mem_whee_b_data_gpio 
+002e 20406050 call gpio_config_input 
+002f 20403f88 call mouse_wheel_check 
+0030 6fe0c91f fetch 1 ,mem_mouse_sensor_sclk_gpio 
+0031 d840003f arg gpcfg_output_high ,temp 
+0032 20406093 call gpio_config_function_int 
+0033 20203e44 branch mouse_lpm_before_common_next 
 
 p_mouse_priority_bb_event:
-0033 1a627e00 copy regc ,pdata 
-0034 c01e003f beq bt_evt_24g_attempt_success ,p_mouse_24g_attempt_success 
-0035 c0020038 beq bt_evt_reconn_failed ,p_mouse_bb_event_reconn_failed 
-0036 c0098038 beq bt_evt_reconn_page_timeout ,p_mouse_bb_event_reconn_failed 
-0037 20204336 branch mouse_priority_bb_event + 2 
+0034 1a627e00 copy regc ,pdata 
+0035 c01e0048 beq bt_evt_24g_attempt_success ,p_mouse_24g_attempt_success 
+0036 c0020041 beq bt_evt_reconn_failed ,p_mouse_bb_event_reconn_failed 
+0037 c0098041 beq bt_evt_reconn_page_timeout ,p_mouse_bb_event_reconn_failed 
+0038 c019003a beq bt_evt_le_start_enc ,p_mouse_le_ll_start_encryt 
+0039 20204336 branch mouse_priority_bb_event + 2 
+
+p_mouse_le_ll_start_encryt:
+003a 6fe0cac7 fetch 1 ,mem_mouse_le_reconnect_flag 
+003b c000803e beq 1 ,p_mouse_le_ll_reconn_start_encryt 
+003c 704b7614 jam 20 ,mem_le_start_encrypt_timer 
+003d 20204373 branch mouse_le_ll_enable_start_enc_flag 
+
+p_mouse_le_ll_reconn_start_encryt:
+003e 2040436c call mouse_updata_le_param 
+003f 704b7605 jam 5 ,mem_le_start_encrypt_timer 
+0040 20204373 branch mouse_le_ll_enable_start_enc_flag 
 
 p_mouse_bb_event_reconn_failed:
-0038 6fe0cac1 fetch 1 ,mem_mouse_bluetooth_fast_conn_flag 
-0039 c07fc2f8 beq 0xff ,mouse_buletooth_fast_conn_end 
-003a 6fe1478c fetch 2 ,mem_ui_state_map 
-003b c3860000 rtnbit1 ui_state_btn_down 
-003c c3830000 rtnbit1 ui_state_bt_discovery 
-003d c3858000 rtnbit1 ui_state_ble_adv 
-003e 20203e20 branch mouse_app_enter_hibernate 
+0041 6fe0cac1 fetch 1 ,mem_mouse_bluetooth_fast_conn_flag 
+0042 c07fc2f8 beq 0xff ,mouse_buletooth_fast_conn_end 
+0043 6fe1478c fetch 2 ,mem_ui_state_map 
+0044 c3860000 rtnbit1 ui_state_btn_down 
+0045 c3830000 rtnbit1 ui_state_bt_discovery 
+0046 c3858000 rtnbit1 ui_state_ble_adv 
+0047 20203e20 branch mouse_app_enter_hibernate 
 
 p_mouse_24g_attempt_success:
-003f 6fe2483c fetch 4 ,mem_24g_addr 
-0040 67e24891 store 4 ,mem_24g_receiver_addr 
-0041 67e24993 store 4 ,mem_mouse_24g_addr 
-0042 204048c6 call mouse_device_poweron_timer_init 
-0043 2020484e branch mouse_24g_attempt_success 
+0048 6fe2483c fetch 4 ,mem_24g_addr 
+0049 67e24891 store 4 ,mem_24g_receiver_addr 
+004a 67e24993 store 4 ,mem_mouse_24g_addr 
+004b 204048c6 call mouse_device_poweron_timer_init 
+004c 2020484e branch mouse_24g_attempt_success 
 
 p_mouse_seting_dpi:
-0044 2040408f call mouse_setting_dpi_4_level 
-0045 20400047 call p_mouse_dpi_led_blink_delay 
-0046 20204098 branch mouse_seting_sensor_type 
+004d 2040408f call mouse_setting_dpi_4_level 
+004e 20400050 call p_mouse_dpi_led_blink_delay 
+004f 20204098 branch mouse_seting_sensor_type 
 
 p_mouse_dpi_led_blink_delay:
-0047 6fe0c923 fetch 1 ,mem_dpi_led_gpio 
-0048 c17f8000 rtneq gpio_disable 
-0049 6fe14ac2 fetch 2 ,mem_mouse_discovery_timer 
-004a 247a0000 nrtn blank 
-004b 6fe14883 fetch 2 ,mem_24g_pair_timeout 
-004c 247a0000 nrtn blank 
-004d 6fe14887 fetch 2 ,mem_24g_reconn_timeout 
-004e 247a0000 nrtn blank 
-004f 6fe0cba7 fetch 1 ,mem_mouse_device_poweron_timer_count 
-0050 247a0000 nrtn blank 
-0051 6fe0cbc1 fetch 1 ,mem_mouse_dpi_led_delay_count_init 
-0052 203a0065 branch p_mouse_dpi_led_blink_init ,blank 
-0053 67e0cba8 store 1 ,mem_mouse_dpi_led_delay_count 
-0054 20600000 rtn 
+0050 6fe0c923 fetch 1 ,mem_dpi_led_gpio 
+0051 c17f8000 rtneq gpio_disable 
+0052 6fe14ac2 fetch 2 ,mem_mouse_discovery_timer 
+0053 247a0000 nrtn blank 
+0054 6fe14883 fetch 2 ,mem_24g_pair_timeout 
+0055 247a0000 nrtn blank 
+0056 6fe14887 fetch 2 ,mem_24g_reconn_timeout 
+0057 247a0000 nrtn blank 
+0058 6fe0cba7 fetch 1 ,mem_mouse_device_poweron_timer_count 
+0059 247a0000 nrtn blank 
+005a 6fe0cbc1 fetch 1 ,mem_mouse_dpi_led_delay_count_init 
+005b 203a006e branch p_mouse_dpi_led_blink_init ,blank 
+005c 67e0cba8 store 1 ,mem_mouse_dpi_led_delay_count 
+005d 20600000 rtn 
 
 p_mouse_bb_event_timer:
-0055 20403e9b call mouse_adc_read 
-0056 20404956 call mouse_low_voltage_led_timer 
-0057 2040232b call g24_pair_timeout_timer 
-0058 20402556 call g24_reconn_timeout_timer 
-0059 204047cd call mouse_24g_long_sleep_param_update_timer 
-005a 204048be call mouse_device_poweron_timer 
-005b 20400062 call p_mouse_dpi_led_blink_delay_timer 
-005c 2040407c call mouse_dpi_key_check_long_press 
-005d 204044cc call mouse_bt_discovery_check 
-005e 204044dc call mouse_commbination_key_process 
-005f 204044ff call mouse_check_discovery_timeout_timer 
-0060 2040007a call p_mouse_check_direct_timeout_timer 
-0061 202044c2 branch mouse_bb_event_timer + 13 
+005e 20403e9b call mouse_adc_read 
+005f 20404956 call mouse_low_voltage_led_timer 
+0060 2040232b call g24_pair_timeout_timer 
+0061 20402556 call g24_reconn_timeout_timer 
+0062 204047cd call mouse_24g_long_sleep_param_update_timer 
+0063 204048be call mouse_device_poweron_timer 
+0064 2040006b call p_mouse_dpi_led_blink_delay_timer 
+0065 2040407c call mouse_dpi_key_check_long_press 
+0066 204044cc call mouse_bt_discovery_check 
+0067 204044dc call mouse_commbination_key_process 
+0068 204044ff call mouse_check_discovery_timeout_timer 
+0069 20400083 call p_mouse_check_direct_timeout_timer 
+006a 202044c2 branch mouse_bb_event_timer + 13 
 
 p_mouse_dpi_led_blink_delay_timer:
-0062 da604ba8 arg mem_mouse_dpi_led_delay_count ,regc 
-0063 da400065 arg p_mouse_dpi_led_blink_init ,regb 
-0064 2020318a branch timer_single_step 
+006b da604ba8 arg mem_mouse_dpi_led_delay_count ,regc 
+006c da40006e arg p_mouse_dpi_led_blink_init ,regb 
+006d 2020318a branch timer_single_step 
 
 p_mouse_dpi_led_blink_init:
-0065 6fe0c927 fetch 1 ,mem_config_sensor_type 
-0066 c001c8f2 beq p3212 ,mouse_dpi_led_blink_init 
-0067 c005c8f2 beq ka8g2 ,mouse_dpi_led_blink_init 
-0068 6fe0c923 fetch 1 ,mem_dpi_led_gpio 
-0069 67e0c92f store 1 ,mem_mouse_struct_led_gpio 
-006a 6fe14bc2 fetch 2 ,mem_mouse_dpi_led_blink_time 
-006b 67e14930 store 2 ,mem_mouse_on_time 
-006c 67e14932 store 2 ,mem_mouse_off_time 
-006d da200000 arg 0 ,rega 
-006e 6848c992 fetcht 1 ,mem_mouse_dpi 
-006f 18408402 increase 2 ,temp 
-0070 18467c03 sub temp ,3 ,null 
-0071 20410074 call p_mouse_dpi_led_blink_init_level_4 ,positive 
-0072 24410078 ncall p_mouse_dpi_led_blink_count_clean ,positive 
-0073 202048ff branch mouse_dpi_led_blink_init_end 
+006e 6fe0c927 fetch 1 ,mem_config_sensor_type 
+006f c001c8f2 beq p3212 ,mouse_dpi_led_blink_init 
+0070 c005c8f2 beq ka8g2 ,mouse_dpi_led_blink_init 
+0071 6fe0c923 fetch 1 ,mem_dpi_led_gpio 
+0072 67e0c92f store 1 ,mem_mouse_struct_led_gpio 
+0073 6fe14bc2 fetch 2 ,mem_mouse_dpi_led_blink_time 
+0074 67e14930 store 2 ,mem_mouse_on_time 
+0075 67e14932 store 2 ,mem_mouse_off_time 
+0076 da200000 arg 0 ,rega 
+0077 6848c992 fetcht 1 ,mem_mouse_dpi 
+0078 18408402 increase 2 ,temp 
+0079 18467c03 sub temp ,3 ,null 
+007a 2041007d call p_mouse_dpi_led_blink_init_level_4 ,positive 
+007b 24410081 ncall p_mouse_dpi_led_blink_count_clean ,positive 
+007c 202048ff branch mouse_dpi_led_blink_init_end 
 
 p_mouse_dpi_led_blink_init_level_4:
-0074 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
-0075 c40e0000 rtnbit0 mouse_enable_dpi_level_4 
-0076 18408401 increase 1 ,temp 
-0077 20600000 rtn 
+007d 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+007e c40e0000 rtnbit0 mouse_enable_dpi_level_4 
+007f 18408401 increase 1 ,temp 
+0080 20600000 rtn 
 
 p_mouse_dpi_led_blink_count_clean:
-0078 184085fd increase -3 ,temp 
-0079 20600000 rtn 
+0081 184085fd increase -3 ,temp 
+0082 20600000 rtn 
 
 p_mouse_check_direct_timeout_timer:
-007a da604b77 arg mem_mouse_direct_timer ,regc 
-007b da40007d arg p_mouse_check_direct_timeout ,regb 
-007c 20204506 branch mouse_check_direct_timeout_timer + 2 
+0083 da604b77 arg mem_mouse_direct_timer ,regc 
+0084 da400086 arg p_mouse_check_direct_timeout ,regb 
+0085 20204506 branch mouse_check_direct_timeout_timer + 2 
 
 p_mouse_check_direct_timeout:
-007d 6fe0cac1 fetch 1 ,mem_mouse_bluetooth_fast_conn_flag 
-007e c07fc2f8 beq 0xff ,mouse_buletooth_fast_conn_end 
-007f 6fe0cab0 fetch 1 ,mem_reconn_times 
-0080 243a470e nbranch mouse_polling_device ,blank 
-0081 20203e20 branch mouse_app_enter_hibernate 
+0086 6fe0cac1 fetch 1 ,mem_mouse_bluetooth_fast_conn_flag 
+0087 c07fc2f8 beq 0xff ,mouse_buletooth_fast_conn_end 
+0088 6fe0cab0 fetch 1 ,mem_reconn_times 
+0089 243a470e nbranch mouse_polling_device ,blank 
+008a 20203e20 branch mouse_app_enter_hibernate 
+
+p_le_slave_match:
+008b 6fe0c3dd fetch 1 ,mem_le_md_count 
+008c 1fe0fe01 pincrease 1 
+008d 67e0c3dd store 1 ,mem_le_md_count 
+008e c006165a beq le_md_max_count ,le_slave_cont 
+008f 2040191b call le_acknowledge 
+0090 2040196a call le_prepare_tx 
+0091 6fe082bd fetch 1 ,mem_le_tx_phy 
+0092 2040168b call le_enable_phy_by_pdata 
+0093 20401838 call le_transmit 
+0094 20201655 branch le_slave_match + 10 
               org 0x800
 
 start:
Index: program/patch.prog
===================================================================
--- /YC1308AC/branch/mouse_project/public_3mode/program/patch.prog	(revision 392)
+++ /YC1308AC/branch/mouse_project/public_3mode/program/patch.prog	(working copy)
@@ -1,4 +1,6 @@
 
+//define BATTERY_SERVICE_CANCEL
+
 	bbit1 8,pf_patch_ext
 	beq patch00_0,p_soft_reset
 	beq patch11_3,p_initialize_radio_cont	
@@ -12,6 +14,12 @@
 	branch loop
 
 pf_patch_ext:
+	beq patch34_1,p_le_slave_match
+	
+//ifdef BATTERY_SERVICE_CANCEL
+//	beq patch38_0,p_le_parse_l2cap
+//endif	
+
 	branch loop
 
 
@@ -83,8 +91,19 @@
 	beq BT_EVT_24G_ATTEMPT_SUCCESS,p_mouse_24g_attempt_success
 	beq BT_EVT_RECONN_FAILED,p_mouse_bb_event_reconn_failed
 	beq BT_EVT_RECONN_PAGE_TIMEOUT,p_mouse_bb_event_reconn_failed
+	beq BT_EVT_LE_START_ENC,p_mouse_le_ll_start_encryt
 	branch mouse_priority_bb_event+2
 
+p_mouse_le_ll_start_encryt:
+	fetch 1,mem_mouse_le_reconnect_flag
+	beq 1,p_mouse_le_ll_reconn_start_encryt
+	jam 20,mem_le_start_encrypt_timer
+	branch mouse_le_ll_enable_start_enc_flag
+p_mouse_le_ll_reconn_start_encryt:
+	call mouse_updata_le_param
+	jam 5,mem_le_start_encrypt_timer
+	branch mouse_le_ll_enable_start_enc_flag
+
 p_mouse_bb_event_reconn_failed:
 	fetch 1,mem_mouse_bluetooth_fast_conn_flag
 	beq 0xff,mouse_buletooth_fast_conn_end
@@ -192,5 +211,60 @@
 	branch mouse_app_enter_hibernate
 
 
+p_le_slave_match:
+	fetch 1,mem_le_md_count
+	pincrease 1
+	store 1,mem_le_md_count
+	beq LE_MD_MAX_COUNT,le_slave_cont
+	call le_acknowledge
+	call le_prepare_tx
+	fetch 1,mem_le_tx_phy
+	call le_enable_phy_by_pdata
+	call le_transmit
+	branch le_slave_match+10
+
+//ifdef BATTERY_SERVICE_CANCEL
+//p_le_parse_l2cap:
+//	ifetch 2,contr
+//	beq LE_L2CAP_CID_ATT,p_le_parse_att
+//	branch le_parse_l2cap+10
+		
+//p_le_parse_att:
+//	call store_contr
+//	call p_mouse_le_reconn_write_enable_timer_reinit
+//	call get_contr
+//	ifetch 3,contr
+//	store 3,mem_le_att_opcode
+//	beq ATTOP_READ_REQUEST,p_le_parse_att_read_request
+//	branch le_parse_att+2
+//p_le_parse_att_read_request:
+//	call le_check_encrypt_state
+//	fetcht 2,mem_le_att_handle
+//	fetch 1,mem_le_configuration
+//	bbit1 BIT_BLE_READ_AUTH,p_le_send_att_read_response_check_auth
+//input:temp is handle
+//p_le_send_att_read_response:
+//	fetch 2,mem_le_att_handle
+//	beq 0x30,le_send_att_error_response_notfound
+//	fetcht 2,mem_le_att_handle
+//	branch le_send_att_read_response
+
+//p_le_send_att_read_response_check_auth:
+//	fetch 2,mem_le_pairing_handle
+//	isub temp,null
+//	nbranch p_le_send_att_read_response,zero
+//	call le_check_encrypt_state
+//	nbranch p_le_send_att_read_response,user
+//	branch le_send_att_read_response_error_insufficient_auth
+
+//p_mouse_le_reconn_write_enable_timer_reinit:
+//	fetch 1,mem_mouse_le_reconnect_flag
+//	rtn blank
+//	fetch 1,mem_le_connect_status_flag
+//	and pdata,0x03,pdata
+//	rtneq 0x03
+//	jam 2,mem_le_start_encrypt_timer
+//	rtn
+//endif
 	
  	
Index: sched/mouse.dat
===================================================================
--- /YC1308AC/branch/mouse_project/public_3mode/sched/mouse.dat	(revision 392)
+++ /YC1308AC/branch/mouse_project/public_3mode/sched/mouse.dat	(working copy)
@@ -1,6 +1,6 @@
 mem_device_option:08	#08 mouse
 
-mem_lpm_config:88 1f ca	#4khz
+mem_lpm_config:88 1f ce	#4khz
 mem_fcomp_div:18
 
 mem_rf_init_data:ff
