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
cecf361f
Commit
cecf361f
authored
17 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Store PDO mapping source in sync manager.
parent
77d1c15d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
master/fsm_coe_map.c
+1
-0
1 addition, 0 deletions
master/fsm_coe_map.c
master/slave.c
+10
-4
10 additions, 4 deletions
master/slave.c
master/sync.c
+1
-0
1 addition, 0 deletions
master/sync.c
master/sync.h
+14
-0
14 additions, 0 deletions
master/sync.h
with
26 additions
and
4 deletions
master/fsm_coe_map.c
+
1
−
0
View file @
cecf361f
...
...
@@ -276,6 +276,7 @@ void ec_fsm_coe_map_action_next_pdo(
list_for_each_entry
(
pdo
,
&
fsm
->
pdos
,
list
)
{
ec_sync_add_pdo
(
sync
,
pdo
);
}
sync
->
mapping_source
=
EC_SYNC_MAPPING_COE
;
ec_fsm_coe_map_clear_pdos
(
fsm
);
// next sync manager
...
...
This diff is collapsed.
Click to expand it.
master/slave.c
+
10
−
4
View file @
cecf361f
...
...
@@ -576,6 +576,7 @@ int ec_slave_fetch_sii_pdos(
// if sync manager index is positive, the PDO is mapped by default
if
(
pdo
->
sync_index
>=
0
)
{
ec_sync_t
*
sync
;
ec_pdo_t
*
mapped_pdo
;
if
(
pdo
->
sync_index
>=
slave
->
sii_sync_count
)
{
...
...
@@ -583,6 +584,7 @@ int ec_slave_fetch_sii_pdos(
pdo
->
sync_index
,
pdo
->
index
,
slave
->
ring_position
);
return
-
1
;
}
sync
=
&
slave
->
sii_syncs
[
pdo
->
sync_index
];
if
(
!
(
mapped_pdo
=
kmalloc
(
sizeof
(
ec_pdo_t
),
GFP_KERNEL
)))
{
EC_ERR
(
"Failed to allocate PDO memory.
\n
"
);
...
...
@@ -595,8 +597,8 @@ int ec_slave_fetch_sii_pdos(
return
-
1
;
}
list_add_tail
(
&
mapped_pdo
->
list
,
&
slave
->
sii_syncs
[
pdo
->
sync_index
].
pdos
)
;
list_add_tail
(
&
mapped_pdo
->
list
,
&
sync
->
pdos
);
sync
->
mapping_source
=
EC_SYNC_MAPPING_SII
;
}
}
...
...
@@ -810,8 +812,12 @@ size_t ec_slave_info(const ec_slave_t *slave, /**< EtherCAT slave */
ec_sync_size
(
sync
),
sync
->
control_register
,
sync
->
enable
?
"enable"
:
"disable"
);
if
(
list_empty
(
&
sync
->
pdos
))
if
(
list_empty
(
&
sync
->
pdos
))
{
off
+=
sprintf
(
buffer
+
off
,
" No PDOs mapped.
\n
"
);
}
else
if
(
sync
->
mapping_source
!=
EC_SYNC_MAPPING_NONE
)
{
off
+=
sprintf
(
buffer
+
off
,
" PDO mapping information from %s.
\n
"
,
sync
->
mapping_source
==
EC_SYNC_MAPPING_SII
?
"SII"
:
"CoE"
);
}
list_for_each_entry
(
pdo
,
&
sync
->
pdos
,
list
)
{
off
+=
sprintf
(
buffer
+
off
,
" %s 0x%04X
\"
%s
\"\n
"
,
...
...
@@ -830,7 +836,7 @@ size_t ec_slave_info(const ec_slave_t *slave, /**< EtherCAT slave */
// type-cast to avoid warnings on some compilers
if
(
!
list_empty
((
struct
list_head
*
)
&
slave
->
sii_pdos
))
off
+=
sprintf
(
buffer
+
off
,
"
\n
Available PDOs:
\n
"
);
off
+=
sprintf
(
buffer
+
off
,
"
\n
Available PDOs
from SII
:
\n
"
);
list_for_each_entry
(
pdo
,
&
slave
->
sii_pdos
,
list
)
{
off
+=
sprintf
(
buffer
+
off
,
" %s 0x%04X
\"
%s
\"
"
,
...
...
This diff is collapsed.
Click to expand it.
master/sync.c
+
1
−
0
View file @
cecf361f
...
...
@@ -62,6 +62,7 @@ void ec_sync_init(
sync
->
est_length
=
0
;
INIT_LIST_HEAD
(
&
sync
->
pdos
);
sync
->
alt_mapping
=
0
;
sync
->
mapping_source
=
EC_SYNC_MAPPING_NONE
;
}
/*****************************************************************************/
...
...
This diff is collapsed.
Click to expand it.
master/sync.h
+
14
−
0
View file @
cecf361f
...
...
@@ -53,6 +53,19 @@
/*****************************************************************************/
/**
* EtherCAT sync manager PDO mapping information source.
*/
typedef
enum
{
EC_SYNC_MAPPING_NONE
,
/**< No PDO mapping information */
EC_SYNC_MAPPING_SII
,
/**< PDO mapping information from SII */
EC_SYNC_MAPPING_COE
/**< PDO mapping information from CoE dictionary */
}
ec_sync_mapping_source_t
;
/*****************************************************************************/
/**
* Sync manager.
*/
...
...
@@ -69,6 +82,7 @@ typedef struct
uint16_t
est_length
;
/**< used to calculate the length via PDO ranges */
struct
list_head
pdos
;
/**< list of mapped PDOs */
unsigned
int
alt_mapping
;
/**< alternative mapping configured */
ec_sync_mapping_source_t
mapping_source
;
/**< pdo mapping source */
}
ec_sync_t
;
...
...
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