Browse Source

Extra debugging for leveling on/off

pull/1/head
Scott Lahteine 5 years ago
parent
commit
b7a67f6f74
  1. 1
      Marlin/src/HAL/HAL_LPC1768/watchdog.cpp
  2. 4
      Marlin/src/feature/bedlevel/bedlevel.cpp

1
Marlin/src/HAL/HAL_LPC1768/watchdog.cpp

@ -68,5 +68,4 @@ bool watchdog_timed_out() { return TEST(WDT_ReadTimeOutFlag(), 0); }
void watchdog_clear_timeout_flag() { WDT_ClrTimeOutFlag(); }
#endif // USE_WATCHDOG
#endif // TARGET_LPC1768

4
Marlin/src/feature/bedlevel/bedlevel.cpp

@ -86,14 +86,18 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) {
#endif
if (planner.leveling_active) { // leveling from on to off
if (DEBUGGING(LEVELING)) DEBUG_POS("Leveling ON", current_position);
// change unleveled current_position to physical current_position without moving steppers.
planner.apply_leveling(current_position);
planner.leveling_active = false; // disable only AFTER calling apply_leveling
if (DEBUGGING(LEVELING)) DEBUG_POS("...Now OFF", current_position);
}
else { // leveling from off to on
if (DEBUGGING(LEVELING)) DEBUG_POS("Leveling OFF", current_position);
planner.leveling_active = true; // enable BEFORE calling unapply_leveling, otherwise ignored
// change physical current_position to unleveled current_position without moving steppers.
planner.unapply_leveling(current_position);
if (DEBUGGING(LEVELING)) DEBUG_POS("...Now ON", current_position);
}
sync_plan_position();

Loading…
Cancel
Save