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
7fffe696
Commit
7fffe696
authored
16 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Check for data sizes when reading Pdo assignment/mapping from CoE.
parent
7ec21e12
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
+2
-1
2 additions, 1 deletion
TODO
master/fsm_coe_map.c
+32
-1
32 additions, 1 deletion
master/fsm_coe_map.c
with
34 additions
and
2 deletions
TODO
+
2
−
1
View file @
7fffe696
...
@@ -14,9 +14,10 @@ Version 1.4.0:
...
@@ -14,9 +14,10 @@ Version 1.4.0:
* Adapt remaining examples.
* Adapt remaining examples.
* READMEs for examples.
* READMEs for examples.
* Update documentation.
* Update documentation.
* Check for sizes of uploaded Sdos when reading mapping from CoE.
* Attach Pdo names from SII or Coe dictioary to Pdos read via CoE.
* Attach Pdo names from SII or Coe dictioary to Pdos read via CoE.
* Add a -n (numeric) switch to ethercat command.
* Add a -n (numeric) switch to ethercat command.
* Remove Eoe cylces and Idle cycles.
* Store Sdo abort code in sdo_request_t and output it in user space.
Future issues:
Future issues:
...
...
This diff is collapsed.
Click to expand it.
master/fsm_coe_map.c
+
32
−
1
View file @
7fffe696
...
@@ -216,6 +216,14 @@ void ec_fsm_coe_map_state_pdo_count(
...
@@ -216,6 +216,14 @@ void ec_fsm_coe_map_state_pdo_count(
return
;
return
;
}
}
if
(
fsm
->
request
.
data_size
!=
sizeof
(
uint8_t
))
{
EC_ERR
(
"Invalid data size %u returned when uploading Sdo 0x%04X:%02X "
"from slave %u.
\n
"
,
fsm
->
request
.
data_size
,
fsm
->
request
.
index
,
fsm
->
request
.
subindex
,
fsm
->
slave
->
ring_position
);
fsm
->
state
=
ec_fsm_coe_map_state_error
;
return
;
}
fsm
->
sync_subindices
=
EC_READ_U8
(
fsm
->
request
.
data
);
fsm
->
sync_subindices
=
EC_READ_U8
(
fsm
->
request
.
data
);
if
(
fsm
->
slave
->
master
->
debug_level
)
if
(
fsm
->
slave
->
master
->
debug_level
)
...
@@ -280,6 +288,15 @@ void ec_fsm_coe_map_state_pdo(
...
@@ -280,6 +288,15 @@ void ec_fsm_coe_map_state_pdo(
return
;
return
;
}
}
if
(
fsm
->
request
.
data_size
!=
sizeof
(
uint16_t
))
{
EC_ERR
(
"Invalid data size %u returned when uploading Sdo 0x%04X:%02X "
"from slave %u.
\n
"
,
fsm
->
request
.
data_size
,
fsm
->
request
.
index
,
fsm
->
request
.
subindex
,
fsm
->
slave
->
ring_position
);
fsm
->
state
=
ec_fsm_coe_map_state_error
;
return
;
}
if
(
!
(
fsm
->
pdo
=
(
ec_pdo_t
*
)
if
(
!
(
fsm
->
pdo
=
(
ec_pdo_t
*
)
kmalloc
(
sizeof
(
ec_pdo_t
),
GFP_KERNEL
)))
{
kmalloc
(
sizeof
(
ec_pdo_t
),
GFP_KERNEL
)))
{
EC_ERR
(
"Failed to allocate Pdo.
\n
"
);
EC_ERR
(
"Failed to allocate Pdo.
\n
"
);
...
@@ -323,6 +340,14 @@ void ec_fsm_coe_map_state_pdo_entry_count(
...
@@ -323,6 +340,14 @@ void ec_fsm_coe_map_state_pdo_entry_count(
return
;
return
;
}
}
if
(
fsm
->
request
.
data_size
!=
sizeof
(
uint8_t
))
{
EC_ERR
(
"Invalid data size %u returned when uploading Sdo 0x%04X:%02X "
"from slave %u.
\n
"
,
fsm
->
request
.
data_size
,
fsm
->
request
.
index
,
fsm
->
request
.
subindex
,
fsm
->
slave
->
ring_position
);
fsm
->
state
=
ec_fsm_coe_map_state_error
;
return
;
}
fsm
->
pdo_subindices
=
EC_READ_U8
(
fsm
->
request
.
data
);
fsm
->
pdo_subindices
=
EC_READ_U8
(
fsm
->
request
.
data
);
if
(
fsm
->
slave
->
master
->
debug_level
)
if
(
fsm
->
slave
->
master
->
debug_level
)
...
@@ -377,7 +402,13 @@ void ec_fsm_coe_map_state_pdo_entry(
...
@@ -377,7 +402,13 @@ void ec_fsm_coe_map_state_pdo_entry(
return
;
return
;
}
}
{
if
(
fsm
->
request
.
data_size
!=
sizeof
(
uint32_t
))
{
EC_ERR
(
"Invalid data size %u returned when uploading Sdo 0x%04X:%02X "
"from slave %u.
\n
"
,
fsm
->
request
.
data_size
,
fsm
->
request
.
index
,
fsm
->
request
.
subindex
,
fsm
->
slave
->
ring_position
);
fsm
->
state
=
ec_fsm_coe_map_state_error
;
}
else
{
uint32_t
pdo_entry_info
;
uint32_t
pdo_entry_info
;
ec_pdo_entry_t
*
pdo_entry
;
ec_pdo_entry_t
*
pdo_entry
;
...
...
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