Index: output/eeprom.dat
===================================================================
--- /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/output/eeprom.dat	(revision 5359)
+++ /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/output/eeprom.dat	(working copy)
@@ -2,7 +2,7 @@
 02
 aa
 55
-9a
+aa
 18
 c2
 84
@@ -39,7 +39,7 @@
 c0
 61
 80
-8d
+8a
 c0
 62
 00
@@ -63,7 +63,7 @@
 c0
 67
 00
-62
+5f
 c0
 67
 82
@@ -83,7 +83,7 @@
 c0
 6b
 00
-83
+80
 c0
 6c
 80
@@ -91,7 +91,7 @@
 c0
 6f
 00
-7d
+7a
 c0
 6f
 83
@@ -119,7 +119,7 @@
 c0
 10
 00
-81
+7e
 c0
 15
 80
@@ -271,7 +271,7 @@
 20
 40
 00
-5d
+5a
 20
 40
 01
@@ -314,18 +314,6 @@
 af
 20
 40
-41
-10
-1a
-21
-7e
-07
-c0
-03
-85
-fa
-20
-40
 3d
 13
 20
@@ -347,7 +335,7 @@
 20
 40
 00
-57
+54
 20
 20
 3b
@@ -451,11 +439,11 @@
 24
 34
 00
-76
+73
 20
 40
 00
-73
+70
 20
 40
 01
@@ -568,6 +556,18 @@
 20
 43
 36
+20
+40
+41
+10
+1a
+21
+7e
+07
+c0
+03
+85
+fa
 6f
 e4
 4b
@@ -5351,7 +5351,7 @@
 20
 40
 00
-5a
+57
 20
 40
 45
@@ -5435,7 +5435,7 @@
 20
 40
 00
-5a
+57
 20
 20
 48
@@ -5447,7 +5447,7 @@
 20
 40
 00
-5a
+57
 6f
 e0
 c8
@@ -6135,19 +6135,23 @@
 20
 40
 06
-10
+14
+70
+4b
+e1
+01
 20
 40
 06
-00
+01
 20
 40
 06
-17
+1b
 20
 20
 05
-fd
+fe
 20
 40
 01
@@ -6159,7 +6163,7 @@
 c0
 00
 86
-05
+06
 70
 4c
 b0
@@ -6189,9 +6193,13 @@
 fe
 01
 1f
-e1
-7e
-03
+e6
+7c
+02
+24
+41
+06
+12
 67
 e0
 cc
@@ -6199,15 +6207,23 @@
 c0
 00
 06
-10
+14
 c0
 00
 86
-13
+17
 c0
 01
 06
-15
+19
+20
+60
+00
+00
+58
+00
+00
+00
 20
 60
 00
@@ -6231,7 +6247,7 @@
 20
 20
 06
-11
+15
 6f
 e0
 cc
@@ -6239,7 +6255,7 @@
 20
 20
 06
-11
+15
 70
 41
 e8
@@ -6267,7 +6283,7 @@
 20
 40
 06
-24
+28
 58
 00
 ff
@@ -6287,7 +6303,7 @@
 c2
 00
 06
-20
+24
 20
 60
 00
@@ -6300,8 +6316,8 @@
 60
 00
 00
-5c
-f4
+b0
+49
 aa
 55
 40
@@ -6487,7 +6503,7 @@
 4b
 04
 09
-5a
+4a
 00
 00
 02
@@ -7441,26 +7457,10 @@
 aa
 aa
 55
-13
+03
 4b
-a6
-92
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
+fc
+7c
 ff
 ff
 ff
@@ -8188,5 +8188,5 @@
 ff
 ff
 ff
-d8
-65
+c2
+57
Index: output/flash.dat
===================================================================
--- /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/output/flash.dat	(revision 5359)
+++ /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/output/flash.dat	(working copy)
@@ -2,7 +2,7 @@
 02
 aa
 55
-9a
+aa
 18
 c2
 84
@@ -39,7 +39,7 @@
 c0
 61
 80
-8d
+8a
 c0
 62
 00
@@ -63,7 +63,7 @@
 c0
 67
 00
-62
+5f
 c0
 67
 82
@@ -83,7 +83,7 @@
 c0
 6b
 00
-83
+80
 c0
 6c
 80
@@ -91,7 +91,7 @@
 c0
 6f
 00
-7d
+7a
 c0
 6f
 83
@@ -119,7 +119,7 @@
 c0
 10
 00
-81
+7e
 c0
 15
 80
@@ -271,7 +271,7 @@
 20
 40
 00
-5d
+5a
 20
 40
 01
@@ -314,18 +314,6 @@
 af
 20
 40
-41
-10
-1a
-21
-7e
-07
-c0
-03
-85
-fa
-20
-40
 3d
 13
 20
@@ -347,7 +335,7 @@
 20
 40
 00
-57
+54
 20
 20
 3b
@@ -451,11 +439,11 @@
 24
 34
 00
-76
+73
 20
 40
 00
-73
+70
 20
 40
 01
@@ -568,6 +556,18 @@
 20
 43
 36
+20
+40
+41
+10
+1a
+21
+7e
+07
+c0
+03
+85
+fa
 6f
 e4
 4b
@@ -5351,7 +5351,7 @@
 20
 40
 00
-5a
+57
 20
 40
 45
@@ -5435,7 +5435,7 @@
 20
 40
 00
-5a
+57
 20
 20
 48
@@ -5447,7 +5447,7 @@
 20
 40
 00
-5a
+57
 6f
 e0
 c8
@@ -6135,19 +6135,23 @@
 20
 40
 06
-10
+14
+70
+4b
+e1
+01
 20
 40
 06
-00
+01
 20
 40
 06
-17
+1b
 20
 20
 05
-fd
+fe
 20
 40
 01
@@ -6159,7 +6163,7 @@
 c0
 00
 86
-05
+06
 70
 4c
 b0
@@ -6189,9 +6193,13 @@
 fe
 01
 1f
-e1
-7e
-03
+e6
+7c
+02
+24
+41
+06
+12
 67
 e0
 cc
@@ -6199,15 +6207,23 @@
 c0
 00
 06
-10
+14
 c0
 00
 86
-13
+17
 c0
 01
 06
-15
+19
+20
+60
+00
+00
+58
+00
+00
+00
 20
 60
 00
@@ -6231,7 +6247,7 @@
 20
 20
 06
-11
+15
 6f
 e0
 cc
@@ -6239,7 +6255,7 @@
 20
 20
 06
-11
+15
 70
 41
 e8
@@ -6267,7 +6283,7 @@
 20
 40
 06
-24
+28
 58
 00
 ff
@@ -6287,7 +6303,7 @@
 c2
 00
 06
-20
+24
 20
 60
 00
@@ -6300,8 +6316,8 @@
 60
 00
 00
-5c
-f4
+b0
+49
 aa
 55
 40
@@ -6487,7 +6503,7 @@
 4b
 04
 09
-5a
+4a
 00
 00
 02
@@ -7441,26 +7457,10 @@
 aa
 aa
 55
-13
+03
 4b
-a6
-92
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
+fc
+7c
 ff
 ff
 ff
@@ -8188,5 +8188,5 @@
 ff
 ff
 ff
-d8
-65
+c2
+57
Index: output/program.lis
===================================================================
--- /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/output/program.lis	(revision 5359)
+++ /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/output/program.lis	(working copy)
@@ -8,20 +8,20 @@
 0005 c0450358 beq patch11_2 ,p_txon_next 
 0006 c045833d beq patch11_3 ,p_initialize_radio_cont 
 0007 c057003a beq patch15_6 ,p_app_init 
-0008 c061808d beq patch18_3 ,p_mouse_start_work 
+0008 c061808a beq patch18_3 ,p_mouse_start_work 
 0009 c06200ac beq patch18_4 ,p_mouse_start_reconnect_device 
 000a c06380c2 beq patch18_7 ,p_mouse_app_enter_hibernate 
 000b c06480c3 beq patch19_1 ,p_mouse_setgpio_hibernate 
 000c c06500f7 beq patch19_2 ,p_mouse_lpm_before_common 
 000d c06600be beq patch19_4 ,p_mouse_adc_read_start 
-000e c0670062 beq patch19_6 ,p_mouse_motion 
+000e c067005f beq patch19_6 ,p_mouse_motion 
 000f c0678262 beq patch19_7 ,p_mouse_dpi_process 
 0010 c0680260 beq patch1a_0 ,p_mouse_seting_dpi 
 0011 c06881f5 beq patch1a_1 ,p_mouse_check_key_gpio 
 0012 c06a01e0 beq patch1a_4 ,p_mouse_sensor_poweron 
-0013 c06b0083 beq patch1a_6 ,p_mouse_priority_bb_event 
+0013 c06b0080 beq patch1a_6 ,p_mouse_priority_bb_event 
 0014 c06c80ff beq patch1b_1 ,p_mouse_bb_event_timer 
-0015 c06f007d beq patch1b_6 ,p_mouse_idle 
+0015 c06f007a beq patch1b_6 ,p_mouse_idle 
 0016 c06f831d beq patch1b_7 ,p_mouse_ready_reconnection_by_button 
 0017 c0708315 beq patch1c_1 ,p_mouse_led_off 
 0018 c0710311 beq patch1c_2 ,p_mouse_led_on 
@@ -30,7 +30,7 @@
 001b 2020137c branch loop 
 
 pf_patch_ext:
-001c c0100081 beq patch24_0 ,p_twspi_reset 
+001c c010007e beq patch24_0 ,p_twspi_reset 
 001d c015802d beq patch25_3 ,p_efuse_vdd_off 
 001e c0198362 beq patch26_3 ,p_adc_init_data 
 001f c01a0367 beq patch26_4 ,p_enable_adc 
@@ -72,7 +72,7 @@
 003f 2040408e call mouse_dpi_config 
 0040 20403d8a call mouse_usb_check_enable 
 0041 20404728 call mouse_drawing_optima_init 
-0042 2040005d call p_mouse_cb_fuction 
+0042 2040005a call p_mouse_cb_fuction 
 0043 204001ec call p_mouse_sensor_powerdown 
 0044 20203bc9 branch mouse_init + 8 
 
@@ -85,90 +85,90 @@
 004a 204004d8 call p_send_time_long_wake 
 004b 20403f1e call mouse_gpio_init 
 004c 204005af call p_mouse_le_name_load 
-004d 20404110 call mouse_key_check_once 
-004e 1a217e07 and rega ,0x07 ,pdata 
-004f c00385fa beq mouse_lmr_button ,p_mouse_freq_test_mode 
-0050 20403d13 call mouse_param_init 
-0051 2040026d call p_mouse_g24_report_setting 
-0052 20400199 call p_mouse_logo_led_off 
-0053 2040018b call p_mouse_1io2led_all_off 
-0054 20400148 call p_mouse_device_multi_led_poweron2s_init 
-0055 20400057 call p_mouse_store_normal_tx_power 
-0056 20203bf5 branch mouse_setting_config + 5 
+004d 20403d13 call mouse_param_init 
+004e 2040026d call p_mouse_g24_report_setting 
+004f 20400199 call p_mouse_logo_led_off 
+0050 2040018b call p_mouse_1io2led_all_off 
+0051 20400148 call p_mouse_device_multi_led_poweron2s_init 
+0052 20400054 call p_mouse_store_normal_tx_power 
+0053 20203bf5 branch mouse_setting_config + 5 
 
 p_mouse_store_normal_tx_power:
-0057 6fe0c1e8 fetch 1 ,mem_tx_power 
-0058 67e0cca9 store 1 ,mem_normal_tx_power 
-0059 20600000 rtn 
+0054 6fe0c1e8 fetch 1 ,mem_tx_power 
+0055 67e0cca9 store 1 ,mem_normal_tx_power 
+0056 20600000 rtn 
 
 p_mouse_fetch_normal_tx_power:
-005a 6fe0cca9 fetch 1 ,mem_normal_tx_power 
-005b 67e0c1e8 store 1 ,mem_tx_power 
-005c 20600000 rtn 
+0057 6fe0cca9 fetch 1 ,mem_normal_tx_power 
+0058 67e0c1e8 store 1 ,mem_tx_power 
+0059 20600000 rtn 
 
 p_mouse_cb_fuction:
-005d 5800028b setarg p_mouse_24g_package_data 
-005e 67e1489b store 2 ,mem_cb_24g_transmit_data 
-005f 580002ac setarg p_mouse_24g_search_dongle 
-0060 67e1489d store 2 ,mem_cb_24g_search_receiver 
-0061 20203bd3 branch mouse_cb_fuction + 4 
+005a 5800028b setarg p_mouse_24g_package_data 
+005b 67e1489b store 2 ,mem_cb_24g_transmit_data 
+005c 580002ac setarg p_mouse_24g_search_dongle 
+005d 67e1489d store 2 ,mem_cb_24g_search_receiver 
+005e 20203bd3 branch mouse_cb_fuction + 4 
 
 p_mouse_motion:
-0062 78547c00 disable user 
-0063 58000000 setarg 0 
-0064 67e348d1 store 6 ,mem_mouse_x 
-0065 20404240 call mouse_check_sensor_data 
-0066 58000089 setarg 0x0089 
-0067 20405b0c call twspi_write 
-0068 2040408e call mouse_dpi_config 
-0069 20403f7e call mouse_zwheel 
-006a 20403f83 call mouse_t_zwheel 
-006b 204001f3 call p_mouse_key 
-006c 6fe0c8d0 fetch 1 ,mem_mouse_key 
-006d 1fe17e1f and_into 0x1f ,pdata 
-006e 67e0c8d0 store 1 ,mem_mouse_key 
-006f 24340076 nbranch p_mouse_low_power_led_delay_off ,user 
-0070 20400073 call p_mouse_work_state_flag 
-0071 204001dd call p_mouse_drawing_optima 
-0072 20204544 branch mouse_no_data_timer_init 
+005f 78547c00 disable user 
+0060 58000000 setarg 0 
+0061 67e348d1 store 6 ,mem_mouse_x 
+0062 20404240 call mouse_check_sensor_data 
+0063 58000089 setarg 0x0089 
+0064 20405b0c call twspi_write 
+0065 2040408e call mouse_dpi_config 
+0066 20403f7e call mouse_zwheel 
+0067 20403f83 call mouse_t_zwheel 
+0068 204001f3 call p_mouse_key 
+0069 6fe0c8d0 fetch 1 ,mem_mouse_key 
+006a 1fe17e1f and_into 0x1f ,pdata 
+006b 67e0c8d0 store 1 ,mem_mouse_key 
+006c 24340073 nbranch p_mouse_low_power_led_delay_off ,user 
+006d 20400070 call p_mouse_work_state_flag 
+006e 204001dd call p_mouse_drawing_optima 
+006f 20204544 branch mouse_no_data_timer_init 
 
 p_mouse_work_state_flag:
-0073 704ca400 jam 0 ,mem_low_power_led_flag 
-0074 704ca500 jam 0 ,mem_24g_low_power_stop_blink 
-0075 20600000 rtn 
+0070 704ca400 jam 0 ,mem_low_power_led_flag 
+0071 704ca500 jam 0 ,mem_24g_low_power_stop_blink 
+0072 20600000 rtn 
 
 p_mouse_low_power_led_delay_off:
-0076 20404728 call mouse_drawing_optima_init 
-0077 6fe0cca5 fetch 1 ,mem_24g_low_power_stop_blink 
-0078 247a0000 nrtn blank 
-0079 6fe0c8fa fetch 1 ,mem_mouse_adc_last_low_voltage_flag 
-007a c1000000 rtneq 0 
-007b 704ca564 jam 0x64 ,mem_24g_low_power_stop_blink 
-007c 20600000 rtn 
+0073 20404728 call mouse_drawing_optima_init 
+0074 6fe0cca5 fetch 1 ,mem_24g_low_power_stop_blink 
+0075 247a0000 nrtn blank 
+0076 6fe0c8fa fetch 1 ,mem_mouse_adc_last_low_voltage_flag 
+0077 c1000000 rtneq 0 
+0078 704ca564 jam 0x64 ,mem_24g_low_power_stop_blink 
+0079 20600000 rtn 
 
 p_mouse_idle:
-007d 20404990 call mouse_low_voltage_led_no_enter_lpm 
-007e 20407936 call ui_check_paring_button 
-007f 2040022d call p_mouse_dpi_check 
-0080 2020464f branch mouse_idle + 4 
+007a 20404990 call mouse_low_voltage_led_no_enter_lpm 
+007b 20407936 call ui_check_paring_button 
+007c 2040022d call p_mouse_dpi_check 
+007d 2020464f branch mouse_idle + 4 
 
 p_twspi_reset:
-0081 6fe0c91f fetch 1 ,mem_mouse_sensor_sclk_gpio 
-0082 20205af8 branch twspi_reset + 1 
+007e 6fe0c91f fetch 1 ,mem_mouse_sensor_sclk_gpio 
+007f 20205af8 branch twspi_reset + 1 
 
 p_mouse_priority_bb_event:
-0083 1a627e00 copy regc ,pdata 
-0084 c01e053e beq bt_evt_24g_attempt_success ,p_mouse_24g_attempt_success 
-0085 c01c8537 beq bt_evt_24g_pairing_complete ,p_mouse_24g_pairing_complete 
-0086 c01d054f beq bt_evt_24g_attempt_fail ,p_mouse_24g_attempt_fail 
-0087 c01905be beq bt_evt_le_start_enc ,p_mouse_le_ll_start_encryt 
-0088 c00a85b8 beq bt_evt_le_disconnected ,p_mouse_le_bb_disconnected 
-0089 c00a05b5 beq bt_evt_le_connected ,p_mouse_le_bb_event_connected 
-008a c02205c5 beq bt_evt_le_parse_conn_param_accepted ,p_mouse_le_parse_conn_param_accepted 
-008b c02005cf beq bt_evt_le_parse_conn_papa_update_rsp ,p_mouse_le_conn_param_update_rsp_recieved 
-008c 20204336 branch mouse_priority_bb_event + 2 
+0080 1a627e00 copy regc ,pdata 
+0081 c01e053e beq bt_evt_24g_attempt_success ,p_mouse_24g_attempt_success 
+0082 c01c8537 beq bt_evt_24g_pairing_complete ,p_mouse_24g_pairing_complete 
+0083 c01d054f beq bt_evt_24g_attempt_fail ,p_mouse_24g_attempt_fail 
+0084 c01905be beq bt_evt_le_start_enc ,p_mouse_le_ll_start_encryt 
+0085 c00a85b8 beq bt_evt_le_disconnected ,p_mouse_le_bb_disconnected 
+0086 c00a05b5 beq bt_evt_le_connected ,p_mouse_le_bb_event_connected 
+0087 c02205c5 beq bt_evt_le_parse_conn_param_accepted ,p_mouse_le_parse_conn_param_accepted 
+0088 c02005cf beq bt_evt_le_parse_conn_papa_update_rsp ,p_mouse_le_conn_param_update_rsp_recieved 
+0089 20204336 branch mouse_priority_bb_event + 2 
 
 p_mouse_start_work:
+008a 20404110 call mouse_key_check_once 
+008b 1a217e07 and rega ,0x07 ,pdata 
+008c c00385fa beq mouse_lmr_button ,p_mouse_freq_test_mode 
 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 
@@ -1780,7 +1780,7 @@
 
 p_mouse_24g_pairing_complete:
 0537 20400418 call p_mouse_soft_agc_disable 
-0538 2040005a call p_mouse_fetch_normal_tx_power 
+0538 20400057 call p_mouse_fetch_normal_tx_power 
 0539 20404544 call mouse_no_data_timer_init 
 053a d8e00001 arg mouse_24g_pairing_flag ,queue 
 053b 204046f4 call mouse_disable_function_flag 
@@ -1803,12 +1803,12 @@
 054a 98467c00 isub temp ,null 
 054b 20628000 rtn zero 
 054c 20400418 call p_mouse_soft_agc_disable 
-054d 2040005a call p_mouse_fetch_normal_tx_power 
+054d 20400057 call p_mouse_fetch_normal_tx_power 
 054e 20204822 branch mouse_24g_first_store_reconn_info 
 
 p_mouse_24g_attempt_fail:
 054f 20400418 call p_mouse_soft_agc_disable 
-0550 2040005a call p_mouse_fetch_normal_tx_power 
+0550 20400057 call p_mouse_fetch_normal_tx_power 
 0551 6fe0c8a5 fetch 1 ,mem_24g_attempt_fail_flag 
 0552 243a0578 nbranch p_mouse_24g_hibernate_set ,blank 
 0553 6fe0c88b fetch 1 ,mem_24g_reconn_type 
@@ -2036,68 +2036,74 @@
 p_mouse_freq_test_mode:
 05fa 70486501 jam 0x01 ,mem_24g_tx_phy 
 05fb 704cac00 jam 0 ,mem_mouse_ch_count 
-05fc 20400610 call p_mouse_set_ch_l 
+05fc 20400614 call p_mouse_set_ch_l 
+05fd 704be101 jam 0x01 ,mem_sensor_shutdown_flag 
 
 p_mouse_freq_test_mode_loop:
-05fd 20400600 call p_mouse_freq_test_mode_state_check 
-05fe 20400617 call p_mouse_freq_test_single_wave 
-05ff 202005fd branch p_mouse_freq_test_mode_loop 
+05fe 20400601 call p_mouse_freq_test_mode_state_check 
+05ff 2040061b call p_mouse_freq_test_single_wave 
+0600 202005fe branch p_mouse_freq_test_mode_loop 
 
 p_mouse_freq_test_mode_state_check:
-0600 204001f5 call p_mouse_check_key_gpio 
-0601 1a217e07 and rega ,0x07 ,pdata 
-0602 c0008605 beq mouse_l_button ,p_mouse_change_freq_set 
-0603 704cb000 jam 0 ,mem_mouse_ch_set_flag 
-0604 20600000 rtn 
+0601 204001f5 call p_mouse_check_key_gpio 
+0602 1a217e07 and rega ,0x07 ,pdata 
+0603 c0008606 beq mouse_l_button ,p_mouse_change_freq_set 
+0604 704cb000 jam 0 ,mem_mouse_ch_set_flag 
+0605 20600000 rtn 
 
 p_mouse_change_freq_set:
-0605 6fe0ccb0 fetch 1 ,mem_mouse_ch_set_flag 
-0606 247a0000 nrtn blank 
-0607 704cb001 jam 1 ,mem_mouse_ch_set_flag 
-0608 6fe0ccac fetch 1 ,mem_mouse_ch_count 
-0609 1fe0fe01 increase 1 ,pdata 
-060a 1fe17e03 and pdata ,0x03 ,pdata 
-060b 67e0ccac store 1 ,mem_mouse_ch_count 
-060c c0000610 beq 0 ,p_mouse_set_ch_l 
-060d c0008613 beq 1 ,p_mouse_set_ch_m 
-060e c0010615 beq 2 ,p_mouse_set_ch_h 
-060f 20600000 rtn 
+0606 6fe0ccb0 fetch 1 ,mem_mouse_ch_set_flag 
+0607 247a0000 nrtn blank 
+0608 704cb001 jam 1 ,mem_mouse_ch_set_flag 
+0609 6fe0ccac fetch 1 ,mem_mouse_ch_count 
+060a 1fe0fe01 increase 1 ,pdata 
+060b 1fe67c02 sub pdata ,0x02 ,null 
+060c 24410612 ncall p_mouse_ch_count_clear ,positive 
+060d 67e0ccac store 1 ,mem_mouse_ch_count 
+060e c0000614 beq 0 ,p_mouse_set_ch_l 
+060f c0008617 beq 1 ,p_mouse_set_ch_m 
+0610 c0010619 beq 2 ,p_mouse_set_ch_h 
+0611 20600000 rtn 
+
+p_mouse_ch_count_clear:
+0612 58000000 setarg 0 
+0613 20600000 rtn 
 
 p_mouse_set_ch_l:
-0610 6fe0ccad fetch 1 ,mem_mouse_ch_l 
+0614 6fe0ccad fetch 1 ,mem_mouse_ch_l 
 
 p_mouse_store_ch:
-0611 67e0c83a store 1 ,mem_24g_ch 
-0612 20600000 rtn 
+0615 67e0c83a store 1 ,mem_24g_ch 
+0616 20600000 rtn 
 
 p_mouse_set_ch_m:
-0613 6fe0ccae fetch 1 ,mem_mouse_ch_m 
-0614 20200611 branch p_mouse_store_ch 
+0617 6fe0ccae fetch 1 ,mem_mouse_ch_m 
+0618 20200615 branch p_mouse_store_ch 
 
 p_mouse_set_ch_h:
-0615 6fe0ccaf fetch 1 ,mem_mouse_ch_h 
-0616 20200611 branch p_mouse_store_ch 
+0619 6fe0ccaf fetch 1 ,mem_mouse_ch_h 
+061a 20200615 branch p_mouse_store_ch 
 
 p_mouse_freq_test_single_wave:
-0617 7041e800 jam tx_power_0db ,mem_tx_power 
-0618 20402243 call g24_set_freq_tx 
-0619 7843fc00 disable enable_white 
-061a 782efc00 enable encode_fec0 
-061b 78307c00 enable is_tx 
-061c 79202a00 set1 txgfsk ,radio_ctrl 
-061d 20400624 call p_test_mode 
-061e 5800ffff setarg 0xffff 
-061f 1fe27200 copy pdata ,loopcnt 
+061b 7041e800 jam tx_power_0db ,mem_tx_power 
+061c 20402243 call g24_set_freq_tx 
+061d 7843fc00 disable enable_white 
+061e 782efc00 enable encode_fec0 
+061f 78307c00 enable is_tx 
+0620 79202a00 set1 txgfsk ,radio_ctrl 
+0621 20400628 call p_test_mode 
+0622 5800ffff setarg 0xffff 
+0623 1fe27200 copy pdata ,loopcnt 
 
 p_pnloop_carrier:
-0620 efe08006 ifetch 1 ,contr 
-0621 08008608 inject mod ,8 
-0622 c2000620 loop p_pnloop_carrier 
-0623 20600000 rtn 
+0624 efe08006 ifetch 1 ,contr 
+0625 08008608 inject mod ,8 
+0626 c2000624 loop p_pnloop_carrier 
+0627 20600000 rtn 
 
 p_test_mode:
-0624 70890d22 jam 0x22 ,core_tx_test_mode 
-0625 20600000 rtn 
+0628 70890d22 jam 0x22 ,core_tx_test_mode 
+0629 20600000 rtn 
               org 0x800
 
 start:
Index: output/ramcode.rom
===================================================================
--- /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/output/ramcode.rom	(revision 5359)
+++ /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/output/ramcode.rom	(working copy)
@@ -6,27 +6,27 @@
 c0450358
 c045833d
 c057003a
-c061808d
+c061808a
 c06200ac
 c06380c2
 c06480c3
 c06500f7
 c06600be
-c0670062
+c067005f
 c0678262
 c0680260
 c06881f5
 c06a01e0
-c06b0083
+c06b0080
 c06c80ff
-c06f007d
+c06f007a
 c06f831d
 c0708315
 c0710311
 c06d0586
 c06d85ac
 2020137c
-c0100081
+c010007e
 c015802d
 c0198362
 c01a0367
@@ -64,7 +64,7 @@
 2040408e
 20403d8a
 20404728
-2040005d
+2040005a
 204001ec
 20203bc9
 20758000
@@ -75,15 +75,12 @@
 204004d8
 20403f1e
 204005af
-20404110
-1a217e07
-c00385fa
 20403d13
 2040026d
 20400199
 2040018b
 20400148
-20400057
+20400054
 20203bf5
 6fe0c1e8
 67e0cca9
@@ -109,8 +106,8 @@
 6fe0c8d0
 1fe17e1f
 67e0c8d0
-24340076
-20400073
+24340073
+20400070
 204001dd
 20204544
 704ca400
@@ -139,6 +136,9 @@
 c02205c5
 c02005cf
 20204336
+20404110
+1a217e07
+c00385fa
 6fe44bab
 c297c80a
 6fe0c938
@@ -1334,7 +1334,7 @@
 203a48cc
 2020014f
 20400418
-2040005a
+20400057
 20404544
 d8e00001
 204046f4
@@ -1355,10 +1355,10 @@
 98467c00
 20628000
 20400418
-2040005a
+20400057
 20204822
 20400418
-2040005a
+20400057
 6fe0c8a5
 243a0578
 6fe0c88b
@@ -1530,13 +1530,14 @@
 20201e10
 70486501
 704cac00
-20400610
-20400600
-20400617
-202005fd
+20400614
+704be101
+20400601
+2040061b
+202005fe
 204001f5
 1a217e07
-c0008605
+c0008606
 704cb000
 20600000
 6fe0ccb0
@@ -1544,31 +1545,34 @@
 704cb001
 6fe0ccac
 1fe0fe01
-1fe17e03
+1fe67c02
+24410612
 67e0ccac
-c0000610
-c0008613
-c0010615
+c0000614
+c0008617
+c0010619
+20600000
+58000000
 20600000
 6fe0ccad
 67e0c83a
 20600000
 6fe0ccae
-20200611
+20200615
 6fe0ccaf
-20200611
+20200615
 7041e800
 20402243
 7843fc00
 782efc00
 78307c00
 79202a00
-20400624
+20400628
 5800ffff
 1fe27200
 efe08006
 08008608
-c2000620
+c2000624
 20600000
 70890d22
 20600000
Index: output/sched.rom
===================================================================
--- /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/output/sched.rom	(revision 5359)
+++ /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/output/sched.rom	(working copy)
@@ -131,7 +131,7 @@
 #bit4 MOUSE_ENABLE_ADC
 #bit5 MOUSE_ENABLE_KEYBOARD
 #bit6 MOUSE_ENABLE_24G_SEARCH_DONGLE
-5a
+4a
 
 #mouse flag byte4
 #bit0 MOUSE_ENABLE_24G_250Hz
Index: program/patch.prog
===================================================================
--- /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/program/patch.prog	(revision 5359)
+++ /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/program/patch.prog	(working copy)
@@ -116,11 +116,7 @@
 ifdef BLE
 	call p_mouse_le_name_load
 endif
-ifdef FREQ_TEST
-	call mouse_key_check_once
-	and rega,0x07,pdata
-	beq MOUSE_LMR_BUTTON,p_mouse_freq_test_mode
-endif
+
 	call mouse_param_init
 	//after mouse_param_init
 ifdef SELECT_ANGLE
@@ -273,6 +269,11 @@
 
 
 p_mouse_start_work:
+ifdef FREQ_TEST
+	call mouse_key_check_once
+	and rega,0x07,pdata
+	beq MOUSE_LMR_BUTTON,p_mouse_freq_test_mode
+endif
 	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
@@ -3636,6 +3637,7 @@
 	jam 0x01,mem_24g_tx_phy
 	jam 0,mem_mouse_ch_count
 	call p_mouse_set_ch_l
+	jam 0x01,mem_sensor_shutdown_flag
 p_mouse_freq_test_mode_loop:
 	call p_mouse_freq_test_mode_state_check
 	call p_mouse_freq_test_single_wave
@@ -3654,13 +3656,17 @@
 	
 	fetch 1,mem_mouse_ch_count
 	increase 1,pdata
-	and pdata,0x03,pdata
+	// and pdata,0x03,pdata
+	sub pdata,0x02,null
+	ncall p_mouse_ch_count_clear,positive
 	store 1,mem_mouse_ch_count
 	beq 0,p_mouse_set_ch_l
 	beq 1,p_mouse_set_ch_m
 	beq 2,p_mouse_set_ch_h
 	rtn
-
+p_mouse_ch_count_clear:
+	setarg 0
+	rtn
 p_mouse_set_ch_l:
 	fetch 1,mem_mouse_ch_l
 p_mouse_store_ch:
Index: program_patch/fcc_spec_code/patch_fcc.prog
===================================================================
--- /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/program_patch/fcc_spec_code/patch_fcc.prog	(revision 5358)
+++ /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/program_patch/fcc_spec_code/patch_fcc.prog	(working copy)
@@ -5,6 +5,7 @@
 	jam 0x01,mem_24g_tx_phy
 	jam 0,mem_mouse_ch_count
 	call p_mouse_set_ch_l
+	jam 0x01,mem_sensor_shutdown_flag
 p_mouse_freq_test_mode_loop:
 	call p_mouse_freq_test_mode_state_check
 	call p_mouse_freq_test_single_wave
@@ -23,13 +24,17 @@
 	
 	fetch 1,mem_mouse_ch_count
 	increase 1,pdata
-	and pdata,0x03,pdata
+	// and pdata,0x03,pdata
+	sub pdata,0x02,null
+	ncall p_mouse_ch_count_clear,positive
 	store 1,mem_mouse_ch_count
 	beq 0,p_mouse_set_ch_l
 	beq 1,p_mouse_set_ch_m
 	beq 2,p_mouse_set_ch_h
 	rtn
-
+p_mouse_ch_count_clear:
+	setarg 0
+	rtn
 p_mouse_set_ch_l:
 	fetch 1,mem_mouse_ch_l
 p_mouse_store_ch:
Index: program_patch/main_patch.prog
===================================================================
--- /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/program_patch/main_patch.prog	(revision 5359)
+++ /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/program_patch/main_patch.prog	(working copy)
@@ -116,11 +116,7 @@
 ifdef BLE
 	call p_mouse_le_name_load
 endif
-ifdef FREQ_TEST
-	call mouse_key_check_once
-	and rega,0x07,pdata
-	beq MOUSE_LMR_BUTTON,p_mouse_freq_test_mode
-endif
+
 	call mouse_param_init
 	//after mouse_param_init
 ifdef SELECT_ANGLE
@@ -273,6 +269,11 @@
 
 
 p_mouse_start_work:
+ifdef FREQ_TEST
+	call mouse_key_check_once
+	and rega,0x07,pdata
+	beq MOUSE_LMR_BUTTON,p_mouse_freq_test_mode
+endif
 	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
Index: sched/mouse.dat
===================================================================
--- /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/sched/mouse.dat	(revision 5359)
+++ /YC1308AC/branch/mouse_project/MingZhe_Project/branch/mouse_public_bt/mouse_public_pb_toggle/sched/mouse.dat	(working copy)
@@ -35,7 +35,7 @@
 #bit4 MOUSE_ENABLE_ADC
 #bit5 MOUSE_ENABLE_KEYBOARD
 #bit6 MOUSE_ENABLE_24G_SEARCH_DONGLE
-5a
+4a
 
 #mouse flag byte4
 #bit0 MOUSE_ENABLE_24G_250Hz
