Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Compact Universal Timing Endpoint based on White Rabbit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Compact Universal Timing Endpoint based on White Rabbit
Commits
3abad7aa
Commit
3abad7aa
authored
Dec 02, 2014
by
Qiang Du
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add get-time.sh from gsi-timing-starter-kit
parent
4f605044
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
get-time.sh
tools/get-time.sh
+22
-0
No files found.
tools/get-time.sh
0 → 100755
View file @
3abad7aa
#! /bin/bash
# http://www.ohwr.org/projects/gsi-timing-starter-kit/wiki/Read_the_current_time
dev
=
"
$1
"
FLAGS
=
"-p -a 32 -d 32 -r 0"
EB_READ
=
"eb-read"
while
true
;
do
UTClo
=
0x
`
$EB_READ
$FLAGS
$dev
0x20308/4
`
UTChi
=
0x
`
$EB_READ
$FLAGS
$dev
0x2030C/4
`
CNT
=
0x
`
$EB_READ
$FLAGS
$dev
0x20304/4
`
UTClon
=
0x
`
$EB_READ
$FLAGS
$dev
0x20308/4
`
if
test
$UTClo
==
$UTClon
;
then
break
;
fi
done
NS
=
$((
CNT
*
8
))
UTC
=
$((
(
UTChi%256
)*
4294967296
+
UTClo
))
printf
"%d.%09d = "
$UTC
$NS
echo
-n
`
date
+
"%Y-%m-%d %H:%M:%S"
-d
@
$UTC
`
printf
".%09d
\n
"
$NS
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