Internal SDO requests now synchronized with external requests.

Internal SDO requests are managed by master FSM and can conflict with
external requests managed by slave FSM. The internal SDO requests
includes SDO requests created by an application and external request are
typical created by EtherCAT Tool for SDO upload/download or a directory
fetch initiated with ethercat sdos command. The conflict will cause a
FPWR from an external request to be overwritten by a FPWR from an
internal SDO request (or oppersite) in the same "train" of datagrams.
This commit is contained in:
Knud Baastrup
2015-04-14 13:12:24 -04:00
parent fd9e5a770e
commit ff75554c58
2 changed files with 17 additions and 0 deletions

View File

@@ -493,6 +493,11 @@ int ec_fsm_master_action_process_sdo(
continue;
}
if (!ec_fsm_slave_is_ready(&slave->fsm)) {
EC_SLAVE_DBG(slave, 1, "Busy - processing external request!\n");
continue;
}
list_for_each_entry(req, &slave->config->sdo_requests, list) {
if (req->state == EC_INT_REQUEST_QUEUED) {

View File

@@ -201,6 +201,18 @@ void ec_fsm_slave_state_ready(
ec_datagram_t *datagram /**< Datagram to use. */
)
{
ec_slave_t *slave = fsm->slave;
ec_sdo_request_t *req;
if (slave->config) {
list_for_each_entry(req, &slave->config->sdo_requests, list) {
if (req->state == EC_INT_REQUEST_QUEUED || req->state == EC_INT_REQUEST_BUSY) {
EC_SLAVE_DBG(slave, 1, "Busy - processing internal SDO request!\n");
return;
}
}
}
// Check for pending external SDO requests
if (ec_fsm_slave_action_process_sdo(fsm, datagram)) {
return;