Untangle core headers (part 1) (#2276)

This commit is contained in:
Oxan van Leeuwen 2021-09-13 09:33:29 +02:00 committed by GitHub
parent f0b6aabc96
commit f31e0532c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 32 additions and 11 deletions

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "esphome/core/component.h" #include "esphome/core/component.h"
#include "esphome/core/esphal.h"
#include "esphome/components/i2c/i2c.h" #include "esphome/components/i2c/i2c.h"
#include "esphome/components/sensor/sensor.h" #include "esphome/components/sensor/sensor.h"

View File

@ -1,4 +1,6 @@
#include "am43_base.h" #include "am43_base.h"
#include <cstring>
#include <cstdio>
namespace esphome { namespace esphome {
namespace am43 { namespace am43 {

View File

@ -1,4 +1,6 @@
#include "anova_base.h" #include "anova_base.h"
#include <cstdio>
#include <cstring>
namespace esphome { namespace esphome {
namespace anova { namespace anova {

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "esphome/core/component.h" #include "esphome/core/component.h"
#include "esphome/core/esphal.h"
#include "esphome/components/sensor/sensor.h" #include "esphome/components/sensor/sensor.h"
#include "esphome/components/binary_sensor/binary_sensor.h" #include "esphome/components/binary_sensor/binary_sensor.h"

View File

@ -1,5 +1,5 @@
#include "climate_traits.h" #include "climate_traits.h"
#include "esphome/core/log.h" #include <cstdio>
namespace esphome { namespace esphome {
namespace climate { namespace climate {

View File

@ -3,6 +3,7 @@
#include "esphome/core/component.h" #include "esphome/core/component.h"
#include "esphome/core/helpers.h" #include "esphome/core/helpers.h"
#include "esphome/core/automation.h" #include "esphome/core/automation.h"
#include "esphome/core/esphal.h"
namespace esphome { namespace esphome {
namespace deep_sleep { namespace deep_sleep {

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "esphome/core/component.h" #include "esphome/core/component.h"
#include "esphome/core/esphal.h"
#include "esphome/components/sensor/sensor.h" #include "esphome/components/sensor/sensor.h"
namespace esphome { namespace esphome {

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "esphome/core/helpers.h" #include "esphome/core/helpers.h"
#include "esphome/core/esphal.h"
#ifdef ARDUINO_ARCH_ESP32 #ifdef ARDUINO_ARCH_ESP32

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "esphome/core/component.h" #include "esphome/core/component.h"
#include "esphome/core/esphal.h"
#include "esphome/components/binary_sensor/binary_sensor.h" #include "esphome/components/binary_sensor/binary_sensor.h"
namespace esphome { namespace esphome {

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "esphome/core/component.h" #include "esphome/core/component.h"
#include "esphome/core/esphal.h"
#include "esphome/components/switch/switch.h" #include "esphome/components/switch/switch.h"
namespace esphome { namespace esphome {

View File

@ -1,4 +1,5 @@
#include "nfc.h" #include "nfc.h"
#include <cstdio>
#include "esphome/core/log.h" #include "esphome/core/log.h"
namespace esphome { namespace esphome {

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "esphome/core/component.h" #include "esphome/core/component.h"
#include "esphome/core/esphal.h"
#include "esphome/core/automation.h" #include "esphome/core/automation.h"
#include "esphome/components/binary_sensor/binary_sensor.h" #include "esphome/components/binary_sensor/binary_sensor.h"

View File

@ -1,4 +1,5 @@
#include "remote_receiver.h" #include "remote_receiver.h"
#include "esphome/core/esphal.h"
#include "esphome/core/log.h" #include "esphome/core/log.h"
#include "esphome/core/helpers.h" #include "esphome/core/helpers.h"

View File

@ -2,6 +2,7 @@
#include "esphome/components/i2c/i2c.h" #include "esphome/components/i2c/i2c.h"
#include "esphome/core/component.h" #include "esphome/core/component.h"
#include "esphome/core/esphal.h"
#include "sx1509_gpio_pin.h" #include "sx1509_gpio_pin.h"
#include "sx1509_registers.h" #include "sx1509_registers.h"

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "esphome/core/component.h" #include "esphome/core/component.h"
#include "esphome/core/esphal.h"
#include "esphome/components/binary_sensor/binary_sensor.h" #include "esphome/components/binary_sensor/binary_sensor.h"
namespace esphome { namespace esphome {

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "esphome/core/component.h" #include "esphome/core/component.h"
#include "esphome/core/esphal.h"
#include "esphome/components/sensor/sensor.h" #include "esphome/components/sensor/sensor.h"
namespace esphome { namespace esphome {

View File

@ -3,6 +3,7 @@
#include <list> #include <list>
#include "esphome/core/component.h" #include "esphome/core/component.h"
#include "esphome/core/esphal.h"
#include "esphome/components/sensor/sensor.h" #include "esphome/components/sensor/sensor.h"
#include "esphome/components/i2c/i2c.h" #include "esphome/components/i2c/i2c.h"

View File

@ -1,9 +1,7 @@
#pragma once #pragma once
#include "Arduino.h" #include "Arduino.h"
#ifdef ARDUINO_ARCH_ESP32
#include <esp32-hal.h>
#endif
// Fix some arduino defs // Fix some arduino defs
#ifdef round #ifdef round
#undef round #undef round

View File

@ -6,8 +6,11 @@
#include <memory> #include <memory>
#include <type_traits> #include <type_traits>
#ifdef ARDUINO_ARCH_ESP32
#include "esp32-hal-psram.h"
#endif
#include "esphome/core/optional.h" #include "esphome/core/optional.h"
#include "esphome/core/esphal.h"
#ifdef CLANG_TIDY #ifdef CLANG_TIDY
#undef ICACHE_RAM_ATTR #undef ICACHE_RAM_ATTR

View File

@ -3,18 +3,20 @@
#include <cassert> #include <cassert>
#include <cstdarg> #include <cstdarg>
#include <string> #include <string>
#ifdef USE_STORE_LOG_STR_IN_FLASH #ifdef USE_STORE_LOG_STR_IN_FLASH
#include "WString.h" #include "WString.h"
#endif #endif
#include "esphome/core/macros.h" // Both the ESP-IDF and Arduino also define ESP_LOG* macros. Include them here, so that they won't
// avoid esp-idf redefining our macros // be reincluded later on and redefine our macros.
#include "esphome/core/esphal.h"
#ifdef ARDUINO_ARCH_ESP32 #ifdef ARDUINO_ARCH_ESP32
#include "esp_err.h" #include <esp_log.h>
#include <esp32-hal-log.h>
#endif #endif
#include "esphome/core/macros.h"
namespace esphome { namespace esphome {
#define ESPHOME_LOG_LEVEL_NONE 0 #define ESPHOME_LOG_LEVEL_NONE 0

View File

@ -1,8 +1,8 @@
#pragma once #pragma once
#include <string> #include <string>
#include <cstring>
#include "esphome/core/esphal.h"
#include "esphome/core/defines.h" #include "esphome/core/defines.h"
namespace esphome { namespace esphome {