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
4f222e13
Commit
4f222e13
authored
16 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Introduced EC_MAP_END.
parent
4d799808
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/mini/mini.c
+2
-1
2 additions, 1 deletion
examples/mini/mini.c
include/ecrt.h
+14
-0
14 additions, 0 deletions
include/ecrt.h
master/slave_config.c
+4
-0
4 additions, 0 deletions
master/slave_config.c
with
20 additions
and
1 deletion
examples/mini/mini.c
+
2
−
1
View file @
4f222e13
...
...
@@ -96,6 +96,7 @@ static ec_pdo_entry_info_t el3162_channel2[] = {
static
ec_pdo_info_t
el3162_mapping
[]
=
{
{
EC_DIR_INPUT
,
0x1A00
,
2
,
el3162_channel1
},
{
EC_DIR_INPUT
,
0x1A01
,
2
,
el3162_channel2
},
{
EC_MAP_END
}
};
static
ec_pdo_entry_info_t
el2004_channels
[]
=
{
...
...
@@ -279,7 +280,7 @@ int __init init_mini_module(void)
goto
out_release_master
;
}
if
(
ecrt_slave_config_mapping
(
sc
,
2
,
el3162_mapping
))
{
if
(
ecrt_slave_config_mapping
(
sc
,
EC_MAP_END
,
el3162_mapping
))
{
printk
(
KERN_ERR
PFX
"Failed to configure Pdo mapping.
\n
"
);
goto
out_release_master
;
}
...
...
This diff is collapsed.
Click to expand it.
include/ecrt.h
+
14
−
0
View file @
4f222e13
...
...
@@ -120,6 +120,14 @@
*/
#define ECRT_VERSION_MAGIC ECRT_VERSION(ECRT_VER_MAJOR, ECRT_VER_MINOR)
/*****************************************************************************/
/** End of mapping.
*
* This is used in ecrt_slave_config_mapping().
*/
#define EC_MAP_END ~0U
/******************************************************************************
* Data types
*****************************************************************************/
...
...
@@ -467,6 +475,12 @@ int ecrt_slave_config_pdo_entry(
* return -1; // error
* \endcode
*
* Processing of \a pdo_infos will stop, if
* - the number of processed items reaches \a n_infos, or
* - the \a dir member of an ec_pdo_info_t item is EC_MAP_END. In this case,
* \a n_infos should set to a number greater than the number of list items;
* using EC_MAP_END is recommended.
*
* \return zero on success, else non-zero
*/
int
ecrt_slave_config_mapping
(
...
...
This diff is collapsed.
Click to expand it.
master/slave_config.c
+
4
−
0
View file @
4f222e13
...
...
@@ -582,6 +582,10 @@ int ecrt_slave_config_mapping(ec_slave_config_t *sc, unsigned int n_infos,
for
(
i
=
0
;
i
<
n_infos
;
i
++
)
{
pi
=
&
pdo_infos
[
i
];
if
(
pi
->
dir
==
EC_MAP_END
)
break
;
pm
=
&
sc
->
mapping
[
pi
->
dir
];
if
(
pm
->
default_mapping
)
{
...
...
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