master/master.c
changeset 1507 68e89abadd19
parent 1500 ed1a733efbc5
child 1513 60ca68d853b8
child 1579 326d47aa986c
--- a/master/master.c	Thu Jul 16 07:52:17 2009 +0000
+++ b/master/master.c	Mon Jul 27 10:37:47 2009 +0000
@@ -129,9 +129,9 @@
     
     INIT_LIST_HEAD(&master->configs);
 
-	master->app_time = 0ULL;
-	master->app_start_time = 0ULL;
-	master->has_start_time = 0;
+    master->app_time = 0ULL;
+    master->app_start_time = 0ULL;
+    master->has_start_time = 0;
 
     master->scan_busy = 0;
     master->allow_scan = 1;
@@ -224,7 +224,7 @@
         EC_ERR("Failed to allocate synchronisation datagram.\n");
         goto out_clear_ref_sync;
     }
-	ec_master_find_dc_ref_clock(master);
+    ec_master_find_dc_ref_clock(master);
 
     // init character device
     ret = ec_cdev_init(&master->cdev, master, device_number);
@@ -1257,17 +1257,17 @@
  * \return Number of configurations.
  */
 unsigned int ec_master_config_count(
-		const ec_master_t *master /**< EtherCAT master. */
-		)
-{
-	const ec_slave_config_t *sc;
-	unsigned int count = 0;
-
-	list_for_each_entry(sc, &master->configs, list) {
-		count++;
-	}
-
-	return count;
+        const ec_master_t *master /**< EtherCAT master. */
+        )
+{
+    const ec_slave_config_t *sc;
+    unsigned int count = 0;
+
+    list_for_each_entry(sc, &master->configs, list) {
+        count++;
+    }
+
+    return count;
 }
 
 /*****************************************************************************/
@@ -1277,12 +1277,12 @@
  */
 #define EC_FIND_CONFIG \
     do { \
-		list_for_each_entry(sc, &master->configs, list) { \
-			if (pos--) \
-				continue; \
-			return sc; \
-		} \
-		return NULL; \
+        list_for_each_entry(sc, &master->configs, list) { \
+            if (pos--) \
+                continue; \
+            return sc; \
+        } \
+        return NULL; \
     } while (0)
 
 /** Get a slave configuration via its position in the list.
@@ -1290,12 +1290,12 @@
  * \return Slave configuration or \a NULL.
  */
 ec_slave_config_t *ec_master_get_config(
-		const ec_master_t *master, /**< EtherCAT master. */
-		unsigned int pos /**< List position. */
-		)
-{
-	ec_slave_config_t *sc;
-	EC_FIND_CONFIG;
+        const ec_master_t *master, /**< EtherCAT master. */
+        unsigned int pos /**< List position. */
+        )
+{
+    ec_slave_config_t *sc;
+    EC_FIND_CONFIG;
 }
 
 /** Get a slave configuration via its position in the list.
@@ -1305,12 +1305,12 @@
  * \return Slave configuration or \a NULL.
  */
 const ec_slave_config_t *ec_master_get_config_const(
-		const ec_master_t *master, /**< EtherCAT master. */
-		unsigned int pos /**< List position. */
-		)
-{
-	const ec_slave_config_t *sc;
-	EC_FIND_CONFIG;
+        const ec_master_t *master, /**< EtherCAT master. */
+        unsigned int pos /**< List position. */
+        )
+{
+    const ec_slave_config_t *sc;
+    EC_FIND_CONFIG;
 }
 
 /*****************************************************************************/
@@ -1320,17 +1320,17 @@
  * \return Number of domains.
  */
 unsigned int ec_master_domain_count(
-		const ec_master_t *master /**< EtherCAT master. */
-		)
-{
-	const ec_domain_t *domain;
-	unsigned int count = 0;
-
-	list_for_each_entry(domain, &master->domains, list) {
-		count++;
-	}
-
-	return count;
+        const ec_master_t *master /**< EtherCAT master. */
+        )
+{
+    const ec_domain_t *domain;
+    unsigned int count = 0;
+
+    list_for_each_entry(domain, &master->domains, list) {
+        count++;
+    }
+
+    return count;
 }
 
 /*****************************************************************************/
@@ -1354,11 +1354,11 @@
  * \return Domain pointer, or \a NULL if not found.
  */
 ec_domain_t *ec_master_find_domain(
-		ec_master_t *master, /**< EtherCAT master. */
-		unsigned int index /**< Domain index. */
-		)
-{
-	ec_domain_t *domain;
+        ec_master_t *master, /**< EtherCAT master. */
+        unsigned int index /**< Domain index. */
+        )
+{
+    ec_domain_t *domain;
     EC_FIND_DOMAIN;
 }
 
@@ -1369,11 +1369,11 @@
  * \return Domain pointer, or \a NULL if not found.
  */
 const ec_domain_t *ec_master_find_domain_const(
-		const ec_master_t *master, /**< EtherCAT master. */
-		unsigned int index /**< Domain index. */
-		)
-{
-	const ec_domain_t *domain;
+        const ec_master_t *master, /**< EtherCAT master. */
+        unsigned int index /**< Domain index. */
+        )
+{
+    const ec_domain_t *domain;
     EC_FIND_DOMAIN;
 }
 
@@ -1384,17 +1384,17 @@
  * \return Number of EoE handlers.
  */
 uint16_t ec_master_eoe_handler_count(
-		const ec_master_t *master /**< EtherCAT master. */
-		)
-{
-	const ec_eoe_t *eoe;
-	unsigned int count = 0;
-
-	list_for_each_entry(eoe, &master->eoe_handlers, list) {
-		count++;
-	}
-
-	return count;
+        const ec_master_t *master /**< EtherCAT master. */
+        )
+{
+    const ec_eoe_t *eoe;
+    unsigned int count = 0;
+
+    list_for_each_entry(eoe, &master->eoe_handlers, list) {
+        count++;
+    }
+
+    return count;
 }
 
 /*****************************************************************************/
@@ -1406,19 +1406,19 @@
  * \return EoE handler pointer, or \a NULL if not found.
  */
 const ec_eoe_t *ec_master_get_eoe_handler_const(
-		const ec_master_t *master, /**< EtherCAT master. */
-		uint16_t index /**< EoE handler index. */
-		)
-{
-	const ec_eoe_t *eoe;
-
-	list_for_each_entry(eoe, &master->eoe_handlers, list) {
-		if (index--)
-			continue;
-		return eoe;
-	}
-
-	return NULL;
+        const ec_master_t *master, /**< EtherCAT master. */
+        uint16_t index /**< EoE handler index. */
+        )
+{
+    const ec_eoe_t *eoe;
+
+    list_for_each_entry(eoe, &master->eoe_handlers, list) {
+        if (index--)
+            continue;
+        return eoe;
+    }
+
+    return NULL;
 }
 
 /*****************************************************************************/
@@ -1452,9 +1452,9 @@
  */
 void ec_master_find_dc_ref_clock(
         ec_master_t *master /**< EtherCAT master. */
-		)
-{
-	ec_slave_t *slave, *ref = NULL;
+        )
+{
+    ec_slave_t *slave, *ref = NULL;
 
     for (slave = master->slaves;
             slave < master->slaves + master->slave_count;
@@ -1480,7 +1480,7 @@
         ec_master_t *master, /**< EtherCAT master. */
         ec_slave_t *port0_slave, /**< Slave at port 0. */
         unsigned int *slave_position /**< Slave position. */
-		)
+        )
 {
     ec_slave_t *slave = master->slaves + *slave_position;
     unsigned int i;
@@ -1512,7 +1512,7 @@
  */
 void ec_master_calc_topology(
         ec_master_t *master /**< EtherCAT master. */
-		)
+        )
 {
     unsigned int slave_position = 0;
 
@@ -1529,9 +1529,9 @@
  */
 void ec_master_calc_transmission_delays(
         ec_master_t *master /**< EtherCAT master. */
-		)
-{
-	ec_slave_t *slave;
+        )
+{
+    ec_slave_t *slave;
 
     for (slave = master->slaves;
             slave < master->slaves + master->slave_count;
@@ -1551,10 +1551,10 @@
  */
 void ec_master_calc_dc(
         ec_master_t *master /**< EtherCAT master. */
-		)
-{
-	// find DC reference clock
-	ec_master_find_dc_ref_clock(master);
+        )
+{
+    // find DC reference clock
+    ec_master_find_dc_ref_clock(master);
 
     // calculate bus topology
     ec_master_calc_topology(master);