rt/msr_module.c
changeset 43 35120a61d55e
parent 42 a22a202d0f42
child 45 f525f7db2d90
equal deleted inserted replaced
42:a22a202d0f42 43:35120a61d55e
   397 
   397 
   398     printk("Activating all EtherCAT slaves.\n");
   398     printk("Activating all EtherCAT slaves.\n");
   399 
   399 
   400     for (i = 0; i < ECAT_SLAVES_COUNT; i++) {
   400     for (i = 0; i < ECAT_SLAVES_COUNT; i++) {
   401         if (EtherCAT_activate_slave(ecat_master, ecat_slaves + i) < 0) {
   401         if (EtherCAT_activate_slave(ecat_master, ecat_slaves + i) < 0) {
       
   402             printk(KERN_ERR "EtherCAT: Could not activate slave %i!\n", i);
   402             goto out_release_master;
   403             goto out_release_master;
   403         }
   404         }
   404     }
   405     }
   405 
   406 
   406     do_gettimeofday(&process_time);
   407     do_gettimeofday(&process_time);
   434     msr_print_info("msk_modul: unloading...");
   435     msr_print_info("msk_modul: unloading...");
   435 
   436 
   436     ipipe_tune_timer(1000000000UL/HZ,0); //alten Timertakt wieder herstellen
   437     ipipe_tune_timer(1000000000UL/HZ,0); //alten Timertakt wieder herstellen
   437     ipipe_unregister_domain(&this_domain);
   438     ipipe_unregister_domain(&this_domain);
   438 
   439 
   439     printk(KERN_INFO "=== Stopping EtherCAT environment... ===\n");
       
   440 
       
   441     if (ecat_master)
   440     if (ecat_master)
   442     {
   441     {
       
   442         printk(KERN_INFO "=== Stopping EtherCAT environment... ===\n");
       
   443 
   443         printk(KERN_INFO "Deactivating slaves.\n");
   444         printk(KERN_INFO "Deactivating slaves.\n");
   444 
   445 
   445         for (i = 0; i < ECAT_SLAVES_COUNT; i++) {
   446         for (i = 0; i < ECAT_SLAVES_COUNT; i++) {
   446             if (EtherCAT_deactivate_slave(ecat_master, ecat_slaves + i) < 0) {
   447             if (EtherCAT_deactivate_slave(ecat_master, ecat_slaves + i) < 0) {
   447                 printk(KERN_WARNING "Warning - Could not deactivate slave!\n");
   448                 printk(KERN_WARNING "Warning - Could not deactivate slave!\n");
   448             }
   449             }
   449         }
   450         }
   450 
   451 
   451         EtherCAT_release(ecat_master);
   452         EtherCAT_release(ecat_master);
   452     }
   453 
   453 
   454         printk(KERN_INFO "=== EtherCAT environment stopped. ===\n");
   454     printk(KERN_INFO "=== EtherCAT environment stopped. ===\n");
   455     }
   455 
   456 
   456 #ifdef USE_MSR_LIB
   457 #ifdef USE_MSR_LIB
   457     msr_rtlib_cleanup();
   458     msr_rtlib_cleanup();
   458 #endif
   459 #endif
   459 }
   460 }