Index: output/eeprom.dat
===================================================================
--- /YC1308AC/branch/mouse_project/mouse_public_sdk/output/eeprom.dat	(revision 1878)
+++ /YC1308AC/branch/mouse_project/mouse_public_sdk/output/eeprom.dat	(working copy)
@@ -2,8 +2,8 @@
 02
 aa
 55
-be
-19
+aa
+1a
 c2
 84
 00
@@ -6588,12 +6588,248 @@
 48
 c8
 c7
+6f
+e0
+c8
+cc
+c5
+13
+06
+71
+6f
+e0
+c8
+cf
+98
+46
+7c
+00
+24
+21
+06
+8c
+6f
+e0
+c8
+c9
+1f
+e6
+7c
+02
+24
+21
+06
+79
+6f
+e0
+c8
+c9
+c0
+00
+06
+8d
 20
+60
+00
+00
+6f
+e0
+c8
+c9
+68
+48
+c8
+ca
+98
+46
+7c
+00
+24
+62
+80
+00
+70
+48
+c9
+00
+68
+48
+c8
+c7
+6f
+e0
+c8
+cb
+c5
+13
+06
+82
+6f
+e0
+c8
+ce
+98
+46
+7c
+00
+24
+61
+00
+00
+6f
+e0
+c8
+c8
+c0
+00
+06
+8a
+1f
+e0
+ff
+ff
+67
+e0
+c8
+c8
+c0
+01
+06
+95
+c0
+00
+86
+97
+70
+41
+e8
+85
 20
-26
-f6
-89
-d4
+60
+00
+00
+70
+48
+c9
+00
+6f
+e0
+c8
+c8
+c0
+01
+86
+93
+1f
+e0
+fe
+01
+67
+e0
+c8
+c8
+c0
+00
+86
+97
+c0
+01
+06
+95
+70
+41
+e8
+05
+20
+60
+00
+00
+70
+41
+e8
+03
+20
+60
+00
+00
+70
+41
+e8
+00
+20
+60
+00
+00
+70
+48
+c8
+01
+70
+48
+c9
+00
+20
+60
+00
+00
+6f
+e0
+c8
+c9
+1f
+e0
+fe
+01
+67
+e0
+c8
+c9
+20
+60
+00
+00
+6f
+e0
+c8
+c9
+1f
+e6
+7c
+02
+24
+41
+06
+a8
+6f
+e0
+c8
+c9
+c1
+00
+00
+00
+1f
+e0
+ff
+ff
+67
+e0
+c8
+c9
+20
+60
+00
+00
+70
+48
+c9
+03
+20
+60
+00
+00
+d8
+25
 aa
 55
 40
@@ -6734,13 +6970,13 @@
 ab
 4b
 04
-09
+19
 4a
 00
 00
-80
-03
-1b
+00
+02
+1f
 aa
 55
 01
@@ -6795,10 +7031,10 @@
 04
 ff
 ff
-08
+ff
 0b
-0c
 0d
+0c
 ff
 ff
 ff
@@ -6822,8 +7058,8 @@
 24
 49
 03
-00
-00
+03
+01
 aa
 55
 03
@@ -7024,7 +7260,7 @@
 ca
 4b
 07
-06
+03
 aa
 55
 01
@@ -7933,252 +8169,16 @@
 02
 40
 00
-0a
+f6
 1f
 55
 aa
 aa
 55
-dc
-92
-c7
-0c
-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
-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
+53
+94
+7f
+ec
 ff
 ff
 ff
@@ -8188,5 +8188,5 @@
 ff
 ff
 ff
-9a
-82
+2a
+dc
Index: output/flash.dat
===================================================================
--- /YC1308AC/branch/mouse_project/mouse_public_sdk/output/flash.dat	(revision 1878)
+++ /YC1308AC/branch/mouse_project/mouse_public_sdk/output/flash.dat	(working copy)
@@ -2,8 +2,8 @@
 02
 aa
 55
-be
-19
+aa
+1a
 c2
 84
 00
@@ -6588,12 +6588,248 @@
 48
 c8
 c7
+6f
+e0
+c8
+cc
+c5
+13
+06
+71
+6f
+e0
+c8
+cf
+98
+46
+7c
+00
+24
+21
+06
+8c
+6f
+e0
+c8
+c9
+1f
+e6
+7c
+02
+24
+21
+06
+79
+6f
+e0
+c8
+c9
+c0
+00
+06
+8d
 20
+60
+00
+00
+6f
+e0
+c8
+c9
+68
+48
+c8
+ca
+98
+46
+7c
+00
+24
+62
+80
+00
+70
+48
+c9
+00
+68
+48
+c8
+c7
+6f
+e0
+c8
+cb
+c5
+13
+06
+82
+6f
+e0
+c8
+ce
+98
+46
+7c
+00
+24
+61
+00
+00
+6f
+e0
+c8
+c8
+c0
+00
+06
+8a
+1f
+e0
+ff
+ff
+67
+e0
+c8
+c8
+c0
+01
+06
+95
+c0
+00
+86
+97
+70
+41
+e8
+85
 20
-26
-f6
-89
-d4
+60
+00
+00
+70
+48
+c9
+00
+6f
+e0
+c8
+c8
+c0
+01
+86
+93
+1f
+e0
+fe
+01
+67
+e0
+c8
+c8
+c0
+00
+86
+97
+c0
+01
+06
+95
+70
+41
+e8
+05
+20
+60
+00
+00
+70
+41
+e8
+03
+20
+60
+00
+00
+70
+41
+e8
+00
+20
+60
+00
+00
+70
+48
+c8
+01
+70
+48
+c9
+00
+20
+60
+00
+00
+6f
+e0
+c8
+c9
+1f
+e0
+fe
+01
+67
+e0
+c8
+c9
+20
+60
+00
+00
+6f
+e0
+c8
+c9
+1f
+e6
+7c
+02
+24
+41
+06
+a8
+6f
+e0
+c8
+c9
+c1
+00
+00
+00
+1f
+e0
+ff
+ff
+67
+e0
+c8
+c9
+20
+60
+00
+00
+70
+48
+c9
+03
+20
+60
+00
+00
+d8
+25
 aa
 55
 40
@@ -6734,13 +6970,13 @@
 ab
 4b
 04
-09
+19
 4a
 00
 00
-80
-03
-1b
+00
+02
+1f
 aa
 55
 01
@@ -6795,10 +7031,10 @@
 04
 ff
 ff
-08
+ff
 0b
-0c
 0d
+0c
 ff
 ff
 ff
@@ -6822,8 +7058,8 @@
 24
 49
 03
-00
-00
+03
+01
 aa
 55
 03
@@ -7024,7 +7260,7 @@
 ca
 4b
 07
-06
+03
 aa
 55
 01
@@ -7933,252 +8169,16 @@
 02
 40
 00
-0a
+f6
 1f
 55
 aa
 aa
 55
-dc
-92
-c7
-0c
-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
-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
+53
+94
+7f
+ec
 ff
 ff
 ff
@@ -8188,5 +8188,5 @@
 ff
 ff
 ff
-9a
-82
+2a
+dc
Index: output/otp.dat
===================================================================
--- /YC1308AC/branch/mouse_project/mouse_public_sdk/output/otp.dat	(revision 1878)
+++ /YC1308AC/branch/mouse_project/mouse_public_sdk/output/otp.dat	(working copy)
@@ -2,8 +2,8 @@
 02
 aa
 55
-be
-19
+aa
+1a
 c2
 84
 00
@@ -6588,12 +6588,248 @@
 48
 c8
 c7
+6f
+e0
+c8
+cc
+c5
+13
+06
+71
+6f
+e0
+c8
+cf
+98
+46
+7c
+00
+24
+21
+06
+8c
+6f
+e0
+c8
+c9
+1f
+e6
+7c
+02
+24
+21
+06
+79
+6f
+e0
+c8
+c9
+c0
+00
+06
+8d
 20
+60
+00
+00
+6f
+e0
+c8
+c9
+68
+48
+c8
+ca
+98
+46
+7c
+00
+24
+62
+80
+00
+70
+48
+c9
+00
+68
+48
+c8
+c7
+6f
+e0
+c8
+cb
+c5
+13
+06
+82
+6f
+e0
+c8
+ce
+98
+46
+7c
+00
+24
+61
+00
+00
+6f
+e0
+c8
+c8
+c0
+00
+06
+8a
+1f
+e0
+ff
+ff
+67
+e0
+c8
+c8
+c0
+01
+06
+95
+c0
+00
+86
+97
+70
+41
+e8
+85
 20
-26
-f6
-89
-d4
+60
+00
+00
+70
+48
+c9
+00
+6f
+e0
+c8
+c8
+c0
+01
+86
+93
+1f
+e0
+fe
+01
+67
+e0
+c8
+c8
+c0
+00
+86
+97
+c0
+01
+06
+95
+70
+41
+e8
+05
+20
+60
+00
+00
+70
+41
+e8
+03
+20
+60
+00
+00
+70
+41
+e8
+00
+20
+60
+00
+00
+70
+48
+c8
+01
+70
+48
+c9
+00
+20
+60
+00
+00
+6f
+e0
+c8
+c9
+1f
+e0
+fe
+01
+67
+e0
+c8
+c9
+20
+60
+00
+00
+6f
+e0
+c8
+c9
+1f
+e6
+7c
+02
+24
+41
+06
+a8
+6f
+e0
+c8
+c9
+c1
+00
+00
+00
+1f
+e0
+ff
+ff
+67
+e0
+c8
+c9
+20
+60
+00
+00
+70
+48
+c9
+03
+20
+60
+00
+00
+d8
+25
 aa
 55
 40
@@ -6734,13 +6970,13 @@
 ab
 4b
 04
-09
+19
 4a
 00
 00
-80
-03
-1b
+00
+02
+1f
 aa
 55
 01
@@ -6795,10 +7031,10 @@
 04
 ff
 ff
-08
+ff
 0b
-0c
 0d
+0c
 ff
 ff
 ff
@@ -6822,8 +7058,8 @@
 24
 49
 03
-00
-00
+03
+01
 aa
 55
 03
@@ -7024,7 +7260,7 @@
 ca
 4b
 07
-06
+03
 aa
 55
 01
@@ -7933,13 +8169,13 @@
 03
 01
 00
-0a
+f6
 1f
 55
 aa
 aa
 55
-9e
-92
-69
-b4
+15
+94
+1d
+90
Index: output/program.lis
===================================================================
--- /YC1308AC/branch/mouse_project/mouse_public_sdk/output/program.lis	(revision 1878)
+++ /YC1308AC/branch/mouse_project/mouse_public_sdk/output/program.lis	(working copy)
@@ -2258,7 +2258,98 @@
 066b 6a214899 fetchr rega ,2 ,mem_rssi_signal_buf_ptr 
 066c 204025cb call rssi_average 
 066d 6048c8c7 storet 1 ,mem_rssi_avg_received 
-066e 202026f6 branch power_ctrl_rssi_avg_compare 
+066e 6fe0c8cc fetch 1 ,mem_rssi_dis_max_24g 
+066f c5130671 bmark1 mark_24g ,p_power_ctrl_start_next 
+0670 6fe0c8cf fetch 1 ,mem_rssi_dis_max_ble 
+
+p_power_ctrl_start_next:
+0671 98467c00 isub temp ,null 
+0672 2421068c nbranch p_power_ctrl_txpower_incrs_force ,positive 
+0673 6fe0c8c9 fetch 1 ,mem_power_ctrl_pac_succ_cnt 
+0674 1fe67c02 sub pdata ,2 ,null 
+0675 24210679 nbranch p_power_ctrl_txpower_decrs_check ,positive 
+0676 6fe0c8c9 fetch 1 ,mem_power_ctrl_pac_succ_cnt 
+0677 c000068d beq 0 ,p_power_ctrl_txpower_incrs 
+0678 20600000 rtn 
+
+p_power_ctrl_txpower_decrs_check:
+0679 6fe0c8c9 fetch 1 ,mem_power_ctrl_pac_succ_cnt 
+067a 6848c8ca fetcht 1 ,mem_power_ctrl_pac_succ_cnt_init 
+067b 98467c00 isub temp ,null 
+067c 24628000 nrtn zero 
+067d 7048c900 jam 0 ,mem_power_ctrl_pac_succ_cnt 
+
+p_power_ctrl_txpower_decrs:
+067e 6848c8c7 fetcht 1 ,mem_rssi_avg_received 
+067f 6fe0c8cb fetch 1 ,mem_rssi_dis_min_24g 
+0680 c5130682 bmark1 mark_24g ,p_power_ctrl_txpower_decrs_next 
+0681 6fe0c8ce fetch 1 ,mem_rssi_dis_min_ble 
+
+p_power_ctrl_txpower_decrs_next:
+0682 98467c00 isub temp ,null 
+0683 24610000 nrtn positive 
+0684 6fe0c8c8 fetch 1 ,mem_power_ctrl_level 
+0685 c000068a beq 0 ,p_power_ctrl_decrs_level0 
+0686 1fe0ffff increase -1 ,pdata 
+0687 67e0c8c8 store 1 ,mem_power_ctrl_level 
+0688 c0010695 beq 2 ,p_power_ctrl_decrs_level2 
+0689 c0008697 beq 1 ,p_power_ctrl_decrs_level1 
+
+p_power_ctrl_decrs_level0:
+068a 7041e885 jam tx_power_f5db ,mem_tx_power 
+068b 20600000 rtn 
+
+p_power_ctrl_txpower_incrs_force:
+068c 7048c900 jam 0 ,mem_power_ctrl_pac_succ_cnt 
+
+p_power_ctrl_txpower_incrs:
+068d 6fe0c8c8 fetch 1 ,mem_power_ctrl_level 
+068e c0018693 beq 3 ,p_power_ctrl_incrs_level3 
+068f 1fe0fe01 increase 1 ,pdata 
+0690 67e0c8c8 store 1 ,mem_power_ctrl_level 
+0691 c0008697 beq 1 ,p_power_ctrl_incrs_level1 
+0692 c0010695 beq 2 ,p_power_ctrl_incrs_level2 
+
+p_power_ctrl_incrs_level3:
+0693 7041e805 jam tx_power_5db ,mem_tx_power 
+0694 20600000 rtn 
+
+p_power_ctrl_decrs_level2:
+
+p_power_ctrl_incrs_level2:
+0695 7041e803 jam tx_power_3db ,mem_tx_power 
+0696 20600000 rtn 
+
+p_power_ctrl_decrs_level1:
+
+p_power_ctrl_incrs_level1:
+0697 7041e800 jam tx_power_0db ,mem_tx_power 
+0698 20600000 rtn 
+
+p_power_ctrl_pac_succ_cnt_init:
+0699 7048c801 jam 1 ,mem_power_ctrl_level 
+069a 7048c900 jam 0 ,mem_power_ctrl_pac_succ_cnt 
+069b 20600000 rtn 
+
+p_power_ctrl_pac_succ_incrs:
+069c 6fe0c8c9 fetch 1 ,mem_power_ctrl_pac_succ_cnt 
+069d 1fe0fe01 increase 1 ,pdata 
+069e 67e0c8c9 store 1 ,mem_power_ctrl_pac_succ_cnt 
+069f 20600000 rtn 
+
+p_power_ctrl_pac_succ_decrs:
+06a0 6fe0c8c9 fetch 1 ,mem_power_ctrl_pac_succ_cnt 
+06a1 1fe67c02 sub pdata ,2 ,null 
+06a2 244106a8 ncall p_power_ctrl_pac_succ_cnt_reinit ,positive 
+06a3 6fe0c8c9 fetch 1 ,mem_power_ctrl_pac_succ_cnt 
+06a4 c1000000 rtneq 0 
+06a5 1fe0ffff increase -1 ,pdata 
+06a6 67e0c8c9 store 1 ,mem_power_ctrl_pac_succ_cnt 
+06a7 20600000 rtn 
+
+p_power_ctrl_pac_succ_cnt_reinit:
+06a8 7048c903 jam 3 ,mem_power_ctrl_pac_succ_cnt 
+06a9 20600000 rtn 
               org 0x3bc1
 
 mouse_init:
Index: output/ramcode.rom
===================================================================
--- /YC1308AC/branch/mouse_project/mouse_public_sdk/output/ramcode.rom	(revision 1878)
+++ /YC1308AC/branch/mouse_project/mouse_public_sdk/output/ramcode.rom	(working copy)
@@ -1644,4 +1644,63 @@
 6a214899
 204025cb
 6048c8c7
-202026f6
+6fe0c8cc
+c5130671
+6fe0c8cf
+98467c00
+2421068c
+6fe0c8c9
+1fe67c02
+24210679
+6fe0c8c9
+c000068d
+20600000
+6fe0c8c9
+6848c8ca
+98467c00
+24628000
+7048c900
+6848c8c7
+6fe0c8cb
+c5130682
+6fe0c8ce
+98467c00
+24610000
+6fe0c8c8
+c000068a
+1fe0ffff
+67e0c8c8
+c0010695
+c0008697
+7041e885
+20600000
+7048c900
+6fe0c8c8
+c0018693
+1fe0fe01
+67e0c8c8
+c0008697
+c0010695
+7041e805
+20600000
+7041e803
+20600000
+7041e800
+20600000
+7048c801
+7048c900
+20600000
+6fe0c8c9
+1fe0fe01
+67e0c8c9
+20600000
+6fe0c8c9
+1fe67c02
+244106a8
+6fe0c8c9
+c1000000
+1fe0ffff
+67e0c8c9
+20600000
+7048c903
+20600000
Index: output/sched.rom
===================================================================
--- /YC1308AC/branch/mouse_project/mouse_public_sdk/output/sched.rom	(revision 1878)
+++ /YC1308AC/branch/mouse_project/mouse_public_sdk/output/sched.rom	(working copy)
@@ -98,7 +98,7 @@
 #bit3 MOUSE_ENABLE_WAKEUP_FROM_POWER
 #bit4 MOUSE_ENABLE_16M
 #bit5 MOUSE_ENABLE_USB
-09
+19
 
 #mouse flag byte3
 #bit0 MOUSE_ENABLE_SPI2
@@ -141,7 +141,7 @@
 #bit5 MOUSE_ENABLE_PB_BUTTON_CONNECT_GND
 #bit6 MOUSE_ENABLE_DPI_KEY_CONNECT_ADC
 #bit7 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING
-80
+00
 
 #mouse flag byte7
 #bit0 MOUSE_ENABLE_AUTO_24G_PARING
@@ -152,7 +152,7 @@
 #bit5 MOUSE_ENABLE_COMMBINATION_KEY_BY_BT_DISCOVERY
 #bit6 MOUSE_ENABLE_DPI_KEY_LONG_PRESS_DISCONVERY
 #bit7 MOUSE_ENABLE_PB_BUTTON_LONG_PRESS_DISCONVERY
-03
+02
 
 #mouse flag byte8
 #bit0 MOUSE_ENABLE_SMOOTHER
@@ -161,7 +161,7 @@
 #bit3 MOUSE_ENABLE_LE_BATTERY_SERVICE_CANCEL
 #bit4 MOUSE_ENABLE_WHEEL_WAKE_UP_CANCEL
 #bit5 MOUSE_ENABLE_DOUBLE_DPI_KEY
-1b
+1f
 
 mem_mouse_led_new_interface_config:
 #bit0 MOUSE_ENABLE_1IO2LED
@@ -197,11 +197,11 @@
 mem_whee_b_data_gpio:04
 mem_config_device_24g_led_gpio:ff
 mem_config_device_bt1_led_gpio:ff
-mem_select_sensor_angle_gpio:08
+mem_select_sensor_angle_gpio:ff
 
 mem_lbutton_gpio:0b
-mem_rbutton_gpio:0c
-mem_mbutton_gpio:0d
+mem_rbutton_gpio:0d
+mem_mbutton_gpio:0c
 mem_config_select_device_button_gpio:ff
 mem_whee_ta_data_gpio:ff
 mem_whee_tb_data_gpio:ff
@@ -214,8 +214,8 @@
 mem_firebutton_gpio:ff
 
 mem_sensor_angle_default:03	#00--6CLK   01--9CLK   02--12CLK   03--3CLK
-mem_sensor_angle_switch:00	#00--6CLK   01--9CLK   02--12CLK   03--3CLK
-mem_config_sensor_dpi:00		#00--1200   01--1600
+mem_sensor_angle_switch:03	#00--6CLK   01--9CLK   02--12CLK   03--3CLK
+mem_config_sensor_dpi:01		#00--1200   01--1600
 
 mem_mouse_logo_led_gpio:ff
 mem_mouse_logo_led_on_time_init:58 02	#1min
@@ -292,7 +292,7 @@
 
 #bit0:mouse_key_l    bit1:mouse_key_r  bit2:mouse_key_m
 mem_mouse_commbination_key_bt:07
-mem_mouse_commbination_key_24g:06
+mem_mouse_commbination_key_24g:03
 
 mem_store_information_delay_timer_init:02
 
Index: program/patch.prog
===================================================================
--- /YC1308AC/branch/mouse_project/mouse_public_sdk/program/patch.prog	(revision 1878)
+++ /YC1308AC/branch/mouse_project/mouse_public_sdk/program/patch.prog	(working copy)
@@ -3,7 +3,7 @@
 define FIRE_KEY
 //define UART_LOG
 //define RSSI_SORT
-
+//define MORE_POWER_CTRL
 
 	bbit1 8,pf_patch_ext
 	beq patch00_0,p_soft_reset
@@ -2824,7 +2824,103 @@
 	call rssi_average
 endif
 	storet 1,mem_rssi_avg_received
-	branch power_ctrl_rssi_avg_compare
+    fetch 1,mem_rssi_dis_max_24g
+	bmark1 mark_24g,p_power_ctrl_start_next
+	fetch 1,mem_rssi_dis_max_ble
+p_power_ctrl_start_next:
+	isub temp,null
+	nbranch p_power_ctrl_txpower_incrs_force,positive
+	fetch 1,mem_power_ctrl_pac_succ_cnt
+	sub pdata,2,null
+	nbranch p_power_ctrl_txpower_decrs_check,positive
+	fetch 1,mem_power_ctrl_pac_succ_cnt
+	beq 0,p_power_ctrl_txpower_incrs
+	rtn
+
+p_power_ctrl_txpower_decrs_check:
+	fetch 1,mem_power_ctrl_pac_succ_cnt
+	fetcht 1,mem_power_ctrl_pac_succ_cnt_init
+	isub temp,null
+	nrtn zero
+	jam 0,mem_power_ctrl_pac_succ_cnt
+p_power_ctrl_txpower_decrs:
+	fetcht 1,mem_rssi_avg_received
+	fetch 1,mem_rssi_dis_min_24g
+	bmark1 mark_24g,p_power_ctrl_txpower_decrs_next
+	fetch 1,mem_rssi_dis_min_ble
+p_power_ctrl_txpower_decrs_next:	
+	isub temp,null
+	nrtn positive
+	fetch 1,mem_power_ctrl_level
+	beq 0,p_power_ctrl_decrs_level0
+	increase -1,pdata
+	store 1,mem_power_ctrl_level
+ifdef MORE_POWER_CTRL	
+	beq 3,p_power_ctrl_decrs_level3
+endif
+	beq 2,p_power_ctrl_decrs_level2
+	beq 1,p_power_ctrl_decrs_level1
+p_power_ctrl_decrs_level0: //-5dBm
+	jam TX_POWER_f5DB,mem_tx_power
+	rtn	
+
+
+p_power_ctrl_txpower_incrs_force:
+	jam 0,mem_power_ctrl_pac_succ_cnt
+p_power_ctrl_txpower_incrs:
+	fetch 1,mem_power_ctrl_level
+ifdef MORE_POWER_CTRL		
+	beq 4,p_power_ctrl_incrs_level4
+else
+	beq 3,p_power_ctrl_incrs_level3
+endif
+	increase 1,pdata
+	store 1,mem_power_ctrl_level
+	beq 1,p_power_ctrl_incrs_level1
+	beq 2,p_power_ctrl_incrs_level2
+ifdef MORE_POWER_CTRL	
+	beq 3,p_power_ctrl_incrs_level3
+p_power_ctrl_incrs_level4:	//+7dBm
+	jam TX_POWER_7DB,mem_tx_power
+	rtn		
+p_power_ctrl_decrs_level3:	
+endif
+p_power_ctrl_incrs_level3:	//+5dBm
+	jam TX_POWER_5DB,mem_tx_power
+	rtn	
+p_power_ctrl_decrs_level2:	
+p_power_ctrl_incrs_level2:	//+6dBm
+	jam TX_POWER_3DB,mem_tx_power
+	rtn
+p_power_ctrl_decrs_level1:
+p_power_ctrl_incrs_level1:	//0dBm
+	jam TX_POWER_0DB,mem_tx_power
+	rtn
+
+p_power_ctrl_pac_succ_cnt_init:
+	jam 1,mem_power_ctrl_level
+	jam 0,mem_power_ctrl_pac_succ_cnt
+	rtn
+
+p_power_ctrl_pac_succ_incrs:
+	fetch 1,mem_power_ctrl_pac_succ_cnt
+	increase 1,pdata
+	store 1,mem_power_ctrl_pac_succ_cnt
+	rtn
+
+p_power_ctrl_pac_succ_decrs:
+	fetch 1,mem_power_ctrl_pac_succ_cnt
+	sub pdata,2,null
+	ncall p_power_ctrl_pac_succ_cnt_reinit,positive
+	fetch 1,mem_power_ctrl_pac_succ_cnt
+	rtneq 0
+	increase -1,pdata
+	store 1,mem_power_ctrl_pac_succ_cnt
+	rtn
+
+p_power_ctrl_pac_succ_cnt_reinit:
+	jam 3,mem_power_ctrl_pac_succ_cnt
+	rtn
 
 ifdef RSSI_SORT
 p_rssi_average:
Index: sched/mouse.dat
===================================================================
--- /YC1308AC/branch/mouse_project/mouse_public_sdk/sched/mouse.dat	(revision 1878)
+++ /YC1308AC/branch/mouse_project/mouse_public_sdk/sched/mouse.dat	(working copy)
@@ -31,7 +31,7 @@
 #bit3 MOUSE_ENABLE_WAKEUP_FROM_POWER
 #bit4 MOUSE_ENABLE_16M
 #bit5 MOUSE_ENABLE_USB
-09
+19
 
 #mouse flag byte3
 #bit0 MOUSE_ENABLE_SPI2
@@ -74,7 +74,7 @@
 #bit5 MOUSE_ENABLE_PB_BUTTON_CONNECT_GND
 #bit6 MOUSE_ENABLE_DPI_KEY_CONNECT_ADC
 #bit7 MOUSE_ENABLE_24G_FIRST_AUTO_PAIRING
-80
+00
 
 #mouse flag byte7
 #bit0 MOUSE_ENABLE_AUTO_24G_PARING
@@ -85,7 +85,7 @@
 #bit5 MOUSE_ENABLE_COMMBINATION_KEY_BY_BT_DISCOVERY
 #bit6 MOUSE_ENABLE_DPI_KEY_LONG_PRESS_DISCONVERY
 #bit7 MOUSE_ENABLE_PB_BUTTON_LONG_PRESS_DISCONVERY
-03
+02
 
 #mouse flag byte8
 #bit0 MOUSE_ENABLE_SMOOTHER
@@ -94,7 +94,7 @@
 #bit3 MOUSE_ENABLE_LE_BATTERY_SERVICE_CANCEL
 #bit4 MOUSE_ENABLE_WHEEL_WAKE_UP_CANCEL
 #bit5 MOUSE_ENABLE_DOUBLE_DPI_KEY
-1b
+1f
 
 mem_mouse_led_new_interface_config:
 #bit0 MOUSE_ENABLE_1IO2LED
@@ -130,11 +130,11 @@
 mem_whee_b_data_gpio:04
 mem_config_device_24g_led_gpio:ff
 mem_config_device_bt1_led_gpio:ff
-mem_select_sensor_angle_gpio:08
+mem_select_sensor_angle_gpio:ff
 
 mem_lbutton_gpio:0b
-mem_rbutton_gpio:0c
-mem_mbutton_gpio:0d
+mem_rbutton_gpio:0d
+mem_mbutton_gpio:0c
 mem_config_select_device_button_gpio:ff
 mem_whee_ta_data_gpio:ff
 mem_whee_tb_data_gpio:ff
@@ -147,8 +147,8 @@
 mem_firebutton_gpio:ff
 
 mem_sensor_angle_default:03	#00--6CLK   01--9CLK   02--12CLK   03--3CLK
-mem_sensor_angle_switch:00	#00--6CLK   01--9CLK   02--12CLK   03--3CLK
-mem_config_sensor_dpi:00		#00--1200   01--1600
+mem_sensor_angle_switch:03	#00--6CLK   01--9CLK   02--12CLK   03--3CLK
+mem_config_sensor_dpi:01		#00--1200   01--1600
 
 mem_mouse_logo_led_gpio:ff
 mem_mouse_logo_led_on_time_init:58 02	#1min
@@ -225,7 +225,7 @@
 
 #bit0:mouse_key_l    bit1:mouse_key_r  bit2:mouse_key_m
 mem_mouse_commbination_key_bt:07
-mem_mouse_commbination_key_24g:06
+mem_mouse_commbination_key_24g:03
 
 mem_store_information_delay_timer_init:02
 
