I haven't compiled and ran it yet, but, in the configuration.h file I've added a define - right after the defines to enable leveling:
#define AUTO_BED_LEVELING_BILINEAR
// ADDED following:
#define CNC_LEVELING_G30_KEEP_ALIVE // if defined, then we do NOT cancel leveling after running the G30 command
Then in the Marlin_main.cpp file I've modified the following
ORIGINAL Code
<<<<
// Disable leveling so the planner won't mess with us
#if HAS_LEVELING
set_bed_leveling_enabled(false);
#endif
>>>>
I modified the code as follows:
<<<<
// Disable leveling so the planner won't mess with us
#if HAS_LEVELING && ! CNC_LEVELING_G30_KEEP_ALIVE
set_bed_leveling_enabled(false);
#endif
>>>>
Only if LEVELING has been defined and ! (NOT) CNC_LEVELING_G30_KEEP_ALIVE has NOT been defined it will set bed leveling to FALSE
so, with our KeepAlive flag defined in the configuration.h file it won't disable leveling when you do a G30 command.
You will need to modify the actual Marlin_main.cpp file - if using Ardunio IDE just send the updated file to your controller as normal - it will compile the changes before sending it.
I will try this myself later, but if you try it first, let me know if it works for you
#define AUTO_BED_LEVELING_BILINEAR
// ADDED following:
#define CNC_LEVELING_G30_KEEP_ALIVE // if defined, then we do NOT cancel leveling after running the G30 command
Then in the Marlin_main.cpp file I've modified the following
ORIGINAL Code
<<<<
// Disable leveling so the planner won't mess with us
#if HAS_LEVELING
set_bed_leveling_enabled(false);
#endif
>>>>
I modified the code as follows:
<<<<
// Disable leveling so the planner won't mess with us
#if HAS_LEVELING && ! CNC_LEVELING_G30_KEEP_ALIVE
set_bed_leveling_enabled(false);
#endif
>>>>
Only if LEVELING has been defined and ! (NOT) CNC_LEVELING_G30_KEEP_ALIVE has NOT been defined it will set bed leveling to FALSE
so, with our KeepAlive flag defined in the configuration.h file it won't disable leveling when you do a G30 command.
You will need to modify the actual Marlin_main.cpp file - if using Ardunio IDE just send the updated file to your controller as normal - it will compile the changes before sending it.
I will try this myself later, but if you try it first, let me know if it works for you