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
6894f595
Commit
6894f595
authored
18 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Introduced ec_slave_get_pdo_sync().
parent
958e105f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
master/domain.c
+1
-11
1 addition, 11 deletions
master/domain.c
master/slave.c
+30
-0
30 additions, 0 deletions
master/slave.c
master/slave.h
+1
-0
1 addition, 0 deletions
master/slave.h
with
32 additions
and
11 deletions
master/domain.c
+
1
−
11
View file @
6894f595
...
...
@@ -266,22 +266,12 @@ int ec_domain_reg_pdo_range(ec_domain_t *domain, /**< EtherCAT domain */
{
ec_data_reg_t
*
data_reg
;
ec_sii_sync_t
*
sync
;
unsigned
int
sync_index
;
uint16_t
sync_length
;
switch
(
dir
)
{
// FIXME
case
EC_DIR_OUTPUT
:
sync_index
=
2
;
break
;
case
EC_DIR_INPUT
:
sync_index
=
3
;
break
;
default:
EC_ERR
(
"Invalid direction!
\n
"
);
return
-
1
;
}
if
(
sync_index
>=
slave
->
sii_sync_count
)
{
if
(
!
(
sync
=
ec_slave_get_pdo_sync
(
slave
,
dir
)))
{
EC_ERR
(
"No sync manager found for PDO range.
\n
"
);
return
-
1
;
}
sync
=
&
slave
->
sii_syncs
[
sync_index
];
// Allocate memory for data registration object
if
(
!
(
data_reg
=
...
...
This diff is collapsed.
Click to expand it.
master/slave.c
+
30
−
0
View file @
6894f595
...
...
@@ -1113,6 +1113,36 @@ uint16_t ec_slave_calc_sync_size(const ec_slave_t *slave,
/*****************************************************************************/
/**
*/
ec_sii_sync_t
*
ec_slave_get_pdo_sync
(
ec_slave_t
*
slave
,
/**< EtherCAT slave */
ec_direction_t
dir
/**< input or output */
)
{
unsigned
int
sync_index
;
switch
(
dir
)
{
case
EC_DIR_OUTPUT
:
sync_index
=
0
;
break
;
case
EC_DIR_INPUT
:
sync_index
=
1
;
break
;
default:
EC_ERR
(
"Invalid direction!
\n
"
);
return
NULL
;
}
if
(
slave
->
sii_mailbox_protocols
)
sync_index
+=
2
;
if
(
sync_index
>=
slave
->
sii_sync_count
)
{
EC_ERR
(
"No appropriate sync manager found.
\n
"
);
return
NULL
;
}
return
&
slave
->
sii_syncs
[
sync_index
];
}
/*****************************************************************************/
/**
Initializes a sync manager configuration page with EEPROM data.
The referenced memory (\a data) must be at least EC_SYNC_SIZE bytes.
...
...
This diff is collapsed.
Click to expand it.
master/slave.h
+
1
−
0
View file @
6894f595
...
...
@@ -284,6 +284,7 @@ int ec_slave_fetch_pdo(ec_slave_t *, const uint8_t *, size_t,
int
ec_slave_locate_string
(
ec_slave_t
*
,
unsigned
int
,
char
**
);
// misc.
ec_sii_sync_t
*
ec_slave_get_pdo_sync
(
ec_slave_t
*
,
ec_direction_t
);
void
ec_slave_sync_config
(
const
ec_slave_t
*
,
const
ec_sii_sync_t
*
,
uint8_t
*
);
void
ec_slave_fmmu_config
(
const
ec_slave_t
*
,
const
ec_fmmu_t
*
,
uint8_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