Removed unnecessary edge in slave configuration FSM graph.
authorFlorian Pose <fp@igh-essen.com>
Mon, 05 Mar 2007 14:59:23 +0000
changeset 615 cde783147040
parent 614 1e74a0212418
child 616 b777e26367c5
Removed unnecessary edge in slave configuration FSM graph.
master/fsm_slave.c
--- a/master/fsm_slave.c	Mon Mar 05 14:51:53 2007 +0000
+++ b/master/fsm_slave.c	Mon Mar 05 14:59:23 2007 +0000
@@ -920,7 +920,7 @@
     ec_slave_t *slave = fsm->slave;
 
     if (datagram->state == EC_DATAGRAM_TIMED_OUT && fsm->retries--) {
-        ec_master_queue_datagram(fsm->slave->master, datagram);
+        ec_master_queue_datagram(slave->master, datagram);
         return;
     }
 
@@ -928,17 +928,29 @@
         fsm->state = ec_fsm_slave_state_error;
         EC_ERR("Failed to receive FMMUs datagram for slave %i"
                 " (datagram state %i).\n",
-               fsm->slave->ring_position, datagram->state);
+               slave->ring_position, datagram->state);
         return;
     }
 
     if (datagram->working_counter != 1) {
-        fsm->slave->error_flag = 1;
+        slave->error_flag = 1;
         fsm->state = ec_fsm_slave_state_error;
         EC_ERR("Failed to set FMMUs - slave %i did not respond.\n",
-               fsm->slave->ring_position);
-        return;
-    }
+               slave->ring_position);
+        return;
+    }
+
+    ec_fsm_slave_conf_enter_sdoconf(fsm);
+}
+
+/*****************************************************************************/
+
+/**
+ */
+
+void ec_fsm_slave_conf_enter_sdoconf(ec_fsm_slave_t *fsm /**< slave state machine */)
+{
+    ec_slave_t *slave = fsm->slave;
 
     // No CoE configuration to be applied? Jump to SAVEOP state.
     if (list_empty(&slave->sdo_confs)) { // skip SDO configuration
@@ -946,23 +958,6 @@
         return;
     }
 
-    ec_fsm_slave_conf_enter_sdoconf(fsm);
-}
-
-/*****************************************************************************/
-
-/**
- */
-
-void ec_fsm_slave_conf_enter_sdoconf(ec_fsm_slave_t *fsm /**< slave state machine */)
-{
-    ec_slave_t *slave = fsm->slave;
-
-    if (list_empty(&slave->sdo_confs)) { // skip SDO configuration
-        ec_fsm_slave_conf_enter_saveop(fsm);
-        return;
-    }
-
     // start SDO configuration
     fsm->state = ec_fsm_slave_conf_state_sdoconf;
     fsm->sdodata = list_entry(fsm->slave->sdo_confs.next, ec_sdo_data_t, list);