From 608be4e050d5eb4acafc3ef8cbf6dd18ecd10313 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Mon, 14 Nov 2022 13:29:41 +1300 Subject: [PATCH] Fix time components on rp2040 (#4024) --- esphome/components/sntp/sntp_component.cpp | 3 +++ esphome/components/time/real_time_clock.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/esphome/components/sntp/sntp_component.cpp b/esphome/components/sntp/sntp_component.cpp index 21fcb96842..3af21a9b23 100644 --- a/esphome/components/sntp/sntp_component.cpp +++ b/esphome/components/sntp/sntp_component.cpp @@ -10,6 +10,9 @@ #ifdef USE_ESP8266 #include "sntp.h" #endif +#ifdef USE_RP2040 +#include "lwip/apps/sntp.h" +#endif // Yes, the server names are leaked, but that's fine. #ifdef CLANG_TIDY diff --git a/esphome/components/time/real_time_clock.cpp b/esphome/components/time/real_time_clock.cpp index 7b5f0aa49b..de76676a4d 100644 --- a/esphome/components/time/real_time_clock.cpp +++ b/esphome/components/time/real_time_clock.cpp @@ -4,6 +4,9 @@ #ifdef USE_ESP8266 #include "sys/time.h" #endif +#ifdef USE_RP2040 +#include +#endif #include namespace esphome {