master/slave.c
changeset 1507 68e89abadd19
parent 1426 af45bba80d85
child 1543 373cd456dc26
child 1583 017fa8fd9ac1
equal deleted inserted replaced
1506:41ca84fb6bb2 1507:68e89abadd19
   745 
   745 
   746 /** Calculates the sum of round-trip-times of connected ports 1-3.
   746 /** Calculates the sum of round-trip-times of connected ports 1-3.
   747  */
   747  */
   748 uint32_t ec_slave_calc_rtt_sum(
   748 uint32_t ec_slave_calc_rtt_sum(
   749         ec_slave_t *slave /**< EtherCAT slave. */
   749         ec_slave_t *slave /**< EtherCAT slave. */
   750 		)
   750         )
   751 {
   751 {
   752     uint32_t rtt_sum = 0, rtt;
   752     uint32_t rtt_sum = 0, rtt;
   753     unsigned int i;
   753     unsigned int i;
   754     
   754     
   755     for (i = 1; i < EC_MAX_PORTS; i++) {
   755     for (i = 1; i < EC_MAX_PORTS; i++) {
   766 
   766 
   767 /** Finds the next slave supporting DC delay measurement.
   767 /** Finds the next slave supporting DC delay measurement.
   768  */
   768  */
   769 ec_slave_t *ec_slave_find_next_dc_slave(
   769 ec_slave_t *ec_slave_find_next_dc_slave(
   770         ec_slave_t *slave /**< EtherCAT slave. */
   770         ec_slave_t *slave /**< EtherCAT slave. */
   771 		)
   771         )
   772 {
   772 {
   773     ec_slave_t *dc_slave = NULL;
   773     ec_slave_t *dc_slave = NULL;
   774 
   774 
   775     if (slave->base_dc_supported) {
   775     if (slave->base_dc_supported) {
   776         dc_slave = slave;
   776         dc_slave = slave;
   794 
   794 
   795 /** Calculates the port transmission delays.
   795 /** Calculates the port transmission delays.
   796  */
   796  */
   797 void ec_slave_calc_port_delays(
   797 void ec_slave_calc_port_delays(
   798         ec_slave_t *slave /**< EtherCAT slave. */
   798         ec_slave_t *slave /**< EtherCAT slave. */
   799 		)
   799         )
   800 {
   800 {
   801     unsigned int i;
   801     unsigned int i;
   802     ec_slave_t *next, *next_dc;
   802     ec_slave_t *next, *next_dc;
   803     uint32_t rtt, next_rtt_sum;
   803     uint32_t rtt, next_rtt_sum;
   804 
   804 
   832 /** Recursively calculates transmission delays.
   832 /** Recursively calculates transmission delays.
   833  */
   833  */
   834 void ec_slave_calc_transmission_delays_rec(
   834 void ec_slave_calc_transmission_delays_rec(
   835         ec_slave_t *slave, /**< Current slave. */
   835         ec_slave_t *slave, /**< Current slave. */
   836         uint32_t *delay /**< Sum of delays. */
   836         uint32_t *delay /**< Sum of delays. */
   837 		)
   837         )
   838 {
   838 {
   839     unsigned int i;
   839     unsigned int i;
   840     ec_slave_t *next, *next_dc;
   840     ec_slave_t *next, *next_dc;
   841 
   841 
   842 #if 0
   842 #if 0