Finish converting GSL to absl::Span
One less dependency.
Change-Id: Iaac25a3c1312a21a8a2b77b8cfee2463bdb51196
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/motors/peripheral/uart.h b/motors/peripheral/uart.h
index ffb1529..d51bcfe 100644
--- a/motors/peripheral/uart.h
+++ b/motors/peripheral/uart.h
@@ -1,11 +1,11 @@
#ifndef MOTORS_PERIPHERAL_UART_H_
#define MOTORS_PERIPHERAL_UART_H_
+#include "absl/types/span.h"
#include "aos/containers/sized_array.h"
#include "motors/core/kinetis.h"
#include "motors/peripheral/uart_buffer.h"
#include "motors/util.h"
-#include "third_party/GSL/include/gsl/gsl"
namespace frc971 {
namespace teensy {
@@ -22,7 +22,7 @@
void Initialize(int baud_rate);
// Blocks until all of the data is at least queued.
- void Write(gsl::span<const char> data, const DisableInterrupts &) {
+ void Write(absl::Span<const char> data, const DisableInterrupts &) {
DoWrite(data);
}
@@ -77,7 +77,7 @@
module_->C2 = c2_value_;
}
- void DoWrite(gsl::span<const char> data);
+ void DoWrite(absl::Span<const char> data);
aos::SizedArray<char, 4> DoRead();
KINETISK_UART_t *const module_;
@@ -100,13 +100,13 @@
// Queues up the given data for immediate writing. Blocks only if the queue
// fills up before all of data is enqueued.
- void Write(gsl::span<const char> data);
+ void Write(absl::Span<const char> data);
// Reads currently available data.
// Returns all the data which is currently available (possibly none);
// buffer is where to store the result. The return value will be a subspan of
// this.
- gsl::span<char> Read(gsl::span<char> buffer);
+ absl::Span<char> Read(absl::Span<char> buffer);
// Should be called as the body of the interrupt handler.
void HandleInterrupt(const DisableInterrupts &disable_interrupts) {