master/master.c
changeset 133 b36d187ecc0b
parent 130 69c2645300ee
child 135 80d493917205
equal deleted inserted replaced
132:63a5b40eb7da 133:b36d187ecc0b
   709         if (master->slave_states & EC_SLAVE_STATE_INIT) {
   709         if (master->slave_states & EC_SLAVE_STATE_INIT) {
   710             printk("INIT");
   710             printk("INIT");
   711             first = 0;
   711             first = 0;
   712         }
   712         }
   713         if (master->slave_states & EC_SLAVE_STATE_PREOP) {
   713         if (master->slave_states & EC_SLAVE_STATE_PREOP) {
   714             if (!first) {
   714             if (!first) printk(", ");
   715                 printk(", ");
       
   716                 first = 0;
       
   717             }
       
   718             printk("PREOP");
   715             printk("PREOP");
       
   716             first = 0;
   719         }
   717         }
   720         if (master->slave_states & EC_SLAVE_STATE_SAVEOP) {
   718         if (master->slave_states & EC_SLAVE_STATE_SAVEOP) {
   721             if (!first) {
   719             if (!first) printk(", ");
   722                 printk(", ");
       
   723                 first = 0;
       
   724             }
       
   725             printk("SAVEOP");
   720             printk("SAVEOP");
       
   721             first = 0;
   726         }
   722         }
   727         if (master->slave_states & EC_SLAVE_STATE_OP) {
   723         if (master->slave_states & EC_SLAVE_STATE_OP) {
   728             if (!first) {
   724             if (!first) printk(", ");
   729                 printk(", ");
       
   730                 first = 0;
       
   731             }
       
   732             printk("OP");
   725             printk("OP");
   733         }
   726         }
   734         printk(")\n");
   727         printk(")\n");
   735     }
   728     }
   736 }
   729 }
   857         }
   850         }
   858 
   851 
   859         // Change state to PREOP
   852         // Change state to PREOP
   860         if (unlikely(ec_slave_state_change(slave, EC_SLAVE_STATE_PREOP)))
   853         if (unlikely(ec_slave_state_change(slave, EC_SLAVE_STATE_PREOP)))
   861             return -1;
   854             return -1;
       
   855 
       
   856         // Fetch SDO list
       
   857         if (slave->sii_mailbox_protocols & EC_MBOX_COE) {
       
   858             if (unlikely(ec_slave_fetch_sdo_list(slave))) {
       
   859                 EC_ERR("Could not fetch SDO list!\n");
       
   860                 return -1;
       
   861             }
       
   862         }
   862 
   863 
   863         // Slaves that are not registered are only brought into PREOP
   864         // Slaves that are not registered are only brought into PREOP
   864         // state -> nice blinking and mailbox comm. possible
   865         // state -> nice blinking and mailbox comm. possible
   865         if (!slave->registered && !slave->type->bus_coupler) {
   866         if (!slave->registered && !slave->type->bus_coupler) {
   866             EC_WARN("Slave %i was not registered!\n", slave->ring_position);
   867             EC_WARN("Slave %i was not registered!\n", slave->ring_position);