Index: do.bat
===================================================================
--- /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_6key_public/do.bat	(revision 4132)
+++ /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_6key_public/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_6key_public/output/otp.dat	(revision 4132)
+++ /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_6key_public/output/otp.dat	(working copy)
@@ -11,7 +11,7 @@
 00
 aa
 55
-06
+3e
 0f
 c2
 84
@@ -32,19 +32,19 @@
 c0
 0a
 03
-80
+84
 c0
 0a
 82
-6a
+6b
 c0
 0c
 02
-78
+79
 c0
 0c
 82
-37
+38
 c0
 0d
 01
@@ -52,7 +52,7 @@
 c0
 12
 83
-a2
+a6
 c0
 13
 80
@@ -84,19 +84,19 @@
 c0
 58
 82
-82
+83
 c0
 62
 82
-7f
+80
 c0
 6d
 03
-51
+55
 c0
 6e
 03
-61
+65
 20
 20
 23
@@ -116,11 +116,11 @@
 c0
 1c
 83
-9c
+a0
 c0
 26
 83
-a0
+a4
 c1
 7f
 80
@@ -2019,6 +2019,10 @@
 10
 70
 8a
+88
+40
+70
+8a
 13
 cd
 70
@@ -2040,7 +2044,7 @@
 20
 40
 02
-3f
+40
 6f
 e0
 c4
@@ -2068,7 +2072,7 @@
 c0
 08
 02
-2c
+2d
 6f
 e0
 c4
@@ -2112,7 +2116,7 @@
 20
 40
 02
-1e
+1f
 70
 80
 43
@@ -2136,15 +2140,15 @@
 20
 40
 03
-23
+27
 20
 40
 03
-4e
+52
 20
 40
 02
-18
+19
 70
 41
 48
@@ -2156,7 +2160,7 @@
 20
 20
 03
-50
+54
 20
 75
 80
@@ -2188,7 +2192,7 @@
 c0
 0c
 02
-24
+25
 6f
 e0
 c4
@@ -2280,7 +2284,7 @@
 20
 20
 02
-0a
+0b
 6f
 e0
 c1
@@ -2288,7 +2292,7 @@
 c0
 05
 02
-3a
+3b
 20
 20
 22
@@ -2316,7 +2320,7 @@
 20
 35
 82
-66
+67
 6f
 e2
 02
@@ -2484,7 +2488,7 @@
 20
 20
 02
-50
+51
 20
 40
 68
@@ -2601,10 +2605,14 @@
 40
 a6
 0a
+20
+40
+70
+d7
 58
 00
 02
-e0
+e2
 67
 e1
 43
@@ -2612,7 +2620,7 @@
 58
 00
 02
-b5
+b7
 67
 e1
 43
@@ -2620,7 +2628,7 @@
 58
 00
 02
-d2
+d4
 67
 e1
 43
@@ -2636,7 +2644,7 @@
 58
 00
 02
-99
+9b
 67
 e1
 43
@@ -2652,7 +2660,7 @@
 58
 00
 02
-ae
+b0
 67
 e1
 43
@@ -2684,7 +2692,7 @@
 20
 40
 02
-9e
+a0
 20
 40
 70
@@ -2728,7 +2736,7 @@
 20
 22
 82
-a9
+ab
 1f
 e2
 04
@@ -2736,7 +2744,7 @@
 20
 40
 02
-ac
+ae
 1a
 20
 a2
@@ -2744,7 +2752,7 @@
 c2
 00
 02
-a3
+a5
 20
 60
 00
@@ -2792,11 +2800,11 @@
 c0
 20
 02
-c9
+cb
 c0
 18
 82
-b9
+bb
 20
 20
 64
@@ -2808,7 +2816,7 @@
 20
 40
 02
-bc
+be
 20
 60
 00
@@ -2820,11 +2828,11 @@
 20
 3a
 02
-bf
+c1
 20
 20
 02
-c4
+c6
 6f
 e1
 4f
@@ -2888,7 +2896,7 @@
 24
 3a
 02
-dd
+df
 6f
 e4
 4f
@@ -2908,7 +2916,7 @@
 c0
 12
 02
-d5
+d7
 20
 60
 00
@@ -2932,7 +2940,7 @@
 24
 3a
 02
-dd
+df
 6f
 e4
 4f
@@ -2957,6 +2965,14 @@
 20
 2e
 93
+df
+e0
+00
+0a
+20
+40
+70
+c8
 20
 40
 64
@@ -2996,7 +3012,7 @@
 20
 20
 02
-ea
+ee
 6f
 e1
 48
@@ -3060,7 +3076,7 @@
 20
 40
 03
-07
+0b
 6f
 e1
 06
@@ -3108,7 +3124,7 @@
 c2
 00
 02
-f3
+f7
 20
 60
 00
@@ -3152,7 +3168,7 @@
 20
 20
 03
-11
+15
 1a
 60
 8c
@@ -3164,7 +3180,7 @@
 20
 20
 03
-14
+18
 20
 40
 65
@@ -3188,7 +3204,7 @@
 20
 40
 03
-1b
+1f
 20
 20
 65
@@ -3276,7 +3292,7 @@
 20
 40
 03
-40
+44
 2a
 2f
 fe
@@ -3308,7 +3324,7 @@
 20
 40
 03
-40
+44
 d8
 a0
 8a
@@ -3336,7 +3352,7 @@
 20
 21
 03
-35
+39
 20
 20
 21
@@ -3440,7 +3456,7 @@
 20
 40
 03
-79
+7d
 70
 8a
 08
@@ -3476,7 +3492,7 @@
 20
 40
 03
-6f
+73
 6f
 f0
 8a
@@ -3520,7 +3536,7 @@
 20
 40
 03
-79
+7d
 70
 80
 cd
@@ -3580,7 +3596,7 @@
 c3
 02
 83
-7a
+7e
 68
 59
 01
@@ -3616,7 +3632,7 @@
 c0
 08
 03
-99
+9d
 58
 00
 57
@@ -3660,7 +3676,7 @@
 c0
 08
 03
-96
+9a
 58
 00
 2b
@@ -3696,7 +3712,7 @@
 20
 20
 03
-92
+96
 58
 00
 83
@@ -3708,7 +3724,7 @@
 20
 20
 03
-87
+8b
 6f
 e0
 c3
@@ -3756,11 +3772,51 @@
 20
 40
 03
-a9
+b7
+6f
+e0
+c0
+cb
+79
+20
+7e
+04
+20
+40
+23
+e1
+24
+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
-25
+2e
 60
 04
 40
@@ -3828,7 +3884,7 @@
 20
 22
 83
-bc
+ca
 e7
 e0
 80
@@ -3848,7 +3904,7 @@
 c2
 00
 03
-b6
+c4
 1a
 42
 04
@@ -3857,8 +3913,8 @@
 60
 00
 00
-df
-e3
+5c
+66
 aa
 55
 40
@@ -6231,5 +6287,5 @@
 55
 98
 70
-00
-2e
+e0
+a0
Index: output/ramcode.rom
===================================================================
--- /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_6key_public/output/ramcode.rom	(revision 4132)
+++ /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_6key_public/output/ramcode.rom	(working copy)
@@ -2,12 +2,12 @@
 c000001d
 c00101d5
 c00881de
-c00a0380
-c00a826a
-c00c0278
-c00c8237
+c00a0384
+c00a826b
+c00c0279
+c00c8238
 c00d01f0
-c01283a2
+c01283a6
 c0138048
 c0518082
 c05281bf
@@ -15,16 +15,16 @@
 c053805d
 c05501ae
 c056809e
-c0588282
-c062827f
-c06d0351
-c06e0361
+c0588283
+c0628280
+c06d0355
+c06e0365
 2020235a
 c0120021
 c0128197
 c013019c
-c01c839c
-c02683a0
+c01c83a0
+c02683a4
 c17f8000
 2020235a
 2435a002
@@ -499,19 +499,20 @@
 37d98200
 7089460d
 70896f10
+708a8840
 708a13cd
 708a0610
 708a844a
 708a8540
 708a16fe
-2040023f
+20400240
 6fe0c436
 205a70d7
 245581ec
 37d98200
 70813b5f
 6fe0c099
-c008022c
+c008022d
 6fe0c438
 1fe1fe04
 67f08a02
@@ -522,18 +523,18 @@
 67f18a73
 708a8660
 708a8b3b
-2040021e
+2040021f
 70804300
 70804205
 58557474
 67f18968
 7089606e
-20400323
-2040034e
-20400218
+20400327
+20400352
+20400219
 7041480c
 20406f4e
-20200350
+20200354
 20758000
 37d98200
 6fe0c11c
@@ -541,7 +542,7 @@
 37d98200
 20600000
 6fe0c099
-c00c0224
+c00c0225
 6fe0c438
 1fe1fe06
 67f08a02
@@ -564,16 +565,16 @@
 67f18a73
 708a762a
 70890204
-2020020a
+2020020b
 6fe0c141
-c005023a
+c005023b
 2020220e
 708a1425
 58a93f3f
 67f18a60
 708a631f
 20600000
-20358266
+20358267
 6fe2020d
 207a0000
 37d98200
@@ -615,7 +616,7 @@
 6fe1415b
 207a0000
 67e1020f
-20200250
+20200251
 2040686f
 204021ba
 18002a08
@@ -645,19 +646,20 @@
 20406454
 20406459
 7040a60a
-580002e0
+204070d7
+580002e2
 67e143db
-580002b5
+580002b7
 67e143dd
-580002d2
+580002d4
 67e143df
 580062d3
 67e143d3
-58000299
+5800029b
 67e143d5
 58006329
 67e143d7
-580002ae
+580002b0
 67e143e3
 58006505
 67e14524
@@ -665,7 +667,7 @@
 2020647d
 20406f35
 7044ecff
-2040029e
+204002a0
 2040701b
 2020739a
 6fe0c6ce
@@ -676,11 +678,11 @@
 efe08011
 6848c6cf
 98467c00
-202282a9
+202282ab
 1fe20400
-204002ac
+204002ae
 1a20a201
-c20002a3
+c20002a5
 20600000
 79200407
 20206edd
@@ -692,15 +694,15 @@
 20406311
 202064d9
 1a627e00
-c02002c9
-c01882b9
+c02002cb
+c01882bb
 202064e0
 704ec201
-204002bc
+204002be
 20600000
 20406730
-203a02bf
-202002c4
+203a02c1
+202002c6
 6fe14f74
 67e14eae
 6fe14f76
@@ -716,24 +718,26 @@
 6fe4450a
 207a0000
 20406730
-243a02dd
+243a02df
 6fe44f02
 67e442d3
 20202e93
 6fe14398
-c01202d5
+c01202d7
 20600000
 204078ad
 7044f101
 20406730
 2040432b
-243a02dd
+243a02df
 6fe44f02
 67e442d3
 20202e93
 6fe44fb0
 67e442d3
 20202e93
+dfe0000a
+204070c8
 2040649b
 d8e00009
 20407cef
@@ -743,7 +747,7 @@
 20407ce1
 78547c00
 2040701b
-202002ea
+202002ee
 6fe148ac
 67e1442e
 204065be
@@ -759,7 +763,7 @@
 67e1068c
 18e27e00
 67e1067a
-20400307
+2040030b
 6fe1068c
 1fe22600
 6fe1067a
@@ -771,7 +775,7 @@
 1fe0a60a
 6fe10678
 1fe27200
-c20002f3
+c20002f7
 20600000
 1a60a405
 efe20012
@@ -782,16 +786,16 @@
 24417806
 580003e8
 98467c00
-20200311
+20200315
 1a608c04
 efe08006
-20200314
+20200318
 2040656b
 6fe0cec9
 243a655d
 20406561
 20216500
-2040031b
+2040031f
 20206557
 da604a30
 20406730
@@ -813,7 +817,7 @@
 708ac200
 708ac300
 d8e00006
-20400340
+20400344
 2a2ffe0d
 2040211d
 2a4ffe0d
@@ -821,14 +825,14 @@
 d8e00005
 2040211c
 2040211e
-20400340
+20400344
 d8a08ac2
 1a31fe00
 20402117
 1a51fe00
 20402117
 18e08fff
-20210335
+20210339
 2020214f
 2000003c
 58000f00
@@ -854,7 +858,7 @@
 6fe0c409
 67f080cd
 20000bb8
-20400379
+2040037d
 708a08c1
 6a40c419
 df200008
@@ -863,7 +867,7 @@
 67e0c433
 6240c419
 20600000
-2040036f
+20400373
 6ff08a09
 793ffe07
 67f08a09
@@ -874,7 +878,7 @@
 6fe0c409
 67f080cd
 20000bb8
-20400379
+2040037d
 7080cd00
 20206fa1
 6ff080cc
@@ -889,7 +893,7 @@
 20600000
 7080cc03
 6ff08129
-c302837a
+c302837e
 68590164
 6049440a
 7080cc00
@@ -898,7 +902,7 @@
 708a8d12
 708a8e0a
 6fe0c099
-c0080399
+c008039d
 58005762
 67f10907
 70890103
@@ -909,7 +913,7 @@
 708a8d44
 708a8e0a
 6fe0c099
-c0080396
+c008039a
 58002bb1
 67f10907
 c6978000
@@ -918,10 +922,10 @@
 20600000
 58004189
 67f10907
-20200392
+20200396
 58008312
 67f10907
-20200387
+2020038b
 6fe0c334
 c1000000
 c001b04a
@@ -933,8 +937,18 @@
 6fe240ad
 9840fe00
 67e240ad
-204003a9
-20202425
+204003b7
+6fe0c0cb
+79207e04
+204023e1
+2455a3cb
+37d98200
+1b227e00
+67e340b1
+6fe1c0c6
+6a20c0c9
+df200003
+2020242e
 600440e7
 d8c08070
 d8a040cc
@@ -951,11 +965,11 @@
 efe08011
 e8408013
 98467c00
-202283bc
+202283ca
 e7e08013
 37d98200
 1a20a201
 1a60a601
-c20003b6
+c20003c4
 1a420400
 20600000
Index: output/sched.rom
===================================================================
--- /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_6key_public/output/sched.rom	(revision 4132)
+++ /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_6key_public/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: 70 1a
+mem_shutter_efuse_start_offset:b0 1f
+mem_shutter_efuse_end_offset:70 1a
 
 mem_shutter_le_pairing_handle:2b 00
 
Index: program/patch.prog
===================================================================
--- /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_6key_public/program/patch.prog	(revision 4132)
+++ /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_6key_public/program/patch.prog	(working copy)
@@ -657,7 +657,7 @@
 
 	jam 0x0d,0x8946
 	jam 0x10,0x896f
-
+	jam 0x40,core_rx_cfg0
 	jam 0xcd,0x8a13
 	jam 0x10,0x8a06
 	jam 0x4a,0x8a84
@@ -837,7 +837,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
 
@@ -966,6 +966,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
@@ -1218,7 +1220,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_6key_public/sched/shutter_dy.dat	(revision 4132)
+++ /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_6key_public/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: 70 1a
+mem_shutter_efuse_start_offset:b0 1f
+mem_shutter_efuse_end_offset:70 1a
 
 mem_shutter_le_pairing_handle:2b 00
 
Index: util/otpcheck.pl
===================================================================
--- /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_6key_public/util/otpcheck.pl	(nonexistent)
+++ /1121s/branch/shutter/branch/dy/Xinfeiyi/yc1088s_xfy_6key_public/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";
+    }
+}
+
+
