Adjusted examples to 1.2.0 interface changes.
This commit is contained in:
parent
029fab972d
commit
f9d1ca97e0
|
|
@ -88,6 +88,7 @@ void run(unsigned long data)
|
|||
#endif
|
||||
|
||||
// send
|
||||
ecrt_domain_queue(domain1);
|
||||
ecrt_master_run(master);
|
||||
ecrt_master_send(master);
|
||||
|
||||
|
|
@ -131,7 +132,7 @@ int __init init_mini_module(void)
|
|||
|
||||
printk(KERN_INFO "=== Starting Minimal EtherCAT environment... ===\n");
|
||||
|
||||
if ((master = ecrt_request_master(0)) == NULL) {
|
||||
if (!(master = ecrt_request_master(0))) {
|
||||
printk(KERN_ERR "Requesting master 0 failed!\n");
|
||||
goto out_return;
|
||||
}
|
||||
|
|
@ -139,8 +140,7 @@ int __init init_mini_module(void)
|
|||
ecrt_master_callbacks(master, request_lock, release_lock, NULL);
|
||||
|
||||
printk(KERN_INFO "Registering domain...\n");
|
||||
if (!(domain1 = ecrt_master_create_domain(master)))
|
||||
{
|
||||
if (!(domain1 = ecrt_master_create_domain(master))) {
|
||||
printk(KERN_ERR "Domain creation failed!\n");
|
||||
goto out_release_master;
|
||||
}
|
||||
|
|
@ -180,8 +180,6 @@ int __init init_mini_module(void)
|
|||
goto out_release_master;
|
||||
}
|
||||
|
||||
ecrt_master_prepare(master);
|
||||
|
||||
printk("Starting cyclic sample thread.\n");
|
||||
init_timer(&timer);
|
||||
timer.function = run;
|
||||
|
|
@ -220,4 +218,3 @@ module_init(init_mini_module);
|
|||
module_exit(cleanup_mini_module);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ void msr_controller_run(void)
|
|||
EC_WRITE_S16(r_ana_out, k_ana_out / 10.0 * 0x7FFF);
|
||||
|
||||
// Send
|
||||
ecrt_domain_queue(domain1);
|
||||
ecrt_master_run(master);
|
||||
ecrt_master_send(master);
|
||||
|
||||
|
|
@ -175,8 +176,6 @@ int __init init_mod(void)
|
|||
goto out_release_master;
|
||||
}
|
||||
|
||||
ecrt_master_prepare(master);
|
||||
|
||||
printk("Starting cyclic sample thread...\n");
|
||||
ticks = start_rt_timer(nano2count(TIMERTICKS));
|
||||
if (rt_task_init(&task, msr_run, 0, 2000, 0, 1, NULL)) {
|
||||
|
|
@ -195,7 +194,6 @@ int __init init_mod(void)
|
|||
rt_task_delete(&task);
|
||||
out_stop_timer:
|
||||
stop_rt_timer();
|
||||
ecrt_master_deactivate(master);
|
||||
out_release_master:
|
||||
ecrt_release_master(master);
|
||||
out_msr_cleanup:
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ void run(long data)
|
|||
// process data
|
||||
//k_pos = EC_READ_U32(r_ssi_input);
|
||||
|
||||
ecrt_domain_queue(domain1);
|
||||
ecrt_master_run(master);
|
||||
ecrt_master_send(master);
|
||||
|
||||
|
|
@ -139,7 +140,6 @@ int __init init_mod(void)
|
|||
goto out_return;
|
||||
}
|
||||
|
||||
|
||||
ecrt_master_callbacks(master, request_lock, release_lock, NULL);
|
||||
|
||||
printk(KERN_INFO "Registering domain...\n");
|
||||
|
|
@ -160,8 +160,6 @@ int __init init_mod(void)
|
|||
goto out_release_master;
|
||||
}
|
||||
|
||||
ecrt_master_prepare(master);
|
||||
|
||||
printk("Starting cyclic sample thread...\n");
|
||||
requested_ticks = nano2count(TIMERTICKS);
|
||||
tick_period = start_rt_timer(requested_ticks);
|
||||
|
|
@ -186,7 +184,6 @@ int __init init_mod(void)
|
|||
rt_task_delete(&task);
|
||||
out_stop_timer:
|
||||
stop_rt_timer();
|
||||
ecrt_master_deactivate(master);
|
||||
out_release_master:
|
||||
ecrt_release_master(master);
|
||||
out_return:
|
||||
|
|
|
|||
Loading…
Reference in New Issue