From 07d33849b0ba5fa19700140c5741041e40c9b6c2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 9 Oct 2018 21:31:20 -0500 Subject: [PATCH] Fix unused var warning, apply ENABLED --- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 8 ++++---- Marlin/src/gcode/bedlevel/G26.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 671ed79947..73046fda31 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -1027,12 +1027,12 @@ static uint8_t ubl_state_at_invocation = 0; - #ifdef UBL_DEVEL_DEBUGGING + #if ENABLED(UBL_DEVEL_DEBUGGING) static uint8_t ubl_state_recursion_chk = 0; #endif void unified_bed_leveling::save_ubl_active_state_and_disable() { - #ifdef UBL_DEVEL_DEBUGGING + #if ENABLED(UBL_DEVEL_DEBUGGING) ubl_state_recursion_chk++; if (ubl_state_recursion_chk != 1) { SERIAL_ECHOLNPGM("save_ubl_active_state_and_disabled() called multiple times in a row."); @@ -1048,7 +1048,7 @@ } void unified_bed_leveling::restore_ubl_active_state_and_leave() { - #ifdef UBL_DEVEL_DEBUGGING + #if ENABLED(UBL_DEVEL_DEBUGGING) if (--ubl_state_recursion_chk) { SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times."); #if ENABLED(NEWPANEL) @@ -1132,7 +1132,7 @@ SERIAL_EOL(); safe_delay(50); - #ifdef UBL_DEVEL_DEBUGGING + #if ENABLED(UBL_DEVEL_DEBUGGING) SERIAL_PROTOCOLLNPAIR("ubl_state_at_invocation :", ubl_state_at_invocation); SERIAL_EOL(); SERIAL_PROTOCOLLNPAIR("ubl_state_recursion_chk :", ubl_state_recursion_chk); diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index e94fdcda71..d4812683a9 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -475,7 +475,9 @@ inline bool turn_on_heaters() { inline bool prime_nozzle() { #if ENABLED(ULTIPANEL) - float Total_Prime = 0.0; + #if ENABLED(PREVENT_LENGTHY_EXTRUDE) + float Total_Prime = 0.0; + #endif if (g26_prime_flag == -1) { // The user wants to control how much filament gets purged @@ -490,7 +492,7 @@ inline bool prime_nozzle() { while (!is_lcd_clicked()) { lcd_chirp(); destination[E_AXIS] += 0.25; - #ifdef PREVENT_LENGTHY_EXTRUDE + #if ENABLED(PREVENT_LENGTHY_EXTRUDE) Total_Prime += 0.25; if (Total_Prime >= EXTRUDE_MAXLENGTH) return G26_ERR; #endif