Silently use alias from SII if reading it from register 0x0012 fails
authorMartin Troxler <martin.troxler@komaxgroup.com>
Mon, 11 Jan 2010 15:43:02 +0100
changeset 1775 576c400d74d5
parent 1610 d46de2278ac6
child 1776 65786b1d3043
Silently use alias from SII if reading it from register 0x0012 fails
master/fsm_slave_scan.c
--- a/master/fsm_slave_scan.c	Mon Jan 04 14:17:31 2010 +0100
+++ b/master/fsm_slave_scan.c	Mon Jan 11 15:43:02 2010 +0100
@@ -769,20 +769,15 @@
         return;
     }
 
-    if (datagram->working_counter != 1) {
-        fsm->slave->error_flag = 1;
-        fsm->state = ec_fsm_slave_scan_state_error;
-        EC_ERR("Failed to read reg alias of slave %u: ",
+	if (datagram->working_counter != 1) {
+		EC_WARN("Failed to read reg alias of slave %u.\n",
                fsm->slave->ring_position);
-        ec_datagram_print_wc_error(datagram);
-        return;
-    }
-
-    slave->sii.alias = EC_READ_U16(datagram->data);
-    if (slave->master->debug_level)
-         EC_DBG("Alias of slave %u is %u.\n",
-                 slave->ring_position,slave->sii.alias);
-
+	} else {
+		slave->sii.alias = EC_READ_U16(datagram->data);
+		if (slave->master->debug_level)
+			 EC_DBG("Alias of slave %u is %u.\n",
+					 slave->ring_position,slave->sii.alias);
+	}
     if (slave->sii.mailbox_protocols & EC_MBOX_COE) {
         ec_fsm_slave_scan_enter_preop(fsm);
     } else {