Removed more tabulators.
--- a/examples/dc_rtai/dc_rtai_sample.c Mon Jul 27 10:37:47 2009 +0000
+++ b/examples/dc_rtai/dc_rtai_sample.c Mon Jul 27 10:44:16 2009 +0000
@@ -161,7 +161,7 @@
void run(long data)
{
int i;
- struct timeval tv;
+ struct timeval tv;
unsigned int sync_ref_counter = 0;
count2timeval(nano2count(rt_get_real_time_ns()), &tv);
@@ -181,18 +181,18 @@
if (counter) {
counter--;
} else {
- u32 c;
-
+ u32 c;
+
counter = FREQUENCY;
// check for master state (optional)
check_master_state();
- c = EC_READ_U32(domain1_pd + off_counter_in);
- if (counter_value != c) {
- counter_value = c;
- printk(KERN_INFO PFX "counter=%u\n", counter_value);
- }
+ c = EC_READ_U32(domain1_pd + off_counter_in);
+ if (counter_value != c) {
+ counter_value = c;
+ printk(KERN_INFO PFX "counter=%u\n", counter_value);
+ }
}
@@ -210,10 +210,10 @@
EC_WRITE_U8(domain1_pd + off_dig_out[i], blink ? 0x66 : 0x99);
}
- EC_WRITE_U8(domain1_pd + off_counter_out, blink ? 0x00 : 0x02);
+ EC_WRITE_U8(domain1_pd + off_counter_out, blink ? 0x00 : 0x02);
rt_sem_wait(&master_sem);
-
+
tv.tv_usec += 1000;
if (tv.tv_usec >= 1000000) {
tv.tv_usec -= 1000000;
@@ -227,11 +227,11 @@
sync_ref_counter = 9;
ecrt_master_sync_reference_clock(master);
}
- ecrt_master_sync_slave_clocks(master);
+ ecrt_master_sync_slave_clocks(master);
ecrt_domain_queue(domain1);
ecrt_master_send(master);
rt_sem_signal(&master_sem);
-
+
rt_task_wait_period();
}
}
@@ -292,10 +292,10 @@
printk(KERN_INFO PFX "Configuring PDOs...\n");
// create configuration for reference clock FIXME
- if (!(sc = ecrt_master_slave_config(master, 0, 0, Beckhoff_EK1100))) {
- printk(KERN_ERR PFX "Failed to get slave configuration.\n");
- goto out_release_master;
- }
+ if (!(sc = ecrt_master_slave_config(master, 0, 0, Beckhoff_EK1100))) {
+ printk(KERN_ERR PFX "Failed to get slave configuration.\n");
+ goto out_release_master;
+ }
for (i = 0; i < NUM_DIG_OUT; i++) {
if (!(sc = ecrt_master_slave_config(master,
@@ -316,22 +316,22 @@
goto out_release_master;
}
- if (!(sc = ecrt_master_slave_config(master,
- CounterSlavePos, IDS_Counter))) {
- printk(KERN_ERR PFX "Failed to get slave configuration.\n");
- goto out_release_master;
- }
- off_counter_in = ecrt_slave_config_reg_pdo_entry(sc,
- 0x6020, 0x11, domain1, NULL);
- if (off_counter_in < 0)
- goto out_release_master;
- off_counter_out = ecrt_slave_config_reg_pdo_entry(sc,
- 0x7020, 1, domain1, NULL);
- if (off_counter_out < 0)
- goto out_release_master;
+ if (!(sc = ecrt_master_slave_config(master,
+ CounterSlavePos, IDS_Counter))) {
+ printk(KERN_ERR PFX "Failed to get slave configuration.\n");
+ goto out_release_master;
+ }
+ off_counter_in = ecrt_slave_config_reg_pdo_entry(sc,
+ 0x6020, 0x11, domain1, NULL);
+ if (off_counter_in < 0)
+ goto out_release_master;
+ off_counter_out = ecrt_slave_config_reg_pdo_entry(sc,
+ 0x7020, 1, domain1, NULL);
+ if (off_counter_out < 0)
+ goto out_release_master;
// configure SYNC signals for this slave
- ecrt_slave_config_dc(sc, 0x0700, 1000000, 440000, 0, 0);
+ ecrt_slave_config_dc(sc, 0x0700, 1000000, 440000, 0, 0);
printk(KERN_INFO PFX "Activating master...\n");
if (ecrt_master_activate(master)) {
--- a/examples/rtai/rtai_sample.c Mon Jul 27 10:37:47 2009 +0000
+++ b/examples/rtai/rtai_sample.c Mon Jul 27 10:44:16 2009 +0000
@@ -236,7 +236,7 @@
ecrt_domain_queue(domain1);
ecrt_master_send(master);
rt_sem_signal(&master_sem);
-
+
rt_task_wait_period();
}
}
--- a/examples/user/main.c Mon Jul 27 10:37:47 2009 +0000
+++ b/examples/user/main.c Mon Jul 27 10:44:16 2009 +0000
@@ -92,9 +92,9 @@
const static ec_pdo_entry_reg_t domain1_regs[] = {
{AnaInSlavePos, Beckhoff_EL3102, 0x3101, 1, &off_ana_in_status},
{AnaInSlavePos, Beckhoff_EL3102, 0x3101, 2, &off_ana_in_value},
- {AnaOutSlavePos, Beckhoff_EL4102, 0x3001, 1, &off_ana_out},
- {DigOutSlavePos, Beckhoff_EL2032, 0x3001, 1, &off_dig_out},
- {}
+ {AnaOutSlavePos, Beckhoff_EL4102, 0x3001, 1, &off_ana_out},
+ {DigOutSlavePos, Beckhoff_EL2032, 0x3001, 1, &off_dig_out},
+ {}
};
static unsigned int counter = 0;
@@ -316,13 +316,13 @@
int main(int argc, char **argv)
{
- ec_slave_config_t *sc;
+ ec_slave_config_t *sc;
struct sigaction sa;
struct itimerval tv;
master = ecrt_request_master(0);
- if (!master)
- return -1;
+ if (!master)
+ return -1;
domain1 = ecrt_master_create_domain(master);
if (!domain1)
@@ -380,7 +380,7 @@
if (ecrt_domain_reg_pdo_entry_list(domain1, domain1_regs)) {
fprintf(stderr, "PDO entry registration failed!\n");
- return -1;
+ return -1;
}
printf("Activating master...\n");
@@ -417,7 +417,7 @@
}
printf("Started.\n");
- while (1) {
+ while (1) {
pause();
#if 0
@@ -430,9 +430,9 @@
cyclic_task();
user_alarms++;
}
- }
-
- return 0;
-}
-
-/****************************************************************************/
+ }
+
+ return 0;
+}
+
+/****************************************************************************/
--- a/lib/master.c Mon Jul 27 10:37:47 2009 +0000
+++ b/lib/master.c Mon Jul 27 10:44:16 2009 +0000
@@ -116,17 +116,17 @@
int ecrt_master(ec_master_t* master, ec_master_info_t *master_info)
{
- ec_ioctl_master_t data;
-
- if (ioctl(master->fd, EC_IOCTL_MASTER, &data) < 0) {
+ ec_ioctl_master_t data;
+
+ if (ioctl(master->fd, EC_IOCTL_MASTER, &data) < 0) {
fprintf(stderr, "Failed to get master info: %s\n", strerror(errno));
- return -1;
- }
-
- master_info->slave_count = data.slave_count;
- master_info->link_up = data.devices[0].link_state;
- master_info->app_time = data.app_time;
- return 0;
+ return -1;
+ }
+
+ master_info->slave_count = data.slave_count;
+ master_info->link_up = data.devices[0].link_state;
+ master_info->app_time = data.app_time;
+ return 0;
}
/*****************************************************************************/
--- a/lib/slave_config.c Mon Jul 27 10:37:47 2009 +0000
+++ b/lib/slave_config.c Mon Jul 27 10:44:16 2009 +0000
@@ -252,10 +252,10 @@
data.config_index = sc->index;
data.dc_assign_activate = assign_activate;
- data.dc_sync[0].cycle_time = sync0_cycle_time;
- data.dc_sync[0].shift_time = sync0_shift_time;
- data.dc_sync[1].cycle_time = sync1_cycle_time;
- data.dc_sync[1].shift_time = sync1_shift_time;
+ data.dc_sync[0].cycle_time = sync0_cycle_time;
+ data.dc_sync[0].shift_time = sync0_shift_time;
+ data.dc_sync[1].cycle_time = sync1_cycle_time;
+ data.dc_sync[1].shift_time = sync1_shift_time;
if (ioctl(sc->master->fd, EC_IOCTL_SC_DC, &data) == -1) {
fprintf(stderr, "Failed to set assign_activate word.\n");