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
f0af07a1
Commit
f0af07a1
authored
17 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Fixed warning about missing sync managers during Pdo mapping.
parent
7e403e80
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
master/fsm_pdo_mapping.c
+37
-46
37 additions, 46 deletions
master/fsm_pdo_mapping.c
master/fsm_pdo_mapping.h
+1
-0
1 addition, 0 deletions
master/fsm_pdo_mapping.h
with
38 additions
and
46 deletions
master/fsm_pdo_mapping.c
+
37
−
46
View file @
f0af07a1
...
@@ -53,7 +53,7 @@ void ec_fsm_pdo_mapping_state_pdo_count(ec_fsm_pdo_mapping_t *);
...
@@ -53,7 +53,7 @@ void ec_fsm_pdo_mapping_state_pdo_count(ec_fsm_pdo_mapping_t *);
void
ec_fsm_pdo_mapping_state_end
(
ec_fsm_pdo_mapping_t
*
);
void
ec_fsm_pdo_mapping_state_end
(
ec_fsm_pdo_mapping_t
*
);
void
ec_fsm_pdo_mapping_state_error
(
ec_fsm_pdo_mapping_t
*
);
void
ec_fsm_pdo_mapping_state_error
(
ec_fsm_pdo_mapping_t
*
);
void
ec_fsm_pdo_mapping_next_
sync
(
ec_fsm_pdo_mapping_t
*
);
void
ec_fsm_pdo_mapping_next_
dir
(
ec_fsm_pdo_mapping_t
*
);
/*****************************************************************************/
/*****************************************************************************/
...
@@ -150,66 +150,57 @@ void ec_fsm_pdo_mapping_state_start(
...
@@ -150,66 +150,57 @@ void ec_fsm_pdo_mapping_state_start(
return
;
return
;
}
}
fsm
->
sync
=
NULL
;
fsm
->
dir
=
(
ec_direction_t
)
-
1
;
// next is EC_DIR_OUTPUT
ec_fsm_pdo_mapping_next_
sync
(
fsm
);
ec_fsm_pdo_mapping_next_
dir
(
fsm
);
}
}
/*****************************************************************************/
/*****************************************************************************/
/** Process mapping of next
sync manager
.
/** Process mapping of next
direction
.
*/
*/
void
ec_fsm_pdo_mapping_next_
sync
(
void
ec_fsm_pdo_mapping_next_
dir
(
ec_fsm_pdo_mapping_t
*
fsm
/**< mapping state machine */
ec_fsm_pdo_mapping_t
*
fsm
/**< mapping state machine */
)
)
{
{
ec_direction_t
dir
;
for
(;
fsm
->
dir
<=
EC_DIR_INPUT
;
fsm
->
dir
++
)
{
const
ec_sync_t
*
sync
;
fsm
->
mapping
=
&
fsm
->
slave
->
config
->
mapping
[
fsm
->
dir
];
const
ec_pdo_mapping_t
*
map
;
if
(
!
(
fsm
->
sync
=
ec_slave_get_pdo_sync
(
fsm
->
slave
,
fsm
->
dir
)))
{
for
(
dir
=
EC_DIR_OUTPUT
;
dir
<=
EC_DIR_INPUT
;
dir
++
)
{
if
(
!
list_empty
(
&
fsm
->
mapping
->
pdos
))
{
if
(
!
(
sync
=
ec_slave_get_pdo_sync
(
fsm
->
slave
,
dir
)))
{
EC_ERR
(
"No sync manager for direction %u!
\n
"
,
fsm
->
dir
);
EC_WARN
(
"No sync manager for direction %u!
\n
"
,
dir
);
fsm
->
state
=
ec_fsm_pdo_mapping_state_end
;
return
;
}
continue
;
continue
;
}
}
if
(
fsm
->
sync
)
{
// there is a last SM
// check if mapping has to be altered
if
(
sync
==
fsm
->
sync
)
// this is the last SM
if
(
ec_pdo_mapping_equal
(
&
fsm
->
sync
->
mapping
,
fsm
->
mapping
))
fsm
->
sync
=
NULL
;
// take the next one
continue
;
}
else
{
map
=
&
fsm
->
slave
->
config
->
mapping
[
dir
];
if
(
fsm
->
slave
->
master
->
debug_level
)
{
if
(
ec_pdo_mapping_equal
(
&
sync
->
mapping
,
map
))
EC_DBG
(
"Configuring Pdo mapping for SM%u of slave %u.
\n
"
,
continue
;
fsm
->
sync
->
index
,
fsm
->
slave
->
ring_position
);
fsm
->
sync
=
sync
;
fsm
->
mapping
=
map
;
break
;
}
}
}
if
(
!
fsm
->
sync
)
{
// set mapped Pdo count to zero
fsm
->
sdodata
.
index
=
0x1C10
+
fsm
->
sync
->
index
;
fsm
->
sdodata
.
subindex
=
0
;
// mapped Pdo count
EC_WRITE_U8
(
&
fsm
->
sdo_value
,
0
);
// zero Pdos mapped
fsm
->
sdodata
.
size
=
1
;
if
(
fsm
->
slave
->
master
->
debug_level
)
if
(
fsm
->
slave
->
master
->
debug_level
)
EC_DBG
(
"Pdo mapping finished for slave %u.
\n
"
,
EC_DBG
(
"Setting Pdo count to zero for SM%u.
\n
"
,
fsm
->
sync
->
index
);
fsm
->
slave
->
ring_position
);
fsm
->
state
=
ec_fsm_pdo_mapping_state_end
;
return
;
}
if
(
fsm
->
slave
->
master
->
debug_level
)
{
fsm
->
state
=
ec_fsm_pdo_mapping_state_zero_count
;
EC_DBG
(
"Configuring Pdo mapping for SM%u of slave %u.
\n
"
,
ec_fsm_coe_download
(
fsm
->
fsm_coe
,
fsm
->
slave
,
&
fsm
->
sdodata
);
fsm
->
sync
->
index
,
fsm
->
slave
->
ring_position
);
ec_fsm_coe_exec
(
fsm
->
fsm_coe
);
// execute immediately
return
;
}
}
// set mapped Pdo count to zero
fsm
->
sdodata
.
index
=
0x1C10
+
fsm
->
sync
->
index
;
fsm
->
sdodata
.
subindex
=
0
;
// mapped Pdo count
EC_WRITE_U8
(
&
fsm
->
sdo_value
,
0
);
// zero Pdos mapped
fsm
->
sdodata
.
size
=
1
;
if
(
fsm
->
slave
->
master
->
debug_level
)
if
(
fsm
->
slave
->
master
->
debug_level
)
EC_DBG
(
"Setting Pdo count to zero for SM%u.
\n
"
,
fsm
->
sync
->
index
);
EC_DBG
(
"Pdo mapping finished for slave %u.
\n
"
,
fsm
->
slave
->
ring_position
);
fsm
->
state
=
ec_fsm_pdo_mapping_state_zero_count
;
fsm
->
state
=
ec_fsm_pdo_mapping_state_end
;
ec_fsm_coe_download
(
fsm
->
fsm_coe
,
fsm
->
slave
,
&
fsm
->
sdodata
);
ec_fsm_coe_exec
(
fsm
->
fsm_coe
);
// execute immediately
}
}
/*****************************************************************************/
/*****************************************************************************/
...
@@ -272,7 +263,7 @@ void ec_fsm_pdo_mapping_state_zero_count(
...
@@ -272,7 +263,7 @@ void ec_fsm_pdo_mapping_state_zero_count(
if
(
fsm
->
slave
->
master
->
debug_level
)
if
(
fsm
->
slave
->
master
->
debug_level
)
EC_DBG
(
"No Pdos to map for SM%u of slave %u.
\n
"
,
EC_DBG
(
"No Pdos to map for SM%u of slave %u.
\n
"
,
fsm
->
sync
->
index
,
fsm
->
slave
->
ring_position
);
fsm
->
sync
->
index
,
fsm
->
slave
->
ring_position
);
ec_fsm_pdo_mapping_next_
sync
(
fsm
);
ec_fsm_pdo_mapping_next_
dir
(
fsm
);
return
;
return
;
}
}
...
@@ -341,8 +332,8 @@ void ec_fsm_pdo_mapping_state_pdo_count(
...
@@ -341,8 +332,8 @@ void ec_fsm_pdo_mapping_state_pdo_count(
EC_DBG
(
"Successfully set Pdo mapping for SM%u of slave %u.
\n
"
,
EC_DBG
(
"Successfully set Pdo mapping for SM%u of slave %u.
\n
"
,
fsm
->
sync
->
index
,
fsm
->
slave
->
ring_position
);
fsm
->
sync
->
index
,
fsm
->
slave
->
ring_position
);
// mapping configuration for this
sync manager complete.
// mapping configuration for this
direction finished
ec_fsm_pdo_mapping_next_
sync
(
fsm
);
ec_fsm_pdo_mapping_next_
dir
(
fsm
);
}
}
/******************************************************************************
/******************************************************************************
...
...
This diff is collapsed.
Click to expand it.
master/fsm_pdo_mapping.h
+
1
−
0
View file @
f0af07a1
...
@@ -62,6 +62,7 @@ struct ec_fsm_pdo_mapping
...
@@ -62,6 +62,7 @@ struct ec_fsm_pdo_mapping
ec_fsm_coe_t
*
fsm_coe
;
/**< CoE state machine to use. */
ec_fsm_coe_t
*
fsm_coe
;
/**< CoE state machine to use. */
ec_slave_t
*
slave
;
/**< Slave the FSM runs on. */
ec_slave_t
*
slave
;
/**< Slave the FSM runs on. */
ec_direction_t
dir
;
/**< Current direction. */
const
ec_sync_t
*
sync
;
/**< Current sync manager. */
const
ec_sync_t
*
sync
;
/**< Current sync manager. */
const
ec_pdo_mapping_t
*
mapping
;
/**< Target Pdo mapping. */
const
ec_pdo_mapping_t
*
mapping
;
/**< Target Pdo mapping. */
const
ec_pdo_t
*
pdo
;
/**< Current Pdo. */
const
ec_pdo_t
*
pdo
;
/**< Current Pdo. */
...
...
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