master/slave.c
branchredundancy
changeset 2374 e898451c054a
parent 2360 622a7faa07df
child 2421 bc2d4bf9cbe5
equal deleted inserted replaced
2373:593272e5a169 2374:e898451c054a
    60 */
    60 */
    61 
    61 
    62 void ec_slave_init(
    62 void ec_slave_init(
    63         ec_slave_t *slave, /**< EtherCAT slave */
    63         ec_slave_t *slave, /**< EtherCAT slave */
    64         ec_master_t *master, /**< EtherCAT master */
    64         ec_master_t *master, /**< EtherCAT master */
       
    65         ec_device_index_t dev_idx, /**< Device index. */
    65         uint16_t ring_position, /**< ring position */
    66         uint16_t ring_position, /**< ring position */
    66         uint16_t station_address /**< station address to configure */
    67         uint16_t station_address /**< station address to configure */
    67         )
    68         )
    68 {
    69 {
    69     unsigned int i;
    70     unsigned int i;
    70     int ret;
    71     int ret;
    71 
    72 
    72     slave->master = master;
    73     slave->master = master;
       
    74     slave->device_index = dev_idx;
    73     slave->ring_position = ring_position;
    75     slave->ring_position = ring_position;
    74     slave->station_address = station_address;
    76     slave->station_address = station_address;
    75     slave->effective_alias = 0x0000;
    77     slave->effective_alias = 0x0000;
    76 
    78 
    77     slave->config = NULL;
    79     slave->config = NULL;