Index: do.bat
===================================================================
--- /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_drag_6key/do.bat	(revision 4029)
+++ /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_drag_6key/do.bat	(working copy)
@@ -81,7 +81,7 @@
 perl ../util/mergepatch.pl mouse_ble_att_list usb_kbdata_vendor_define usb_kbdata usb_msdata usb_devicedata usb_confdata ble_shutter_gatt_list ble_shutter_key_value_list ble_car_att_list sha256 
 perl ../util/romcrc.pl romcode.rom
 perl  ../util/mergepatch.pl otp
-
+perl  ../util/otpcheck.pl
 
 if "%device_option%" equ "shutter_dy" (
 cd ..\output
Index: output/otp.dat
===================================================================
--- /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_drag_6key/output/otp.dat	(revision 4029)
+++ /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_drag_6key/output/otp.dat	(working copy)
@@ -11,7 +11,7 @@
 00
 aa
 55
-c2
+fe
 0f
 c2
 84
@@ -24,35 +24,35 @@
 c0
 01
 01
-e0
+e1
 c0
 08
 81
-e9
+ea
 c0
 0a
 03
-af
+b4
 c0
 0a
 82
-75
+77
 c0
 0c
 02
-83
+85
 c0
 0c
 82
-42
+44
 c0
 0d
 01
-fb
+fc
 c0
 12
 83
-d1
+d6
 c0
 13
 80
@@ -64,7 +64,7 @@
 c0
 52
 81
-c7
+c8
 c0
 53
 00
@@ -76,7 +76,7 @@
 c0
 55
 01
-b6
+b7
 c0
 56
 80
@@ -84,19 +84,19 @@
 c0
 58
 82
-8d
+8f
 c0
 62
 82
-8a
+8c
 c0
 6d
 03
-80
+85
 c0
 6e
 03
-90
+95
 20
 20
 23
@@ -108,19 +108,19 @@
 c0
 12
 81
-9f
+a0
 c0
 13
 01
-a4
+a5
 c0
 1c
 83
-cb
+d0
 c0
 26
 83
-cf
+d4
 c1
 7f
 80
@@ -608,7 +608,7 @@
 24
 42
 81
-99
+9a
 6f
 e0
 ce
@@ -1534,9 +1534,9 @@
 00
 05
 20
-20
-67
-be
+60
+00
+00
 20
 40
 67
@@ -1626,9 +1626,9 @@
 80
 05
 20
-20
-67
-be
+60
+00
+00
 18
 e2
 7e
@@ -1642,6 +1642,10 @@
 00
 00
 70
+48
+9e
+14
+70
 4e
 c9
 00
@@ -1656,7 +1660,7 @@
 20
 3a
 01
-9c
+9d
 20
 20
 65
@@ -1784,7 +1788,7 @@
 c0
 00
 81
-bc
+bd
 20
 20
 66
@@ -1800,7 +1804,7 @@
 c0
 03
 01
-c0
+c1
 20
 60
 00
@@ -1808,7 +1812,7 @@
 20
 40
 01
-c2
+c3
 20
 20
 67
@@ -1892,7 +1896,7 @@
 24
 3a
 01
-d7
+d8
 20
 20
 65
@@ -1908,7 +1912,7 @@
 20
 40
 01
-dd
+de
 da
 60
 4a
@@ -1968,7 +1972,7 @@
 20
 20
 01
-e0
+e1
 70
 8a
 0f
@@ -2063,6 +2067,10 @@
 10
 70
 8a
+88
+40
+70
+8a
 13
 cd
 70
@@ -2084,7 +2092,7 @@
 20
 40
 02
-4a
+4c
 6f
 e0
 c4
@@ -2096,7 +2104,7 @@
 24
 55
 81
-f7
+f8
 37
 d9
 82
@@ -2112,7 +2120,7 @@
 c0
 08
 02
-37
+39
 6f
 e0
 c4
@@ -2156,7 +2164,7 @@
 20
 40
 02
-29
+2b
 70
 80
 43
@@ -2180,15 +2188,15 @@
 20
 40
 03
-52
+57
 20
 40
 03
-7d
+82
 20
 40
 02
-23
+25
 70
 41
 48
@@ -2200,7 +2208,7 @@
 20
 20
 03
-7f
+84
 20
 75
 80
@@ -2232,7 +2240,7 @@
 c0
 0c
 02
-2f
+31
 6f
 e0
 c4
@@ -2324,7 +2332,7 @@
 20
 20
 02
-15
+17
 6f
 e0
 c1
@@ -2332,7 +2340,7 @@
 c0
 05
 02
-45
+47
 20
 20
 22
@@ -2360,7 +2368,7 @@
 20
 35
 82
-71
+73
 6f
 e2
 02
@@ -2528,7 +2536,7 @@
 20
 20
 02
-5b
+5d
 20
 40
 68
@@ -2645,10 +2653,14 @@
 40
 a6
 0a
+20
+40
+70
+d7
 58
 00
 03
-0e
+11
 67
 e1
 43
@@ -2656,7 +2668,7 @@
 58
 00
 02
-da
+dd
 67
 e1
 43
@@ -2664,7 +2676,7 @@
 58
 00
 03
-00
+03
 67
 e1
 43
@@ -2680,7 +2692,7 @@
 58
 00
 02
-a4
+a7
 67
 e1
 43
@@ -2696,7 +2708,7 @@
 58
 00
 02
-b9
+bc
 67
 e1
 43
@@ -2728,7 +2740,7 @@
 20
 40
 02
-a9
+ac
 20
 40
 70
@@ -2772,7 +2784,7 @@
 20
 22
 82
-b4
+b7
 1f
 e2
 04
@@ -2780,7 +2792,7 @@
 20
 40
 02
-b7
+ba
 1a
 20
 a2
@@ -2788,7 +2800,7 @@
 c2
 00
 02
-ae
+b1
 20
 60
 00
@@ -2804,7 +2816,7 @@
 20
 40
 02
-ce
+d1
 20
 40
 68
@@ -2828,7 +2840,7 @@
 20
 40
 02
-c1
+c4
 20
 20
 64
@@ -2840,7 +2852,7 @@
 da
 40
 02
-c4
+c7
 20
 20
 42
@@ -2864,7 +2876,7 @@
 20
 22
 82
-cc
+cf
 6f
 e1
 45
@@ -2900,7 +2912,7 @@
 da
 40
 02
-d3
+d6
 20
 20
 42
@@ -2940,19 +2952,19 @@
 c0
 20
 02
-f7
+fa
 c0
 18
 82
-e7
+ea
 c0
 0a
 02
-e0
+e3
 c0
 0a
 82
-e2
+e5
 20
 20
 64
@@ -2992,7 +3004,7 @@
 20
 40
 02
-ea
+ed
 20
 60
 00
@@ -3004,11 +3016,11 @@
 20
 3a
 02
-ed
+f0
 20
 20
 02
-f2
+f5
 6f
 e1
 4f
@@ -3072,7 +3084,7 @@
 24
 3a
 03
-0b
+0e
 6f
 e4
 4f
@@ -3092,7 +3104,7 @@
 c0
 12
 03
-03
+06
 20
 60
 00
@@ -3116,7 +3128,7 @@
 24
 3a
 03
-0b
+0e
 6f
 e4
 4f
@@ -3141,6 +3153,14 @@
 20
 2e
 93
+df
+e0
+00
+0a
+20
+40
+70
+c8
 20
 40
 64
@@ -3180,7 +3200,7 @@
 20
 20
 03
-18
+1d
 6f
 e1
 48
@@ -3244,7 +3264,7 @@
 20
 40
 03
-35
+3a
 6f
 e1
 06
@@ -3292,7 +3312,7 @@
 c2
 00
 03
-21
+26
 20
 60
 00
@@ -3336,7 +3356,7 @@
 20
 20
 03
-3f
+44
 1a
 60
 8c
@@ -3348,7 +3368,7 @@
 20
 20
 03
-42
+47
 20
 40
 65
@@ -3372,7 +3392,7 @@
 20
 40
 03
-49
+4e
 20
 20
 65
@@ -3464,7 +3484,7 @@
 20
 40
 03
-6f
+74
 2a
 2f
 fe
@@ -3496,7 +3516,7 @@
 20
 40
 03
-6f
+74
 d8
 a0
 8a
@@ -3524,7 +3544,7 @@
 20
 21
 03
-64
+69
 20
 20
 21
@@ -3628,7 +3648,7 @@
 20
 40
 03
-a8
+ad
 70
 8a
 08
@@ -3664,7 +3684,7 @@
 20
 40
 03
-9e
+a3
 6f
 f0
 8a
@@ -3708,7 +3728,7 @@
 20
 40
 03
-a8
+ad
 70
 80
 cd
@@ -3768,7 +3788,7 @@
 c3
 02
 83
-a9
+ae
 68
 59
 01
@@ -3804,7 +3824,7 @@
 c0
 08
 03
-c8
+cd
 58
 00
 57
@@ -3848,7 +3868,7 @@
 c0
 08
 03
-c5
+ca
 58
 00
 2b
@@ -3884,7 +3904,7 @@
 20
 20
 03
-c1
+c6
 58
 00
 83
@@ -3896,7 +3916,7 @@
 20
 20
 03
-b6
+bb
 6f
 e0
 c3
@@ -3944,11 +3964,51 @@
 20
 40
 03
-d8
+e7
+6f
+e0
+c0
+cb
+79
 20
+7e
+04
 20
+40
+23
+e1
 24
-25
+55
+a3
+cb
+37
+d9
+82
+00
+1b
+22
+7e
+00
+67
+e3
+40
+b1
+6f
+e1
+c0
+c6
+6a
+20
+c0
+c9
+df
+20
+00
+03
+20
+20
+24
+2e
 60
 04
 40
@@ -4016,7 +4076,7 @@
 20
 22
 83
-eb
+fa
 e7
 e0
 80
@@ -4036,7 +4096,7 @@
 c2
 00
 03
-e5
+f4
 1a
 42
 04
@@ -4045,8 +4105,8 @@
 60
 00
 00
-8e
-43
+6a
+74
 aa
 55
 40
@@ -4190,7 +4250,7 @@
 b0
 1f
 00
-1d
+1a
 aa
 55
 02
@@ -6506,7 +6566,7 @@
 aa
 aa
 55
-52
+4f
 87
-9c
-69
+13
+f5
Index: output/ramcode.rom
===================================================================
--- /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_drag_6key/output/ramcode.rom	(revision 4029)
+++ /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_drag_6key/output/ramcode.rom	(working copy)
@@ -1,30 +1,30 @@
 c2840016
 c000001d
-c00101e0
-c00881e9
-c00a03af
-c00a8275
-c00c0283
-c00c8242
-c00d01fb
-c01283d1
+c00101e1
+c00881ea
+c00a03b4
+c00a8277
+c00c0285
+c00c8244
+c00d01fc
+c01283d6
 c0138048
 c0518089
-c05281c7
+c05281c8
 c0530053
 c0538064
-c05501b6
+c05501b7
 c05680a6
-c058828d
-c062828a
-c06d0380
-c06e0390
+c058828f
+c062828c
+c06d0385
+c06e0395
 2020235a
 c0120021
-c012819f
-c01301a4
-c01c83cb
-c02683cf
+c01281a0
+c01301a5
+c01c83d0
+c02683d4
 c17f8000
 2020235a
 2435a002
@@ -146,7 +146,7 @@
 18e27e00
 6848cec5
 98467c00
-24428199
+2442819a
 6fe0cec9
 245a0194
 18e27e00
@@ -378,7 +378,7 @@
 18a08a04
 6fe24b17
 e7e20005
-202067be
+20600000
 20406730
 243a0187
 58000034
@@ -401,14 +401,15 @@
 1ff27e00
 1fed7e00
 e7e18005
-202067be
+20600000
 18e27e00
 c0030197
 20600000
+70489e14
 704ec900
 20204325
 6fe0cec9
-203a019c
+203a019d
 20206529
 20406730
 207a0000
@@ -440,13 +441,13 @@
 efe18006
 67e1c397
 c003e704
-c00081bc
+c00081bd
 202066db
 18c08dfe
 efe08006
-c00301c0
+c00301c1
 20600000
-204001c2
+204001c3
 202067bf
 704eaa01
 7049e400
@@ -467,11 +468,11 @@
 24417806
 1a608c09
 efe08006
-243a01d7
+243a01d8
 20206547
 704ec001
 2040656b
-204001dd
+204001de
 da604aae
 dfe00003
 2020655a
@@ -486,7 +487,7 @@
 20402018
 2040310f
 2040248c
-202001e0
+202001e1
 708a0f60
 708a10aa
 708a127a
@@ -510,19 +511,20 @@
 37d98200
 7089460d
 70896f10
+708a8840
 708a13cd
 708a0610
 708a844a
 708a8540
 708a16fe
-2040024a
+2040024c
 6fe0c436
 205a70d7
-245581f7
+245581f8
 37d98200
 70813b5f
 6fe0c099
-c0080237
+c0080239
 6fe0c438
 1fe1fe04
 67f08a02
@@ -533,18 +535,18 @@
 67f18a73
 708a8660
 708a8b3b
-20400229
+2040022b
 70804300
 70804205
 58557474
 67f18968
 7089606e
-20400352
-2040037d
-20400223
+20400357
+20400382
+20400225
 7041480c
 20406f4e
-2020037f
+20200384
 20758000
 37d98200
 6fe0c11c
@@ -552,7 +554,7 @@
 37d98200
 20600000
 6fe0c099
-c00c022f
+c00c0231
 6fe0c438
 1fe1fe06
 67f08a02
@@ -575,16 +577,16 @@
 67f18a73
 708a762a
 70890204
-20200215
+20200217
 6fe0c141
-c0050245
+c0050247
 2020220e
 708a1425
 58a93f3f
 67f18a60
 708a631f
 20600000
-20358271
+20358273
 6fe2020d
 207a0000
 37d98200
@@ -626,7 +628,7 @@
 6fe1415b
 207a0000
 67e1020f
-2020025b
+2020025d
 2040686f
 204021ba
 18002a08
@@ -656,19 +658,20 @@
 20406454
 20406459
 7040a60a
-5800030e
+204070d7
+58000311
 67e143db
-580002da
+580002dd
 67e143dd
-58000300
+58000303
 67e143df
 580062d3
 67e143d3
-580002a4
+580002a7
 67e143d5
 58006329
 67e143d7
-580002b9
+580002bc
 67e143e3
 58006505
 67e14524
@@ -676,7 +679,7 @@
 2020647d
 20406f35
 7044ecff
-204002a9
+204002ac
 2040701b
 2020739a
 6fe0c6ce
@@ -687,30 +690,30 @@
 efe08011
 6848c6cf
 98467c00
-202282b4
+202282b7
 1fe20400
-204002b7
+204002ba
 1a20a201
-c20002ae
+c20002b1
 20600000
 79200407
 20206edd
-204002ce
+204002d1
 20406858
 2040676c
 2040675a
 204064bc
 204064d3
-204002c1
+204002c4
 202064d9
 da604518
-da4002c4
+da4002c7
 202042e7
 6fe0cfed
 1fe0fe01
 67e0cfed
 1fe67c03
-202282cc
+202282cf
 6fe14516
 67e14518
 20600000
@@ -719,7 +722,7 @@
 6fe0cec9
 207a0000
 da604fb8
-da4002d3
+da4002d6
 202042e0
 704fb805
 6fe0cfb9
@@ -729,10 +732,10 @@
 c000c325
 20600000
 1a627e00
-c02002f7
-c01882e7
-c00a02e0
-c00a82e2
+c02002fa
+c01882ea
+c00a02e3
+c00a82e5
 202064e0
 704fed00
 202064f4
@@ -742,11 +745,11 @@
 67e14518
 202064ef
 704ec201
-204002ea
+204002ed
 20600000
 20406730
-203a02ed
-202002f2
+203a02f0
+202002f5
 6fe14f74
 67e14eae
 6fe14f76
@@ -762,24 +765,26 @@
 6fe4450a
 207a0000
 20406730
-243a030b
+243a030e
 6fe44f02
 67e442d3
 20202e93
 6fe14398
-c0120303
+c0120306
 20600000
 204078ad
 7044f101
 20406730
 2040432b
-243a030b
+243a030e
 6fe44f02
 67e442d3
 20202e93
 6fe44fb0
 67e442d3
 20202e93
+dfe0000a
+204070c8
 2040649b
 d8e00009
 20407cef
@@ -789,7 +794,7 @@
 20407ce1
 78547c00
 2040701b
-20200318
+2020031d
 6fe148ac
 67e1442e
 204065be
@@ -805,7 +810,7 @@
 67e1068c
 18e27e00
 67e1067a
-20400335
+2040033a
 6fe1068c
 1fe22600
 6fe1067a
@@ -817,7 +822,7 @@
 1fe0a60a
 6fe10678
 1fe27200
-c2000321
+c2000326
 20600000
 1a60a405
 efe20012
@@ -828,16 +833,16 @@
 24417806
 580003e8
 98467c00
-2020033f
+20200344
 1a608c04
 efe08006
-20200342
+20200347
 2040656b
 6fe0cec9
 243a655d
 20406561
 20216500
-20400349
+2040034e
 20206557
 da604a30
 7049e50a
@@ -860,7 +865,7 @@
 708ac200
 708ac300
 d8e00006
-2040036f
+20400374
 2a2ffe0d
 2040211d
 2a4ffe0d
@@ -868,14 +873,14 @@
 d8e00005
 2040211c
 2040211e
-2040036f
+20400374
 d8a08ac2
 1a31fe00
 20402117
 1a51fe00
 20402117
 18e08fff
-20210364
+20210369
 2020214f
 2000003c
 58000f00
@@ -901,7 +906,7 @@
 6fe0c409
 67f080cd
 20000bb8
-204003a8
+204003ad
 708a08c1
 6a40c419
 df200008
@@ -910,7 +915,7 @@
 67e0c433
 6240c419
 20600000
-2040039e
+204003a3
 6ff08a09
 793ffe07
 67f08a09
@@ -921,7 +926,7 @@
 6fe0c409
 67f080cd
 20000bb8
-204003a8
+204003ad
 7080cd00
 20206fa1
 6ff080cc
@@ -936,7 +941,7 @@
 20600000
 7080cc03
 6ff08129
-c30283a9
+c30283ae
 68590164
 6049440a
 7080cc00
@@ -945,7 +950,7 @@
 708a8d12
 708a8e0a
 6fe0c099
-c00803c8
+c00803cd
 58005762
 67f10907
 70890103
@@ -956,7 +961,7 @@
 708a8d44
 708a8e0a
 6fe0c099
-c00803c5
+c00803ca
 58002bb1
 67f10907
 c6978000
@@ -965,10 +970,10 @@
 20600000
 58004189
 67f10907
-202003c1
+202003c6
 58008312
 67f10907
-202003b6
+202003bb
 6fe0c334
 c1000000
 c001b04a
@@ -980,8 +985,18 @@
 6fe240ad
 9840fe00
 67e240ad
-204003d8
-20202425
+204003e7
+6fe0c0cb
+79207e04
+204023e1
+2455a3cb
+37d98200
+1b227e00
+67e340b1
+6fe1c0c6
+6a20c0c9
+df200003
+2020242e
 600440e7
 d8c08070
 d8a040cc
@@ -998,11 +1013,11 @@
 efe08011
 e8408013
 98467c00
-202283eb
+202283fa
 e7e08013
 37d98200
 1a20a201
 1a60a601
-c20003e5
+c20003f4
 1a420400
 20600000
Index: output/sched.rom
===================================================================
--- /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_drag_6key/output/sched.rom	(revision 4029)
+++ /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_drag_6key/output/sched.rom	(working copy)
@@ -77,8 +77,8 @@
 mem_tx_power:06
 
 //save otp addr
-mem_shutter_efuse_start_offset: b0 1f
-mem_shutter_efuse_end_offset: 00 1d
+mem_shutter_efuse_start_offset:b0 1f
+mem_shutter_efuse_end_offset:00 1a
 
 mem_shutter_le_pairing_handle:2b 00
 
Index: program/patch.prog
===================================================================
--- /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_drag_6key/program/patch.prog	(revision 4029)
+++ /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_drag_6key/program/patch.prog	(working copy)
@@ -499,7 +499,8 @@
 	increase 4,contw
 	fetch 4,mem_shutter_move_data
 	istore 4,contw
-	branch shutter_dy_store_move_config_info
+	rtn
+	// branch shutter_dy_store_move_config_info
 
 p_get_move_release_data:
 	call shutter_dy_check_iphone
@@ -526,7 +527,8 @@
 	lshift4 pdata,pdata
 	lshift8 pdata,pdata
 	istore 3,contw
-	branch shutter_dy_store_move_config_info
+	rtn
+	// branch shutter_dy_store_move_config_info
 
 p_shutter_short_key_cancel:
 	copy queue,pdata
@@ -534,6 +536,7 @@
 	rtn
 
 p_move_mode_disable:
+	jam 0x14,mem_shutter_1s_timer
 	jam 0,mem_move_mode_trigger_enable
 	branch app_led_off
 
@@ -682,7 +685,7 @@
 
 	jam 0x0d,0x8946
 	jam 0x10,0x896f
-
+	jam 0x40,core_rx_cfg0
 	jam 0xcd,0x8a13
 	jam 0x10,0x8a06
 	jam 0x4a,0x8a84
@@ -862,7 +865,7 @@
 	call shutter_dy_key_conf
 	call shutter_dy_adv_conf
 	jam 0x0a,mem_lpm_overhead
-
+	call wdt_set_disable
 	setarg p_shutter_dy_process_idle
 	store 2,mem_cb_idle_process
 
@@ -1209,6 +1212,8 @@
 	branch le_l2cap_tx_update_req
 
 p_shutter_dy_process_idle:
+	arg 10, pdata //Լ96ms
+	call wdt_init_config
 	call shutter_dy_shutter_send_data_to_master
 	arg key_scan_timer,queue
 	call timer_check
@@ -1475,7 +1480,18 @@
 	iadd temp,pdata
 	store 4,mem_sleep_counter_all
 	call p_lpm_save_context
-	branch lpm_sleep_skip_cb_function+4
+	fetch 1,mem_lpm_hv_sel
+	set1 LPM_DOZE_EN_BIT, pdata
+	call lpm_write_sel_hv
+	ncall lpm_preon_counter,wake
+	until null,lpo_edge
+	copy clkn,pdata
+	store 6,mem_sleep_clkn
+	// storer clkn,6,mem_sleep_clkn
+	fetch 3,mem_lpm_isogate
+	fetchr rega,1,mem_lpm_ldo_sel
+	arg 3,loopcnt
+	branch lpm_sleep_loop
 
 p_lpm_save_context:
 	storer mark,8,mem_saved_mark
Index: sched/shutter_dy.dat
===================================================================
--- /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_drag_6key/sched/shutter_dy.dat	(revision 4029)
+++ /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_drag_6key/sched/shutter_dy.dat	(working copy)
@@ -10,8 +10,8 @@
 mem_tx_power:06
 
 //save otp addr
-mem_shutter_efuse_start_offset: b0 1f
-mem_shutter_efuse_end_offset: 00 1d
+mem_shutter_efuse_start_offset:b0 1f
+mem_shutter_efuse_end_offset:00 1a
 
 mem_shutter_le_pairing_handle:2b 00
 
Index: util/otpcheck.pl
===================================================================
--- /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_drag_6key/util/otpcheck.pl	(nonexistent)
+++ /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_drag_6key/util/otpcheck.pl	(working copy)
@@ -0,0 +1,77 @@
+#!/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_shutter_efuse_end_offset:"
+    my $sched_position = index($sched_content, 'mem_shutter_efuse_end_offset:');
+    # 如果找到了 "mem_shutter_efuse_end_offset:"
+    if ($sched_position != -1) {
+        # 获取 "mem_shutter_efuse_end_offset:" 后面的两个字节
+        my $five_bytes_with_spaces = substr($sched_content, $sched_position + length("mem_shutter_efuse_end_offset:"), 5);
+        $five_bytes_with_spaces =~ s/ //g;  # 移除空格
+        my $five_bytes =$five_bytes_with_spaces;
+        print "Q:  $five_bytes\n";
+        # 字节颠倒
+        my $reversed_bytes = substr($five_bytes, 2, 2) . substr($five_bytes, 0, 2);
+        my $decimal_value = hex($reversed_bytes);
+        # 打印找到的字符串位置信息以及后面跟随的两个字节
+        print "Original otp 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 "otp check failed, please check mem_shutter_efuse_end_offset'\n";
+        }
+    } else {
+        print "String 'mem_shutter_efuse_end_offset:' not found in file '$sched_filename'.\n";
+    }
+}
+
+
