mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 11:26:39 +00:00
[libretiny] Use C++17 nested namespace syntax (#14325)
This commit is contained in:
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome::libretiny {} // namespace esphome::libretiny
|
||||||
namespace libretiny {} // namespace libretiny
|
|
||||||
} // namespace esphome
|
|
||||||
|
|
||||||
#endif // USE_LIBRETINY
|
#endif // USE_LIBRETINY
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
#include "gpio_arduino.h"
|
#include "gpio_arduino.h"
|
||||||
#include "esphome/core/log.h"
|
#include "esphome/core/log.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome::libretiny {
|
||||||
namespace libretiny {
|
|
||||||
|
|
||||||
static const char *const TAG = "lt.gpio";
|
static const char *const TAG = "lt.gpio";
|
||||||
|
|
||||||
@@ -77,7 +76,9 @@ void ArduinoInternalGPIOPin::detach_interrupt() const {
|
|||||||
detachInterrupt(pin_); // NOLINT
|
detachInterrupt(pin_); // NOLINT
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace libretiny
|
} // namespace esphome::libretiny
|
||||||
|
|
||||||
|
namespace esphome {
|
||||||
|
|
||||||
using namespace libretiny;
|
using namespace libretiny;
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
#ifdef USE_LIBRETINY
|
#ifdef USE_LIBRETINY
|
||||||
#include "esphome/core/hal.h"
|
#include "esphome/core/hal.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome::libretiny {
|
||||||
namespace libretiny {
|
|
||||||
|
|
||||||
class ArduinoInternalGPIOPin : public InternalGPIOPin {
|
class ArduinoInternalGPIOPin : public InternalGPIOPin {
|
||||||
public:
|
public:
|
||||||
@@ -31,7 +30,6 @@ class ArduinoInternalGPIOPin : public InternalGPIOPin {
|
|||||||
gpio::Flags flags_{};
|
gpio::Flags flags_{};
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace libretiny
|
} // namespace esphome::libretiny
|
||||||
} // namespace esphome
|
|
||||||
|
|
||||||
#endif // USE_LIBRETINY
|
#endif // USE_LIBRETINY
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
|
|
||||||
#include "esphome/core/log.h"
|
#include "esphome/core/log.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome::libretiny {
|
||||||
namespace libretiny {
|
|
||||||
|
|
||||||
static const char *const TAG = "lt.component";
|
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; }
|
float LTComponent::get_setup_priority() const { return setup_priority::LATE; }
|
||||||
|
|
||||||
} // namespace libretiny
|
} // namespace esphome::libretiny
|
||||||
} // namespace esphome
|
|
||||||
|
|
||||||
#endif // USE_LIBRETINY
|
#endif // USE_LIBRETINY
|
||||||
|
|||||||
@@ -12,8 +12,7 @@
|
|||||||
#include "esphome/components/text_sensor/text_sensor.h"
|
#include "esphome/components/text_sensor/text_sensor.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome::libretiny {
|
||||||
namespace libretiny {
|
|
||||||
|
|
||||||
class LTComponent : public Component {
|
class LTComponent : public Component {
|
||||||
public:
|
public:
|
||||||
@@ -30,7 +29,6 @@ class LTComponent : public Component {
|
|||||||
#endif // USE_TEXT_SENSOR
|
#endif // USE_TEXT_SENSOR
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace libretiny
|
} // namespace esphome::libretiny
|
||||||
} // namespace esphome
|
|
||||||
|
|
||||||
#endif // USE_LIBRETINY
|
#endif // USE_LIBRETINY
|
||||||
|
|||||||
@@ -8,8 +8,7 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome::libretiny {
|
||||||
namespace libretiny {
|
|
||||||
|
|
||||||
static const char *const TAG = "lt.preferences";
|
static const char *const TAG = "lt.preferences";
|
||||||
|
|
||||||
@@ -194,7 +193,9 @@ void setup_preferences() {
|
|||||||
global_preferences = &s_preferences;
|
global_preferences = &s_preferences;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace libretiny
|
} // namespace esphome::libretiny
|
||||||
|
|
||||||
|
namespace esphome {
|
||||||
|
|
||||||
ESPPreferences *global_preferences; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
ESPPreferences *global_preferences; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,10 @@
|
|||||||
|
|
||||||
#ifdef USE_LIBRETINY
|
#ifdef USE_LIBRETINY
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome::libretiny {
|
||||||
namespace libretiny {
|
|
||||||
|
|
||||||
void setup_preferences();
|
void setup_preferences();
|
||||||
|
|
||||||
} // namespace libretiny
|
} // namespace esphome::libretiny
|
||||||
} // namespace esphome
|
|
||||||
|
|
||||||
#endif // USE_LIBRETINY
|
#endif // USE_LIBRETINY
|
||||||
|
|||||||
Reference in New Issue
Block a user