mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-02-06 11:51:45 +08:00
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:
@@ -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) {
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user