Skip to content
Snippets Groups Projects
Commit 2dd52764 authored by Florian Pose's avatar Florian Pose
Browse files

Smaller fixes on RTAI example.

parent 0a8af0f0
No related branches found
No related tags found
No related merge requests found
...@@ -23,17 +23,14 @@ ...@@ -23,17 +23,14 @@
* *
*****************************************************************************/ *****************************************************************************/
// Linux
#include <linux/module.h> #include <linux/module.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/interrupt.h>
// RTAI // RTAI
#include "rtai.h"
#include "rtai_sched.h" #include "rtai_sched.h"
#include "rtai_sem.h" #include "rtai_sem.h"
// EtherCAT realtime interface // EtherCAT
#include "../../include/ecrt.h" #include "../../include/ecrt.h"
/*****************************************************************************/ /*****************************************************************************/
...@@ -63,7 +60,6 @@ void *r_ssi_input; ...@@ -63,7 +60,6 @@ void *r_ssi_input;
// channels // channels
uint32_t k_pos; uint32_t k_pos;
uint8_t k_stat;
ec_field_init_t domain1_fields[] = { ec_field_init_t domain1_fields[] = {
{&r_ssi_input, "3", "Beckhoff", "EL5001", "InputValue", 0}, {&r_ssi_input, "3", "Beckhoff", "EL5001", "InputValue", 0},
...@@ -207,12 +203,10 @@ int __init init_mod(void) ...@@ -207,12 +203,10 @@ int __init init_mod(void)
ecrt_master_prepare_async_io(master); ecrt_master_prepare_async_io(master);
#endif #endif
#if 1
if (ecrt_master_start_eoe(master)) { if (ecrt_master_start_eoe(master)) {
printk(KERN_ERR "Failed to start EoE processing!\n"); printk(KERN_ERR "Failed to start EoE processing!\n");
goto out_deactivate; goto out_deactivate;
} }
#endif
printk("Starting cyclic sample thread...\n"); printk("Starting cyclic sample thread...\n");
requested_ticks = nano2count(TIMERTICKS); requested_ticks = nano2count(TIMERTICKS);
...@@ -253,10 +247,8 @@ void __exit cleanup_mod(void) ...@@ -253,10 +247,8 @@ void __exit cleanup_mod(void)
{ {
printk(KERN_INFO "=== Stopping EtherCAT RTAI sample module... ===\n"); printk(KERN_INFO "=== Stopping EtherCAT RTAI sample module... ===\n");
printk(KERN_INFO "Stopping RT task...\n");
rt_task_delete(&task); rt_task_delete(&task);
stop_rt_timer(); stop_rt_timer();
printk(KERN_INFO "Deactivating EtherCAT master...\n");
ecrt_master_deactivate(master); ecrt_master_deactivate(master);
ecrt_release_master(master); ecrt_release_master(master);
rt_sem_delete(&master_sem); rt_sem_delete(&master_sem);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment