Skip to content

Commit 17dfc28

Browse files
committed
Carve out support for ESP32 to avoid compilation errors
1 parent 908fb48 commit 17dfc28

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/SparkFun_Extensible_Message_Parser.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ SEMP_PARSE_STATE * sempAllocateParseStructure(
8181
#if defined(ESP32)
8282
parse = (SEMP_PARSE_STATE *)ps_malloc(length + bufferLength);
8383
#else
84-
parse = (SEMP_PARSE_STATE *)malloc(length + bufferLength);
85-
sempPrintln(print, "PSRAM: Platform not supported");
84+
{
85+
parse = (SEMP_PARSE_STATE *)malloc(length + bufferLength);
86+
sempPrintln(printDebug, "PSRAM: Platform not supported");
87+
}
8688
#endif
8789
else
8890
parse = (SEMP_PARSE_STATE *)malloc(length + bufferLength);
@@ -322,13 +324,16 @@ SEMP_PARSE_STATE *sempBeginParser(
322324

323325
// Attempt to use PSRAM
324326
psramSize = 0;
327+
328+
#if defined(ESP32)
325329
if (psramInit())
326330
psramSize = ESP.getPsramSize();
327331
usePSRAM = (psramSize != 0);
328332
if (usePSRAM == false)
329333
sempPrintln(printError, "SEMP: PSRAM failed to initialize!");
330334
else
331335
sempPrintf(printError, "SEMP: PSRAM Size (bytes): %d\r\n", psramSize);
336+
#endif
332337

333338
// Validate the parser address is not nullptr
334339
parse = sempAllocateParseStructure(usePSRAM, printDebug, scratchPadBytes, bufferLength);

0 commit comments

Comments
 (0)