Index: do.bat
===================================================================
--- /1121s/1121se/branch/mouse/mouse_public_1M/do.bat	(revision 3440)
+++ /1121s/1121se/branch/mouse/mouse_public_1M/do.bat	(working copy)
@@ -81,6 +81,8 @@
 perl ../util/mergepatch.pl mouse_ble_att_list usb_kbdata_vendor_define usb_kbdata usb_msdata usb_devicedata usb_confdata keyboard_ble_hid_map_only_keyboard keyboard_ble_hid_map_magic_keyboard keyboard_ble_hid_map_n_key_rollover_keyboard ble_shutter_gatt_list ble_shutter_key_value_list   
 perl ../util/romcrc.pl romcode.rom
 perl  ../util/mergepatch.pl otp
+perl ../util/otpcheck.pl 
+echo.
 
 
 if "%device_option%" equ "mouse" (
Index: eotp.bat
===================================================================
--- /1121s/1121se/branch/mouse/mouse_public_1M/eotp.bat	(nonexistent)
+++ /1121s/1121se/branch/mouse/mouse_public_1M/eotp.bat	(working copy)
@@ -0,0 +1,7 @@
+call do.bat eep
+set baud=a0
+e pu
+e 8043 00
+e otp output/otp.dat 0
+e otr 0 20
+e ku
\ No newline at end of file
Index: format/g24_protocol_stack/24g_reconn.format
===================================================================
--- /1121s/1121se/branch/mouse/mouse_public_1M/format/g24_protocol_stack/24g_reconn.format	(revision 3440)
+++ /1121s/1121se/branch/mouse/mouse_public_1M/format/g24_protocol_stack/24g_reconn.format	(working copy)
@@ -25,5 +25,6 @@
 2 FAST_CONN_AND_3_0_ADDR
 3 RECEIVER_AND_3_0_ADDR
 4 PAIR_AND_3_0_ADDR
+5 PAIR_AND_RECEIVER
 )
 
Index: output/eeprom.dat
===================================================================
--- /1121s/1121se/branch/mouse/mouse_public_1M/output/eeprom.dat	(revision 3440)
+++ /1121s/1121se/branch/mouse/mouse_public_1M/output/eeprom.dat	(working copy)
@@ -2,36 +2,44 @@
 02
 aa
 55
-be
-00
+2a
+02
 c2
 84
 00
-06
+07
 c0
 3c
 80
-09
+0b
+c0
+47
+80
+0d
 c0
 48
 00
-0b
+20
 c0
 4b
 80
-1d
+4b
 c0
 75
 00
-2c
+87
 20
 20
 23
 3e
 c0
+5f
+80
+32
+c0
 64
 80
-1e
+3d
 c1
 7f
 80
@@ -48,6 +56,82 @@
 20
 4d
 f6
+1a
+62
+7e
+00
+c0
+1d
+00
+10
+20
+20
+53
+dc
+20
+40
+59
+2b
+20
+40
+59
+33
+6f
+e0
+c6
+17
+24
+3a
+59
+0a
+6f
+e0
+c5
+f9
+c0
+02
+d9
+8c
+c0
+00
+80
+18
+20
+20
+59
+75
+6f
+e4
+47
+0e
+c2
+9f
+00
+1c
+c2
+98
+00
+1c
+20
+20
+59
+83
+6f
+e1
+45
+ed
+67
+e1
+45
+f5
+70
+45
+f9
+05
+20
+20
+35
+0a
 20
 40
 2a
@@ -63,7 +147,7 @@
 c0
 7f
 80
-12
+27
 6f
 e0
 c8
@@ -91,19 +175,19 @@
 c2
 80
 80
-1a
+2f
 c2
 80
 00
-1a
+2f
 c2
 82
 80
-1a
+2f
 c2
 83
 00
-1a
+2f
 20
 20
 54
@@ -120,10 +204,50 @@
 20
 68
 3e
+6f
+e0
+c5
+fa
 20
-60
-00
-00
+3a
+32
+01
+6f
+e1
+45
+f7
+1f
+e0
+fe
+01
+67
+e1
+45
+f7
+2f
+ef
+fe
+09
+6f
+e0
+c5
+f9
+c0
+02
+80
+3b
+20
+20
+35
+65
+20
+20
+b5
+1f
+20
+20
+32
+7a
 6f
 e0
 c3
@@ -131,7 +255,7 @@
 c0
 04
 00
-21
+40
 20
 20
 36
@@ -147,7 +271,7 @@
 20
 40
 00
-27
+46
 6f
 e4
 47
@@ -180,62 +304,299 @@
 20
 59
 e6
+6f
+e4
+47
+0e
+c2
+88
+d5
+80
+c2
+88
+55
+88
+c2
+89
+00
+50
+20
+60
+00
+00
 20
 40
-6b
-28
+00
+53
 20
 40
-6b
-63
+00
+5a
 20
 20
-6b
-26
-fc
-bd
-aa
 55
+8b
+20
 40
-00
-00
+56
+99
+6f
+e1
+46
+a0
+d8
 40
+aa
+55
+98
+46
+7c
 00
+20
+62
+80
 00
+60
+49
+46
+a0
+20
+20
+56
+9d
+6f
+e0
+c6
+78
+c1
 00
 00
 00
+c0
 00
+80
+5f
+c0
+01
 00
+73
+20
+60
 00
 00
+6a
+41
+4a
+8b
+1a
+42
+26
 00
+20
+40
+56
+e5
+6f
+e3
+4a
+46
+20
+3a
 00
+6b
+67
+e3
+4a
+40
+1a
+60
+a6
+06
+6f
+e1
+4a
+8d
+9a
+66
+7c
 00
+24
+61
 00
 00
+1a
+62
+24
 00
-02
-00
-00
-81
-00
-00
-00
-00
+20
+20
 00
+61
+6f
+e3
+4a
+40
+68
+4b
+46
+80
+98
+46
+7c
 00
+20
+62
+80
+00
+df
+20
+00
+06
+da
+20
+46
+80
+1a
+62
+24
+00
+20
+20
+6b
+33
+6a
+41
+4a
+77
+1a
+42
+26
+00
+20
+40
+57
+0e
+6f
+e3
+4a
+5e
+20
+3a
+00
+7f
+67
+e3
+4a
+58
+1a
+60
+a6
+06
+6f
+e1
+4a
+79
+9a
+66
+7c
+00
+24
+61
+00
+00
+1a
+62
+24
+00
+20
+20
+00
+75
+6f
+e3
+4a
+58
+68
+4b
+46
+8d
+98
+46
+7c
+00
+20
+62
+80
+00
+df
+20
+00
+06
+da
+20
+46
+8d
+1a
+62
+24
+00
+20
+20
+6b
+33
+20
+40
+6b
+28
+20
+40
+6b
+63
+20
+20
+6b
+26
+e1
+a7
+aa
+55
+40
+00
+00
+40
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+02
+00
+80
+81
 00
 00
 00
 00
-04
 00
 00
 00
 00
 00
 00
+04
+00
+00
+00
 00
 00
 00
@@ -257,6 +618,9 @@
 00
 00
 00
+00
+80
+00
 02
 00
 00
@@ -271,12 +635,12 @@
 0e
 47
 00
-85
+e5
 04
 00
-00
-00
-01
+02
+22
+89
 1b
 aa
 55
@@ -311,14 +675,14 @@
 ff
 ff
 ff
+0a
 ff
 ff
 ff
 ff
-ff
-ff
-ff
-ff
+0c
+8c
+09
 ff
 ff
 aa
@@ -448,14 +812,14 @@
 00
 16
 47
-01
+02
 aa
 55
 01
 00
 94
 40
-01
+00
 aa
 55
 01
@@ -485,7 +849,7 @@
 00
 78
 46
-00
+01
 34
 aa
 55
@@ -883,7 +1247,7 @@
 54
 35
 2e
-32
+31
 20
 4d
 6f
@@ -901,7 +1265,7 @@
 54
 35
 2e
-32
+31
 20
 4d
 6f
@@ -914,9 +1278,9 @@
 00
 d5
 42
-07
+06
 00
-07
+09
 00
 20
 00
@@ -960,22 +1324,36 @@
 80
 aa
 55
-1a
+14
 00
 7b
 4a
-ef
+23
+1a
+ea
+1a
+eb
+1a
+b2
 1b
-52
+b3
+1b
+2a
 1c
-53
+2b
+1c
+de
+1c
+df
 1c
-1a
-1d
-1b
-1d
 92
 1d
+aa
+55
+08
+00
+73
+4a
 93
 1d
 46
@@ -984,6 +1362,12 @@
 1e
 fa
 1e
+aa
+55
+06
+00
+8f
+4a
 fb
 1e
 ac
@@ -1230,673 +1614,289 @@
 41
 ff
 aa
-55
-02
-00
-9c
-40
-49
-41
-aa
-55
-11
-00
-05
-49
-03
-04
-01
-02
-20
-2a
-3f
-15
-14
-1b
-0e
-11
-8a
-8b
-83
-84
-88
-aa
-55
-74
-00
-19
-49
-09
-5a
-26
-34
-19
-04
-09
-00
-ff
-ff
-09
-5a
-0d
-f0
-1d
-e3
-7d
-d2
-ff
-ff
-09
-5a
-0d
-10
-1d
-ed
-7d
-80
-ff
-ff
-1b
-35
-28
-b4
-29
-46
-2a
-96
-2b
-8c
-2c
-6e
-2d
-64
-38
-5f
-39
-0f
-3a
-32
-3b
-47
-42
-10
-ff
-ff
-54
-2e
-55
-f2
-61
-f4
-63
-70
-75
-52
-76
-41
-77
-ed
-78
-23
-79
-46
-7a
-e5
-7c
-48
-7e
-77
-7f
-01
-0b
-00
-7f
-00
-09
-00
-ff
-ff
-09
-5a
-ff
-27
-ab
-40
-be
-d1
-a0
-41
-a1
-12
-a7
-ff
-b6
-00
-b5
-c8
-a5
-af
-ff
-00
-09
-00
-ff
-ff
-aa
-55
-0c
-00
-d1
-49
-05
-b9
-09
-5a
-0b
-72
-0c
-52
-09
-00
-ff
-ff
-aa
-55
-40
-00
-91
-49
-09
-5a
-0d
-10
-0e
-c5
-5b
-9a
-10
-38
-11
-42
-28
-28
-41
-23
-49
-39
-4a
-b0
-4b
-a0
-4c
-90
-4d
-70
-09
-00
-ff
-ff
-09
-5a
-06
-02
-09
-69
-0d
-48
-0e
-9f
-0f
-ba
-09
-00
-ff
-ff
-09
-a5
-26
-34
-19
-04
-60
-07
-69
-04
-7d
-20
-7e
-00
-09
-00
-ff
-ff
-aa
-55
-1d
-00
-dd
-49
-09
-a5
-46
-34
-6a
-c0
-69
-24
-09
-00
-ff
-ff
-09
-5a
-0b
-f3
-09
-00
-ff
-ff
-00
-09
-a5
-0b
-f3
-09
-00
-ff
-ff
-55
-aa
-aa
-55
-f1
-6b
-ed
-cf
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
+55
+02
+00
+9c
+40
+49
+41
+aa
+55
+11
+00
+05
+49
+03
+04
+01
+02
+20
+2a
+3f
+15
+14
+1b
+0e
+11
+8a
+8b
+83
+84
+88
+aa
+55
+74
+00
+19
+49
+09
+5a
+26
+34
+19
+04
+09
+00
 ff
 ff
+09
+5a
+0d
+f0
+1d
+e3
+7d
+d2
 ff
 ff
+09
+5a
+0d
+10
+1d
+ed
+7d
+80
 ff
 ff
+1b
+35
+28
+b4
+29
+46
+2a
+96
+2b
+8c
+2c
+6e
+2d
+64
+38
+5f
+39
+0f
+3a
+32
+3b
+47
+42
+10
 ff
 ff
+54
+2e
+55
+f2
+61
+f4
+63
+70
+75
+52
+76
+41
+77
+ed
+78
+23
+79
+46
+7a
+e5
+7c
+48
+7e
+77
+7f
+01
+0b
+00
+7f
+00
+09
+00
 ff
 ff
+09
+5a
 ff
+27
+ab
+40
+be
+d1
+a0
+41
+a1
+12
+a7
 ff
+b6
+00
+b5
+c8
+a5
+af
 ff
+00
+09
+00
 ff
 ff
+aa
+55
+0c
+00
+d1
+49
+05
+b9
+09
+5a
+0b
+72
+0c
+52
+09
+00
 ff
 ff
+aa
+55
+40
+00
+91
+49
+09
+5a
+0d
+10
+0e
+c5
+5b
+9a
+10
+38
+11
+42
+28
+28
+41
+23
+49
+39
+4a
+b0
+4b
+a0
+4c
+90
+4d
+70
+09
+00
 ff
 ff
+09
+5a
+06
+02
+09
+69
+0d
+48
+0e
+9f
+0f
+ba
+09
+00
 ff
 ff
+09
+a5
+26
+34
+19
+04
+60
+07
+69
+04
+7d
+20
+7e
+00
+09
+00
 ff
 ff
+aa
+55
+1d
+00
+dd
+49
+09
+a5
+46
+34
+6a
+c0
+69
+24
+09
+00
 ff
 ff
+09
+5a
+0b
+f3
+09
+00
 ff
 ff
+00
+09
+a5
+0b
+f3
+09
+00
 ff
 ff
+55
+aa
+aa
+55
+55
+72
+54
+39
 ff
 ff
 ff
@@ -8188,5 +8188,5 @@
 ff
 ff
 ff
-86
-ad
+9b
+79
Index: output/otp.dat
===================================================================
--- /1121s/1121se/branch/mouse/mouse_public_1M/output/otp.dat	(revision 3440)
+++ /1121s/1121se/branch/mouse/mouse_public_1M/output/otp.dat	(working copy)
@@ -11,36 +11,44 @@
 00
 aa
 55
-be
-00
+2a
+02
 c2
 84
 00
-06
+07
 c0
 3c
 80
-09
+0b
+c0
+47
+80
+0d
 c0
 48
 00
-0b
+20
 c0
 4b
 80
-1d
+4b
 c0
 75
 00
-2c
+87
 20
 20
 23
 3e
 c0
+5f
+80
+32
+c0
 64
 80
-1e
+3d
 c1
 7f
 80
@@ -57,6 +65,82 @@
 20
 4d
 f6
+1a
+62
+7e
+00
+c0
+1d
+00
+10
+20
+20
+53
+dc
+20
+40
+59
+2b
+20
+40
+59
+33
+6f
+e0
+c6
+17
+24
+3a
+59
+0a
+6f
+e0
+c5
+f9
+c0
+02
+d9
+8c
+c0
+00
+80
+18
+20
+20
+59
+75
+6f
+e4
+47
+0e
+c2
+9f
+00
+1c
+c2
+98
+00
+1c
+20
+20
+59
+83
+6f
+e1
+45
+ed
+67
+e1
+45
+f5
+70
+45
+f9
+05
+20
+20
+35
+0a
 20
 40
 2a
@@ -72,7 +156,7 @@
 c0
 7f
 80
-12
+27
 6f
 e0
 c8
@@ -100,19 +184,19 @@
 c2
 80
 80
-1a
+2f
 c2
 80
 00
-1a
+2f
 c2
 82
 80
-1a
+2f
 c2
 83
 00
-1a
+2f
 20
 20
 54
@@ -129,10 +213,50 @@
 20
 68
 3e
+6f
+e0
+c5
+fa
 20
-60
-00
-00
+3a
+32
+01
+6f
+e1
+45
+f7
+1f
+e0
+fe
+01
+67
+e1
+45
+f7
+2f
+ef
+fe
+09
+6f
+e0
+c5
+f9
+c0
+02
+80
+3b
+20
+20
+35
+65
+20
+20
+b5
+1f
+20
+20
+32
+7a
 6f
 e0
 c3
@@ -140,7 +264,7 @@
 c0
 04
 00
-21
+40
 20
 20
 36
@@ -156,7 +280,7 @@
 20
 40
 00
-27
+46
 6f
 e4
 47
@@ -189,6 +313,246 @@
 20
 59
 e6
+6f
+e4
+47
+0e
+c2
+88
+d5
+80
+c2
+88
+55
+88
+c2
+89
+00
+50
+20
+60
+00
+00
+20
+40
+00
+53
+20
+40
+00
+5a
+20
+20
+55
+8b
+20
+40
+56
+99
+6f
+e1
+46
+a0
+d8
+40
+aa
+55
+98
+46
+7c
+00
+20
+62
+80
+00
+60
+49
+46
+a0
+20
+20
+56
+9d
+6f
+e0
+c6
+78
+c1
+00
+00
+00
+c0
+00
+80
+5f
+c0
+01
+00
+73
+20
+60
+00
+00
+6a
+41
+4a
+8b
+1a
+42
+26
+00
+20
+40
+56
+e5
+6f
+e3
+4a
+46
+20
+3a
+00
+6b
+67
+e3
+4a
+40
+1a
+60
+a6
+06
+6f
+e1
+4a
+8d
+9a
+66
+7c
+00
+24
+61
+00
+00
+1a
+62
+24
+00
+20
+20
+00
+61
+6f
+e3
+4a
+40
+68
+4b
+46
+80
+98
+46
+7c
+00
+20
+62
+80
+00
+df
+20
+00
+06
+da
+20
+46
+80
+1a
+62
+24
+00
+20
+20
+6b
+33
+6a
+41
+4a
+77
+1a
+42
+26
+00
+20
+40
+57
+0e
+6f
+e3
+4a
+5e
+20
+3a
+00
+7f
+67
+e3
+4a
+58
+1a
+60
+a6
+06
+6f
+e1
+4a
+79
+9a
+66
+7c
+00
+24
+61
+00
+00
+1a
+62
+24
+00
+20
+20
+00
+75
+6f
+e3
+4a
+58
+68
+4b
+46
+8d
+98
+46
+7c
+00
+20
+62
+80
+00
+df
+20
+00
+06
+da
+20
+46
+8d
+1a
+62
+24
+00
+20
+20
+6b
+33
 20
 40
 6b
@@ -201,8 +565,8 @@
 20
 6b
 26
-fc
-bd
+e1
+a7
 aa
 55
 40
@@ -226,7 +590,7 @@
 00
 02
 00
-00
+80
 81
 00
 00
@@ -264,7 +628,7 @@
 00
 00
 00
-00
+80
 00
 02
 00
@@ -280,12 +644,12 @@
 0e
 47
 00
-85
+e5
 04
 00
-00
-00
-01
+02
+22
+89
 1b
 aa
 55
@@ -320,14 +684,14 @@
 ff
 ff
 ff
+0a
 ff
 ff
 ff
 ff
-ff
-ff
-ff
-ff
+0c
+8c
+09
 ff
 ff
 aa
@@ -457,14 +821,14 @@
 00
 16
 47
-01
+02
 aa
 55
 01
 00
 94
 40
-01
+00
 aa
 55
 01
@@ -494,7 +858,7 @@
 00
 78
 46
-00
+01
 34
 aa
 55
@@ -892,7 +1256,7 @@
 54
 35
 2e
-32
+31
 20
 4d
 6f
@@ -910,7 +1274,7 @@
 54
 35
 2e
-32
+31
 20
 4d
 6f
@@ -923,9 +1287,9 @@
 00
 d5
 42
-07
+06
 00
-07
+09
 00
 20
 00
@@ -969,22 +1333,36 @@
 80
 aa
 55
-1a
+14
 00
 7b
 4a
-ef
+23
+1a
+ea
+1a
+eb
+1a
+b2
 1b
-52
+b3
+1b
+2a
 1c
-53
+2b
+1c
+de
+1c
+df
 1c
-1a
-1d
-1b
-1d
 92
 1d
+aa
+55
+08
+00
+73
+4a
 93
 1d
 46
@@ -993,6 +1371,12 @@
 1e
 fa
 1e
+aa
+55
+06
+00
+8f
+4a
 fb
 1e
 ac
@@ -1518,7 +1902,7 @@
 aa
 aa
 55
-f1
-6b
-ed
-cf
+55
+72
+54
+39
Index: output/program.lis
===================================================================
--- /1121s/1121se/branch/mouse/mouse_public_1M/output/program.lis	(revision 3440)
+++ /1121s/1121se/branch/mouse/mouse_public_1M/output/program.lis	(working copy)
@@ -1,72 +1,193 @@
               include "bt_format "
               org 0x0000
-0000 c2840006 bbit1 8 ,pf_patch_ext 
-0001 c03c8009 beq patch0f_1 ,p_mouse_start_work 
-0002 c048000b beq patch12_0 ,p_mouse_le 
-0003 c04b801d beq patch12_7 ,p_mouse_store_device_info 
-0004 c075002c beq patch1d_2 ,p_otp_read_data 
-0005 2020233e branch assert 
+0000 c2840007 bbit1 8 ,pf_patch_ext 
+0001 c03c800b beq patch0f_1 ,p_mouse_start_work 
+0002 c047800d beq patch11_7 ,p_mouse_priority_bb_event 
+0003 c0480020 beq patch12_0 ,p_mouse_le 
+0004 c04b804b beq patch12_7 ,p_mouse_store_device_info 
+0005 c0750087 beq patch1d_2 ,p_otp_read_data 
+0006 2020233e branch assert 
 
 pf_patch_ext:
-0006 c064801e beq patch39_1 ,p_g24_retransmit 
-0007 c17f8000 rtneq patch3f_7 
-0008 2020233e branch assert 
+0007 c05f8032 beq patch37_7 ,p_g24_reconn_device_fail 
+0008 c064803d beq patch39_1 ,p_g24_retransmit 
+0009 c17f8000 rtneq patch3f_7 
+000a 2020233e branch assert 
 
 p_mouse_start_work:
-0009 20403717 call app_param_init 
-000a 20204df6 branch mouse_start_work + 1 
+000b 20403717 call app_param_init 
+000c 20204df6 branch mouse_start_work + 1 
+
+p_mouse_priority_bb_event:
+000d 1a627e00 copy regc ,pdata 
+000e c01d0010 beq bt_evt_24g_attempt_fail ,p_mouse_24g_attempt_fail 
+000f 202053dc branch mouse_priority_bb_event + 2 
+
+p_mouse_24g_attempt_fail:
+0010 2040592b call mouse_soft_agc_disable 
+0011 20405933 call device_fetch_normal_tx_power 
+0012 6fe0c617 fetch 1 ,mem_24g_attempt_fail_flag 
+0013 243a590a nbranch mouse_24g_hibernate_set ,blank 
+0014 6fe0c5f9 fetch 1 ,mem_24g_reconn_type 
+0015 c002d98c beq pair_and_receiver ,mouse_24g_auto_pair_attempt_fail 
+0016 c0008018 beq fast_conn_and_receiver ,p_mouse_24g_fast_conn_attempt_fail 
+0017 20205975 branch mouse_24g_attempt_fail + 4 
+
+p_mouse_24g_fast_conn_attempt_fail:
+0018 6fe4470e fetch mouse_flag_len ,mem_mouse_flag 
+0019 c29f001c bbit1 mouse_enable_24g_first_auto_pairing ,p_mouse_24g_start_auto_pair 
+001a c298001c bbit1 mouse_enable_auto_24g_paring ,p_mouse_24g_start_auto_pair 
+001b 20205983 branch mouse_24g_fast_conn_attempt_fail + 3 
+
+p_mouse_24g_start_auto_pair:
+001c 6fe145ed fetch 2 ,mem_24g_pair_timeout_init 
+001d 67e145f5 store 2 ,mem_24g_reconn_timeout 
+001e 7045f905 jam pair_and_receiver ,mem_24g_reconn_type 
+001f 2020350a branch g24_reconn_start 
 
 p_mouse_le:
-000b 20402a06 call le_fifo_check_nearly_full 
-000c 247a0000 nrtn blank 
-000d 6fe0c74f fetch 1 ,mem_device_fast_conn_flag 
-000e c07f8012 beq 0xff ,p_mouse_le_next 
-000f 6fe0c882 fetch 1 ,mem_le_connect_status_flag 
-0010 1fe17e03 and pdata ,0x03 ,pdata 
-0011 c1818000 rtnne 0x03 
+0020 20402a06 call le_fifo_check_nearly_full 
+0021 247a0000 nrtn blank 
+0022 6fe0c74f fetch 1 ,mem_device_fast_conn_flag 
+0023 c07f8027 beq 0xff ,p_mouse_le_next 
+0024 6fe0c882 fetch 1 ,mem_le_connect_status_flag 
+0025 1fe17e03 and pdata ,0x03 ,pdata 
+0026 c1818000 rtnne 0x03 
 
 p_mouse_le_next:
-0012 6fe0c9f9 fetch 1 ,mem_mouse_clear_sensor_data_flag 
-0013 205a538b call mouse_clear_sensor_data_by_reset ,blank 
-0014 6fe4470e fetch mouse_flag_len ,mem_mouse_flag 
-0015 c280801a bbit1 mouse_24g_pairing_flag ,p_mouse_le_send_empty_packet 
-0016 c280001a bbit1 mouse_select_device_flag ,p_mouse_le_send_empty_packet 
-0017 c282801a bbit1 mouse_bt_discovery_button_down_flag ,p_mouse_le_send_empty_packet 
-0018 c283001a bbit1 mouse_bt_discovery_button_long_down_flag ,p_mouse_le_send_empty_packet 
-0019 20205447 branch mouse_le_package 
+0027 6fe0c9f9 fetch 1 ,mem_mouse_clear_sensor_data_flag 
+0028 205a538b call mouse_clear_sensor_data_by_reset ,blank 
+0029 6fe4470e fetch mouse_flag_len ,mem_mouse_flag 
+002a c280802f bbit1 mouse_24g_pairing_flag ,p_mouse_le_send_empty_packet 
+002b c280002f bbit1 mouse_select_device_flag ,p_mouse_le_send_empty_packet 
+002c c282802f bbit1 mouse_bt_discovery_button_down_flag ,p_mouse_le_send_empty_packet 
+002d c283002f bbit1 mouse_bt_discovery_button_long_down_flag ,p_mouse_le_send_empty_packet 
+002e 20205447 branch mouse_le_package 
 
 p_mouse_le_send_empty_packet:
-001a 58000000 setarg 0 
-001b 67e3c65c store 7 ,mem_mouse_key 
-001c 2020683e branch hid_device_le_send_mouse_data 
-
-p_mouse_store_device_info:
-001d 20600000 rtn 
+002f 58000000 setarg 0 
+0030 67e3c65c store 7 ,mem_mouse_key 
+0031 2020683e branch hid_device_le_send_mouse_data 
+
+p_g24_reconn_device_fail:
+0032 6fe0c5fa fetch 1 ,mem_24g_fast_conn_enable 
+0033 203a3201 branch g24_ch ,blank 
+0034 6fe145f7 fetch 2 ,mem_24g_reconn_count 
+0035 1fe0fe01 increase 1 ,pdata 
+0036 67e145f7 store 2 ,mem_24g_reconn_count 
+0037 2feffe09 isolate1 9 ,pdata 
+0038 6fe0c5f9 fetch 1 ,mem_24g_reconn_type 
+0039 c002803b beq pair_and_receiver ,p_g24_reconn_pair_and_receiver 
+003a 20203565 branch g24_reconn_device_fail + 7 
+
+p_g24_reconn_pair_and_receiver:
+003b 2020b51f branch g24_reconn_receiver_addr ,true 
+003c 2020327a branch g24_pair_init_param 
 
 p_g24_retransmit:
-001e 6fe0c3cf fetch 1 ,mem_device_option 
-001f c0040021 beq dvc_op_mouse ,p_mouse_g24_retransmit 
-0020 2020363b branch g24_retransmit0 
+003d 6fe0c3cf fetch 1 ,mem_device_option 
+003e c0040040 beq dvc_op_mouse ,p_mouse_g24_retransmit 
+003f 2020363b branch g24_retransmit0 
 
 p_mouse_g24_retransmit:
-0021 6fe0c752 fetch 1 ,mem_device_need_soft_reset 
-0022 247a0000 nrtn blank 
-0023 20400027 call p_mouse_g24_retransmit_100ms_timer 
-0024 6fe4470e fetch mouse_flag_len ,mem_mouse_flag 
-0025 c3808000 rtnbit1 mouse_24g_pairing_flag 
-0026 2020363b branch g24_retransmit0 
+0040 6fe0c752 fetch 1 ,mem_device_need_soft_reset 
+0041 247a0000 nrtn blank 
+0042 20400046 call p_mouse_g24_retransmit_100ms_timer 
+0043 6fe4470e fetch mouse_flag_len ,mem_mouse_flag 
+0044 c3808000 rtnbit1 mouse_24g_pairing_flag 
+0045 2020363b branch g24_retransmit0 
 
 p_mouse_g24_retransmit_100ms_timer:
-0027 d8e0000c arg 12 ,queue 
-0028 20407cf1 call timer_check 
-0029 247a0000 nrtn blank 
-002a 204054d7 call mouse_commbination_key_process 
-002b 202059e6 branch mouse_g24_retransmit_100ms_timer_next 
+0046 d8e0000c arg 12 ,queue 
+0047 20407cf1 call timer_check 
+0048 247a0000 nrtn blank 
+0049 204054d7 call mouse_commbination_key_process 
+004a 202059e6 branch mouse_g24_retransmit_100ms_timer_next 
+
+p_mouse_store_device_info:
+004b 6fe4470e fetch mouse_flag_len ,mem_mouse_flag 
+004c c288d580 bbit1 mouse_enable_eeprom ,mouse_store_eeprom_device_info 
+004d c2885588 bbit1 mouse_enable_flash ,mouse_store_flash_device_info 
+004e c2890050 bbit1 mouse_enable_otp ,p_mouse_store_otp_device_info 
+004f 20600000 rtn 
+
+p_mouse_store_otp_device_info:
+0050 20400053 call p_mouse_write_otp_app_initflag 
+0051 2040005a call p_mouse_write_otp_locall_addr 
+0052 2020558b branch mouse_store_otp_device_info + 1 
+
+p_mouse_write_otp_app_initflag:
+0053 20405699 call mouse_otp_load_app_initflag 
+0054 6fe146a0 fetch 2 ,mem_store_flag 
+0055 d840aa55 arg eeprom_init_flag ,temp 
+0056 98467c00 isub temp ,null 
+0057 20628000 rtn zero 
+0058 604946a0 storet 2 ,mem_store_flag 
+0059 2020569d branch mouse_otp_store_app_initflag 
+
+p_mouse_write_otp_locall_addr:
+005a 6fe0c678 fetch 1 ,mem_device_flag 
+005b c1000000 rtneq mode_24g_device 
+005c c000805f beq mode_bt_device1 ,p_mouse_write_otp_le_locall_addr1 
+005d c0010073 beq mode_bt_device2 ,p_mouse_write_otp_le_locall_addr2 
+005e 20600000 rtn 
+
+p_mouse_write_otp_le_locall_addr1:
+005f 6a414a8b fetchr regb ,2 ,mem_otp_offset_le_locall_addr1 
+0060 1a422600 copy regb ,regc 
+
+p_mouse_write_otp_le_locall_addr1_loop:
+0061 204056e5 call mouse_read_otp_le_locall_addr1_common 
+0062 6fe34a46 fetch 6 ,mem_mouse_le_locall_addr1_temp 
+0063 203a006b branch p_mouse_le_local_addr1_store ,blank 
+0064 67e34a40 store 6 ,mem_mouse_le_locall_addr1_last 
+0065 1a60a606 increase 6 ,regc 
+0066 6fe14a8d fetch 2 ,mem_otp_offset_le_locall_addr1_end 
+0067 9a667c00 isub regc ,null 
+0068 24610000 nrtn positive 
+0069 1a622400 copy regc ,regb 
+006a 20200061 branch p_mouse_write_otp_le_locall_addr1_loop 
+
+p_mouse_le_local_addr1_store:
+006b 6fe34a40 fetch 6 ,mem_mouse_le_locall_addr1_last 
+006c 684b4680 fetcht 6 ,mem_device1_locall_addr 
+006d 98467c00 isub temp ,null 
+006e 20628000 rtn zero 
+006f df200006 arg 6 ,loopcnt 
+0070 da204680 arg mem_device1_locall_addr ,rega 
+0071 1a622400 copy regc ,regb 
+0072 20206b33 branch otp_write 
+
+p_mouse_write_otp_le_locall_addr2:
+0073 6a414a77 fetchr regb ,2 ,mem_otp_offset_le_locall_addr2 
+0074 1a422600 copy regb ,regc 
+
+p_mouse_write_otp_le_locall_addr2_loop:
+0075 2040570e call mouse_read_otp_le_locall_addr2_common 
+0076 6fe34a5e fetch 6 ,mem_mouse_le_locall_addr2_temp 
+0077 203a007f branch p_mouse_le_local_addr2_store ,blank 
+0078 67e34a58 store 6 ,mem_mouse_le_locall_addr2_last 
+0079 1a60a606 increase 6 ,regc 
+007a 6fe14a79 fetch 2 ,mem_otp_offset_le_locall_addr2_end 
+007b 9a667c00 isub regc ,null 
+007c 24610000 nrtn positive 
+007d 1a622400 copy regc ,regb 
+007e 20200075 branch p_mouse_write_otp_le_locall_addr2_loop 
+
+p_mouse_le_local_addr2_store:
+007f 6fe34a58 fetch 6 ,mem_mouse_le_locall_addr2_last 
+0080 684b468d fetcht 6 ,mem_device2_locall_addr 
+0081 98467c00 isub temp ,null 
+0082 20628000 rtn zero 
+0083 df200006 arg 6 ,loopcnt 
+0084 da20468d arg mem_device2_locall_addr ,rega 
+0085 1a622400 copy regc ,regb 
+0086 20206b33 branch otp_write 
 
 p_otp_read_data:
-002c 20406b28 call enable_otp_read 
-002d 20406b63 call otp_read_data1 
-002e 20206b26 branch otp_disable_chgpump 
+0087 20406b28 call enable_otp_read 
+0088 20406b63 call otp_read_data1 
+0089 20206b26 branch otp_disable_chgpump 
               org 0x2000
 
 start:
Index: program/app_mouse.prog
===================================================================
--- /1121s/1121se/branch/mouse/mouse_public_1M/program/app_mouse.prog	(revision 3440)
+++ /1121s/1121se/branch/mouse/mouse_public_1M/program/app_mouse.prog	(working copy)
@@ -3644,9 +3644,9 @@
 	copy regb,regc
 mouse_read_otp_device_flag_loop:
 	call mouse_read_otp_device_flag_common
-	fetch 1,mem_device_otp_flag_temp
-	branch mouse_device_flag_load,blank	
-	store 1,mem_device_flag_last
+	fetch 1,mem_device_otp_flag_temp	//当前读取的值
+	branch mouse_device_flag_load,blank	//为空说明当前地址没有存数据
+	store 1,mem_device_flag_last	//上一次保存的值
 	increase 1,regc
 	fetch 2,mem_otp_offset_device_flag_end
 	isub regc,null
Index: program/patch.prog
===================================================================
--- /1121s/1121se/branch/mouse/mouse_public_1M/program/patch.prog	(revision 3440)
+++ /1121s/1121se/branch/mouse/mouse_public_1M/program/patch.prog	(working copy)
@@ -11,55 +11,26 @@
 	beq patch11_2,p_mouse_init_sunt
 	beq patch11_3,p_mouse_init_sensor
 endif
+endif
+	beq patch11_7,p_mouse_priority_bb_event
 	beq patch12_0,p_mouse_le
 	beq patch12_7,p_mouse_store_device_info
-endif
 	beq patch1d_2,p_otp_read_data
 	branch assert
 
 pf_patch_ext:
+	beq patch37_7,p_g24_reconn_device_fail
 ifdef G24_RETRANSMIT_COMMBINATION_PAIR
 	beq patch39_1,p_g24_retransmit
 endif
 	rtneq patch3f_7
 	branch assert
 
-
 ifdef TEST
 p_mouse_start_work:
 	call app_param_init
 	branch mouse_start_work+1
 
-p_mouse_le:
-	call le_fifo_check_nearly_full
-	nrtn blank
-	fetch 1,mem_device_fast_conn_flag
-	beq 0xff,p_mouse_le_next
-	fetch 1,mem_le_connect_status_flag
-	and pdata,0x03,pdata
-	rtnne 0x03
-p_mouse_le_next:
-	fetch 1,mem_mouse_clear_sensor_data_flag
-	call mouse_clear_sensor_data_by_reset,blank
-	fetch MOUSE_FLAG_LEN,mem_mouse_flag
-	bbit1 MOUSE_24G_PAIRING_FLAG,p_mouse_le_send_empty_packet
-	bbit1 MOUSE_SELECT_DEVICE_FLAG,p_mouse_le_send_empty_packet
-	bbit1 MOUSE_BT_DISCOVERY_BUTTON_DOWN_FLAG,p_mouse_le_send_empty_packet
-	bbit1 MOUSE_BT_DISCOVERY_BUTTON_LONG_DOWN_FLAG,p_mouse_le_send_empty_packet
-	branch mouse_le_package
-
-p_mouse_le_send_empty_packet:
-	setarg 0
-	store 7,mem_mouse_key
-	branch hid_device_le_send_mouse_data
-
-p_mouse_store_device_info:
-//	fetch MOUSE_FLAG_LEN,mem_mouse_flag
-//	bbit1 MOUSE_ENABLE_EEPROM,mouse_store_eeprom_device_info
-//	bbit1 MOUSE_ENABLE_FLASH,mouse_store_flash_device_info
-//	bbit1 MOUSE_ENABLE_OTP,mouse_store_otp_device_info
-	rtn
-
 ifdef AUTO_TEST
 p_mouse_init_sunt:
 p_mouse_init_sensor:
@@ -112,6 +83,73 @@
 endif
 
 endif
+p_mouse_priority_bb_event:
+	copy regc,pdata
+	beq BT_EVT_24G_ATTEMPT_FAIL,p_mouse_24g_attempt_fail
+	branch mouse_priority_bb_event+2
+p_mouse_24g_attempt_fail:
+	call mouse_soft_agc_disable
+	call device_fetch_normal_tx_power
+	fetch 1,mem_24g_attempt_fail_flag
+	nbranch mouse_24g_hibernate_set,blank
+	fetch 1,mem_24g_reconn_type
+	beq PAIR_AND_RECEIVER,mouse_24g_auto_pair_attempt_fail
+	beq FAST_CONN_AND_RECEIVER,p_mouse_24g_fast_conn_attempt_fail
+	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_AUTO_24G_PARING,p_mouse_24g_start_auto_pair
+	branch mouse_24g_fast_conn_attempt_fail+3
+p_mouse_24g_start_auto_pair:
+	fetch 2,mem_24g_pair_timeout_init
+	store 2,mem_24g_reconn_timeout
+	jam PAIR_AND_RECEIVER,mem_24g_reconn_type
+	branch g24_reconn_start
+
+p_mouse_le:
+	call le_fifo_check_nearly_full
+	nrtn blank
+	fetch 1,mem_device_fast_conn_flag
+	beq 0xff,p_mouse_le_next
+	fetch 1,mem_le_connect_status_flag
+	and pdata,0x03,pdata
+	rtnne 0x03
+p_mouse_le_next:
+	fetch 1,mem_mouse_clear_sensor_data_flag
+	call mouse_clear_sensor_data_by_reset,blank
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_24G_PAIRING_FLAG,p_mouse_le_send_empty_packet
+	bbit1 MOUSE_SELECT_DEVICE_FLAG,p_mouse_le_send_empty_packet
+	bbit1 MOUSE_BT_DISCOVERY_BUTTON_DOWN_FLAG,p_mouse_le_send_empty_packet
+	bbit1 MOUSE_BT_DISCOVERY_BUTTON_LONG_DOWN_FLAG,p_mouse_le_send_empty_packet
+	branch mouse_le_package
+
+p_mouse_le_send_empty_packet:
+	setarg 0
+	store 7,mem_mouse_key
+	branch hid_device_le_send_mouse_data
+
+p_g24_reconn_device_fail:
+	fetch 1,mem_24g_fast_conn_enable
+	branch g24_ch,blank
+	fetch 2,mem_24g_reconn_count
+	increase 1,pdata
+	store 2,mem_24g_reconn_count
+	isolate1 9,pdata
+	fetch 1,mem_24g_reconn_type
+	beq PAIR_AND_RECEIVER,p_g24_reconn_pair_and_receiver
+	branch g24_reconn_device_fail+7
+	// beq FAST_CONN_AND_RECEIVER,g24_reconn_fast_conn_and_receiver
+	// beq FAST_CONN_AND_3_0_ADDR,g24_reconn_fast_conn_and_3_0
+	// beq RECEIVER_AND_3_0_ADDR,g24_reconn_receiver_and_3_0
+	// beq PAIR_AND_3_0_ADDR,g24_reconn_pair_and_3_0
+	// branch g24_reconn_receiver_addr
+
+p_g24_reconn_pair_and_receiver:
+	branch g24_reconn_receiver_addr,true
+	branch g24_pair_init_param
 
 ifdef G24_RETRANSMIT_COMMBINATION_PAIR
 p_g24_retransmit:
@@ -134,6 +172,85 @@
 	branch mouse_g24_retransmit_100ms_timer_next
 endif
 
+p_mouse_store_device_info:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit1 MOUSE_ENABLE_EEPROM,mouse_store_eeprom_device_info
+	bbit1 MOUSE_ENABLE_FLASH,mouse_store_flash_device_info
+	bbit1 MOUSE_ENABLE_OTP,p_mouse_store_otp_device_info
+	rtn
+p_mouse_store_otp_device_info:
+	call p_mouse_write_otp_app_initflag
+	call p_mouse_write_otp_locall_addr
+	branch mouse_store_otp_device_info+1
+p_mouse_write_otp_app_initflag:
+	call mouse_otp_load_app_initflag
+	fetch 2,mem_store_flag
+	arg EEPROM_INIT_FLAG,temp
+	isub temp,null
+	rtn zero
+	storet 2,mem_store_flag
+	branch mouse_otp_store_app_initflag
+
+/**************store le local addr start**********/
+p_mouse_write_otp_locall_addr:
+	fetch 1,mem_device_flag
+	rtneq MODE_24G_DEVICE
+	beq MODE_BT_DEVICE1,p_mouse_write_otp_le_locall_addr1
+	beq MODE_BT_DEVICE2,p_mouse_write_otp_le_locall_addr2
+	rtn
+
+p_mouse_write_otp_le_locall_addr1:
+	fetchr regb,2,mem_otp_offset_le_locall_addr1
+	copy regb,regc
+p_mouse_write_otp_le_locall_addr1_loop:
+	call mouse_read_otp_le_locall_addr1_common
+	fetch 6,mem_mouse_le_locall_addr1_temp
+	branch p_mouse_le_local_addr1_store,blank	
+	store 6,mem_mouse_le_locall_addr1_last
+	increase 6,regc
+	fetch 2,mem_otp_offset_le_locall_addr1_end
+	isub regc,null
+	nrtn positive	//if read end,retention last value
+	copy regc,regb
+	branch p_mouse_write_otp_le_locall_addr1_loop
+
+p_mouse_le_local_addr1_store:
+	fetch 6,mem_mouse_le_locall_addr1_last
+	fetcht 6,mem_device1_locall_addr
+	isub temp,null
+	rtn zero
+	arg 6,loopcnt
+	arg mem_device1_locall_addr,rega
+	copy regc,regb
+	branch otp_write			/* regb = otp address, rega pointers data, loopcnt is count */
+
+p_mouse_write_otp_le_locall_addr2:
+	fetchr regb,2,mem_otp_offset_le_locall_addr2
+	copy regb,regc
+p_mouse_write_otp_le_locall_addr2_loop:
+	call mouse_read_otp_le_locall_addr2_common
+	fetch 6,mem_mouse_le_locall_addr2_temp
+	branch p_mouse_le_local_addr2_store,blank	
+	store 6,mem_mouse_le_locall_addr2_last
+	increase 6,regc
+	fetch 2,mem_otp_offset_le_locall_addr2_end
+	isub regc,null
+	nrtn positive	//if read end,retention last value
+	copy regc,regb
+	branch p_mouse_write_otp_le_locall_addr2_loop
+
+p_mouse_le_local_addr2_store:
+	fetch 6,mem_mouse_le_locall_addr2_last
+	fetcht 6,mem_device2_locall_addr
+	isub temp,null
+	rtn zero
+	arg 6,loopcnt
+	arg mem_device2_locall_addr,rega
+	copy regc,regb
+	branch otp_write			/* regb = otp address, rega pointers data, loopcnt is count */
+
+/**************store le local addr end**********/
+
 p_otp_read_data:
 	call enable_otp_read
 	call otp_read_data1
Index: sched/mouse.dat
===================================================================
--- /1121s/1121se/branch/mouse/mouse_public_1M/sched/mouse.dat	(revision 3440)
+++ /1121s/1121se/branch/mouse/mouse_public_1M/sched/mouse.dat	(working copy)
@@ -19,7 +19,7 @@
 #bit5 MOUSE_ENABLE_24G_SEARCH_DONGLE
 #bit6 MOUSE_ENABLE_LOAD_AND_STORE_DPI
 #bit7 MOUSE_ENABLE_24G
-85
+e5#85
 
 #mouse flag byte3
 #bit0 MOUSE_ENABLE_FLASH
@@ -49,7 +49,7 @@
 #bit3 MOUSE_ENABLE_LOW_LED
 #bit4 MOUSE_ENABLE_LOW_FOR_LED
 #bit5 MOUSE_ENABLE_DPI_FOR_LED
-00
+02
 
 #mouse flag byte6 
 #bit0 MOUSE_ENABLE_SELECT_DEVICE_BY_DPI_BUTTON
@@ -60,7 +60,7 @@
 #bit5 MOUSE_ENABLE_PB_BUTTON_CONNECT_GND
 #bit6 MOUSE_ENABLE_FIRE_KEY_CONNECT_GND
 #bit7 MOUSE_ENABLE_CUSTOMER_KEY_CONNECT_VIN
-00
+22
 
 #mouse flag byte7
 #bit0 MOUSE_ENABLE_AUTO_24G_PARING
@@ -71,7 +71,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
-01
+89
 
 #mouse flag byte8
 #bit0 MOUSE_ENABLE_SMOOTHER
@@ -107,14 +107,14 @@
 ff #mem_whee_ta_data_gpio
 ff #mem_whee_tb_data_gpio
 ff #mem_matrix_public_gpio
-ff #mem_config_select_device_button_gpio
+0a #mem_config_select_device_button_gpio
 ff #mem_customer_key_gpio
 ff #mem_firebutton_gpio
 ff #mem_dpi_another_button_gpio
 ff #mem_mouse_logo_led_gpio
-ff #mem_mouse_1io2led_multi_24gled
-ff #mem_mouse_1io2led_multi_bt1led
-ff #mem_mouse_1io2led_multi_bt2led
+0c #mem_mouse_1io2led_multi_24gled
+8c #mem_mouse_1io2led_multi_bt1led
+09 #mem_mouse_1io2led_multi_bt2led
 ff #mem_mouse_low_voltage_alarm_gpio
 ff #mem_mouse_dpi_gpio
 
@@ -153,16 +153,16 @@
 
 #device parm
 mem_device_option:08
-mem_device_number:01   #01--only 2.4g   02--2.4g+ble
+mem_device_number:02   #01:only 2.4g   02:2.4g+ble    03:2.4g+ble+ble
 
-mem_lpm_mode:01
+mem_lpm_mode:00
 mem_lpm_mult:20
 mem_lpm_mult_init:20
 
 mem_device_set_analog_bit_set:00 00 00
 
 mem_device_flag:
-00		#00--24g 01--bt
+01		#00--24g 01--bt
 34
 #ff ff ff ff ff ff			#eeprom need
 mem_device2_type:
@@ -273,14 +273,14 @@
 
 
 mem_le_name_len:
-'BT5.2 Mouse
+'BT5.1 Mouse
 
 mem_le_name_patch_len:	#max 18bytes
-'BT5.2 Mouse
+'BT5.1 Mouse
 
 mem_le_interval_min:
-07 00 #min interval
-07 00 #max interval
+06 00 #min interval
+09 00 #max interval
 20 00 #latency
 64 00 #timeout
 
@@ -299,26 +299,52 @@
 #mem_otp_offset_le_locall_addr2:
 #mem_otp_offset_le_locall_addr2_end:
 
-mem_otp_offset_dpi:ef 1b 										#7151 begin 		200 count
-mem_otp_offset_dpi_end:52 1c 								#7250 end
+#otp write info offset
+mem_otp_offset_dpi:23 1a                            #6691 begin 400count ----------info begin	
+mem_otp_offset_dpi_end:ea 1a						#6890 end   1byte-->4bit storage
+
+mem_otp_offset_device_flag:eb 1a					#6891 begin		400 count
+mem_otp_offset_device_flag_end:b2 1b				#7090 end   1byte-->4bit storage
+
+mem_otp_offset_24g_addr:b3 1b						#7091 begin		30 count
+mem_otp_offset_24g_addr_end:2a 1c					#7210 end   4byte
 
-mem_otp_offset_device_flag:53 1c 							#7251 begin             400 count 
-mem_otp_offset_device_flag_end:1a 1d						#7450 end
+mem_otp_offset_le_addr1:2b 1c						#7211 begin		30 count
+mem_otp_offset_le_addr1_end:de 1c					#7390 end   6byte
 
-mem_otp_offset_24g_addr:1b 1d								#7451 begin		30 count
-mem_otp_offset_24g_addr_end:92 1d						#7570 end		
+mem_otp_offset_le_locall_addr1:df 1c				#7391 begin		30 count
+mem_otp_offset_le_locall_addr1_end:92 1d			#7570 end   6byte
 
-mem_otp_offset_le_addr1:93 1d								#7571 begin		30 count
-mem_otp_offset_le_addr1_end:46 1e						#7750 end
+mem_otp_offset_le_addr2:93 1d						#7571 begin		30 count
+mem_otp_offset_le_addr2_end:46 1e					#7750 end   6byte
 
-mem_otp_offset_le_locall_addr1:47 1e						#7751 begin		30 count
-mem_otp_offset_le_locall_addr1_end:fa 1e					#7930  end
+mem_otp_offset_le_locall_addr2:47 1e				#7751 begin		30 count
+mem_otp_offset_le_locall_addr2_end:fa 1e			#7930  end  6byte
 
-mem_otp_offset_le_addr_increase_count:fb 1e			#7931 begin		100 count
-mem_otp_offset_le_addr_increase_count_end:ac 1f		#8108 end
+mem_otp_offset_le_addr_increase_count:fb 1e			#7931 begin		89 count
+mem_otp_offset_le_addr_increase_count_end:ac 1f		#8108 end   2byte			----------info over	
 
 mem_otp_offset_app_initflag:ae 1f		#8110 end
 
+# mem_otp_offset_dpi:ef 1b 										#7151 begin 		200 count
+# mem_otp_offset_dpi_end:52 1c 								#7250 end
+
+# mem_otp_offset_device_flag:53 1c 							#7251 begin             400 count 
+# mem_otp_offset_device_flag_end:1a 1d						#7450 end
+
+# mem_otp_offset_24g_addr:1b 1d								#7451 begin		30 count
+# mem_otp_offset_24g_addr_end:92 1d						#7570 end		
+
+# mem_otp_offset_le_addr1:93 1d								#7571 begin		30 count
+# mem_otp_offset_le_addr1_end:46 1e						#7750 end
+
+# mem_otp_offset_le_locall_addr1:47 1e						#7751 begin		30 count
+# mem_otp_offset_le_locall_addr1_end:fa 1e					#7930  end
+
+# mem_otp_offset_le_addr_increase_count:fb 1e			#7931 begin		89 count    2byte
+# mem_otp_offset_le_addr_increase_count_end:ac 1f		#8108 end
+
+# mem_otp_offset_app_initflag:ae 1f		#8110 end
 #usb
 mem_usb_offline_check_gpio:ff
 
Index: util/otpcheck.pl
===================================================================
--- /1121s/1121se/branch/mouse/mouse_public_1M/util/otpcheck.pl	(nonexistent)
+++ /1121s/1121se/branch/mouse/mouse_public_1M/util/otpcheck.pl	(working copy)
@@ -0,0 +1,76 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use File::Spec;  
+# 获取当前脚本的目录路径
+my $current_dir = File::Spec->rel2abs('.');
+my $parent_dir = File::Spec->catdir($current_dir, '..');  # 获取上一级目录
+
+# 指定要搜索的文件名
+my $filename = File::Spec->catfile($parent_dir, 'output', 'otp.dat');
+# 打开文件进行读取
+open(my $fh, '<',$filename) or die "无法打开文件 '$filename':$!";
+
+# 读取整个文件到数组中
+my @file_content = <$fh>;
+chomp @file_content;  # 移除每行的换行符
+
+# 关闭文件句柄
+close($fh);
+
+# 初始化变量
+my $found = 0;
+my $otp_end_address = 0;
+# 循环遍历文件内容，每次移动一个字节
+for my $start (0 ..$#file_content - 3) {
+    # 提取从当前起始位置开始的四个字节
+    my $chunk = join('', @file_content[$start .. $start + 3]);
+    
+    # 检查这四个字节是否匹配指定的字符串
+    if ($chunk eq '55aaaa55') {
+        $otp_end_address = $start +9;
+        # print "After adding 9 to the start position: $start\n";
+        $found = 1;
+    }
+}
+
+# 如果找到了 "55aaaa55"，则继续处理 sched.rom 文件
+if ($found) {
+    my $sched_filename = File::Spec->catfile($parent_dir, 'output', 'sched.rom');
+    # 打开文件进行读取
+    open(my $sched_fh, '<',$sched_filename) or die "无法打开文件 '$sched_filename'$!";
+    # 读取整个文件到字符串中
+    my $sched_content = do { local$/; <$sched_fh> };
+    chomp $sched_content;  # 移除字符串末尾的换行符
+    # print "sched_content: $sched_content\n";
+    # 关闭文件句柄
+    close($sched_fh);
+    # 在 sched_content 中查找 "mem_otp_offset_dpi:"
+    my $sched_position = index($sched_content, 'mem_otp_offset_dpi:');
+    # 如果找到了 "mem_otp_offset_dpi:"
+    if ($sched_position != -1) {
+        # 获取 "mem_otp_offset_dpi:" 后面的两个字节
+        my $five_bytes_with_spaces = substr($sched_content, $sched_position + length("mem_otp_offset_dpi:"), 5);
+        $five_bytes_with_spaces =~ s/ //g;  # 移除空格
+        my $five_bytes =$five_bytes_with_spaces;
+        # 字节颠倒
+        my $reversed_bytes = substr($five_bytes, 2, 2) . substr($five_bytes, 0, 2);
+        my $decimal_value = hex($reversed_bytes);
+        # 打印找到的字符串位置信息以及后面跟随的两个字节
+        print "Original otp dpi store start little-endian bytes: $five_bytes\n";
+        print "Reversed (big-endian) bytes:  $decimal_value\n";
+        print "otp end bytes:  $otp_end_address\n";
+        if($decimal_value>$otp_end_address)
+        {
+            print"otp check done";
+        }
+        else
+        {
+            die "系统错误：在文件 '$sched_filename' 中找不到字符串 'mem_otp_offset_dpi:'\n";
+        }
+    } else {
+        print "String 'mem_otp_offset_dpi:' not found in file '$sched_filename'.\n";
+    }
+}
+
+
