aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/rx_samples_c.c4
-rw-r--r--host/examples/sync_to_gps.cpp4
-rw-r--r--host/examples/test_clock_synch.cpp6
3 files changed, 7 insertions, 7 deletions
diff --git a/host/examples/rx_samples_c.c b/host/examples/rx_samples_c.c
index b31450184..1cabafc9d 100644
--- a/host/examples/rx_samples_c.c
+++ b/host/examples/rx_samples_c.c
@@ -223,12 +223,12 @@ int main(int argc, char* argv[])
// Handle data
fwrite(buff, sizeof(float) * 2, num_rx_samps, fp);
if (verbose) {
- time_t full_secs;
+ int64_t full_secs;
double frac_secs;
uhd_rx_metadata_time_spec(md, &full_secs, &frac_secs);
fprintf(stderr, "Received packet: %zu samples, %.f full secs, %f frac secs\n",
num_rx_samps,
- difftime(full_secs, (time_t) 0),
+ difftime(full_secs, (int64_t) 0),
frac_secs);
}
diff --git a/host/examples/sync_to_gps.cpp b/host/examples/sync_to_gps.cpp
index 0b7f030bc..bb0f77f61 100644
--- a/host/examples/sync_to_gps.cpp
+++ b/host/examples/sync_to_gps.cpp
@@ -111,7 +111,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[])
}
//Set to GPS time
- uhd::time_spec_t gps_time = uhd::time_spec_t(time_t(usrp->get_mboard_sensor("gps_time", mboard).to_int()));
+ uhd::time_spec_t gps_time = uhd::time_spec_t(int64_t(usrp->get_mboard_sensor("gps_time", mboard).to_int()));
usrp->set_time_next_pps(gps_time+1.0, mboard);
//Wait for it to apply
@@ -121,7 +121,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[])
std::this_thread::sleep_for(std::chrono::seconds(2));
//Check times
- gps_time = uhd::time_spec_t(time_t(usrp->get_mboard_sensor("gps_time", mboard).to_int()));
+ gps_time = uhd::time_spec_t(int64_t(usrp->get_mboard_sensor("gps_time", mboard).to_int()));
uhd::time_spec_t time_last_pps = usrp->get_time_last_pps(mboard);
std::cout << "USRP time: " << (boost::format("%0.9f") % time_last_pps.get_real_secs()) << std::endl;
std::cout << "GPSDO time: " << (boost::format("%0.9f") % gps_time.get_real_secs()) << std::endl;
diff --git a/host/examples/test_clock_synch.cpp b/host/examples/test_clock_synch.cpp
index 38bc4980a..a0b67a95b 100644
--- a/host/examples/test_clock_synch.cpp
+++ b/host/examples/test_clock_synch.cpp
@@ -25,7 +25,7 @@ namespace po = boost::program_options;
using namespace uhd::usrp_clock;
using namespace uhd::usrp;
-void get_usrp_time(multi_usrp::sptr usrp, size_t mboard, std::vector<time_t> *times){
+void get_usrp_time(multi_usrp::sptr usrp, size_t mboard, std::vector<int64_t> *times){
(*times)[mboard] = usrp->get_time_now(mboard).get_full_secs();
}
@@ -94,7 +94,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//Get GPS time to initially set USRP devices
std::cout << std::endl << "Querying Clock for time and setting USRP times..." << std::endl << std::endl;
- time_t clock_time = clock->get_time();
+ int64_t clock_time = clock->get_time();
usrp->set_time_next_pps(uhd::time_spec_t(double(clock_time+1)));
srand((unsigned int)time(NULL));
@@ -106,7 +106,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::this_thread::sleep_for(std::chrono::milliseconds(wait_time));
//Get all times before output
- std::vector<time_t> usrp_times(usrp->get_num_mboards());
+ std::vector<int64_t> usrp_times(usrp->get_num_mboards());
boost::thread_group thread_group;
clock_time = clock->get_time();
for(size_t j = 0; j < usrp->get_num_mboards(); j++){