flexi-bot/docs/marlin/_gcode/M100.md
2023-09-05 20:38:49 +02:00

1.2 KiB

tag title brief author requires group codes notes parameters examples
m0100 Free Memory Observe memory used by code thinkyhead M100_FREE_MEMORY_WATCHER debug
M100
Requires `M100_FREE_MEMORY_WATCHER`.
tag optional description
D true Dump the free memory block from `__brkval` to the stack pointer
tag optional description
F true Return the number of free bytes in the memory pool along with other vital statistics that define the memory pool
tag optional description
I true Initialize the free memory pool so it can be watched and print vital statistics that define the free memory pool
tag optional description values
C true 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
tag type
n int

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.