From 9991b694717c6b9946300a49452abaac259c5caf Mon Sep 17 00:00:00 2001 From: Rune Harlyk Date: Fri, 17 May 2024 14:07:43 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=8B=20Moves=20defines=20to=20header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- esp32/lib/ESP32-sveltekit/SystemStatus.cpp | 25 --------------------- esp32/lib/ESP32-sveltekit/SystemStatus.h | 26 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/esp32/lib/ESP32-sveltekit/SystemStatus.cpp b/esp32/lib/ESP32-sveltekit/SystemStatus.cpp index 9fd0ac3..66b66e0 100644 --- a/esp32/lib/ESP32-sveltekit/SystemStatus.cpp +++ b/esp32/lib/ESP32-sveltekit/SystemStatus.cpp @@ -13,31 +13,6 @@ **/ #include -#include - -#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 -#include "esp32/rom/rtc.h" -#define ESP_PLATFORM "ESP32"; -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32/rom/rtc.h" -#define ESP_PLATFORM "ESP32-S2"; -#elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/rom/rtc.h" -#define ESP_PLATFORM "ESP32-C3"; -#elif CONFIG_IDF_TARGET_ESP32S3 -#include "esp32s3/rom/rtc.h" -#define ESP_PLATFORM "ESP32-S3"; -#else -#error Target CONFIG_IDF_TARGET is not supported -#endif - -#ifndef ARDUINO_VERSION -#ifndef STRINGIZE -#define STRINGIZE(s) #s -#endif -#define ARDUINO_VERSION_STR(major, minor, patch) "v" STRINGIZE(major) "." STRINGIZE(minor) "." STRINGIZE(patch) -#define ARDUINO_VERSION ARDUINO_VERSION_STR(ESP_ARDUINO_VERSION_MAJOR, ESP_ARDUINO_VERSION_MINOR, ESP_ARDUINO_VERSION_PATCH) -#endif String verbosePrintResetReason(int reason) { diff --git a/esp32/lib/ESP32-sveltekit/SystemStatus.h b/esp32/lib/ESP32-sveltekit/SystemStatus.h index f34bd30..94d3e3c 100644 --- a/esp32/lib/ESP32-sveltekit/SystemStatus.h +++ b/esp32/lib/ESP32-sveltekit/SystemStatus.h @@ -21,6 +21,32 @@ #include #include #include +#include + +#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 +#include "esp32/rom/rtc.h" +#define ESP_PLATFORM "ESP32"; +#elif CONFIG_IDF_TARGET_ESP32S2 +#include "esp32/rom/rtc.h" +#define ESP_PLATFORM "ESP32-S2"; +#elif CONFIG_IDF_TARGET_ESP32C3 +#include "esp32c3/rom/rtc.h" +#define ESP_PLATFORM "ESP32-C3"; +#elif CONFIG_IDF_TARGET_ESP32S3 +#include "esp32s3/rom/rtc.h" +#define ESP_PLATFORM "ESP32-S3"; +#else +#error Target CONFIG_IDF_TARGET is not supported +#endif + +#ifndef ARDUINO_VERSION +#ifndef STRINGIZE +#define STRINGIZE(s) #s +#endif +#define ARDUINO_VERSION_STR(major, minor, patch) "v" STRINGIZE(major) "." STRINGIZE(minor) "." STRINGIZE(patch) +#define ARDUINO_VERSION ARDUINO_VERSION_STR(ESP_ARDUINO_VERSION_MAJOR, ESP_ARDUINO_VERSION_MINOR, ESP_ARDUINO_VERSION_PATCH) +#endif + #define SYSTEM_STATUS_SERVICE_PATH "/api/systemStatus"