[core] Add defines for enabling implemented features

This commit is contained in:
Kuba Szczodrzyński
2022-06-19 17:31:14 +02:00
parent 2fedcb61b5
commit c9fe63ec7b
7 changed files with 28 additions and 1 deletions

View File

@@ -25,6 +25,8 @@
* Adapted in October 2018
*/
#if LT_ARD_HAS_WIFI
#include <Arduino.h>
#ifdef HTTPCLIENT_1_1_COMPATIBLE
@@ -1623,3 +1625,5 @@ bool HTTPClient::generateCookieString(String *cookieString) {
return found;
}
#endif // LT_ARD_HAS_WIFI

View File

@@ -1,5 +1,7 @@
/* Copyright (c) Kuba Szczodrzyński 2022-06-03. */
#if LT_ARD_HAS_MD5
#include "MD5.h"
#if LT_MD5_USE_POLARSSL
@@ -21,4 +23,6 @@ void MD5Final(unsigned char digest[16], LT_MD5_CTX_T *context) {
} // extern "C"
#endif
#endif // LT_MD5_USE_POLARSSL
#endif // LT_ARD_HAS_MD5

View File

@@ -1,5 +1,7 @@
/* Copyright (c) Kuba Szczodrzyński 2022-04-30. */
#if LT_ARD_HAS_WIFI && LT_HAS_MBEDTLS
#include "MbedTLSClient.h"
#include <IPAddress.h>
@@ -440,3 +442,5 @@ bool MbedTLSClient::getFingerprintSHA256(uint8_t result[32]) {
mbedtls_sha256_finish(&shaCtx, result);
return true;
}
#endif // LT_ARD_HAS_WIFI && LT_HAS_MBEDTLS

View File

@@ -19,6 +19,8 @@
Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling)
*/
#if LT_ARD_HAS_WIFI
#include <Arduino.h>
#include "WebServer.h"
@@ -603,3 +605,5 @@ bool WebServer::_parseFormUploadAborted() {
_currentHandler->upload(*this, _currentUri, *_currentUpload);
return false;
}
#endif // LT_ARD_HAS_WIFI

View File

@@ -20,6 +20,8 @@
Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling)
*/
#if LT_ARD_HAS_WIFI
#include <Arduino.h>
#include "FS.h"
@@ -715,3 +717,5 @@ String WebServer::_responseCodeToString(int code) {
return F("");
}
}
#endif // LT_ARD_HAS_WIFI

View File

@@ -23,6 +23,8 @@
*
*/
#if LT_ARD_HAS_WIFI
#include "WiFiMulti.h"
#include <Arduino.h>
#include <limits.h>
@@ -236,3 +238,5 @@ uint8_t WiFiMulti::run(uint32_t connectTimeout) {
return status;
}
#endif // LT_ARD_HAS_WIFI

View File

@@ -24,6 +24,9 @@ env.Append(
# which conflicts with C++ built-in bool
# so it's either -fpermissive or this:
("bool", "bool"),
# implemented features
("LT_ARD_HAS_WIFI", "1"),
("LT_ARD_HAS_MD5", "1"),
],
LINKFLAGS=[
"-Wl,--undefined=InfraStart",