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
6dbc960f
Commit
6dbc960f
authored
Sep 12, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IO, max limit for number of channels for a card removed
parent
ab3f39d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
src/lib/rt/src/rt_io_base.c
src/lib/rt/src/rt_io_base.c
+75
-0
No files found.
src/lib/rt/src/rt_io_base.c
View file @
6dbc960f
...
...
@@ -1680,6 +1680,7 @@ static pwr_tStatus io_init_card(
if
(
ok
)
{
/* Treat this card in this process */
strcpy
(
attrname
,
cname
);
strcat
(
attrname
,
".MaxNoOfChannels"
);
sts
=
gdh_GetObjectInfo
(
attrname
,
&
maxchan
,
sizeof
(
maxchan
));
...
...
@@ -1693,6 +1694,80 @@ static pwr_tStatus io_init_card(
}
}
if
(
!
fix_channels
)
{
/* Count number of channels */
maxchan
=
0
;
sts
=
gdh_GetChild
(
objid
,
&
chan
);
while
(
ODD
(
sts
))
{
sts
=
gdh_GetObjectClass
(
chan
,
&
class
);
if
(
EVEN
(
sts
))
return
sts
;
switch
(
class
)
{
case
pwr_cClass_ChanAi
:
case
pwr_cClass_ChanAit
:
case
pwr_cClass_ChanAo
:
case
pwr_cClass_ChanDo
:
case
pwr_cClass_ChanDi
:
case
pwr_cClass_ChanIi
:
case
pwr_cClass_ChanIo
:
case
pwr_cClass_ChanCo
:
maxchan
++
;
break
;
default:
;
}
sts
=
gdh_GetNextSibling
(
chan
,
&
chan
);
}
if
(
!
maxchan
)
{
gdh_sAttrDef
*
bd
;
int
rows
;
int
i
;
sts
=
gdh_GetObjectBodyDef
(
class
,
&
bd
,
&
rows
,
pwr_cNObjid
);
if
(
EVEN
(
sts
))
return
sts
;
for
(
i
=
0
;
i
<
rows
;
i
++
)
{
switch
(
bd
[
i
].
attr
->
Param
.
TypeRef
)
{
case
pwr_cClass_ChanAi
:
case
pwr_cClass_ChanAit
:
case
pwr_cClass_ChanAo
:
case
pwr_cClass_ChanDi
:
case
pwr_cClass_ChanDo
:
case
pwr_cClass_ChanIi
:
case
pwr_cClass_ChanIo
:
case
pwr_cClass_ChanCo
:
maxchan
++
;
break
;
default:
if
(
bd
[
i
].
attr
->
Param
.
Info
.
Flags
&
PWR_MASK_CLASS
)
{
gdh_sAttrDef
*
bd2
;
int
rows2
,
ii
;
sts
=
gdh_GetObjectBodyDef
(
bd
[
i
].
attr
->
Param
.
TypeRef
,
&
bd2
,
&
rows2
,
pwr_cNObjid
);
if
(
EVEN
(
sts
))
return
sts
;
for
(
ii
=
0
;
ii
<
rows2
;
ii
++
)
{
switch
(
bd2
[
ii
].
attr
->
Param
.
TypeRef
)
{
case
pwr_cClass_ChanAi
:
case
pwr_cClass_ChanAit
:
case
pwr_cClass_ChanAo
:
case
pwr_cClass_ChanDi
:
case
pwr_cClass_ChanDo
:
case
pwr_cClass_ChanIi
:
case
pwr_cClass_ChanIo
:
case
pwr_cClass_ChanCo
:
maxchan
++
;
break
;
default:
;
}
}
free
(
(
char
*
)
bd2
);
}
}
}
free
(
(
char
*
)
bd
);
}
}
cp
=
calloc
(
1
,
sizeof
(
io_sCard
));
cp
->
chanlist
=
(
io_sChannel
*
)
calloc
(
maxchan
,
sizeof
(
io_sChannel
));
cp
->
ChanListSize
=
maxchan
;
...
...
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