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