Index: output/eeprom.dat
===================================================================
--- /branch/mouse_project/ZJL_Project/DJC/Only24G_WK3/output/eeprom.dat	(revision 3181)
+++ /branch/mouse_project/ZJL_Project/DJC/Only24G_WK3/output/eeprom.dat	(working copy)
@@ -1015,11 +1015,11 @@
 c0
 18
 01
-04
+03
 c0
 18
 81
-2f
+2e
 20
 40
 40
@@ -1037,14 +1037,10 @@
 03
 01
 20
-40
+20
 00
 f7
 20
-20
-2b
-fa
-20
 40
 01
 38
@@ -1055,15 +1051,15 @@
 c0
 6c
 01
-0a
+09
 c0
 2d
 01
-23
+22
 c0
 68
 81
-34
+33
 20
 20
 40
@@ -1215,7 +1211,7 @@
 20
 20
 01
-28
+27
 20
 40
 01
@@ -1249,6 +1245,10 @@
 64
 13
 20
+00
+2e
+e0
+20
 20
 41
 3a
@@ -1261,9 +1261,9 @@
 64
 13
 20
-40
-2b
-fa
+00
+2e
+e0
 20
 40
 00
@@ -1275,7 +1275,7 @@
 c0
 6c
 01
-0a
+09
 20
 60
 00
@@ -4517,12 +4517,12 @@
 07
 d0
 68
-00
-cb
+01
+4b
 f7
-c0
-7f
-83
+c2
+85
+03
 c2
 20
 40
@@ -4565,16 +4565,16 @@
 04
 4b
 68
-00
-cb
+01
+4b
 f7
 1f
 e0
 fe
 01
 60
-00
-cb
+01
+4b
 f7
 68
 00
@@ -6384,8 +6384,8 @@
 20
 3f
 90
-22
-2c
+6e
+ac
 aa
 55
 08
@@ -7028,7 +7028,7 @@
 00
 40
 4b
-03
+04
 00
 aa
 55
@@ -7093,5 +7093,5 @@
 4c
 04
 01
-c1
-ab
+ba
+93
Index: output/program.lis
===================================================================
--- /branch/mouse_project/ZJL_Project/DJC/Only24G_WK3/output/program.lis	(revision 3181)
+++ /branch/mouse_project/ZJL_Project/DJC/Only24G_WK3/output/program.lis	(working copy)
@@ -338,88 +338,88 @@
 
 p_mouse_init_sensor:
 00fb 204040d9 call mouse_read_sensor_id 
-00fc c0180104 beq p32xx_id1 ,p_mouse_init_p32xx_id2_judge 
-00fd c018812f beq p3065_id1 ,p_mouse_p3065_init_param 
+00fc c0180103 beq p32xx_id1 ,p_mouse_init_p32xx_id2_judge 
+00fd c018812e beq p3065_id1 ,p_mouse_p3065_init_param 
 00fe 204040d1 call mouse_twspi_reset 
 00ff 200003e8 nop 1000 
 0100 202000fb branch p_mouse_init_sensor 
 
 p_mouse_init_sensor_reset:
 0101 704b0301 jam 1 ,mem_mouse_init_sensor_reset_flag 
-0102 204000f7 call p_mouse_init_sunt 
-0103 20202bfa branch delays_5ms 
+0102 202000f7 branch p_mouse_init_sunt 
 
 p_mouse_init_p32xx_id2_judge:
-0104 20400138 call p_mouse_sensor_poweron 
-0105 6800c6de fetch 1 ,mem_sensor_id2 
-0106 c06c010a beq p8009_id2 ,p_mouse_8009_init_param 
-0107 c02d0123 beq p8650_id2 ,p_mouse_8650_init_param 
-0108 c0688134 beq s201_id2 ,p_mouse_s201_init_param 
-0109 202040e1 branch mouse_init_p32xx_id2_judge + 1 
+0103 20400138 call p_mouse_sensor_poweron 
+0104 6800c6de fetch 1 ,mem_sensor_id2 
+0105 c06c0109 beq p8009_id2 ,p_mouse_8009_init_param 
+0106 c02d0122 beq p8650_id2 ,p_mouse_8650_init_param 
+0107 c0688133 beq s201_id2 ,p_mouse_s201_init_param 
+0108 202040e1 branch mouse_init_p32xx_id2_judge + 1 
 
 p_mouse_8009_init_param:
-010a 58000016 setarg 0x16 
-010b 20406414 call twspi_read 
-010c 1fe67cbd sub pdata ,0xbd ,null 
-010d 242280fb nbranch p_mouse_init_sensor ,zero 
-010e 58000019 setarg 0x19 
-010f 20406414 call twspi_read 
-0110 1fe67c55 sub pdata ,0x55 ,null 
-0111 242280fb nbranch p_mouse_init_sensor ,zero 
-0112 5800001b setarg 0x1b 
-0113 20406414 call twspi_read 
-0114 1fe67c1d sub pdata ,0x1d ,null 
-0115 242280fb nbranch p_mouse_init_sensor ,zero 
-0116 7046e007 jam p8009 ,mem_config_sensor_type 
-0117 204040f6 call mouse_sensor_disable_wp 
-0118 58000206 setarg 0x0206 
-0119 20406413 call twspi_write 
-011a 58006909 setarg 0x6909 
-011b 20406413 call twspi_write 
-011c 5800280d setarg 0x280d 
-011d 20406413 call twspi_write 
-011e 58009f0e setarg 0x9f0e 
-011f 20406413 call twspi_write 
-0120 5800ba0f setarg 0xba0f 
-0121 20406413 call twspi_write 
-0122 202040f4 branch mouse_sensor_enable_wp 
+0109 58000016 setarg 0x16 
+010a 20406414 call twspi_read 
+010b 1fe67cbd sub pdata ,0xbd ,null 
+010c 242280fb nbranch p_mouse_init_sensor ,zero 
+010d 58000019 setarg 0x19 
+010e 20406414 call twspi_read 
+010f 1fe67c55 sub pdata ,0x55 ,null 
+0110 242280fb nbranch p_mouse_init_sensor ,zero 
+0111 5800001b setarg 0x1b 
+0112 20406414 call twspi_read 
+0113 1fe67c1d sub pdata ,0x1d ,null 
+0114 242280fb nbranch p_mouse_init_sensor ,zero 
+0115 7046e007 jam p8009 ,mem_config_sensor_type 
+0116 204040f6 call mouse_sensor_disable_wp 
+0117 58000206 setarg 0x0206 
+0118 20406413 call twspi_write 
+0119 58006909 setarg 0x6909 
+011a 20406413 call twspi_write 
+011b 5800280d setarg 0x280d 
+011c 20406413 call twspi_write 
+011d 58009f0e setarg 0x9f0e 
+011e 20406413 call twspi_write 
+011f 5800ba0f setarg 0xba0f 
+0120 20406413 call twspi_write 
+0121 202040f4 branch mouse_sensor_enable_wp 
 
 p_mouse_8650_init_param:
-0123 7046e008 jam p8650 ,mem_config_sensor_type 
-0124 58008006 setarg 0x8006 
-0125 20406413 call twspi_write 
-0126 20407ec1 call delay_10ms 
-0127 da604b0f arg mem_sensor_8650_init ,regc 
+0122 7046e008 jam p8650 ,mem_config_sensor_type 
+0123 58008006 setarg 0x8006 
+0124 20406413 call twspi_write 
+0125 20407ec1 call delay_10ms 
+0126 da604b0f arg mem_sensor_8650_init ,regc 
 
 p_sensor_wr_seq:
-0128 ea610000 ifetch 2 ,regc 
-0129 d840ffff arg 0xffff ,temp 
-012a 98467c00 isub temp ,null 
-012b 20628000 rtn zero 
-012c 20406413 call twspi_write 
-012d 1a60a602 increase 2 ,regc 
-012e 20200128 branch p_sensor_wr_seq 
+0127 ea610000 ifetch 2 ,regc 
+0128 d840ffff arg 0xffff ,temp 
+0129 98467c00 isub temp ,null 
+012a 20628000 rtn zero 
+012b 20406413 call twspi_write 
+012c 1a60a602 increase 2 ,regc 
+012d 20200127 branch p_sensor_wr_seq 
 
 p_mouse_p3065_init_param:
-012f 20400138 call p_mouse_sensor_poweron 
-0130 6800c6de fetch 1 ,mem_sensor_id2 
-0131 c03840e8 beq p3065_xy_id2 ,mouse_p3065xy_init_param 
-0132 7046e001 jam p3065 ,mem_config_sensor_type 
-0133 20600000 rtn 
+012e 20400138 call p_mouse_sensor_poweron 
+012f 6800c6de fetch 1 ,mem_sensor_id2 
+0130 c03840e8 beq p3065_xy_id2 ,mouse_p3065xy_init_param 
+0131 7046e001 jam p3065 ,mem_config_sensor_type 
+0132 20600000 rtn 
 
 p_mouse_s201_init_param:
-0134 7046e009 jam s201 ,mem_config_sensor_type 
-0135 58000022 setarg 0x0022 
-0136 20406413 call twspi_write 
+0133 7046e009 jam s201 ,mem_config_sensor_type 
+0134 58000022 setarg 0x0022 
+0135 20406413 call twspi_write 
+0136 20002ee0 nop 12000 
 0137 2020413a branch mouse_3205_3t_init_param + 1 
 
 p_mouse_sensor_poweron:
 0138 58008006 setarg 0x8006 
 0139 20406413 call twspi_write 
-013a 20402bfa call delays_5ms 
+013a 20002ee0 nop 12000 
 013b 204000ef call p_mouse_dpi_config 
 013c 6800c6de fetch 1 ,mem_sensor_id2 
-013d c06c010a beq p8009_id2 ,p_mouse_8009_init_param 
+013d c06c0109 beq p8009_id2 ,p_mouse_8009_init_param 
 013e 20600000 rtn 
 
 p_mouse_sensor_powerdown:
@@ -1564,8 +1564,8 @@
 p_g24_auto_pair_start_loop:
 0466 20402afa call lpo_calibration 
 0467 200007d0 nop 2000 
-0468 6800cbf7 fetch 1 ,mem_24g_check_dongle_times 
-0469 c07f83c2 beq 0xff ,p_g24_stop_g24_mode 
+0468 68014bf7 fetch 2 ,mem_24g_check_dongle_times 
+0469 c28503c2 bbit1 10 ,p_g24_stop_g24_mode 
 046a 20400399 call p_g24_transmit_receive_ack 
 046b 242c0474 nbranch p_g24_auto_pair_retry ,sync 
 046c 24378474 nbranch p_g24_auto_pair_retry ,user3 
@@ -1578,9 +1578,9 @@
 0473 2020044b branch p_g24_tx_attemp_dongle_succ 
 
 p_g24_auto_pair_retry:
-0474 6800cbf7 fetch 1 ,mem_24g_check_dongle_times 
+0474 68014bf7 fetch 2 ,mem_24g_check_dongle_times 
 0475 1fe0fe01 increase 1 ,pdata 
-0476 6000cbf7 store 1 ,mem_24g_check_dongle_times 
+0476 60014bf7 store 2 ,mem_24g_check_dongle_times 
 0477 6800cd08 fetch 1 ,mem_24g_auto_paring_switch 
 0478 1fe0fe01 increase 1 ,pdata 
 0479 1fe17e03 and_into 3 ,pdata 
@@ -6106,8 +6106,6 @@
 2bf7 20407f91 call ceiling 
 2bf8 6000c178 store 1 ,mem_lpm_xtalcnt 
 2bf9 20007530 nop 30000 
-
-delays_5ms:
 2bfa 20007530 nop 30000 
 2bfb 20007530 nop 30000 
 2bfc 20600000 rtn 
Index: program/bt.prog
===================================================================
--- /branch/mouse_project/ZJL_Project/DJC/Only24G_WK3/program/bt.prog	(revision 3181)
+++ /branch/mouse_project/ZJL_Project/DJC/Only24G_WK3/program/bt.prog	(working copy)
@@ -3962,7 +3962,6 @@
 	call ceiling
 	store 1,mem_lpm_xtalcnt
 	nop 30000
-delays_5ms:
 	nop 30000
 	nop 30000	
 	rtn
Index: program/patch.prog
===================================================================
--- /branch/mouse_project/ZJL_Project/DJC/Only24G_WK3/program/patch.prog	(revision 3181)
+++ /branch/mouse_project/ZJL_Project/DJC/Only24G_WK3/program/patch.prog	(working copy)
@@ -460,8 +460,7 @@
 
 p_mouse_init_sensor_reset:
 	jam 1,mem_mouse_init_sensor_reset_flag
-	call p_mouse_init_sunt
-	branch delays_5ms
+	branch p_mouse_init_sunt
 
 p_mouse_init_p32xx_id2_judge:
 	call p_mouse_sensor_poweron
@@ -524,12 +523,13 @@
 	jam S201,mem_config_sensor_type
 	setarg 0x0022	// reset to factory settings
 	call twspi_write
+	nop 12000
 	branch mouse_3205_3t_init_param+1
 
 p_mouse_sensor_poweron:
 	setarg 0x8006	// reset to factory settings
 	call twspi_write
-	call delays_5ms
+	nop 12000
 	call p_mouse_dpi_config
 	fetch 1,mem_sensor_id2
 	beq P8009_ID2,p_mouse_8009_init_param
@@ -874,7 +874,7 @@
 ifdef BLE
 p_mouse_le_bb_event_connected:
 	jam 0,mem_mouse_long_mult_flag
-	//call p_mouse_init_sensor_reset
+	call p_mouse_init_sensor_reset
 	call p_mouse_data_init
 	branch mouse_le_bb_event_connected
 
@@ -2744,8 +2744,8 @@
 p_g24_auto_pair_start_loop:
 	call lpo_calibration
 	nop 2000
-	fetch 1,mem_24g_check_dongle_times
-	beq 0xff,p_g24_stop_g24_mode
+	fetch 2,mem_24g_check_dongle_times
+	bbit1 10,p_g24_stop_g24_mode
 	call p_g24_transmit_receive_ack
 	nbranch p_g24_auto_pair_retry,sync
 	nbranch p_g24_auto_pair_retry,user3
@@ -2756,11 +2756,11 @@
 	isub temp,null
 	branch p_g24_start_pairing_sm1,zero
 	branch p_g24_tx_attemp_dongle_succ
-
+	
 p_g24_auto_pair_retry:
-	fetch 1,mem_24g_check_dongle_times
+	fetch 2,mem_24g_check_dongle_times
 	increase 1,pdata
-	store 1,mem_24g_check_dongle_times
+	store 2,mem_24g_check_dongle_times
 	fetch 1,mem_24g_auto_paring_switch
 	increase 1,pdata
 	and_into 3,pdata
Index: sched/mouse.dat
===================================================================
--- /branch/mouse_project/ZJL_Project/DJC/Only24G_WK3/sched/mouse.dat	(revision 3181)
+++ /branch/mouse_project/ZJL_Project/DJC/Only24G_WK3/sched/mouse.dat	(working copy)
@@ -260,7 +260,7 @@
 mem_24g_pairing_sm:ff
 mem_24g_common_temp:00 00 00 00 00 00 00 00 00 00
 mem_24g_enter_hibernate:80 ee 36#10 min
-mem_firmware_version:03 00
+mem_firmware_version:04 00
 
 mem_device_flag:
 01
