Added support for simulation time.

This allows control loops to behave more predictably in the face of the
simulator running at non-realtime speeds.

Change-Id: I3508ed7ad316a3bf8b2c54b68c93baaf8cc4d941
Closes: artf2607

Conflicts:
	wpilibc/wpilibC++Sim/include/Timer.h
	wpilibc/wpilibC++Sim/src/Utility.cpp
This commit is contained in:
Alex Henning
2014-06-26 10:50:47 -07:00
parent 15e3781805
commit e4e199f066
10 changed files with 112 additions and 51 deletions

View File

@@ -7,8 +7,8 @@
#include "Utility.h"
#include "HAL/cpp/StackTrace.hpp"
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include "Task.h"
#include "Timer.h"
#include <stdio.h>
#include <string.h>
@@ -160,7 +160,6 @@ bool wpi_assertNotEqual_impl(int valueA,
*/
uint32_t GetFPGATime()
{
boost::posix_time::ptime time = boost::posix_time::microsec_clock::universal_time();
return time.time_of_day().total_microseconds();
return wpilib::internal::simTime * 1e6;
}