examples/rtai/rtai_sample.c
changeset 1580 1baac79a40cf
parent 1513 60ca68d853b8
child 1935 8ea1033bd4c2
--- a/examples/rtai/rtai_sample.c	Thu Nov 19 14:39:10 2009 +0100
+++ b/examples/rtai/rtai_sample.c	Thu Nov 19 14:44:57 2009 +0100
@@ -243,24 +243,28 @@
 
 /*****************************************************************************/
 
-void send_callback(ec_master_t *master)
-{
+void send_callback(void *cb_data)
+{
+    ec_master_t *m = (ec_master_t *) cb_data;
+
     // too close to the next real time cycle: deny access...
     if (get_cycles() - t_last_cycle <= t_critical) {
         rt_sem_wait(&master_sem);
-        ecrt_master_send_ext(master);
+        ecrt_master_send_ext(m);
         rt_sem_signal(&master_sem);
     }
 }
 
 /*****************************************************************************/
 
-void receive_callback(ec_master_t *master)
-{
+void receive_callback(void *cb_data)
+{
+    ec_master_t *m = (ec_master_t *) cb_data;
+
     // too close to the next real time cycle: deny access...
     if (get_cycles() - t_last_cycle <= t_critical) {
         rt_sem_wait(&master_sem);
-        ecrt_master_receive(master);
+        ecrt_master_receive(m);
         rt_sem_signal(&master_sem);
     }
 }
@@ -288,7 +292,7 @@
         goto out_return;
     }
 
-    ecrt_master_callbacks(master, send_callback, receive_callback);
+    ecrt_master_callbacks(master, send_callback, receive_callback, master);
 
     printk(KERN_INFO PFX "Registering domain...\n");
     if (!(domain1 = ecrt_master_create_domain(master))) {