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
4a9d9faa
Commit
4a9d9faa
authored
16 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Output attachment failure messages only when debugging.
parent
0e530653
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
TODO
+0
-2
0 additions, 2 deletions
TODO
master/slave_config.c
+25
-21
25 additions, 21 deletions
master/slave_config.c
with
25 additions
and
23 deletions
TODO
+
0
−
2
View file @
4a9d9faa
...
@@ -10,8 +10,6 @@ Version 1.4.0:
...
@@ -10,8 +10,6 @@ Version 1.4.0:
* Remove get_cycles() calls and references to cpu_khz to increase
* Remove get_cycles() calls and references to cpu_khz to increase
portability.
portability.
* Make ecrt_master_slave_config() return no error when slave is not present
or invalid.
* Make scanning and configuration run parallel (each).
* Make scanning and configuration run parallel (each).
* Adapt remaining examples.
* Adapt remaining examples.
* READMEs for examples.
* READMEs for examples.
...
...
This diff is collapsed.
Click to expand it.
master/slave_config.c
+
25
−
21
View file @
4a9d9faa
...
@@ -174,37 +174,39 @@ int ec_slave_config_attach(
...
@@ -174,37 +174,39 @@ int ec_slave_config_attach(
if
(
!
(
slave
=
ec_master_find_slave
(
if
(
!
(
slave
=
ec_master_find_slave
(
sc
->
master
,
sc
->
alias
,
sc
->
position
)))
{
sc
->
master
,
sc
->
alias
,
sc
->
position
)))
{
EC_WARN
(
"Failed to find slave for configuration %u:%u.
\n
"
,
if
(
sc
->
master
->
debug_level
)
sc
->
alias
,
sc
->
position
);
EC_DBG
(
"Failed to find slave for configuration %u:%u.
\n
"
,
sc
->
alias
,
sc
->
position
);
return
-
1
;
return
-
1
;
}
}
if
(
slave
->
config
)
{
if
(
slave
->
config
)
{
EC_ERR
(
"Failed to attach slave configuration %u:%u. Slave %u"
if
(
sc
->
master
->
debug_level
)
" already has a configuration!
\n
"
,
sc
->
alias
,
EC_DBG
(
"Failed to attach slave configuration %u:%u. Slave %u"
sc
->
position
,
slave
->
ring_position
);
" already has a configuration!
\n
"
,
sc
->
alias
,
return
-
2
;
sc
->
position
,
slave
->
ring_position
);
}
return
-
2
;
if
(
slave
->
sii
.
vendor_id
!=
sc
->
vendor_id
}
||
slave
->
sii
.
product_code
!=
sc
->
product_code
)
{
if
(
slave
->
sii
.
vendor_id
!=
sc
->
vendor_id
EC_ERR
(
"Slave %u has an invalid type (0x%08X/0x%08X) for"
||
slave
->
sii
.
product_code
!=
sc
->
product_code
)
{
" configuration %u:%u (0x%08X/0x%08X).
\n
"
,
if
(
sc
->
master
->
debug_level
)
slave
->
ring_position
,
slave
->
sii
.
vendor_id
,
EC_DBG
(
"Slave %u has an invalid type (0x%08X/0x%08X) for"
slave
->
sii
.
product_code
,
sc
->
alias
,
sc
->
position
,
" configuration %u:%u (0x%08X/0x%08X).
\n
"
,
sc
->
vendor_id
,
sc
->
product_code
);
slave
->
ring_position
,
slave
->
sii
.
vendor_id
,
return
-
3
;
slave
->
sii
.
product_code
,
sc
->
alias
,
sc
->
position
,
sc
->
vendor_id
,
sc
->
product_code
);
return
-
3
;
}
}
// attach slave
// attach slave
slave
->
config
=
sc
;
slave
->
config
=
sc
;
sc
->
slave
=
slave
;
sc
->
slave
=
slave
;
ec_slave_request_state
(
slave
,
EC_SLAVE_STATE_OP
);
if
(
sc
->
master
->
debug_level
)
if
(
sc
->
master
->
debug_level
)
EC_DBG
(
"Attached slave %u to config %u:%u.
\n
"
,
EC_DBG
(
"Attached slave %u to config %u:%u.
\n
"
,
slave
->
ring_position
,
sc
->
alias
,
sc
->
position
);
slave
->
ring_position
,
sc
->
alias
,
sc
->
position
);
ec_slave_request_state
(
slave
,
EC_SLAVE_STATE_OP
);
return
0
;
return
0
;
}
}
...
@@ -259,14 +261,16 @@ void ec_slave_config_load_default_mapping(
...
@@ -259,14 +261,16 @@ void ec_slave_config_load_default_mapping(
" config %u:%u.
\n
"
,
pdo
->
index
,
sc
->
alias
,
sc
->
position
);
" config %u:%u.
\n
"
,
pdo
->
index
,
sc
->
alias
,
sc
->
position
);
if
(
!
sc
->
slave
)
{
if
(
!
sc
->
slave
)
{
EC_WARN
(
"Failed to load default Pdo configuration for %u:%u:"
if
(
sc
->
master
->
debug_level
)
" Slave not found.
\n
"
,
sc
->
alias
,
sc
->
position
);
EC_DBG
(
"Failed to load default Pdo configuration for %u:%u:"
" Slave not found.
\n
"
,
sc
->
alias
,
sc
->
position
);
return
;
return
;
}
}
if
(
!
(
sync
=
ec_slave_get_pdo_sync
(
sc
->
slave
,
pdo
->
dir
)))
{
if
(
!
(
sync
=
ec_slave_get_pdo_sync
(
sc
->
slave
,
pdo
->
dir
)))
{
EC_WARN
(
"Slave %u does not provide a default Pdo"
if
(
sc
->
master
->
debug_level
)
" configuration!
\n
"
,
sc
->
slave
->
ring_position
);
EC_DBG
(
"Slave %u does not provide a default Pdo"
" configuration!
\n
"
,
sc
->
slave
->
ring_position
);
return
;
return
;
}
}
...
...
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