diff --git a/examples/dc_rtai/dc_rtai_sample.c b/examples/dc_rtai/dc_rtai_sample.c
index f6ab201d..f08d019b 100644
--- a/examples/dc_rtai/dc_rtai_sample.c
+++ b/examples/dc_rtai/dc_rtai_sample.c
@@ -220,7 +220,7 @@ void run(long data)
tv.tv_usec -= 1000000;
tv.tv_sec++;
}
- ecrt_master_application_time(master, EC_TIMEVAL2NANO(&tv));
+ ecrt_master_application_time(master, EC_TIMEVAL2NANO(tv));
if (sync_ref_counter) {
sync_ref_counter--;
diff --git a/examples/dc_user/main.c b/examples/dc_user/main.c
index 4d266321..7946a014 100644
--- a/examples/dc_user/main.c
+++ b/examples/dc_user/main.c
@@ -164,7 +164,7 @@ void cyclic_task()
app_time.tv_usec -= 1000000;
app_time.tv_sec++;
}
- ecrt_master_application_time(master, EC_TIMEVAL2NANO(&app_time));
+ ecrt_master_application_time(master, EC_TIMEVAL2NANO(app_time));
if (sync_ref_counter) {
sync_ref_counter--;
diff --git a/include/ecrt.h b/include/ecrt.h
index 69dbdd03..8f801fb8 100644
--- a/include/ecrt.h
+++ b/include/ecrt.h
@@ -120,12 +120,12 @@
*
* This macro converts a unix epoch time to EtherCAT DC time.
*
- * \see ecrt_master_sync_reference_clock()
+ * \see void ecrt_master_application_time()
*
- * \param TV Pointer to struct timeval.
+ * \param TV struct timeval containing epoch time.
*/
#define EC_TIMEVAL2NANO(TV) \
- (((TV)->tv_sec - 946684800ULL) * 1000000000ULL + (TV)->tv_usec * 1000ULL)
+ (((TV).tv_sec - 946684800ULL) * 1000000000ULL + (TV).tv_usec * 1000ULL)
/******************************************************************************
* Data types
@@ -205,7 +205,7 @@ typedef struct {
uint32_t revision_number; /**< Revision-Number stored on the slave. */
uint32_t serial_number; /**< Serial-Number stored on the slave. */
uint16_t alias; /**< The slaves alias if not equal to 0. */
- int16_t current_on_ebus;
+ int16_t current_on_ebus; /**< Used current in mA. */
uint8_t al_state; /**< Current state of the slave. */
uint8_t error_flag; /**< Error flag for that slave. */
uint8_t sync_count; /**< Number of sync managers. */
@@ -527,9 +527,14 @@ void ecrt_master_state(
/** Sets the application time.
*
- * The master has to know the application time when operation slaves with
- * distributed clocks. The time is not incremented by the master, so this
- * method has to be called cyclically.
+ * The master has to know the application's time when operating slaves with
+ * distributed clocks. The time is not incremented by the master itself, so
+ * this method has to be called cyclically.
+ *
+ * The time is used when setting the slaves' System Time Offset and
+ * Cyclic Operation Start Time registers and when synchronizing the
+ * DC reference clock to the application time via
+ * ecrt_master_sync_reference_clock().
*
* The time is defined as nanoseconds from 2000-01-01 00:00. Converting an
* epoch time can be done with the EC_TIMEVAL2NANO() macro.