equal
deleted
inserted
replaced
86 #ifdef KBUS |
86 #ifdef KBUS |
87 EC_WRITE_U8(r_outputs + 2, einaus ? 0xFF : 0x00); |
87 EC_WRITE_U8(r_outputs + 2, einaus ? 0xFF : 0x00); |
88 #endif |
88 #endif |
89 |
89 |
90 // send |
90 // send |
|
91 ecrt_domain_queue(domain1); |
91 ecrt_master_run(master); |
92 ecrt_master_run(master); |
92 ecrt_master_send(master); |
93 ecrt_master_send(master); |
93 |
94 |
94 spin_unlock(&master_lock); |
95 spin_unlock(&master_lock); |
95 |
96 |
129 ec_slave_t *slave; |
130 ec_slave_t *slave; |
130 #endif |
131 #endif |
131 |
132 |
132 printk(KERN_INFO "=== Starting Minimal EtherCAT environment... ===\n"); |
133 printk(KERN_INFO "=== Starting Minimal EtherCAT environment... ===\n"); |
133 |
134 |
134 if ((master = ecrt_request_master(0)) == NULL) { |
135 if (!(master = ecrt_request_master(0))) { |
135 printk(KERN_ERR "Requesting master 0 failed!\n"); |
136 printk(KERN_ERR "Requesting master 0 failed!\n"); |
136 goto out_return; |
137 goto out_return; |
137 } |
138 } |
138 |
139 |
139 ecrt_master_callbacks(master, request_lock, release_lock, NULL); |
140 ecrt_master_callbacks(master, request_lock, release_lock, NULL); |
140 |
141 |
141 printk(KERN_INFO "Registering domain...\n"); |
142 printk(KERN_INFO "Registering domain...\n"); |
142 if (!(domain1 = ecrt_master_create_domain(master))) |
143 if (!(domain1 = ecrt_master_create_domain(master))) { |
143 { |
|
144 printk(KERN_ERR "Domain creation failed!\n"); |
144 printk(KERN_ERR "Domain creation failed!\n"); |
145 goto out_release_master; |
145 goto out_release_master; |
146 } |
146 } |
147 |
147 |
148 printk(KERN_INFO "Registering PDOs...\n"); |
148 printk(KERN_INFO "Registering PDOs...\n"); |
177 printk(KERN_INFO "Activating master...\n"); |
177 printk(KERN_INFO "Activating master...\n"); |
178 if (ecrt_master_activate(master)) { |
178 if (ecrt_master_activate(master)) { |
179 printk(KERN_ERR "Failed to activate master!\n"); |
179 printk(KERN_ERR "Failed to activate master!\n"); |
180 goto out_release_master; |
180 goto out_release_master; |
181 } |
181 } |
182 |
|
183 ecrt_master_prepare(master); |
|
184 |
182 |
185 printk("Starting cyclic sample thread.\n"); |
183 printk("Starting cyclic sample thread.\n"); |
186 init_timer(&timer); |
184 init_timer(&timer); |
187 timer.function = run; |
185 timer.function = run; |
188 timer.expires = jiffies + 10; |
186 timer.expires = jiffies + 10; |
218 |
216 |
219 module_init(init_mini_module); |
217 module_init(init_mini_module); |
220 module_exit(cleanup_mini_module); |
218 module_exit(cleanup_mini_module); |
221 |
219 |
222 /*****************************************************************************/ |
220 /*****************************************************************************/ |
223 |
|