Remove include HAP.h from SRP

SRP now only requires Utils (for TempBuffer).

Also, moved HS_ALLOC definitions into Utils so it can be re-used by others files
This commit is contained in:
Gregg 2023-12-28 18:11:39 -06:00
parent cd85cc1629
commit ffe56e7261
4 changed files with 5 additions and 24 deletions

View File

@ -31,18 +31,6 @@
#error ERROR: HOMESPAN IS ONLY AVAILABLE FOR ESP32 MICROCONTROLLERS! #error ERROR: HOMESPAN IS ONLY AVAILABLE FOR ESP32 MICROCONTROLLERS!
#endif #endif
#if defined(BOARD_HAS_PSRAM)
#define HS_MALLOC ps_malloc
#define HS_CALLOC ps_calloc
#define HS_REALLOC ps_realloc
#define ps_new(X) new(ps_malloc(sizeof(X)))X
#else
#define HS_MALLOC malloc
#define HS_CALLOC calloc
#define HS_REALLOC realloc
#define ps_new(X) new X
#endif
#pragma GCC diagnostic ignored "-Wpmf-conversions" // eliminates warning messages from use of pointers to member functions to detect whether update() and loop() are overridden by user #pragma GCC diagnostic ignored "-Wpmf-conversions" // eliminates warning messages from use of pointers to member functions to detect whether update() and loop() are overridden by user
#pragma GCC diagnostic ignored "-Wunused-result" // eliminates warning message regarded unused result from call to crypto_scalarmult_curve25519() #pragma GCC diagnostic ignored "-Wunused-result" // eliminates warning message regarded unused result from call to crypto_scalarmult_curve25519()

View File

@ -29,7 +29,6 @@
#include <Arduino.h> #include <Arduino.h>
#include "SRP.h" #include "SRP.h"
#include "HAP.h"
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////

View File

@ -31,17 +31,7 @@
#include <mbedtls/bignum.h> #include <mbedtls/bignum.h>
#include <mbedtls/base64.h> #include <mbedtls/base64.h>
#if defined(BOARD_HAS_PSRAM) #include "Utils.h"
#define HS_MALLOC ps_malloc
#define HS_CALLOC ps_calloc
#define HS_REALLOC ps_realloc
#define ps_new(X) new(ps_malloc(sizeof(X)))X
#else
#define HS_MALLOC malloc
#define HS_CALLOC calloc
#define HS_REALLOC realloc
#define ps_new(X) new X
#endif
///////////////////////////////////////////////// /////////////////////////////////////////////////
// Pair-Setup Code Verification Data and Salt // Pair-Setup Code Verification Data and Salt

View File

@ -33,9 +33,13 @@
#if defined(BOARD_HAS_PSRAM) #if defined(BOARD_HAS_PSRAM)
#define HS_MALLOC ps_malloc #define HS_MALLOC ps_malloc
#define HS_CALLOC ps_calloc #define HS_CALLOC ps_calloc
#define HS_REALLOC ps_realloc
#define ps_new(X) new(ps_malloc(sizeof(X)))X
#else #else
#define HS_MALLOC malloc #define HS_MALLOC malloc
#define HS_CALLOC calloc #define HS_CALLOC calloc
#define HS_REALLOC realloc
#define ps_new(X) new X
#endif #endif
namespace Utils { namespace Utils {