Finish G12, update Nozzle::clean (#14642)

This commit is contained in:
InsanityAutomation
2019-07-17 04:41:04 -04:00
committed by Scott Lahteine
parent 57ed063ba1
commit b8cc61262f
10 changed files with 57 additions and 55 deletions

View File

@ -100,6 +100,10 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) {
}
}
TemporaryBedLevelingState::TemporaryBedLevelingState(const bool enable) : saved(planner.leveling_active) {
set_bed_leveling_enabled(enable);
}
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
void set_z_fade_height(const float zfh, const bool do_report/*=true*/) {

View File

@ -46,6 +46,18 @@ void reset_bed_level();
void _manual_goto_xy(const float &x, const float &y);
#endif
/**
* A class to save and change the bed leveling state,
* then restore it when it goes out of scope.
*/
class TemporaryBedLevelingState {
bool saved;
public:
TemporaryBedLevelingState(const bool enable);
~TemporaryBedLevelingState() { set_bed_leveling_enabled(saved); }
};
#define TEMPORARY_BED_LEVELING_STATE(enable) TemporaryBedLevelingState tbls(enable)
#if HAS_MESH
typedef float (&bed_mesh_t)[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];