examples/tty/tty.c
changeset 2068 3001f6523e63
parent 2024 96e2ae6cce95
child 2589 2b9c78543663
--- a/examples/tty/tty.c	Fri May 13 15:33:16 2011 +0200
+++ b/examples/tty/tty.c	Fri May 13 15:34:20 2011 +0200
@@ -141,8 +141,8 @@
     // send process data
     down(&master_sem);
     ecrt_domain_queue(domain1);
+    up(&master_sem);
     ecrt_master_send(master);
-    up(&master_sem);
 
     // restart timer
     timer.expires += HZ / FREQUENCY;
@@ -151,21 +151,17 @@
 
 /*****************************************************************************/
 
-void send_callback(void *cb_data)
+void request_lock_callback(void *cb_data)
 {
     ec_master_t *m = (ec_master_t *) cb_data;
     down(&master_sem);
-    ecrt_master_send_ext(m);
-    up(&master_sem);
-}
-
-/*****************************************************************************/
-
-void receive_callback(void *cb_data)
+}
+
+/*****************************************************************************/
+
+void release_lock_callback(void *cb_data)
 {
     ec_master_t *m = (ec_master_t *) cb_data;
-    down(&master_sem);
-    ecrt_master_receive(m);
     up(&master_sem);
 }
 
@@ -186,7 +182,7 @@
     }
 
     sema_init(&master_sem, 1);
-    ecrt_master_callbacks(master, send_callback, receive_callback, master);
+    ecrt_master_callbacks(master, request_lock_callback, release_lock_callback, master);
 
     printk(KERN_INFO PFX "Registering domain...\n");
     if (!(domain1 = ecrt_master_create_domain(master))) {