From e5eb4f156040541e147c76908d937bd4695db64d Mon Sep 17 00:00:00 2001 From: NP v/d Spek Date: Sat, 24 Aug 2024 20:45:50 +0200 Subject: [PATCH] add USE_ESP32 define checks --- esphome/components/espnow/espnow.cpp | 4 ++++ esphome/components/espnow/espnow_packet.c | 3 +++ esphome/components/espnow/espnow_packet.h | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/esphome/components/espnow/espnow.cpp b/esphome/components/espnow/espnow.cpp index d3c93ce5c0..d6fe536215 100644 --- a/esphome/components/espnow/espnow.cpp +++ b/esphome/components/espnow/espnow.cpp @@ -1,5 +1,7 @@ #include "espnow.h" +#if defined(USE_ESP32) + #include #include "esp_mac.h" @@ -388,3 +390,5 @@ ESPNowComponent *global_esp_now = nullptr; } // namespace espnow } // namespace esphome + +#endif diff --git a/esphome/components/espnow/espnow_packet.c b/esphome/components/espnow/espnow_packet.c index a8b5c77222..e9a185f16a 100644 --- a/esphome/components/espnow/espnow_packet.c +++ b/esphome/components/espnow/espnow_packet.c @@ -1,4 +1,5 @@ #include "espnow_packet.h" +#if defined(USE_ESP32) #include "esphome/core/log.h" @@ -43,3 +44,5 @@ bool ESPNowPacket::is_valid() { this->crc16 = crc; return valid; } + +#endif diff --git a/esphome/components/espnow/espnow_packet.h b/esphome/components/espnow/espnow_packet.h index 380a808370..cfa41b08af 100644 --- a/esphome/components/espnow/espnow_packet.h +++ b/esphome/components/espnow/espnow_packet.h @@ -1,6 +1,6 @@ #pragma once -// #if defined(USE_ESP32) +#if defined(USE_ESP32) #include "esphome/core/automation.h" #include "esphome/core/component.h" @@ -100,3 +100,5 @@ struct ESPNowPacket { } // namespace espnow } // namespace esphome + +#endif