Index: do.bat
===================================================================
--- /1121s/branch/mouse/XZR_Project/1m/Only_24G_8179/do.bat	(revision 3063)
+++ /1121s/branch/mouse/XZR_Project/1m/Only_24G_8179/do.bat	(working copy)
@@ -93,9 +93,9 @@
 echo create auth rom
 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/mergepatch.pl otp
+perl ../util/otpcheck.pl 
+echo.
 if "%device_option%" equ "mouse" (
 cd ..\output
 copy eeprom.dat ..\util\eeprom.dat
Index: output/otp.dat
===================================================================
--- /1121s/branch/mouse/XZR_Project/1m/Only_24G_8179/output/otp.dat	(revision 3063)
+++ /1121s/branch/mouse/XZR_Project/1m/Only_24G_8179/output/otp.dat	(working copy)
@@ -6586,40 +6586,10 @@
 ff
 aa
 55
-2e
-00
-fc
-48
-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
+1a
+49
 09
 5a
 06
@@ -6837,8 +6807,8 @@
 aa
 aa
 55
-6e
-58
-35
-8c
+d1
+4d
+42
+f6
 20
Index: sched/mouse.dat
===================================================================
--- /1121s/branch/mouse/XZR_Project/1m/Only_24G_8179/sched/mouse.dat	(revision 3063)
+++ /1121s/branch/mouse/XZR_Project/1m/Only_24G_8179/sched/mouse.dat	(working copy)
@@ -394,22 +394,22 @@
 09 00
 ff ff
 
-mem_sensor_ka8ul_init:
-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
+# mem_sensor_ka8ul_init:
+# 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
 
 mem_sensor_8009_init:
 09 5a
Index: util/otpcheck.pl
===================================================================
--- /1121s/branch/mouse/XZR_Project/1m/Only_24G_8179/util/otpcheck.pl	(nonexistent)
+++ /1121s/branch/mouse/XZR_Project/1m/Only_24G_8179/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";
+    }
+}
+
+
