New transition in slave conf state machine: Skip fmmu and SDO configuration.
authorFlorian Pose <fp@igh-essen.com>
Sat, 05 Aug 2006 07:11:59 +0000
changeset 338 469369417422
parent 337 6fd537c56448
child 339 a3a4ee854bd8
New transition in slave conf state machine: Skip fmmu and SDO configuration.
master/fsm.c
--- a/master/fsm.c	Fri Aug 04 15:37:46 2006 +0000
+++ b/master/fsm.c	Sat Aug 05 07:11:59 2006 +0000
@@ -1382,11 +1382,18 @@
         return;
     }
 
-    if (!slave->base_fmmu_count) {
-        fsm->slave_state = ec_fsm_slaveconf_saveop;
-        fsm->change_new = EC_SLAVE_STATE_SAVEOP;
-        fsm->change_state = ec_fsm_change_start;
-        fsm->change_state(fsm); // execute immediately
+    if (!slave->base_fmmu_count) { // skip FMMU configuration
+        if (list_empty(&slave->sdo_confs)) { // skip SDO configuration
+            fsm->slave_state = ec_fsm_slaveconf_saveop;
+            fsm->change_new = EC_SLAVE_STATE_SAVEOP;
+            fsm->change_state = ec_fsm_change_start;
+            fsm->change_state(fsm); // execute immediately
+            return;
+        }
+        fsm->slave_state = ec_fsm_slaveconf_sdoconf;
+        fsm->sdodata = list_entry(slave->sdo_confs.next, ec_sdo_data_t, list);
+        fsm->coe_state = ec_fsm_coe_down_start;
+        fsm->coe_state(fsm); // execute immediately
         return;
     }
 
@@ -1424,7 +1431,7 @@
     }
 
     // No CoE configuration to be applied? Jump to SAVEOP state.
-    if (list_empty(&slave->sdo_confs)) {
+    if (list_empty(&slave->sdo_confs)) { // skip SDO configuration
         // set state to SAVEOP
         fsm->slave_state = ec_fsm_slaveconf_saveop;
         fsm->change_new = EC_SLAVE_STATE_SAVEOP;