mini/ec_mini.c
branchkernel2.6
changeset 33 f4171b8aadf8
parent 28 801dc7eabf51
child 36 6e9de6fbf74c
equal deleted inserted replaced
32:7d9809fbf7b9 33:f4171b8aadf8
   228 
   228 
   229 int __init init_module()
   229 int __init init_module()
   230 {
   230 {
   231   printk(KERN_INFO "=== Starting Minimal EtherCAT environment... ===\n");
   231   printk(KERN_INFO "=== Starting Minimal EtherCAT environment... ===\n");
   232 
   232 
   233   if ((ecat_master = EtherCAT_master(0)) == NULL)
   233   if ((ecat_master = EtherCAT_request(0)) == NULL)
   234   {
   234   {
   235     printk(KERN_ERR "No EtherCAT master available!\n");
   235     printk(KERN_ERR "EtherCAT master 0 not available!\n");
   236     return -1;
   236     return -1;
   237   }
   237   }
   238 
   238 
   239   printk("Checking EtherCAT slaves.\n");
   239   printk("Checking EtherCAT slaves.\n");
   240 
   240 
   288       EtherCAT_clear_process_data(ecat_master);
   288       EtherCAT_clear_process_data(ecat_master);
   289 #endif // ECAT_CYCLIC_DATA
   289 #endif // ECAT_CYCLIC_DATA
   290 
   290 
   291       printk(KERN_INFO "Deactivating slaves.\n");
   291       printk(KERN_INFO "Deactivating slaves.\n");
   292       EtherCAT_deactivate_all_slaves(ecat_master);
   292       EtherCAT_deactivate_all_slaves(ecat_master);
       
   293 
       
   294       EtherCAT_release(ecat_master);
   293     }
   295     }
   294 
   296 
   295     printk(KERN_INFO "=== Minimal EtherCAT environment stopped. ===\n");
   297     printk(KERN_INFO "=== Minimal EtherCAT environment stopped. ===\n");
   296 }
   298 }
   297 
   299