add USE_ESP32 define checks

This commit is contained in:
NP v/d Spek 2024-08-24 20:45:50 +02:00
parent bccb306fff
commit e5eb4f1560
3 changed files with 10 additions and 1 deletions

View file

@ -1,5 +1,7 @@
#include "espnow.h" #include "espnow.h"
#if defined(USE_ESP32)
#include <cstring> #include <cstring>
#include "esp_mac.h" #include "esp_mac.h"
@ -388,3 +390,5 @@ ESPNowComponent *global_esp_now = nullptr;
} // namespace espnow } // namespace espnow
} // namespace esphome } // namespace esphome
#endif

View file

@ -1,4 +1,5 @@
#include "espnow_packet.h" #include "espnow_packet.h"
#if defined(USE_ESP32)
#include "esphome/core/log.h" #include "esphome/core/log.h"
@ -43,3 +44,5 @@ bool ESPNowPacket::is_valid() {
this->crc16 = crc; this->crc16 = crc;
return valid; return valid;
} }
#endif

View file

@ -1,6 +1,6 @@
#pragma once #pragma once
// #if defined(USE_ESP32) #if defined(USE_ESP32)
#include "esphome/core/automation.h" #include "esphome/core/automation.h"
#include "esphome/core/component.h" #include "esphome/core/component.h"
@ -100,3 +100,5 @@ struct ESPNowPacket {
} // namespace espnow } // namespace espnow
} // namespace esphome } // namespace esphome
#endif