234 } |
234 } |
235 |
235 |
236 slave->current_state = EC_READ_U8(datagram->data); |
236 slave->current_state = EC_READ_U8(datagram->data); |
237 if (slave->current_state & EC_SLAVE_STATE_ACK_ERR) { |
237 if (slave->current_state & EC_SLAVE_STATE_ACK_ERR) { |
238 char state_str[EC_STATE_STRING_SIZE]; |
238 char state_str[EC_STATE_STRING_SIZE]; |
239 ec_state_string(slave->current_state, state_str); |
239 ec_state_string(slave->current_state, state_str, 0); |
240 EC_WARN("Slave %u has state error bit set (%s)!\n", |
240 EC_WARN("Slave %u has state error bit set (%s)!\n", |
241 slave->ring_position, state_str); |
241 slave->ring_position, state_str); |
242 } |
242 } |
243 |
243 |
244 // read base data |
244 // read base data |
464 EC_READ_U32(slave->sii_words + 0x000A); |
464 EC_READ_U32(slave->sii_words + 0x000A); |
465 slave->sii.revision_number = |
465 slave->sii.revision_number = |
466 EC_READ_U32(slave->sii_words + 0x000C); |
466 EC_READ_U32(slave->sii_words + 0x000C); |
467 slave->sii.serial_number = |
467 slave->sii.serial_number = |
468 EC_READ_U32(slave->sii_words + 0x000E); |
468 EC_READ_U32(slave->sii_words + 0x000E); |
469 slave->sii.rx_mailbox_offset = |
469 slave->sii.boot_rx_mailbox_offset = |
|
470 EC_READ_U16(slave->sii_words + 0x0014); |
|
471 slave->sii.boot_rx_mailbox_size = |
|
472 EC_READ_U16(slave->sii_words + 0x0015); |
|
473 slave->sii.boot_tx_mailbox_offset = |
|
474 EC_READ_U16(slave->sii_words + 0x0016); |
|
475 slave->sii.boot_tx_mailbox_size = |
|
476 EC_READ_U16(slave->sii_words + 0x0017); |
|
477 slave->sii.std_rx_mailbox_offset = |
470 EC_READ_U16(slave->sii_words + 0x0018); |
478 EC_READ_U16(slave->sii_words + 0x0018); |
471 slave->sii.rx_mailbox_size = |
479 slave->sii.std_rx_mailbox_size = |
472 EC_READ_U16(slave->sii_words + 0x0019); |
480 EC_READ_U16(slave->sii_words + 0x0019); |
473 slave->sii.tx_mailbox_offset = |
481 slave->sii.std_tx_mailbox_offset = |
474 EC_READ_U16(slave->sii_words + 0x001A); |
482 EC_READ_U16(slave->sii_words + 0x001A); |
475 slave->sii.tx_mailbox_size = |
483 slave->sii.std_tx_mailbox_size = |
476 EC_READ_U16(slave->sii_words + 0x001B); |
484 EC_READ_U16(slave->sii_words + 0x001B); |
477 slave->sii.mailbox_protocols = |
485 slave->sii.mailbox_protocols = |
478 EC_READ_U16(slave->sii_words + 0x001C); |
486 EC_READ_U16(slave->sii_words + 0x001C); |
479 |
487 |
480 if (slave->sii_nwords == EC_FIRST_SII_CATEGORY_OFFSET) { |
488 if (slave->sii_nwords == EC_FIRST_SII_CATEGORY_OFFSET) { |