Nest some more namespaces
Did someone previously suggest that all namespace had been
nested? Silly.
Signed-off-by: Stephan Pleines <pleines.stephan@gmail.com>
Change-Id: I22278c1caaeba8b47dc46fb2ed3078c20a11e190
diff --git a/motors/peripheral/adc.h b/motors/peripheral/adc.h
index c22a856..22db93a 100644
--- a/motors/peripheral/adc.h
+++ b/motors/peripheral/adc.h
@@ -5,8 +5,7 @@
#include "motors/util.h"
-namespace frc971 {
-namespace motors {
+namespace frc971::motors {
enum class AdcChannels {
kA,
@@ -15,7 +14,6 @@
void AdcInitCommon(AdcChannels adc0_channels = AdcChannels::kB,
AdcChannels adc1_channels = AdcChannels::kB);
-} // namespace motors
-} // namespace frc971
+} // namespace frc971::motors
#endif // MOTORS_PERIPHERAL_ADC_H_
diff --git a/motors/peripheral/adc_dma.h b/motors/peripheral/adc_dma.h
index a00b730..f04f5ce 100644
--- a/motors/peripheral/adc_dma.h
+++ b/motors/peripheral/adc_dma.h
@@ -9,8 +9,7 @@
#include "motors/peripheral/configuration.h"
#include "motors/util.h"
-namespace frc971 {
-namespace teensy {
+namespace frc971::teensy {
// This class manages configuring the hardware to automatically capture various
// sensor values periodically with tight timing. Currently it's only 4 samples
@@ -108,7 +107,6 @@
::std::array<volatile uint32_t *, 2> ftm_delays_{nullptr, nullptr};
};
-} // namespace teensy
-} // namespace frc971
+} // namespace frc971::teensy
#endif // MOTORS_PERIPHERAL_ADC_DMA_H_
diff --git a/motors/peripheral/spi.h b/motors/peripheral/spi.h
index f865703..c5a1b64 100644
--- a/motors/peripheral/spi.h
+++ b/motors/peripheral/spi.h
@@ -7,8 +7,7 @@
#include "motors/peripheral/uart_buffer.h"
#include "motors/util.h"
-namespace frc971 {
-namespace teensy {
+namespace frc971::teensy {
// Simple synchronous interface to a SPI peripheral.
class Spi {
@@ -112,7 +111,6 @@
int frames_to_receive_ = 0;
};
-} // namespace teensy
-} // namespace frc971
+} // namespace frc971::teensy
#endif // MOTORS_PERIPHERAL_SPI_H_
diff --git a/motors/peripheral/uart.h b/motors/peripheral/uart.h
index bfd630b..f8e7e7e 100644
--- a/motors/peripheral/uart.h
+++ b/motors/peripheral/uart.h
@@ -8,8 +8,7 @@
#include "motors/peripheral/uart_buffer.h"
#include "motors/util.h"
-namespace frc971 {
-namespace teensy {
+namespace frc971::teensy {
// Simple synchronous interface to a UART.
class Uart {
@@ -121,7 +120,6 @@
UartBuffer<1024> transmit_buffer_, receive_buffer_;
};
-} // namespace teensy
-} // namespace frc971
+} // namespace frc971::teensy
#endif // MOTORS_PERIPHERAL_UART_H_
diff --git a/motors/peripheral/uart_buffer.h b/motors/peripheral/uart_buffer.h
index 9266465..714cfe8 100644
--- a/motors/peripheral/uart_buffer.h
+++ b/motors/peripheral/uart_buffer.h
@@ -6,8 +6,7 @@
#include "absl/types/span.h"
-namespace frc971 {
-namespace teensy {
+namespace frc971::teensy {
// Manages a circular buffer of data to send out.
template <int kSize>
@@ -90,7 +89,6 @@
++size_;
}
-} // namespace teensy
-} // namespace frc971
+} // namespace frc971::teensy
#endif // MOTORS_PERIPHERAL_UART_BUFFER_H_