mirror of
https://github.com/esphome/esphome.git
synced 2026-02-27 17:34:22 -07:00
[libretiny] Use C++17 nested namespace syntax (#14325)
This commit is contained in:
@@ -4,8 +4,6 @@
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
namespace esphome {
|
||||
namespace libretiny {} // namespace libretiny
|
||||
} // namespace esphome
|
||||
namespace esphome::libretiny {} // namespace esphome::libretiny
|
||||
|
||||
#endif // USE_LIBRETINY
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user