fmt removed fmt::make_args_checked since it's no longer needed for
constexpr format string checks.
fmt deprecated implicit conversions from enums to integers in format
arguments, so I added explicit static casts.
A lot of these are breaking changes. frc::Timer was replaced with the
contents of frc2::Timer. The others were in-place argument changes or
removing deprecated non-unit overloads.
This makes code easier to read and more consistent between C++ and Java.
Also update clang-format settings to always add a line break (even if no braces are used).
Based on run of include-what-you-use.org to identify unused include files in various .h and .cpp files.
The changes mostly fall into 3 categories:
- Actually unused includes - copy-paste errors, not removing includes after cleaning up code, etc
- A too-broad include used where a more specific (and hopefully smaller) header will do
- Interface .h files including headers only needed by the .cpp implementation - moving from .h to .cpp
will mean that code which uses the .h doesn't pay the price of processing the header file they don't need
This avoids users having to call both IsOperatorControl() and IsEnabled() to figure out if their robot is
enabled and in the teleop state. The expression above involves calling two methods that each have their
own lock.
These new methods should only involve locking one mutex, since only one call is made to HAL_GetControlWord().
Remove WaitForCachedData as it's no longer required.
Also properly handle caching / transition detection logic that occurs at the
WPILib level.
This also changes DriverStation::IsNewControlData() to check for WPILib-level
caching instead of wrapping the HAL function.
This is useful for both cleanly exiting from simulation and for unit testing
at a framework level.
This change required removing move constructor/assignment from IterativeRobot.
std::scoped_lock was introduced in C++17 and is strictly better than
std::lock_guard as it supports locking any number of mutexes safely.
It's also easier to use than std::lock for locking multiple mutexes at
once.
Most of the MotorSafety implementation was moved into the MotorSafety base
class. SafePWM's inheritance of MotorSafety was moved into PWM to
eliminate Java needing a helper class.
In Java, a helper class for Sendable (SendableImpl) was added due to
lack of multiple inheritance.
The old headers were moved into folders because doing so avoids polluting
the system include directories.
Folder names were also normalized to lowercase.
Also switch eventName and gameSpecificData to fixed 64-byte arrays to avoid mallocs and
extra NetComm calls. This behavior matches 2018 LabView.
The DS caching is kept in Java to avoid JNI and/or massive amounts of allocations.
This does not increase latency because Java still only hits NetComm once.
Moving the DS caching benefits all languages other than Java, because it avoids the need
for individual implementations. If caching is ever added to NetComm, it will then only be
necessary to remove it from the HAL and Java rather than all languages.
During shared library loading, a different libLLVM can be pulled in, causing
llvm symbols from dependent libraries to resolve to that library instead of
this one. This has been seen in the wild with the Mesa OpenGL implementation
in JavaFX applications (see wpilibsuite/shuffleboard#361).
This is clearly a very breaking change. For some level of backwards
compatibility, a namespace alias from llvm to wpi is performed in the "llvm"
headers. Unfortunately, forward declarations of llvm classes will still break,
but compilers seem to generate clear error messages in those cases
("namespace alias 'llvm' not allowed here, assuming 'wpi'").
This change also moves all the wpiutil headers to a single "wpi" subdirectory
from the previously split "llvm", "support", "tcpsockets", and "udpsockets".
Shim headers will be added for backwards compatibility in a later commit.