Skip to content

Commit 07e9b12

Browse files
committed
SPI: avoid using malloc() by default
1 parent dc2b660 commit 07e9b12

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libraries/SPI/src/SPI.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void SPIClass::usingInterrupt(int interruptNumber)
8888
interruptMode = SPI_IMODE_GLOBAL;
8989
else
9090
{
91-
#ifdef USE_MALLOC_FOR_IRQ_MAP
91+
#if USE_MALLOC_FOR_IRQ_MAP
9292
if (irqMap == NULL) {
9393
irqMap = (uint8_t*)malloc(EXTERNAL_NUM_INTERRUPTS);
9494
}
@@ -119,7 +119,7 @@ void SPIClass::notUsingInterrupt(int interruptNumber)
119119

120120
if (interruptMask_lo == 0 && interruptMask_hi == 0) {
121121
interruptMode = SPI_IMODE_NONE;
122-
#ifdef USE_MALLOC_FOR_IRQ_MAP
122+
#if USE_MALLOC_FOR_IRQ_MAP
123123
free(irqMap);
124124
irqMap = NULL;
125125
#endif

libraries/SPI/src/SPI.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <Arduino.h>
2424

2525
#ifndef USE_MALLOC_FOR_IRQ_MAP
26-
#define USE_MALLOC_FOR_IRQ_MAP 1
26+
#define USE_MALLOC_FOR_IRQ_MAP 0
2727
#endif
2828

2929
// SPI_HAS_TRANSACTION means SPI has

0 commit comments

Comments
 (0)