Split update from read value;
Inhibit interrupts when reading (normally done from loop code);
Don't inhibit interrupts when updating (normally done from interupt code);
Make freeMemory() local and ask for inline code generation.
Add function to maintain a minimum value seen of free memory. Add call to it in DCCWaveform interrupt handler (assumed to be the likely worst case for stack usage). Report this minimum value in main loop.