From a2adbf29f47ddc733d0cd96d167a7768ed3102f2 Mon Sep 17 00:00:00 2001 From: Paul Korzhyk Date: Sat, 18 Jun 2022 15:13:30 +0300 Subject: [PATCH 1/3] A user-friendlier compilation error for SDMMC_HOST See https://github.com/PerMalmberg/Smooth/issues/171 --- lib/smooth/include/smooth/core/filesystem/MMCSDCard.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/smooth/include/smooth/core/filesystem/MMCSDCard.h b/lib/smooth/include/smooth/core/filesystem/MMCSDCard.h index 1ae0c8e7..8abe071f 100644 --- a/lib/smooth/include/smooth/core/filesystem/MMCSDCard.h +++ b/lib/smooth/include/smooth/core/filesystem/MMCSDCard.h @@ -18,6 +18,11 @@ limitations under the License. #pragma once #include "SDCard.h" + +#ifndef SOC_SDMMC_HOST_SUPPORTED +#error "Your chip does not support SDMCC_HOST. See https://github.com/PerMalmberg/Smooth/issues/171" +#endif + #include "driver/sdmmc_host.h" namespace smooth::core::filesystem From 4013e2865b1d17f3a5b0d18d81be4fa5a8c77bca Mon Sep 17 00:00:00 2001 From: Paul Korzhyk Date: Thu, 23 Jun 2022 14:25:53 +0300 Subject: [PATCH 2/3] Add a link to docs --- lib/smooth/include/smooth/core/filesystem/MMCSDCard.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/smooth/include/smooth/core/filesystem/MMCSDCard.h b/lib/smooth/include/smooth/core/filesystem/MMCSDCard.h index 8abe071f..8acd1ca3 100644 --- a/lib/smooth/include/smooth/core/filesystem/MMCSDCard.h +++ b/lib/smooth/include/smooth/core/filesystem/MMCSDCard.h @@ -19,9 +19,12 @@ limitations under the License. #include "SDCard.h" -#ifndef SOC_SDMMC_HOST_SUPPORTED -#error "Your chip does not support SDMCC_HOST. See https://github.com/PerMalmberg/Smooth/issues/171" -#endif +#pragma GCC error "Your chip does not support SDMMC_HOST. See https://github.com/PerMalmberg/Smooth/issues/171" + +#pragma message("Target system is:" CONFIG_IDF_TARGET) +#pragma message( \ + "SoC caps documentation: https://docs.espressif.com/projects/esp-idf/en/latest/" CONFIG_IDF_TARGET \ + "/api-reference/system/soc_caps.html") #include "driver/sdmmc_host.h" From d62110881816da667793b74602cf9a7fc562614d Mon Sep 17 00:00:00 2001 From: Paul Korzhyk Date: Thu, 23 Jun 2022 22:20:55 +0300 Subject: [PATCH 3/3] Fix the CI and the PR --- lib/smooth/include/smooth/core/filesystem/MMCSDCard.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/smooth/include/smooth/core/filesystem/MMCSDCard.h b/lib/smooth/include/smooth/core/filesystem/MMCSDCard.h index 8acd1ca3..d50b5580 100644 --- a/lib/smooth/include/smooth/core/filesystem/MMCSDCard.h +++ b/lib/smooth/include/smooth/core/filesystem/MMCSDCard.h @@ -19,12 +19,14 @@ limitations under the License. #include "SDCard.h" +#ifndef SOC_SDMMC_HOST_SUPPORTED #pragma GCC error "Your chip does not support SDMMC_HOST. See https://github.com/PerMalmberg/Smooth/issues/171" #pragma message("Target system is:" CONFIG_IDF_TARGET) #pragma message( \ "SoC caps documentation: https://docs.espressif.com/projects/esp-idf/en/latest/" CONFIG_IDF_TARGET \ "/api-reference/system/soc_caps.html") +#endif #include "driver/sdmmc_host.h"