This is a simple example sketch showing how to use the SD allocator.
#include <Arduino.h>
#include <SdFat.h>
const int chipSelect = 9;
const uint32_t poolSize = 1024l * 32l;
const int spiSpeed = SPI_FULL_SPEED;
SdFat sd;
void setup()
{
while (!Serial)
;
Serial.begin(115200);
if (!sd.begin(chipSelect, spiSpeed))
sd.initErrorHalt();
valloc.start();
delay(3000);
}
void loop()
{
*vpi = 42;
Serial.print("*vpi = "); Serial.println(*vpi);
valloc.free(vpi);
delay(1000);
}