Separated application time from synchronizing reference clock.

This commit is contained in:
Florian Pose
2009-05-04 10:05:55 +00:00
parent 25db02ecd0
commit a34809e18d
7 changed files with 77 additions and 55 deletions
+3 -6
View File
@@ -51,7 +51,7 @@
#define NUM_DIG_OUT 1
#define PFX "ec_dc_sample: "
#define PFX "ec_dc_rtai_sample: "
/*****************************************************************************/
@@ -220,16 +220,13 @@ void run(long data)
tv.tv_usec -= 1000000;
tv.tv_sec++;
}
ecrt_master_application_time(master, EC_TIMEVAL2NANO(&tv));
if (sync_ref_counter) {
sync_ref_counter--;
} else {
sync_ref_counter = 9;
#if 0
printk(KERN_INFO PFX "ref: %u %u %llu\n",
(u32) tv.tv_sec, (u32) tv.tv_usec, EC_TIMEVAL2NANO(&tv));
#endif
ecrt_master_sync_reference_clock(master, EC_TIMEVAL2NANO(&tv));
ecrt_master_sync_reference_clock(master);
}
ecrt_master_sync_slave_clocks(master);
ecrt_domain_queue(domain1);
+2 -1
View File
@@ -164,12 +164,13 @@ void cyclic_task()
app_time.tv_usec -= 1000000;
app_time.tv_sec++;
}
ecrt_master_application_time(master, EC_TIMEVAL2NANO(&app_time));
if (sync_ref_counter) {
sync_ref_counter--;
} else {
sync_ref_counter = 9;
ecrt_master_sync_reference_clock(master, EC_TIMEVAL2NANO(&app_time));
ecrt_master_sync_reference_clock(master);
}
ecrt_master_sync_slave_clocks(master);