From 8da77059277c6f7859b41542acfb5dc49380e28a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 20 Sep 2025 18:29:17 -0600 Subject: [PATCH] fix nrf52 --- esphome/components/sha256/sha256.cpp | 6 ++++++ esphome/components/sha256/sha256.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/esphome/components/sha256/sha256.cpp b/esphome/components/sha256/sha256.cpp index cf3cfb1a30..71e4045499 100644 --- a/esphome/components/sha256/sha256.cpp +++ b/esphome/components/sha256/sha256.cpp @@ -1,4 +1,8 @@ #include "sha256.h" + +// Only compile SHA256 implementation on platforms that support it +#if defined(USE_ESP32) || defined(USE_ESP8266) || defined(USE_RP2040) || defined(USE_LIBRETINY) + #include "esphome/core/helpers.h" #include @@ -142,3 +146,5 @@ bool SHA256::equals_hex(const char *expected) { } } // namespace esphome::sha256 + +#endif // Platform check diff --git a/esphome/components/sha256/sha256.h b/esphome/components/sha256/sha256.h index 5f56d7542a..2a7aa72183 100644 --- a/esphome/components/sha256/sha256.h +++ b/esphome/components/sha256/sha256.h @@ -1,6 +1,10 @@ #pragma once #include "esphome/core/defines.h" + +// Only define SHA256 on platforms that support it +#if defined(USE_ESP32) || defined(USE_ESP8266) || defined(USE_RP2040) || defined(USE_LIBRETINY) + #include #include #include @@ -59,3 +63,5 @@ class SHA256 { }; } // namespace esphome::sha256 + +#endif // Platform check