From 209c09cbf4e2abea85385221bdfc570df90428d3 Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Tue, 31 Mar 2020 20:28:36 +0200 Subject: [PATCH] Change namespace --- interfaces/gpio_interface.h | 2 +- interfaces/spi_interface.h | 2 +- src/platform/hal.h | 2 +- src/platform/nrf52/gpio.cc | 2 +- src/platform/nrf52/gpio.h | 4 ++-- src/platform/nrf52/spi.cc | 4 ++-- src/platform/nrf52/spi.h | 8 ++++---- src/st7789.cc | 8 ++++---- src/st7789.h | 16 ++++++++-------- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/interfaces/gpio_interface.h b/interfaces/gpio_interface.h index 097482e..e3df6cd 100644 --- a/interfaces/gpio_interface.h +++ b/interfaces/gpio_interface.h @@ -3,7 +3,7 @@ #include -namespace interfaces { +namespace pinetime::interfaces { class GpioInterface { diff --git a/interfaces/spi_interface.h b/interfaces/spi_interface.h index 15b6490..8187d5a 100644 --- a/interfaces/spi_interface.h +++ b/interfaces/spi_interface.h @@ -3,7 +3,7 @@ #include -namespace interfaces { +namespace pinetime::interfaces { class SpiInterface { diff --git a/src/platform/hal.h b/src/platform/hal.h index d3f5234..85c1bc1 100644 --- a/src/platform/hal.h +++ b/src/platform/hal.h @@ -5,7 +5,7 @@ #include "platform/nrf52/gpio.h" #include "platform/nrf52/spi.h" - namespace hal = platform::nrf52; + namespace hal = pinetime::platform::nrf52; #endif #endif diff --git a/src/platform/nrf52/gpio.cc b/src/platform/nrf52/gpio.cc index eb70ac8..20e8a34 100644 --- a/src/platform/nrf52/gpio.cc +++ b/src/platform/nrf52/gpio.cc @@ -7,7 +7,7 @@ extern "C" { NRF_GPIO_Type *const GPIO_REGS = reinterpret_cast(NRF_P0_BASE); } -using namespace platform::nrf52; +using namespace pinetime::platform::nrf52; Gpio::Gpio(uint32_t pin) : pin_number(pin) diff --git a/src/platform/nrf52/gpio.h b/src/platform/nrf52/gpio.h index bc0e230..e16e536 100644 --- a/src/platform/nrf52/gpio.h +++ b/src/platform/nrf52/gpio.h @@ -3,9 +3,9 @@ #include "gpio_interface.h" -namespace platform::nrf52 { +namespace pinetime::platform::nrf52 { -class Gpio : public interfaces::GpioInterface +class Gpio : public pinetime::interfaces::GpioInterface { public: inline Gpio() {} diff --git a/src/platform/nrf52/spi.cc b/src/platform/nrf52/spi.cc index adf6a69..1e6664a 100644 --- a/src/platform/nrf52/spi.cc +++ b/src/platform/nrf52/spi.cc @@ -9,9 +9,9 @@ extern "C" { NRF_SPI_Type *SPI_REGS = reinterpret_cast(NRF_SPI0_BASE); } -using namespace platform::nrf52; +using namespace pinetime::platform::nrf52; -Spi::Spi(uint32_t instance, uint32_t sck, uint32_t mosi, uint32_t miso, interfaces::GpioInterface & cs) +Spi::Spi(uint32_t instance, uint32_t sck, uint32_t mosi, uint32_t miso, pinetime::interfaces::GpioInterface & cs) : chip_select(cs) { assert(instance < 3); diff --git a/src/platform/nrf52/spi.h b/src/platform/nrf52/spi.h index 51913c4..13654a5 100644 --- a/src/platform/nrf52/spi.h +++ b/src/platform/nrf52/spi.h @@ -4,12 +4,12 @@ #include "gpio_interface.h" #include "spi_interface.h" -namespace platform::nrf52 { +namespace pinetime::platform::nrf52 { -class Spi : public interfaces::SpiInterface +class Spi : public pinetime::interfaces::SpiInterface { public: - Spi(uint32_t instance, uint32_t sck, uint32_t mosi, uint32_t miso, interfaces::GpioInterface & cs); + Spi(uint32_t instance, uint32_t sck, uint32_t mosi, uint32_t miso, pinetime::interfaces::GpioInterface & cs); ~Spi(); void send(const uint8_t * buffer, uint32_t len) override; void recv(uint8_t * buffer, uint32_t len) override; @@ -17,7 +17,7 @@ public: private: uint32_t transfer(uint32_t); - interfaces::GpioInterface & chip_select; + pinetime::interfaces::GpioInterface & chip_select; }; } diff --git a/src/st7789.cc b/src/st7789.cc index d7f1059..2412869 100644 --- a/src/st7789.cc +++ b/src/st7789.cc @@ -3,10 +3,10 @@ #include "delay.h" #include "st7789.h" -St7789::St7789(interfaces::SpiInterface & spi_if, - interfaces::GpioInterface & rst, - interfaces::GpioInterface & dc, - interfaces::GpioInterface & bl) +St7789::St7789(pinetime::interfaces::SpiInterface & spi_if, + pinetime::interfaces::GpioInterface & rst, + pinetime::interfaces::GpioInterface & dc, + pinetime::interfaces::GpioInterface & bl) : spi(spi_if) , reset(rst) , data_command(dc) diff --git a/src/st7789.h b/src/st7789.h index 7e9e94a..3a34c2c 100644 --- a/src/st7789.h +++ b/src/st7789.h @@ -8,19 +8,19 @@ class St7789 { public: - St7789(interfaces::SpiInterface &, - interfaces::GpioInterface &, - interfaces::GpioInterface &, - interfaces::GpioInterface &); + St7789(pinetime::interfaces::SpiInterface &, + pinetime::interfaces::GpioInterface &, + pinetime::interfaces::GpioInterface &, + pinetime::interfaces::GpioInterface &); void init(); void clear(uint16_t Color); private: - interfaces::SpiInterface & spi; - interfaces::GpioInterface & reset; - interfaces::GpioInterface & data_command; - interfaces::GpioInterface & backlight; + pinetime::interfaces::SpiInterface & spi; + pinetime::interfaces::GpioInterface & reset; + pinetime::interfaces::GpioInterface & data_command; + pinetime::interfaces::GpioInterface & backlight; void send_cmd(uint8_t); void send_data(uint8_t);