From 7d3be90159c30699df5392dcae9d305268137fd9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 6 Aug 2020 04:19:56 -0500 Subject: [PATCH] Conditions cleanup --- Marlin/src/feature/leds/printer_event_leds.cpp | 2 +- Marlin/src/feature/leds/printer_event_leds.h | 2 +- Marlin/src/inc/Conditionals_adv.h | 5 +++++ Marlin/src/inc/Conditionals_post.h | 2 +- Marlin/src/lcd/menu/menu_ubl.cpp | 2 +- Marlin/src/libs/least_squares_fit.cpp | 4 ++-- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Marlin/src/feature/leds/printer_event_leds.cpp b/Marlin/src/feature/leds/printer_event_leds.cpp index 58084da837..31c628c281 100644 --- a/Marlin/src/feature/leds/printer_event_leds.cpp +++ b/Marlin/src/feature/leds/printer_event_leds.cpp @@ -21,7 +21,7 @@ */ /** - * printer_event_leds.cpp - LED color changing based on printer status + * feature/leds/printer_event_leds.cpp - LED color changing based on printer status */ #include "../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/feature/leds/printer_event_leds.h b/Marlin/src/feature/leds/printer_event_leds.h index 0295f9f5ac..86ec292aa3 100644 --- a/Marlin/src/feature/leds/printer_event_leds.h +++ b/Marlin/src/feature/leds/printer_event_leds.h @@ -22,7 +22,7 @@ #pragma once /** - * printer_event_leds.h - LED color changing based on printer status + * feature/leds/printer_event_leds.h - LED color changing based on printer status */ #include "leds.h" diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index a057034ab6..277131289a 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -383,3 +383,8 @@ #if ANY(AUTO_BED_LEVELING_UBL, M100_FREE_MEMORY_WATCHER, DEBUG_GCODE_PARSER, TMC_DEBUG, MARLIN_DEV_MODE) #define NEED_HEX_PRINT 1 #endif + +// Flag whether least_squares_fit.cpp is used +#if ANY(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_LINEAR, Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) + #define NEED_LSF 1 +#endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 5534acaf2c..a93e0527bf 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1955,7 +1955,7 @@ #if PIN_EXISTS(DIGIPOTSS) #define HAS_DIGIPOTSS 1 #endif -#if ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_Z, MOTOR_CURRENT_PWM_E) +#if ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_Z, MOTOR_CURRENT_PWM_E) #define HAS_MOTOR_CURRENT_PWM 1 #endif diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index 8a5095c88f..997130a91a 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -451,7 +451,7 @@ void ubl_map_screen() { #if IS_KINEMATIC // Index of the mesh point upon entry - const uint32_t old_pos_index = grid_index(x_plot, y_plot); + const int32_t old_pos_index = grid_index(x_plot, y_plot); // Direction from new (unconstrained) encoder value const int8_t step_dir = int32_t(ui.encoderPosition) < old_pos_index ? -1 : 1; #endif diff --git a/Marlin/src/libs/least_squares_fit.cpp b/Marlin/src/libs/least_squares_fit.cpp index ce3a342b92..ef6ef9e90d 100644 --- a/Marlin/src/libs/least_squares_fit.cpp +++ b/Marlin/src/libs/least_squares_fit.cpp @@ -34,7 +34,7 @@ #include "../inc/MarlinConfig.h" -#if ANY(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_LINEAR, Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS) +#if NEED_LSF #include "least_squares_fit.h" @@ -67,4 +67,4 @@ int finish_incremental_LSF(struct linear_fit_data *lsf) { return 0; } -#endif // AUTO_BED_LEVELING_UBL || ENABLED(AUTO_BED_LEVELING_LINEAR) +#endif // NEED_LSF