thinkyhead

M100 - Free Memory

debug Observe memory used by code M100_FREE_MEMORY_WATCHER

Description

Use M100 for development purposes to observe how much memory (particularly stack) is being used by code. Proper AVR code should avoid use of new, malloc, etc., and instead use either pre-allocated static variables or stack.

Usage

M100 [C<n>] [D] [F] [I]

Parameters

[C<n>]

Corrupt ‘n’ locations in the free memory pool and report the locations of the corruption. This is useful to check the correctness of the M100 D and M100 F commands

    [D]

    Dump the free memory block from __brkval to the stack pointer

    [F]

    Return the number of free bytes in the memory pool along with other vital statistics that define the memory pool

    [I]

    Initialize the free memory pool so it can be watched and print vital statistics that define the free memory pool