examples/dc_user/main.c
changeset 1971 ba8a75cb1c98
parent 1970 00e18cef9fc8
child 2421 bc2d4bf9cbe5
equal deleted inserted replaced
1970:00e18cef9fc8 1971:ba8a75cb1c98
   229 		EC_WRITE_U8(domain1_pd + off_dig_out, blink ? 0x66 : 0x99);
   229 		EC_WRITE_U8(domain1_pd + off_dig_out, blink ? 0x66 : 0x99);
   230 		EC_WRITE_U8(domain1_pd + off_counter_out, blink ? 0x00 : 0x02);
   230 		EC_WRITE_U8(domain1_pd + off_counter_out, blink ? 0x00 : 0x02);
   231 
   231 
   232 		// write application time to master
   232 		// write application time to master
   233 		clock_gettime(CLOCK_TO_USE, &time);
   233 		clock_gettime(CLOCK_TO_USE, &time);
   234 		ecrt_master_application_time(master, timespec2u64(time));
   234 		ecrt_master_application_time(master, TIMESPEC2NS(time));
   235 
   235 
   236 		if (sync_ref_counter) {
   236 		if (sync_ref_counter) {
   237 			sync_ref_counter--;
   237 			sync_ref_counter--;
   238 		} else {
   238 		} else {
   239 			sync_ref_counter = 1; // sync every cycle
   239 			sync_ref_counter = 1; // sync every cycle