Adjusted minimal example to interface changes.
authorFlorian Pose <fp@igh-essen.com>
Fri, 09 Mar 2007 10:32:25 +0000
changeset 641 811952909e11
parent 640 16e9ad7d8e12
child 642 3ed80c8ed616
Adjusted minimal example to interface changes.
examples/mini/mini.c
--- a/examples/mini/mini.c	Fri Mar 09 10:24:50 2007 +0000
+++ b/examples/mini/mini.c	Fri Mar 09 10:32:25 2007 +0000
@@ -67,7 +67,7 @@
 static void *r_freq;
 
 #if 1
-ec_pdo_reg_t domain1_pdos[] = {
+ec_pdo_reg_t domain1_pdo_regs[] = {
     {"2", Beckhoff_EL2004_Outputs,   &r_dig_out},
     {"3", Beckhoff_EL4132_Output1,   &r_ana_out},
     {"4", Beckhoff_EL5101_Value,     &r_count},
@@ -179,7 +179,7 @@
 
 #if 1
     printk(KERN_INFO PFX "Configuring alternative PDO mapping...\n");
-    if (!(slave = ecrt_master_get_slave(master, "4")))
+    if (!(slave = ecrt_master_get_slave(master, "4", Beckhoff_EL5101)))
         goto out_release_master;
 
     if (ecrt_slave_pdo_mapping(slave, EC_DIR_INPUT, 2, 0x1A00, 0x1A02))
@@ -188,27 +188,31 @@
 
     printk(KERN_INFO PFX "Registering PDOs...\n");
 #if 1
-    if (ecrt_domain_register_pdo_list(domain1, domain1_pdos)) {
+    if (ecrt_domain_register_pdo_list(domain1, domain1_pdo_regs)) {
         printk(KERN_ERR PFX "PDO registration failed!\n");
         goto out_release_master;
     }
 #endif
 
 #ifdef KBUS
-    if (!ecrt_domain_register_pdo_range(domain1, "0", Beckhoff_BK1120,
-                                        EC_DIR_OUTPUT, 0, 4, &r_outputs)) {
+    if (!(slave = ecrt_master_get_slave(master, "0", Beckhoff_BK1120)))
+        goto out_release_master;
+    
+    if (!ecrt_domain_register_pdo_range(
+                domain1, slave, EC_DIR_OUTPUT, 0, 4, &r_outputs)) {
         printk(KERN_ERR PFX "PDO registration failed!\n");
         goto out_release_master;
     }
-    if (!ecrt_domain_register_pdo_range(domain1, "0", Beckhoff_BK1120,
-                                        EC_DIR_INPUT, 0, 4, &r_inputs)) {
+    
+    if (!ecrt_domain_register_pdo_range(
+                domain1, slave, EC_DIR_INPUT, 0, 4, &r_inputs)) {
         printk(KERN_ERR PFX "PDO registration failed!\n");
         goto out_release_master;
     }
 #endif
 
 #if 0
-    if (!(slave = ecrt_master_get_slave(master, "4")))
+    if (!(slave = ecrt_master_get_slave(master, "4", Beckhoff_EL5001)))
         goto out_release_master;
 
     if (ecrt_slave_conf_sdo8(slave, 0x4061, 1, 0))