Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
e974cea4
Commit
e974cea4
authored
Sep 30, 2008
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed csup_Exec to use CLOCK_MONTONIC
parent
db89d4eb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
12 deletions
+17
-12
src/exe/rt_emon/src/rt_emon.c
src/exe/rt_emon/src/rt_emon.c
+6
-5
src/exe/rt_io_comm/src/rt_io_comm.c
src/exe/rt_io_comm/src/rt_io_comm.c
+11
-7
No files found.
src/exe/rt_emon/src/rt_emon.c
View file @
e974cea4
/*
/*
* Proview $Id: rt_emon.c,v 1.1
3 2008-01-24 09:56:58
claes Exp $
* Proview $Id: rt_emon.c,v 1.1
4 2008-09-30 14:00:54
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -1205,16 +1205,17 @@ cSup_exec (
...
@@ -1205,16 +1205,17 @@ cSup_exec (
)
)
{
{
pwr_sClass_CycleSup
*
o
=
(
pwr_sClass_CycleSup
*
)
sp
->
op
;
pwr_sClass_CycleSup
*
o
=
(
pwr_sClass_CycleSup
*
)
sp
->
op
;
pwr_t
Delta
Time
dnow
;
pwr_tTime
dnow
;
pwr_t
Delta
Time
nextLimit
;
pwr_tTime
nextLimit
;
int
diff
;
int
diff
;
time_Uptime
(
NULL
,
&
dnow
,
NULL
);
// time_Uptime(NULL, &dnow, NULL);
clock_gettime
(
CLOCK_MONOTONIC
,
&
dnow
);
nextLimit
.
tv_nsec
=
o
->
NextLimit
.
tv_nsec
;
nextLimit
.
tv_nsec
=
o
->
NextLimit
.
tv_nsec
;
nextLimit
.
tv_sec
=
o
->
NextLimit
.
tv_sec
;
nextLimit
.
tv_sec
=
o
->
NextLimit
.
tv_sec
;
o
->
DetectCount
++
;
o
->
DetectCount
++
;
diff
=
time_
D
comp
(
&
dnow
,
&
nextLimit
);
diff
=
time_
A
comp
(
&
dnow
,
&
nextLimit
);
if
(
diff
>
0
||
(
o
->
Delayed
&&
!
o
->
DelayNoted
))
{
if
(
diff
>
0
||
(
o
->
Delayed
&&
!
o
->
DelayNoted
))
{
if
(
o
->
AlarmCheck
&&
o
->
DetectOn
&&
!
o
->
Blocked
)
{
if
(
o
->
AlarmCheck
&&
o
->
DetectOn
&&
!
o
->
Blocked
)
{
...
...
src/exe/rt_io_comm/src/rt_io_comm.c
View file @
e974cea4
/*
/*
* Proview $Id: rt_io_comm.c,v 1.
5 2007-05-18 12:04:17
claes Exp $
* Proview $Id: rt_io_comm.c,v 1.
6 2008-09-30 14:05:14
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -78,8 +78,8 @@ int main (int argc, char **argv)
...
@@ -78,8 +78,8 @@ int main (int argc, char **argv)
char
mp
[
2000
];
char
mp
[
2000
];
qcom_sGet
get
;
qcom_sGet
get
;
pwr_tTime
now
;
pwr_tTime
now
;
pwr_t
Delta
Time
next
;
pwr_tTime
next
;
pwr_t
Delta
Time
after
;
pwr_tTime
after
;
pwr_tDeltaTime
cycle
;
pwr_tDeltaTime
cycle
;
lst_sEntry
*
csup_lh
;
lst_sEntry
*
csup_lh
;
int
delay_action
=
0
;
int
delay_action
=
0
;
...
@@ -106,6 +106,7 @@ int main (int argc, char **argv)
...
@@ -106,6 +106,7 @@ int main (int argc, char **argv)
if
(
init_io
)
{
if
(
init_io
)
{
double
f
;
double
f
;
sts
=
io_init
(
io_mProcess_IoComm
,
pwr_cNObjid
,
&
io_ctx
,
1
,
ihp
->
CycleTimeBus
);
sts
=
io_init
(
io_mProcess_IoComm
,
pwr_cNObjid
,
&
io_ctx
,
1
,
ihp
->
CycleTimeBus
);
if
(
ODD
(
sts
))
if
(
ODD
(
sts
))
errh_SetStatus
(
PWR__SRUN
);
errh_SetStatus
(
PWR__SRUN
);
...
@@ -120,7 +121,8 @@ int main (int argc, char **argv)
...
@@ -120,7 +121,8 @@ int main (int argc, char **argv)
cycle
.
tv_sec
=
f
;
cycle
.
tv_sec
=
f
;
cycle
.
tv_nsec
=
(
ihp
->
CycleTimeBus
-
f
)
*
1.0e9
;
cycle
.
tv_nsec
=
(
ihp
->
CycleTimeBus
-
f
)
*
1.0e9
;
cycle
.
tv_nsec
++
;
cycle
.
tv_nsec
++
;
time_Uptime
(
&
sts
,
&
next
,
&
cycle
);
clock_gettime
(
CLOCK_MONOTONIC
,
&
next
);
time_Aadd
(
NULL
,
&
next
,
&
cycle
);
}
}
get
.
maxSize
=
sizeof
(
mp
);
get
.
maxSize
=
sizeof
(
mp
);
...
@@ -138,9 +140,11 @@ int main (int argc, char **argv)
...
@@ -138,9 +140,11 @@ int main (int argc, char **argv)
io_ScanSupLst
(
io_ctx
->
SupCtx
);
io_ScanSupLst
(
io_ctx
->
SupCtx
);
clock_gettime
(
CLOCK_REALTIME
,
&
now
);
clock_gettime
(
CLOCK_REALTIME
,
&
now
);
time_Uptime
(
&
sts
,
&
after
,
NULL
);
clock_gettime
(
CLOCK_MONOTONIC
,
&
after
);
time_Uptime
(
&
sts
,
&
next
,
&
cycle
);
next
=
after
;
delay_action
=
csup_Exec
(
&
sts
,
csup_lh
,
&
next
,
&
after
,
&
now
);
time_Aadd
(
NULL
,
&
next
,
&
cycle
);
delay_action
=
csup_Exec
(
&
sts
,
csup_lh
,
(
pwr_tDeltaTime
*
)
&
next
,
(
pwr_tDeltaTime
*
)
&
after
,
&
now
);
if
(
delay_action
==
2
)
if
(
delay_action
==
2
)
ihp
->
IOReadWriteFlag
=
FALSE
;
ihp
->
IOReadWriteFlag
=
FALSE
;
...
...
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