Upgrade WPILib and upgraded compilers to C++17
I haven't touched the CTRE libraries yet, although they may need to be
upgraded as well.
Note that this change makes it so that you need either Ubuntu 18.04 or
later or debian buster or later in order to build the code (you may be
able to build code for the roborio on older operating systems, but
running the tests will not work normally).
Change-Id: I0cfa37fe37f830edde6d305e1f50414c369098e4
diff --git a/y2019/jevois/teensy.cc b/y2019/jevois/teensy.cc
index 58d1570..4da89a8 100644
--- a/y2019/jevois/teensy.cc
+++ b/y2019/jevois/teensy.cc
@@ -1,6 +1,8 @@
#include <inttypes.h>
#include <stdio.h>
+#include <optional>
+
#include "aos/time/time.h"
#include "motors/core/kinetis.h"
#include "motors/core/time.h"
@@ -115,18 +117,18 @@
SpiQueue(const SpiQueue &) = delete;
SpiQueue &operator=(const SpiQueue &) = delete;
- tl::optional<gsl::span<const char, spi_transfer_size()>> Tick() {
+ std::optional<gsl::span<const char, spi_transfer_size()>> Tick() {
{
DisableInterrupts disable_interrupts;
if (waiting_for_enable_ || waiting_for_disable_) {
- return tl::nullopt;
+ return std::nullopt;
}
}
const auto now = aos::monotonic_clock::now();
if (TransferTimedOut(now)) {
printf("SPI timeout with %d left\n", static_cast<int>(to_receive_.size()));
WaitForNextTransfer();
- return tl::nullopt;
+ return std::nullopt;
}
{
DisableInterrupts disable_interrupts;
@@ -138,7 +140,7 @@
if (DeassertHappened(now)) {
printf("CS deasserted with %d left\n", static_cast<int>(to_receive_.size()));
WaitForNextTransfer();
- return tl::nullopt;
+ return std::nullopt;
}
bool all_done;
{
@@ -160,7 +162,7 @@
WaitForNextTransfer();
return received_transfer_;
}
- return tl::nullopt;
+ return std::nullopt;
}
void HandleInterrupt() {