How to turn off/remove unused parts of the Arduino SD library?

How can we turn off/remove unused parts in Arduino SD library? Can we have some kind of #define to do that?

I only need read/write/append/seek function.
I cannot use Arduino's standard SD library fully because of the lack of flash. I'm using PetitFS but it doesn't support appending to a file!
Thanks for any help!
P/S: In case you wonder what I am doing and why my sketch so big, I'm porting fake86 to Arduino UNO (here and here).

my sketch is 87456 bytes (for ATmega1284p).
you too can use a MCU with more flash and SRAM (the SD library uses a 512 bytes large buffer)

raspiduinogit:
How can we turn off/remove unused parts in Arduino SD library? Can we have some kind of #define to do that?

The compiler should not include code you dont use.

To turn the question around, how do you know the compiler is including unused code ?

Many, many times there are requests in these forums to significantly reduce the amount of flash and memory space that the SD library uses, if you find a way, do let on.

In order to make all discussion on the subject accessible, I'll share @raspiduinogit's post of same from the SD library repository on GitHub:

pert:
In order to make all discussion on the subject accessible, I'll share @raspiduinogit's post of same from the SD library repository on GitHub:
How can we remove some features from the library? · Issue #89 · arduino-libraries/SD · GitHub

OK, so I don't need any of these libraries anymore. I found there is a small library named Fat16 (GitHub - greiman/Fat16: Smaller FAT16 only library for Arduino) and it supports appending. Thanks anyway!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.