Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
etherlabmaster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ICS Control System Infrastructure
etherlabmaster
Commits
ae568246
Commit
ae568246
authored
18 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Corrected error messages in get_slave().
parent
0e7ba3e0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
master/master.c
+13
-10
13 additions, 10 deletions
master/master.c
with
13 additions
and
10 deletions
master/master.c
+
13
−
10
View file @
ae568246
...
...
@@ -424,8 +424,9 @@ void ec_master_leave_operation_mode(ec_master_t *master
// wait for FSM datagram
if
(
datagram
->
state
==
EC_DATAGRAM_SENT
)
{
// active waiting
while
(
get_cycles
()
-
datagram
->
cycles_sent
<
(
cycles_t
)
EC_IO_TIMEOUT
/* us */
*
(
cpu_khz
/
1000
))
{}
<
(
cycles_t
)
EC_IO_TIMEOUT
/* us */
*
(
cpu_khz
/
1000
))
;
ecrt_master_receive
(
master
);
}
...
...
@@ -1507,10 +1508,12 @@ ec_slave_t *ecrt_master_get_slave(const ec_master_t *master, /**< Master */
)
{
unsigned
long
first
,
second
;
char
*
remainder
,
*
remainder2
;
char
*
remainder
,
*
remainder2
,
original
;
unsigned
int
alias_requested
,
alias_found
;
ec_slave_t
*
alias_slave
=
NULL
,
*
slave
;
original
=
address
;
if
(
!
address
||
address
[
0
]
==
0
)
return
NULL
;
alias_requested
=
0
;
...
...
@@ -1521,7 +1524,7 @@ ec_slave_t *ecrt_master_get_slave(const ec_master_t *master, /**< Master */
first
=
simple_strtoul
(
address
,
&
remainder
,
0
);
if
(
remainder
==
address
)
{
EC_ERR
(
"Slave address
\"
%s
\"
- First number empty!
\n
"
,
address
);
EC_ERR
(
"Slave address
\"
%s
\"
- First number empty!
\n
"
,
original
);
return
NULL
;
}
...
...
@@ -1534,7 +1537,7 @@ ec_slave_t *ecrt_master_get_slave(const ec_master_t *master, /**< Master */
}
}
if
(
!
alias_found
)
{
EC_ERR
(
"Slave address
\"
%s
\"
- Alias not found!
\n
"
,
address
);
EC_ERR
(
"Slave address
\"
%s
\"
- Alias not found!
\n
"
,
original
);
return
NULL
;
}
}
...
...
@@ -1548,7 +1551,7 @@ ec_slave_t *ecrt_master_get_slave(const ec_master_t *master, /**< Master */
if
(
slave
->
ring_position
==
first
)
return
slave
;
}
EC_ERR
(
"Slave address
\"
%s
\"
- Absolute position invalid!
\n
"
,
address
);
original
);
}
}
else
if
(
remainder
[
0
]
==
':'
)
{
// field position
...
...
@@ -1556,19 +1559,19 @@ ec_slave_t *ecrt_master_get_slave(const ec_master_t *master, /**< Master */
second
=
simple_strtoul
(
remainder
,
&
remainder2
,
0
);
if
(
remainder2
==
remainder
)
{
EC_ERR
(
"Slave address
\"
%s
\"
- Second number empty!
\n
"
,
address
);
EC_ERR
(
"Slave address
\"
%s
\"
- Second number empty!
\n
"
,
original
);
return
NULL
;
}
if
(
remainder2
[
0
])
{
EC_ERR
(
"Slave address
\"
%s
\"
- Invalid trailer!
\n
"
,
address
);
EC_ERR
(
"Slave address
\"
%s
\"
- Invalid trailer!
\n
"
,
original
);
return
NULL
;
}
if
(
alias_requested
)
{
if
(
!
ec_slave_is_coupler
(
alias_slave
))
{
EC_ERR
(
"Slave address
\"
%s
\"
: Alias slave must be bus coupler"
" in colon mode.
\n
"
,
address
);
" in colon mode.
\n
"
,
original
);
return
NULL
;
}
list_for_each_entry
(
slave
,
&
master
->
slaves
,
list
)
{
...
...
@@ -1577,7 +1580,7 @@ ec_slave_t *ecrt_master_get_slave(const ec_master_t *master, /**< Master */
return
slave
;
}
EC_ERR
(
"Slave address
\"
%s
\"
- Bus coupler %i has no %lu. slave"
" following!
\n
"
,
address
,
alias_slave
->
ring_position
,
" following!
\n
"
,
original
,
alias_slave
->
ring_position
,
second
);
return
NULL
;
}
...
...
@@ -1589,7 +1592,7 @@ ec_slave_t *ecrt_master_get_slave(const ec_master_t *master, /**< Master */
}
}
else
EC_ERR
(
"Slave address
\"
%s
\"
- Invalid format!
\n
"
,
address
);
EC_ERR
(
"Slave address
\"
%s
\"
- Invalid format!
\n
"
,
original
);
return
NULL
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment