# HG changeset patch # User Martin Troxler # Date 1260447561 -3600 # Node ID 5ad4eb4963a624c876208b25e4dd33a71e8d8f92 # Parent 491dea6f4fd7fa57dad597592186ef6cfc83cc58 Postpone SDO request when slave is in INIT diff -r 491dea6f4fd7 -r 5ad4eb4963a6 master/fsm_slave.c --- a/master/fsm_slave.c Tue Dec 01 16:00:22 2009 +0100 +++ b/master/fsm_slave.c Thu Dec 10 13:19:21 2009 +0100 @@ -142,17 +142,15 @@ // search the first external request to be processed list_for_each_entry_safe(request, next, &slave->slave_sdo_requests, list) { + + if (slave->current_state == EC_SLAVE_STATE_INIT) { + EC_WARN("Postponing SDO request, slave %u is in INIT.\n", + slave->ring_position); + return 0; + } list_del_init(&request->list); // dequeue request->req.state = EC_INT_REQUEST_BUSY; - if (slave->current_state == EC_SLAVE_STATE_INIT) { - EC_ERR("Discarding SDO request, slave %u is in INIT.\n", - slave->ring_position); - request->req.state = EC_INT_REQUEST_FAILURE; - wake_up(&slave->sdo_queue); - continue; - } - // Found pending SDO request. Execute it! if (master->debug_level) EC_DBG("Processing SDO request for slave %u...\n",