mirror of
https://github.com/nasa/trick.git
synced 2024-12-18 20:57:55 +00:00
TPROCTE_HOME Being Used In Place Of TPRO_HOME #778
Changed the Tsync routing from using the old TPro API to the new Tsync API.
This commit is contained in:
parent
a78fcf1bc9
commit
a420418443
@ -35,7 +35,7 @@ PLATFORM_LIBS += -L$(DMTCP)/dmtcpaware -ldmtcpaware
|
||||
endif
|
||||
|
||||
ifneq ($(TPROCTE),)
|
||||
TRICK_ADDITIONAL_CXXFLAGS += -D_TPRO_CTE -I$(TPROCTE)/linux/h -I$(TPROCTE)/common/h
|
||||
TRICK_ADDITIONAL_CXXFLAGS += -D_TPRO_CTE -I$(TPROCTE)/linux/h -I$(TPROCTE)/linux/tsync/h -I$(TPROCTE)/common/h -I$(TPROCTE)/common/tsync/h
|
||||
PLATFORM_LIBS += $(TPROCTE)/linux/tsync/lib/libtsync.a $(TPROCTE)/linux/lib/libtpro.a
|
||||
TRICK_EXCLUDE += :$(TPROCTE)
|
||||
endif
|
||||
|
@ -7,6 +7,7 @@ PROGRAMMERS:
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "tsync.h"
|
||||
#include "trick/TPROCTEClock.hh"
|
||||
#include "trick/message_proto.h"
|
||||
#include "trick/message_type.h"
|
||||
@ -67,26 +68,17 @@ Please run ${TRICK_HOME}/configure --with-tpro=<directory holding CTE>, and reco
|
||||
*/
|
||||
long long Trick::TPROCTEClock::wall_clock_time() {
|
||||
#ifdef _TPRO_CTE
|
||||
unsigned char rv;
|
||||
TPRO_TimeObj tproTime;
|
||||
long long curr_time ;
|
||||
TSYNC_HWTimeSecondsObj hwTime;
|
||||
|
||||
/* Get the TPRO/TSAT current time */
|
||||
rv = TPRO_getTime(pBoard, &tproTime);
|
||||
/* Send Get Seconds Time message */
|
||||
TSYNC_ERROR err = TSYNC_HW_getTimeSec(pBoard, &hwTime);
|
||||
|
||||
/* If unable to get the TPRO/TSAT current time... */
|
||||
if (rv != TPRO_SUCCESS) {
|
||||
printf (" Could not retrieve time from '%s'!! [%d]\n", dev_name.c_str(), rv);
|
||||
return 0 ;
|
||||
} else {
|
||||
curr_time = (long long)(tproTime.days * 86400LL * 1000000LL) ;
|
||||
curr_time += (long long)(tproTime.hours * 3600LL * 1000000LL) ;
|
||||
curr_time += (long long)(tproTime.minutes * 60LL * 1000000LL) ;
|
||||
curr_time += (long long)(tproTime.seconds * 1000000LL) ;
|
||||
curr_time += (long long)((tproTime.secsDouble - tproTime.seconds) * 1000000LL) ;
|
||||
if (err != TSYNC_SUCCESS) {
|
||||
printf(" Error: %s.\n", tsync_strerror(err));
|
||||
return 0;
|
||||
}
|
||||
return hwTime.time.seconds * 1000000LL + (hwTime.time.ns /1000);
|
||||
|
||||
return (curr_time);
|
||||
#else
|
||||
message_publish(MSG_ERROR, "TPRO CTE card was not enabled at compile time\n");
|
||||
return 0 ;
|
||||
|
Loading…
Reference in New Issue
Block a user