equal
deleted
inserted
replaced
325 sync->physical_start_address = EC_READ_U16(data); |
325 sync->physical_start_address = EC_READ_U16(data); |
326 sync->length = EC_READ_U16(data + 2); |
326 sync->length = EC_READ_U16(data + 2); |
327 sync->control_register = EC_READ_U8 (data + 4); |
327 sync->control_register = EC_READ_U8 (data + 4); |
328 sync->enable = EC_READ_U8 (data + 6); |
328 sync->enable = EC_READ_U8 (data + 6); |
329 |
329 |
|
330 sync->est_length = 0; |
|
331 |
330 list_add_tail(&sync->list, &slave->sii_syncs); |
332 list_add_tail(&sync->list, &slave->sii_syncs); |
331 } |
333 } |
332 |
334 |
333 return 0; |
335 return 0; |
334 } |
336 } |
823 /**< sync manager */ |
825 /**< sync manager */ |
824 ) |
826 ) |
825 { |
827 { |
826 ec_sii_pdo_t *pdo; |
828 ec_sii_pdo_t *pdo; |
827 ec_sii_pdo_entry_t *pdo_entry; |
829 ec_sii_pdo_entry_t *pdo_entry; |
828 unsigned int bit_size; |
830 unsigned int bit_size, byte_size; |
829 |
831 |
830 if (sync->length) return sync->length; |
832 if (sync->length) return sync->length; |
|
833 if (sync->est_length) return sync->est_length; |
831 |
834 |
832 bit_size = 0; |
835 bit_size = 0; |
833 list_for_each_entry(pdo, &slave->sii_pdos, list) { |
836 list_for_each_entry(pdo, &slave->sii_pdos, list) { |
834 if (pdo->sync_index != sync->index) continue; |
837 if (pdo->sync_index != sync->index) continue; |
835 |
838 |
837 bit_size += pdo_entry->bit_length; |
840 bit_size += pdo_entry->bit_length; |
838 } |
841 } |
839 } |
842 } |
840 |
843 |
841 if (bit_size % 8) // round up to full bytes |
844 if (bit_size % 8) // round up to full bytes |
842 return bit_size / 8 + 1; |
845 byte_size = bit_size / 8 + 1; |
843 else |
846 else |
844 return bit_size / 8; |
847 byte_size = bit_size / 8; |
|
848 |
|
849 return byte_size; |
845 } |
850 } |
846 |
851 |
847 /*****************************************************************************/ |
852 /*****************************************************************************/ |
848 |
853 |
849 /** |
854 /** |