Fixed semaphore bug introduced in 96e2ae6cce95.
--- a/examples/mini/mini.c Fri Jan 13 11:27:20 2012 +0100
+++ b/examples/mini/mini.c Fri Jan 13 12:05:14 2012 +0100
@@ -346,9 +346,10 @@
EC_WRITE_U8(domain1_pd + off_dig_out, blink ? 0x06 : 0x09);
// send process data
+ down(&master_sem);
ecrt_domain_queue(domain1);
+ ecrt_master_send(master);
up(&master_sem);
- ecrt_master_send(master);
// restart timer
timer.expires += HZ / FREQUENCY;
@@ -391,7 +392,8 @@
}
sema_init(&master_sem, 1);
- ecrt_master_callbacks(master, request_lock_callback, release_lock_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))) {
@@ -437,7 +439,8 @@
#if SDO_ACCESS
printk(KERN_INFO PFX "Creating SDO requests...\n");
- if (!(sdo = ecrt_slave_config_create_sdo_request(sc_ana_in, 0x3102, 2, 2))) {
+ if (!(sdo = ecrt_slave_config_create_sdo_request(
+ sc_ana_in, 0x3102, 2, 2))) {
printk(KERN_ERR PFX "Failed to create SDO request.\n");
goto out_release_master;
}