[libretiny] Use C++17 nested namespace syntax (#14325)

This commit is contained in:
J. Nick Koston
2026-02-26 13:02:36 -07:00
committed by GitHub
parent e8b45e53fd
commit 08035261b8
7 changed files with 17 additions and 25 deletions

View File

@@ -4,8 +4,6 @@
#include <Arduino.h>
namespace esphome {
namespace libretiny {} // namespace libretiny
} // namespace esphome
namespace esphome::libretiny {} // namespace esphome::libretiny
#endif // USE_LIBRETINY

View File

@@ -3,8 +3,7 @@
#include "gpio_arduino.h"
#include "esphome/core/log.h"
namespace esphome {
namespace libretiny {
namespace esphome::libretiny {
static const char *const TAG = "lt.gpio";
@@ -77,7 +76,9 @@ void ArduinoInternalGPIOPin::detach_interrupt() const {
detachInterrupt(pin_); // NOLINT
}
} // namespace libretiny
} // namespace esphome::libretiny
namespace esphome {
using namespace libretiny;

View File

@@ -3,8 +3,7 @@
#ifdef USE_LIBRETINY
#include "esphome/core/hal.h"
namespace esphome {
namespace libretiny {
namespace esphome::libretiny {
class ArduinoInternalGPIOPin : public InternalGPIOPin {
public:
@@ -31,7 +30,6 @@ class ArduinoInternalGPIOPin : public InternalGPIOPin {
gpio::Flags flags_{};
};
} // namespace libretiny
} // namespace esphome
} // namespace esphome::libretiny
#endif // USE_LIBRETINY

View File

@@ -4,8 +4,7 @@
#include "esphome/core/log.h"
namespace esphome {
namespace libretiny {
namespace esphome::libretiny {
static const char *const TAG = "lt.component";
@@ -28,7 +27,6 @@ void LTComponent::dump_config() {
float LTComponent::get_setup_priority() const { return setup_priority::LATE; }
} // namespace libretiny
} // namespace esphome
} // namespace esphome::libretiny
#endif // USE_LIBRETINY

View File

@@ -12,8 +12,7 @@
#include "esphome/components/text_sensor/text_sensor.h"
#endif
namespace esphome {
namespace libretiny {
namespace esphome::libretiny {
class LTComponent : public Component {
public:
@@ -30,7 +29,6 @@ class LTComponent : public Component {
#endif // USE_TEXT_SENSOR
};
} // namespace libretiny
} // namespace esphome
} // namespace esphome::libretiny
#endif // USE_LIBRETINY

View File

@@ -8,8 +8,7 @@
#include <cstring>
#include <memory>
namespace esphome {
namespace libretiny {
namespace esphome::libretiny {
static const char *const TAG = "lt.preferences";
@@ -194,7 +193,9 @@ void setup_preferences() {
global_preferences = &s_preferences;
}
} // namespace libretiny
} // namespace esphome::libretiny
namespace esphome {
ESPPreferences *global_preferences; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)

View File

@@ -2,12 +2,10 @@
#ifdef USE_LIBRETINY
namespace esphome {
namespace libretiny {
namespace esphome::libretiny {
void setup_preferences();
} // namespace libretiny
} // namespace esphome
} // namespace esphome::libretiny
#endif // USE_LIBRETINY