Results 1 to 1 of 1
Threaded View
-
07-05-2015, 02:18 PM #1
M99 Free Memory Watcher function for debug
Attached is the M99 Free Memory Watcher function. It is primarily for developers, but if you are doing something where you are worried that you are running out of memory, this will help confirm or dismiss that concern.
Put the attached file in your Marlin code directory. And then make these three changes to your code base:
In Marlin_Main.cpp you need to add a declaration up at the top somewhere saying:
Code:#ifdef M99_FREE_MEMORY_WATCHER void m99_code(); #endif
Code:#ifdef M99_FREE_MEMORY_WATCHER case 99: m99_code(); break; #endif // M48 Z-Probe repeatability measurement function
Code:// // M99 Free Memory Watcher // #define M99_FREE_MEMORY_WATCHER // uncomment to add the M99 Free Memory Watcher for debug purpose
Code:// M99 Free Memory Watcher // // This code watches the free memory block between the bottom of the heap and the top of the stack. // This memory block is initialized and watched via the M99 command. // // M99 I Initializes the free memory block and prints vitals statistics about the area // M99 F Identifies how much of the free memory block remains free and unused. It also // detects and reports any corruption within the free memory block that may have // happened due to errant firmware. // M99 D Does a hex display of the free memory block along with a flag for any errant // data that does not match the expected value. // M99 C x Corrupts x locations within the free memory block. This is useful to check the // correctness of the M99 F and M99 D commands.
Last edited by Roxy; 07-05-2015 at 02:25 PM.
New member with print issue
06-11-2024, 08:57 AM in Tips, Tricks and Tech Help