Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re860_factory
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
waterword
re860_factory
Commits
1261225a
Commit
1261225a
authored
Oct 20, 2025
by
lyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:产测rtc检测条件增加基于osf寄存器
parent
1591ab36
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
factoryTest_plugin/factory_testRtc.js
factoryTest_plugin/factory_testRtc.js
+23
-0
No files found.
factoryTest_plugin/factory_testRtc.js
View file @
1261225a
...
...
@@ -218,6 +218,29 @@ function getRtcTime() {
return
{
err
:
1
,
msg
:
'
RTC device not found
'
,
time
:
'
NA
'
};
}
// 检测驱动信号
var
rtcEnPath
=
"
/sys/devices/platform/soc@3000000/2502000.twi/i2c-0/0-0051/osf
"
;
console
.
log
(
"
rtcEnPath:
"
+
rtcEnPath
);
if
(
fs
.
exists
(
"
../../../../..
"
+
rtcEnPath
))
{
// return { err: 1, msg: 'RTC enable file not found', time: 'NA' };
system
(
"
cat
"
+
rtcEnPath
+
"
> /tmp/rtc_en.txt
"
);
var
debugStr
=
fs
.
read
(
"
/tmp/rtc_en.txt
"
,
"
r
"
);
console
.
log
(
"
debugStr:
"
+
debugStr
);
if
(
debugStr
===
null
||
debugStr
===
undefined
)
{
console
.
log
(
"
Failed to read data from file.
"
);
return
{
err
:
1
,
msg
:
'
Failed to read RTC enable file
'
,
time
:
'
NA
'
};
}
var
stateStr
=
debugStr
.
trim
();
if
(
stateStr
==
"
1
"
)
{
return
{
err
:
1
,
msg
:
'
RTC is disabled by driver
'
,
time
:
'
NA
'
};
}
}
// 1. 执行 hwclock
system
(
'
hwclock -f /dev/rtc1 > /tmp/hwRtc.txt 2>&1
'
);
// 把 stderr 也重定向
const
raw
=
fs
.
read
(
'
/tmp/hwRtc.txt
'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment