From 1cfee30aef44f5e8b7b33e1878ef07914da382f9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 15 Sep 2021 18:11:49 -0500 Subject: [PATCH] Move warnings to another file --- Marlin/src/MarlinCore.cpp | 429 ---------------- Marlin/src/inc/Warnings.cpp | 457 ++++++++++++++++++ .../PlatformIO/scripts/preflight-checks.py | 17 +- 3 files changed, 469 insertions(+), 434 deletions(-) create mode 100644 Marlin/src/inc/Warnings.cpp diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index bb399258f93e4..cd3144db4a6e3 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1667,432 +1667,3 @@ void loop() { } while (ENABLED(__AVR__)); // Loop forever on slower (AVR) boards } - -// -// Warnings! Located here so they will appear just once in the build output. -// - -#if ENABLED(MARLIN_DEV_MODE) - #warning "WARNING! Disable MARLIN_DEV_MODE for the final build!" -#endif - -#if NONE(HAS_RESUME_CONTINUE, HOST_PROMPT_SUPPORT) - #warning "Your Configuration provides no method to acquire user feedback!" -#endif - -#if AUTO_ASSIGNED_X2_STEPPER - #warning "Auto-assigned X2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." -#endif -#if AUTO_ASSIGNED_X2_MS1 - #warning "Auto-assigned X2_MS1_PIN to an unused En_MS1_PIN." -#endif -#if AUTO_ASSIGNED_X2_MS2 - #warning "Auto-assigned X2_MS2_PIN to an unused En_MS2_PIN." -#endif -#if AUTO_ASSIGNED_X2_MS3 - #warning "Auto-assigned X2_MS3_PIN to an unused En_MS3_PIN." -#endif -#if AUTO_ASSIGNED_X2_CS - #warning "Auto-assigned X2_CS_PIN to an unused En_CS_PIN." -#endif -#if AUTO_ASSIGNED_X2_DIAG - #if X2_USE_ENDSTOP == _XMIN_ - #warning "Auto-assigned X2_DIAG_PIN to X_MIN_PIN." - #elif X2_USE_ENDSTOP == _XMAX_ - #warning "Auto-assigned X2_DIAG_PIN to X_MAX_PIN." - #elif X2_USE_ENDSTOP == _YMIN_ - #warning "Auto-assigned X2_DIAG_PIN to Y_MIN_PIN." - #elif X2_USE_ENDSTOP == _YMAX_ - #warning "Auto-assigned X2_DIAG_PIN to Y_MAX_PIN." - #elif X2_USE_ENDSTOP == _ZMIN_ - #warning "Auto-assigned X2_DIAG_PIN to Z_MIN_PIN." - #elif X2_USE_ENDSTOP == _ZMAX_ - #warning "Auto-assigned X2_DIAG_PIN to Z_MAX_PIN." - #elif X2_USE_ENDSTOP == _XDIAG_ - #warning "Auto-assigned X2_DIAG_PIN to X_DIAG_PIN." - #elif X2_USE_ENDSTOP == _YDIAG_ - #warning "Auto-assigned X2_DIAG_PIN to Y_DIAG_PIN." - #elif X2_USE_ENDSTOP == _ZDIAG_ - #warning "Auto-assigned X2_DIAG_PIN to Z_DIAG_PIN." - #elif X2_USE_ENDSTOP == _E0DIAG_ - #warning "Auto-assigned X2_DIAG_PIN to E0_DIAG_PIN." - #elif X2_USE_ENDSTOP == _E1DIAG_ - #warning "Auto-assigned X2_DIAG_PIN to E1_DIAG_PIN." - #elif X2_USE_ENDSTOP == _E2DIAG_ - #warning "Auto-assigned X2_DIAG_PIN to E2_DIAG_PIN." - #elif X2_USE_ENDSTOP == _E3DIAG_ - #warning "Auto-assigned X2_DIAG_PIN to E3_DIAG_PIN." - #elif X2_USE_ENDSTOP == _E4DIAG_ - #warning "Auto-assigned X2_DIAG_PIN to E4_DIAG_PIN." - #elif X2_USE_ENDSTOP == _E5DIAG_ - #warning "Auto-assigned X2_DIAG_PIN to E5_DIAG_PIN." - #elif X2_USE_ENDSTOP == _E6DIAG_ - #warning "Auto-assigned X2_DIAG_PIN to E6_DIAG_PIN." - #elif X2_USE_ENDSTOP == _E7DIAG_ - #warning "Auto-assigned X2_DIAG_PIN to E7_DIAG_PIN." - #endif -#endif -#if AUTO_ASSIGNED_Y2_STEPPER - #warning "Auto-assigned Y2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." -#endif -#if AUTO_ASSIGNED_Y2_MS1 - #warning "Auto-assigned Y2_MS1_PIN to an unused En_MS1_PIN." -#endif -#if AUTO_ASSIGNED_Y2_MS2 - #warning "Auto-assigned Y2_MS2_PIN to an unused En_MS2_PIN." -#endif -#if AUTO_ASSIGNED_Y2_MS3 - #warning "Auto-assigned Y2_MS3_PIN to an unused En_MS3_PIN." -#endif -#if AUTO_ASSIGNED_Y2_CS - #warning "Auto-assigned Y2_CS_PIN to an unused En_CS_PIN." -#endif -#if AUTO_ASSIGNED_Y2_DIAG - #if Y2_USE_ENDSTOP == _XMIN_ - #warning "Auto-assigned Y2_DIAG_PIN to X_MIN_PIN." - #elif Y2_USE_ENDSTOP == _XMAX_ - #warning "Auto-assigned Y2_DIAG_PIN to X_MAX_PIN." - #elif Y2_USE_ENDSTOP == _YMIN_ - #warning "Auto-assigned Y2_DIAG_PIN to Y_MIN_PIN." - #elif Y2_USE_ENDSTOP == _YMAX_ - #warning "Auto-assigned Y2_DIAG_PIN to Y_MAX_PIN." - #elif Y2_USE_ENDSTOP == _ZMIN_ - #warning "Auto-assigned Y2_DIAG_PIN to Z_MIN_PIN." - #elif Y2_USE_ENDSTOP == _ZMAX_ - #warning "Auto-assigned Y2_DIAG_PIN to Z_MAX_PIN." - #elif Y2_USE_ENDSTOP == _XDIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to X_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _YDIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to Y_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _ZDIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to Z_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _E0DIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to E0_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _E1DIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to E1_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _E2DIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to E2_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _E3DIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to E3_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _E4DIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to E4_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _E5DIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to E5_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _E6DIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to E6_DIAG_PIN." - #elif Y2_USE_ENDSTOP == _E7DIAG_ - #warning "Auto-assigned Y2_DIAG_PIN to E7_DIAG_PIN." - #endif -#endif -#if AUTO_ASSIGNED_Z2_STEPPER - #warning "Auto-assigned Z2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." -#endif -#if AUTO_ASSIGNED_Z2_MS1 - #warning "Auto-assigned Z2_MS1_PIN to an unused En_MS1_PIN." -#endif -#if AUTO_ASSIGNED_Z2_MS2 - #warning "Auto-assigned Z2_MS2_PIN to an unused En_MS2_PIN." -#endif -#if AUTO_ASSIGNED_Z2_MS3 - #warning "Auto-assigned Z2_MS3_PIN to an unused En_MS3_PIN." -#endif -#if AUTO_ASSIGNED_Z2_CS - #warning "Auto-assigned Z2_CS_PIN to an unused En_CS_PIN." -#endif -#if AUTO_ASSIGNED_Z2_DIAG - #if Z2_USE_ENDSTOP == _XMIN_ - #warning "Auto-assigned Z2_DIAG_PIN to X_MIN_PIN." - #elif Z2_USE_ENDSTOP == _XMAX_ - #warning "Auto-assigned Z2_DIAG_PIN to X_MAX_PIN." - #elif Z2_USE_ENDSTOP == _YMIN_ - #warning "Auto-assigned Z2_DIAG_PIN to Y_MIN_PIN." - #elif Z2_USE_ENDSTOP == _YMAX_ - #warning "Auto-assigned Z2_DIAG_PIN to Y_MAX_PIN." - #elif Z2_USE_ENDSTOP == _ZMIN_ - #warning "Auto-assigned Z2_DIAG_PIN to Z_MIN_PIN." - #elif Z2_USE_ENDSTOP == _ZMAX_ - #warning "Auto-assigned Z2_DIAG_PIN to Z_MAX_PIN." - #elif Z2_USE_ENDSTOP == _XDIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to X_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _YDIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to Y_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _ZDIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to Z_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _E0DIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to E0_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _E1DIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to E1_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _E2DIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to E2_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _E3DIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to E3_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _E4DIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to E4_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _E5DIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to E5_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _E6DIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to E6_DIAG_PIN." - #elif Z2_USE_ENDSTOP == _E7DIAG_ - #warning "Auto-assigned Z2_DIAG_PIN to E7_DIAG_PIN." - #endif -#endif -#if AUTO_ASSIGNED_Z3_STEPPER - #warning "Auto-assigned Z3 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." -#endif -#if AUTO_ASSIGNED_Z3_CS - #warning "Auto-assigned Z3_CS_PIN to an unused En_CS_PIN." -#endif -#if AUTO_ASSIGNED_Z3_MS1 - #warning "Auto-assigned Z3_MS1_PIN to an unused En_MS1_PIN." -#endif -#if AUTO_ASSIGNED_Z3_MS2 - #warning "Auto-assigned Z3_MS2_PIN to an unused En_MS2_PIN." -#endif -#if AUTO_ASSIGNED_Z3_MS3 - #warning "Auto-assigned Z3_MS3_PIN to an unused En_MS3_PIN." -#endif -#if AUTO_ASSIGNED_Z3_DIAG - #if Z3_USE_ENDSTOP == _XMIN_ - #warning "Auto-assigned Z3_DIAG_PIN to X_MIN_PIN." - #elif Z3_USE_ENDSTOP == _XMAX_ - #warning "Auto-assigned Z3_DIAG_PIN to X_MAX_PIN." - #elif Z3_USE_ENDSTOP == _YMIN_ - #warning "Auto-assigned Z3_DIAG_PIN to Y_MIN_PIN." - #elif Z3_USE_ENDSTOP == _YMAX_ - #warning "Auto-assigned Z3_DIAG_PIN to Y_MAX_PIN." - #elif Z3_USE_ENDSTOP == _ZMIN_ - #warning "Auto-assigned Z3_DIAG_PIN to Z_MIN_PIN." - #elif Z3_USE_ENDSTOP == _ZMAX_ - #warning "Auto-assigned Z3_DIAG_PIN to Z_MAX_PIN." - #elif Z3_USE_ENDSTOP == _XDIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to X_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _YDIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to Y_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _ZDIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to Z_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _E0DIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to E0_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _E1DIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to E1_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _E2DIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to E2_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _E3DIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to E3_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _E4DIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to E4_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _E5DIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to E5_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _E6DIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to E6_DIAG_PIN." - #elif Z3_USE_ENDSTOP == _E7DIAG_ - #warning "Auto-assigned Z3_DIAG_PIN to E7_DIAG_PIN." - #endif -#endif -#if AUTO_ASSIGNED_Z4_STEPPER - #warning "Auto-assigned Z4 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." -#endif -#if AUTO_ASSIGNED_Z4_CS - #warning "Auto-assigned Z4_CS_PIN to an unused En_CS_PIN." -#endif -#if AUTO_ASSIGNED_Z4_MS1 - #warning "Auto-assigned Z4_MS1_PIN to an unused En_MS1_PIN." -#endif -#if AUTO_ASSIGNED_Z4_MS2 - #warning "Auto-assigned Z4_MS2_PIN to an unused En_MS2_PIN." -#endif -#if AUTO_ASSIGNED_Z4_MS3 - #warning "Auto-assigned Z4_MS3_PIN to an unused En_MS3_PIN." -#endif -#if AUTO_ASSIGNED_Z4_DIAG - #if Z4_USE_ENDSTOP == _XMIN_ - #warning "Auto-assigned Z4_DIAG_PIN to X_MIN_PIN." - #elif Z4_USE_ENDSTOP == _XMAX_ - #warning "Auto-assigned Z4_DIAG_PIN to X_MAX_PIN." - #elif Z4_USE_ENDSTOP == _YMIN_ - #warning "Auto-assigned Z4_DIAG_PIN to Y_MIN_PIN." - #elif Z4_USE_ENDSTOP == _YMAX_ - #warning "Auto-assigned Z4_DIAG_PIN to Y_MAX_PIN." - #elif Z4_USE_ENDSTOP == _ZMIN_ - #warning "Auto-assigned Z4_DIAG_PIN to Z_MIN_PIN." - #elif Z4_USE_ENDSTOP == _ZMAX_ - #warning "Auto-assigned Z4_DIAG_PIN to Z_MAX_PIN." - #elif Z4_USE_ENDSTOP == _XDIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to X_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _YDIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to Y_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _ZDIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to Z_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _E0DIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to E0_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _E1DIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to E1_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _E2DIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to E2_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _E3DIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to E3_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _E4DIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to E4_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _E5DIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to E5_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _E6DIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to E6_DIAG_PIN." - #elif Z4_USE_ENDSTOP == _E7DIAG_ - #warning "Auto-assigned Z4_DIAG_PIN to E7_DIAG_PIN." - #endif -#endif -#if AUTO_ASSIGNED_I_STEPPER - #warning "Auto-assigned I STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." -#endif -#if AUTO_ASSIGNED_I_CS - #warning "Auto-assigned I_CS_PIN to an unused En_CS_PIN." -#endif -#if AUTO_ASSIGNED_I_MS1 - #warning "Auto-assigned I_MS1_PIN to an unused En_MS1_PIN." -#endif -#if AUTO_ASSIGNED_I_MS2 - #warning "Auto-assigned I_MS2_PIN to an unused En_MS2_PIN." -#endif -#if AUTO_ASSIGNED_I_MS3 - #warning "Auto-assigned I_MS3_PIN to an unused En_MS3_PIN." -#endif -#if AUTO_ASSIGNED_I_DIAG - #if I_USE_ENDSTOP == _XMIN_ - #warning "Auto-assigned I_DIAG_PIN to X_MIN_PIN." - #elif I_USE_ENDSTOP == _XMAX_ - #warning "Auto-assigned I_DIAG_PIN to X_MAX_PIN." - #elif I_USE_ENDSTOP == _YMIN_ - #warning "Auto-assigned I_DIAG_PIN to Y_MIN_PIN." - #elif I_USE_ENDSTOP == _YMAX_ - #warning "Auto-assigned I_DIAG_PIN to Y_MAX_PIN." - #elif I_USE_ENDSTOP == _ZMIN_ - #warning "Auto-assigned I_DIAG_PIN to Z_MIN_PIN." - #elif I_USE_ENDSTOP == _ZMAX_ - #warning "Auto-assigned I_DIAG_PIN to Z_MAX_PIN." - #elif I_USE_ENDSTOP == _XDIAG_ - #warning "Auto-assigned I_DIAG_PIN to X_DIAG_PIN." - #elif I_USE_ENDSTOP == _YDIAG_ - #warning "Auto-assigned I_DIAG_PIN to Y_DIAG_PIN." - #elif I_USE_ENDSTOP == _ZDIAG_ - #warning "Auto-assigned I_DIAG_PIN to Z_DIAG_PIN." - #elif I_USE_ENDSTOP == _E0DIAG_ - #warning "Auto-assigned I_DIAG_PIN to E0_DIAG_PIN." - #elif I_USE_ENDSTOP == _E1DIAG_ - #warning "Auto-assigned I_DIAG_PIN to E1_DIAG_PIN." - #elif I_USE_ENDSTOP == _E2DIAG_ - #warning "Auto-assigned I_DIAG_PIN to E2_DIAG_PIN." - #elif I_USE_ENDSTOP == _E3DIAG_ - #warning "Auto-assigned I_DIAG_PIN to E3_DIAG_PIN." - #elif I_USE_ENDSTOP == _E4DIAG_ - #warning "Auto-assigned I_DIAG_PIN to E4_DIAG_PIN." - #elif I_USE_ENDSTOP == _E5DIAG_ - #warning "Auto-assigned I_DIAG_PIN to E5_DIAG_PIN." - #elif I_USE_ENDSTOP == _E6DIAG_ - #warning "Auto-assigned I_DIAG_PIN to E6_DIAG_PIN." - #elif I_USE_ENDSTOP == _E7DIAG_ - #warning "Auto-assigned I_DIAG_PIN to E7_DIAG_PIN." - #endif -#endif -#if AUTO_ASSIGNED_J_STEPPER - #warning "Auto-assigned J STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." -#endif -#if AUTO_ASSIGNED_J_CS - #warning "Auto-assigned J_CS_PIN to an unused En_CS_PIN." -#endif -#if AUTO_ASSIGNED_J_MS1 - #warning "Auto-assigned J_MS1_PIN to an unused En_MS1_PIN." -#endif -#if AUTO_ASSIGNED_J_MS2 - #warning "Auto-assigned J_MS2_PIN to an unused En_MS2_PIN." -#endif -#if AUTO_ASSIGNED_J_MS3 - #warning "Auto-assigned J_MS3_PIN to an unused En_MS3_PIN." -#endif -#if AUTO_ASSIGNED_J_DIAG - #if J_USE_ENDSTOP == _XMIN_ - #warning "Auto-assigned J_DIAG_PIN to X_MIN_PIN." - #elif J_USE_ENDSTOP == _XMAX_ - #warning "Auto-assigned J_DIAG_PIN to X_MAX_PIN." - #elif J_USE_ENDSTOP == _YMIN_ - #warning "Auto-assigned J_DIAG_PIN to Y_MIN_PIN." - #elif J_USE_ENDSTOP == _YMAX_ - #warning "Auto-assigned J_DIAG_PIN to Y_MAX_PIN." - #elif J_USE_ENDSTOP == _ZMIN_ - #warning "Auto-assigned J_DIAG_PIN to Z_MIN_PIN." - #elif J_USE_ENDSTOP == _ZMAX_ - #warning "Auto-assigned J_DIAG_PIN to Z_MAX_PIN." - #elif J_USE_ENDSTOP == _XDIAG_ - #warning "Auto-assigned J_DIAG_PIN to X_DIAG_PIN." - #elif J_USE_ENDSTOP == _YDIAG_ - #warning "Auto-assigned J_DIAG_PIN to Y_DIAG_PIN." - #elif J_USE_ENDSTOP == _ZDIAG_ - #warning "Auto-assigned J_DIAG_PIN to Z_DIAG_PIN." - #elif J_USE_ENDSTOP == _E0DIAG_ - #warning "Auto-assigned J_DIAG_PIN to E0_DIAG_PIN." - #elif J_USE_ENDSTOP == _E1DIAG_ - #warning "Auto-assigned J_DIAG_PIN to E1_DIAG_PIN." - #elif J_USE_ENDSTOP == _E2DIAG_ - #warning "Auto-assigned J_DIAG_PIN to E2_DIAG_PIN." - #elif J_USE_ENDSTOP == _E3DIAG_ - #warning "Auto-assigned J_DIAG_PIN to E3_DIAG_PIN." - #elif J_USE_ENDSTOP == _E4DIAG_ - #warning "Auto-assigned J_DIAG_PIN to E4_DIAG_PIN." - #elif J_USE_ENDSTOP == _E5DIAG_ - #warning "Auto-assigned J_DIAG_PIN to E5_DIAG_PIN." - #elif J_USE_ENDSTOP == _E6DIAG_ - #warning "Auto-assigned J_DIAG_PIN to E6_DIAG_PIN." - #elif J_USE_ENDSTOP == _E7DIAG_ - #warning "Auto-assigned J_DIAG_PIN to E7_DIAG_PIN." - #endif -#endif -#if AUTO_ASSIGNED_K_STEPPER - #warning "Auto-assigned K STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." -#endif -#if AUTO_ASSIGNED_K_CS - #warning "Auto-assigned K_CS_PIN to an unused En_CS_PIN." -#endif -#if AUTO_ASSIGNED_K_MS1 - #warning "Auto-assigned K_MS1_PIN to an unused En_MS1_PIN." -#endif -#if AUTO_ASSIGNED_K_MS2 - #warning "Auto-assigned K_MS2_PIN to an unused En_MS2_PIN." -#endif -#if AUTO_ASSIGNED_K_MS3 - #warning "Auto-assigned K_MS3_PIN to an unused En_MS3_PIN." -#endif -#if AUTO_ASSIGNED_K_DIAG - #if K_USE_ENDSTOP == _XMIN_ - #warning "Auto-assigned K_DIAG_PIN to X_MIN_PIN." - #elif K_USE_ENDSTOP == _XMAX_ - #warning "Auto-assigned K_DIAG_PIN to X_MAX_PIN." - #elif K_USE_ENDSTOP == _YMIN_ - #warning "Auto-assigned K_DIAG_PIN to Y_MIN_PIN." - #elif K_USE_ENDSTOP == _YMAX_ - #warning "Auto-assigned K_DIAG_PIN to Y_MAX_PIN." - #elif K_USE_ENDSTOP == _ZMIN_ - #warning "Auto-assigned K_DIAG_PIN to Z_MIN_PIN." - #elif K_USE_ENDSTOP == _ZMAX_ - #warning "Auto-assigned K_DIAG_PIN to Z_MAX_PIN." - #elif K_USE_ENDSTOP == _XDIAG_ - #warning "Auto-assigned K_DIAG_PIN to X_DIAG_PIN." - #elif K_USE_ENDSTOP == _YDIAG_ - #warning "Auto-assigned K_DIAG_PIN to Y_DIAG_PIN." - #elif K_USE_ENDSTOP == _ZDIAG_ - #warning "Auto-assigned K_DIAG_PIN to Z_DIAG_PIN." - #elif K_USE_ENDSTOP == _E0DIAG_ - #warning "Auto-assigned K_DIAG_PIN to E0_DIAG_PIN." - #elif K_USE_ENDSTOP == _E1DIAG_ - #warning "Auto-assigned K_DIAG_PIN to E1_DIAG_PIN." - #elif K_USE_ENDSTOP == _E2DIAG_ - #warning "Auto-assigned K_DIAG_PIN to E2_DIAG_PIN." - #elif K_USE_ENDSTOP == _E3DIAG_ - #warning "Auto-assigned K_DIAG_PIN to E3_DIAG_PIN." - #elif K_USE_ENDSTOP == _E4DIAG_ - #warning "Auto-assigned K_DIAG_PIN to E4_DIAG_PIN." - #elif K_USE_ENDSTOP == _E5DIAG_ - #warning "Auto-assigned K_DIAG_PIN to E5_DIAG_PIN." - #elif K_USE_ENDSTOP == _E6DIAG_ - #warning "Auto-assigned K_DIAG_PIN to E6_DIAG_PIN." - #elif K_USE_ENDSTOP == _E7DIAG_ - #warning "Auto-assigned K_DIAG_PIN to E7_DIAG_PIN." - #endif -#endif diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp new file mode 100644 index 0000000000000..aba3d94366545 --- /dev/null +++ b/Marlin/src/inc/Warnings.cpp @@ -0,0 +1,457 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Warnings.cpp + * Test configuration values and give warnings at compile-time. + */ + +#include "MarlinConfig.h" + +// +// Warnings! Located here so they will appear just once in the build output. +// + +#if ENABLED(MARLIN_DEV_MODE) + #warning "WARNING! Disable MARLIN_DEV_MODE for the final build!" +#endif + +#if NONE(HAS_RESUME_CONTINUE, HOST_PROMPT_SUPPORT) + #warning "Your Configuration provides no method to acquire user feedback!" +#endif + +#if AUTO_ASSIGNED_X2_STEPPER + #warning "Auto-assigned X2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." +#endif +#if AUTO_ASSIGNED_X2_MS1 + #warning "Auto-assigned X2_MS1_PIN to an unused En_MS1_PIN." +#endif +#if AUTO_ASSIGNED_X2_MS2 + #warning "Auto-assigned X2_MS2_PIN to an unused En_MS2_PIN." +#endif +#if AUTO_ASSIGNED_X2_MS3 + #warning "Auto-assigned X2_MS3_PIN to an unused En_MS3_PIN." +#endif +#if AUTO_ASSIGNED_X2_CS + #warning "Auto-assigned X2_CS_PIN to an unused En_CS_PIN." +#endif +#if AUTO_ASSIGNED_X2_DIAG + #if X2_USE_ENDSTOP == _XMIN_ + #warning "Auto-assigned X2_DIAG_PIN to X_MIN_PIN." + #elif X2_USE_ENDSTOP == _XMAX_ + #warning "Auto-assigned X2_DIAG_PIN to X_MAX_PIN." + #elif X2_USE_ENDSTOP == _YMIN_ + #warning "Auto-assigned X2_DIAG_PIN to Y_MIN_PIN." + #elif X2_USE_ENDSTOP == _YMAX_ + #warning "Auto-assigned X2_DIAG_PIN to Y_MAX_PIN." + #elif X2_USE_ENDSTOP == _ZMIN_ + #warning "Auto-assigned X2_DIAG_PIN to Z_MIN_PIN." + #elif X2_USE_ENDSTOP == _ZMAX_ + #warning "Auto-assigned X2_DIAG_PIN to Z_MAX_PIN." + #elif X2_USE_ENDSTOP == _XDIAG_ + #warning "Auto-assigned X2_DIAG_PIN to X_DIAG_PIN." + #elif X2_USE_ENDSTOP == _YDIAG_ + #warning "Auto-assigned X2_DIAG_PIN to Y_DIAG_PIN." + #elif X2_USE_ENDSTOP == _ZDIAG_ + #warning "Auto-assigned X2_DIAG_PIN to Z_DIAG_PIN." + #elif X2_USE_ENDSTOP == _E0DIAG_ + #warning "Auto-assigned X2_DIAG_PIN to E0_DIAG_PIN." + #elif X2_USE_ENDSTOP == _E1DIAG_ + #warning "Auto-assigned X2_DIAG_PIN to E1_DIAG_PIN." + #elif X2_USE_ENDSTOP == _E2DIAG_ + #warning "Auto-assigned X2_DIAG_PIN to E2_DIAG_PIN." + #elif X2_USE_ENDSTOP == _E3DIAG_ + #warning "Auto-assigned X2_DIAG_PIN to E3_DIAG_PIN." + #elif X2_USE_ENDSTOP == _E4DIAG_ + #warning "Auto-assigned X2_DIAG_PIN to E4_DIAG_PIN." + #elif X2_USE_ENDSTOP == _E5DIAG_ + #warning "Auto-assigned X2_DIAG_PIN to E5_DIAG_PIN." + #elif X2_USE_ENDSTOP == _E6DIAG_ + #warning "Auto-assigned X2_DIAG_PIN to E6_DIAG_PIN." + #elif X2_USE_ENDSTOP == _E7DIAG_ + #warning "Auto-assigned X2_DIAG_PIN to E7_DIAG_PIN." + #endif +#endif +#if AUTO_ASSIGNED_Y2_STEPPER + #warning "Auto-assigned Y2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." +#endif +#if AUTO_ASSIGNED_Y2_MS1 + #warning "Auto-assigned Y2_MS1_PIN to an unused En_MS1_PIN." +#endif +#if AUTO_ASSIGNED_Y2_MS2 + #warning "Auto-assigned Y2_MS2_PIN to an unused En_MS2_PIN." +#endif +#if AUTO_ASSIGNED_Y2_MS3 + #warning "Auto-assigned Y2_MS3_PIN to an unused En_MS3_PIN." +#endif +#if AUTO_ASSIGNED_Y2_CS + #warning "Auto-assigned Y2_CS_PIN to an unused En_CS_PIN." +#endif +#if AUTO_ASSIGNED_Y2_DIAG + #if Y2_USE_ENDSTOP == _XMIN_ + #warning "Auto-assigned Y2_DIAG_PIN to X_MIN_PIN." + #elif Y2_USE_ENDSTOP == _XMAX_ + #warning "Auto-assigned Y2_DIAG_PIN to X_MAX_PIN." + #elif Y2_USE_ENDSTOP == _YMIN_ + #warning "Auto-assigned Y2_DIAG_PIN to Y_MIN_PIN." + #elif Y2_USE_ENDSTOP == _YMAX_ + #warning "Auto-assigned Y2_DIAG_PIN to Y_MAX_PIN." + #elif Y2_USE_ENDSTOP == _ZMIN_ + #warning "Auto-assigned Y2_DIAG_PIN to Z_MIN_PIN." + #elif Y2_USE_ENDSTOP == _ZMAX_ + #warning "Auto-assigned Y2_DIAG_PIN to Z_MAX_PIN." + #elif Y2_USE_ENDSTOP == _XDIAG_ + #warning "Auto-assigned Y2_DIAG_PIN to X_DIAG_PIN." + #elif Y2_USE_ENDSTOP == _YDIAG_ + #warning "Auto-assigned Y2_DIAG_PIN to Y_DIAG_PIN." + #elif Y2_USE_ENDSTOP == _ZDIAG_ + #warning "Auto-assigned Y2_DIAG_PIN to Z_DIAG_PIN." + #elif Y2_USE_ENDSTOP == _E0DIAG_ + #warning "Auto-assigned Y2_DIAG_PIN to E0_DIAG_PIN." + #elif Y2_USE_ENDSTOP == _E1DIAG_ + #warning "Auto-assigned Y2_DIAG_PIN to E1_DIAG_PIN." + #elif Y2_USE_ENDSTOP == _E2DIAG_ + #warning "Auto-assigned Y2_DIAG_PIN to E2_DIAG_PIN." + #elif Y2_USE_ENDSTOP == _E3DIAG_ + #warning "Auto-assigned Y2_DIAG_PIN to E3_DIAG_PIN." + #elif Y2_USE_ENDSTOP == _E4DIAG_ + #warning "Auto-assigned Y2_DIAG_PIN to E4_DIAG_PIN." + #elif Y2_USE_ENDSTOP == _E5DIAG_ + #warning "Auto-assigned Y2_DIAG_PIN to E5_DIAG_PIN." + #elif Y2_USE_ENDSTOP == _E6DIAG_ + #warning "Auto-assigned Y2_DIAG_PIN to E6_DIAG_PIN." + #elif Y2_USE_ENDSTOP == _E7DIAG_ + #warning "Auto-assigned Y2_DIAG_PIN to E7_DIAG_PIN." + #endif +#endif +#if AUTO_ASSIGNED_Z2_STEPPER + #warning "Auto-assigned Z2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." +#endif +#if AUTO_ASSIGNED_Z2_MS1 + #warning "Auto-assigned Z2_MS1_PIN to an unused En_MS1_PIN." +#endif +#if AUTO_ASSIGNED_Z2_MS2 + #warning "Auto-assigned Z2_MS2_PIN to an unused En_MS2_PIN." +#endif +#if AUTO_ASSIGNED_Z2_MS3 + #warning "Auto-assigned Z2_MS3_PIN to an unused En_MS3_PIN." +#endif +#if AUTO_ASSIGNED_Z2_CS + #warning "Auto-assigned Z2_CS_PIN to an unused En_CS_PIN." +#endif +#if AUTO_ASSIGNED_Z2_DIAG + #if Z2_USE_ENDSTOP == _XMIN_ + #warning "Auto-assigned Z2_DIAG_PIN to X_MIN_PIN." + #elif Z2_USE_ENDSTOP == _XMAX_ + #warning "Auto-assigned Z2_DIAG_PIN to X_MAX_PIN." + #elif Z2_USE_ENDSTOP == _YMIN_ + #warning "Auto-assigned Z2_DIAG_PIN to Y_MIN_PIN." + #elif Z2_USE_ENDSTOP == _YMAX_ + #warning "Auto-assigned Z2_DIAG_PIN to Y_MAX_PIN." + #elif Z2_USE_ENDSTOP == _ZMIN_ + #warning "Auto-assigned Z2_DIAG_PIN to Z_MIN_PIN." + #elif Z2_USE_ENDSTOP == _ZMAX_ + #warning "Auto-assigned Z2_DIAG_PIN to Z_MAX_PIN." + #elif Z2_USE_ENDSTOP == _XDIAG_ + #warning "Auto-assigned Z2_DIAG_PIN to X_DIAG_PIN." + #elif Z2_USE_ENDSTOP == _YDIAG_ + #warning "Auto-assigned Z2_DIAG_PIN to Y_DIAG_PIN." + #elif Z2_USE_ENDSTOP == _ZDIAG_ + #warning "Auto-assigned Z2_DIAG_PIN to Z_DIAG_PIN." + #elif Z2_USE_ENDSTOP == _E0DIAG_ + #warning "Auto-assigned Z2_DIAG_PIN to E0_DIAG_PIN." + #elif Z2_USE_ENDSTOP == _E1DIAG_ + #warning "Auto-assigned Z2_DIAG_PIN to E1_DIAG_PIN." + #elif Z2_USE_ENDSTOP == _E2DIAG_ + #warning "Auto-assigned Z2_DIAG_PIN to E2_DIAG_PIN." + #elif Z2_USE_ENDSTOP == _E3DIAG_ + #warning "Auto-assigned Z2_DIAG_PIN to E3_DIAG_PIN." + #elif Z2_USE_ENDSTOP == _E4DIAG_ + #warning "Auto-assigned Z2_DIAG_PIN to E4_DIAG_PIN." + #elif Z2_USE_ENDSTOP == _E5DIAG_ + #warning "Auto-assigned Z2_DIAG_PIN to E5_DIAG_PIN." + #elif Z2_USE_ENDSTOP == _E6DIAG_ + #warning "Auto-assigned Z2_DIAG_PIN to E6_DIAG_PIN." + #elif Z2_USE_ENDSTOP == _E7DIAG_ + #warning "Auto-assigned Z2_DIAG_PIN to E7_DIAG_PIN." + #endif +#endif +#if AUTO_ASSIGNED_Z3_STEPPER + #warning "Auto-assigned Z3 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." +#endif +#if AUTO_ASSIGNED_Z3_CS + #warning "Auto-assigned Z3_CS_PIN to an unused En_CS_PIN." +#endif +#if AUTO_ASSIGNED_Z3_MS1 + #warning "Auto-assigned Z3_MS1_PIN to an unused En_MS1_PIN." +#endif +#if AUTO_ASSIGNED_Z3_MS2 + #warning "Auto-assigned Z3_MS2_PIN to an unused En_MS2_PIN." +#endif +#if AUTO_ASSIGNED_Z3_MS3 + #warning "Auto-assigned Z3_MS3_PIN to an unused En_MS3_PIN." +#endif +#if AUTO_ASSIGNED_Z3_DIAG + #if Z3_USE_ENDSTOP == _XMIN_ + #warning "Auto-assigned Z3_DIAG_PIN to X_MIN_PIN." + #elif Z3_USE_ENDSTOP == _XMAX_ + #warning "Auto-assigned Z3_DIAG_PIN to X_MAX_PIN." + #elif Z3_USE_ENDSTOP == _YMIN_ + #warning "Auto-assigned Z3_DIAG_PIN to Y_MIN_PIN." + #elif Z3_USE_ENDSTOP == _YMAX_ + #warning "Auto-assigned Z3_DIAG_PIN to Y_MAX_PIN." + #elif Z3_USE_ENDSTOP == _ZMIN_ + #warning "Auto-assigned Z3_DIAG_PIN to Z_MIN_PIN." + #elif Z3_USE_ENDSTOP == _ZMAX_ + #warning "Auto-assigned Z3_DIAG_PIN to Z_MAX_PIN." + #elif Z3_USE_ENDSTOP == _XDIAG_ + #warning "Auto-assigned Z3_DIAG_PIN to X_DIAG_PIN." + #elif Z3_USE_ENDSTOP == _YDIAG_ + #warning "Auto-assigned Z3_DIAG_PIN to Y_DIAG_PIN." + #elif Z3_USE_ENDSTOP == _ZDIAG_ + #warning "Auto-assigned Z3_DIAG_PIN to Z_DIAG_PIN." + #elif Z3_USE_ENDSTOP == _E0DIAG_ + #warning "Auto-assigned Z3_DIAG_PIN to E0_DIAG_PIN." + #elif Z3_USE_ENDSTOP == _E1DIAG_ + #warning "Auto-assigned Z3_DIAG_PIN to E1_DIAG_PIN." + #elif Z3_USE_ENDSTOP == _E2DIAG_ + #warning "Auto-assigned Z3_DIAG_PIN to E2_DIAG_PIN." + #elif Z3_USE_ENDSTOP == _E3DIAG_ + #warning "Auto-assigned Z3_DIAG_PIN to E3_DIAG_PIN." + #elif Z3_USE_ENDSTOP == _E4DIAG_ + #warning "Auto-assigned Z3_DIAG_PIN to E4_DIAG_PIN." + #elif Z3_USE_ENDSTOP == _E5DIAG_ + #warning "Auto-assigned Z3_DIAG_PIN to E5_DIAG_PIN." + #elif Z3_USE_ENDSTOP == _E6DIAG_ + #warning "Auto-assigned Z3_DIAG_PIN to E6_DIAG_PIN." + #elif Z3_USE_ENDSTOP == _E7DIAG_ + #warning "Auto-assigned Z3_DIAG_PIN to E7_DIAG_PIN." + #endif +#endif +#if AUTO_ASSIGNED_Z4_STEPPER + #warning "Auto-assigned Z4 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." +#endif +#if AUTO_ASSIGNED_Z4_CS + #warning "Auto-assigned Z4_CS_PIN to an unused En_CS_PIN." +#endif +#if AUTO_ASSIGNED_Z4_MS1 + #warning "Auto-assigned Z4_MS1_PIN to an unused En_MS1_PIN." +#endif +#if AUTO_ASSIGNED_Z4_MS2 + #warning "Auto-assigned Z4_MS2_PIN to an unused En_MS2_PIN." +#endif +#if AUTO_ASSIGNED_Z4_MS3 + #warning "Auto-assigned Z4_MS3_PIN to an unused En_MS3_PIN." +#endif +#if AUTO_ASSIGNED_Z4_DIAG + #if Z4_USE_ENDSTOP == _XMIN_ + #warning "Auto-assigned Z4_DIAG_PIN to X_MIN_PIN." + #elif Z4_USE_ENDSTOP == _XMAX_ + #warning "Auto-assigned Z4_DIAG_PIN to X_MAX_PIN." + #elif Z4_USE_ENDSTOP == _YMIN_ + #warning "Auto-assigned Z4_DIAG_PIN to Y_MIN_PIN." + #elif Z4_USE_ENDSTOP == _YMAX_ + #warning "Auto-assigned Z4_DIAG_PIN to Y_MAX_PIN." + #elif Z4_USE_ENDSTOP == _ZMIN_ + #warning "Auto-assigned Z4_DIAG_PIN to Z_MIN_PIN." + #elif Z4_USE_ENDSTOP == _ZMAX_ + #warning "Auto-assigned Z4_DIAG_PIN to Z_MAX_PIN." + #elif Z4_USE_ENDSTOP == _XDIAG_ + #warning "Auto-assigned Z4_DIAG_PIN to X_DIAG_PIN." + #elif Z4_USE_ENDSTOP == _YDIAG_ + #warning "Auto-assigned Z4_DIAG_PIN to Y_DIAG_PIN." + #elif Z4_USE_ENDSTOP == _ZDIAG_ + #warning "Auto-assigned Z4_DIAG_PIN to Z_DIAG_PIN." + #elif Z4_USE_ENDSTOP == _E0DIAG_ + #warning "Auto-assigned Z4_DIAG_PIN to E0_DIAG_PIN." + #elif Z4_USE_ENDSTOP == _E1DIAG_ + #warning "Auto-assigned Z4_DIAG_PIN to E1_DIAG_PIN." + #elif Z4_USE_ENDSTOP == _E2DIAG_ + #warning "Auto-assigned Z4_DIAG_PIN to E2_DIAG_PIN." + #elif Z4_USE_ENDSTOP == _E3DIAG_ + #warning "Auto-assigned Z4_DIAG_PIN to E3_DIAG_PIN." + #elif Z4_USE_ENDSTOP == _E4DIAG_ + #warning "Auto-assigned Z4_DIAG_PIN to E4_DIAG_PIN." + #elif Z4_USE_ENDSTOP == _E5DIAG_ + #warning "Auto-assigned Z4_DIAG_PIN to E5_DIAG_PIN." + #elif Z4_USE_ENDSTOP == _E6DIAG_ + #warning "Auto-assigned Z4_DIAG_PIN to E6_DIAG_PIN." + #elif Z4_USE_ENDSTOP == _E7DIAG_ + #warning "Auto-assigned Z4_DIAG_PIN to E7_DIAG_PIN." + #endif +#endif +#if AUTO_ASSIGNED_I_STEPPER + #warning "Auto-assigned I STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." +#endif +#if AUTO_ASSIGNED_I_CS + #warning "Auto-assigned I_CS_PIN to an unused En_CS_PIN." +#endif +#if AUTO_ASSIGNED_I_MS1 + #warning "Auto-assigned I_MS1_PIN to an unused En_MS1_PIN." +#endif +#if AUTO_ASSIGNED_I_MS2 + #warning "Auto-assigned I_MS2_PIN to an unused En_MS2_PIN." +#endif +#if AUTO_ASSIGNED_I_MS3 + #warning "Auto-assigned I_MS3_PIN to an unused En_MS3_PIN." +#endif +#if AUTO_ASSIGNED_I_DIAG + #if I_USE_ENDSTOP == _XMIN_ + #warning "Auto-assigned I_DIAG_PIN to X_MIN_PIN." + #elif I_USE_ENDSTOP == _XMAX_ + #warning "Auto-assigned I_DIAG_PIN to X_MAX_PIN." + #elif I_USE_ENDSTOP == _YMIN_ + #warning "Auto-assigned I_DIAG_PIN to Y_MIN_PIN." + #elif I_USE_ENDSTOP == _YMAX_ + #warning "Auto-assigned I_DIAG_PIN to Y_MAX_PIN." + #elif I_USE_ENDSTOP == _ZMIN_ + #warning "Auto-assigned I_DIAG_PIN to Z_MIN_PIN." + #elif I_USE_ENDSTOP == _ZMAX_ + #warning "Auto-assigned I_DIAG_PIN to Z_MAX_PIN." + #elif I_USE_ENDSTOP == _XDIAG_ + #warning "Auto-assigned I_DIAG_PIN to X_DIAG_PIN." + #elif I_USE_ENDSTOP == _YDIAG_ + #warning "Auto-assigned I_DIAG_PIN to Y_DIAG_PIN." + #elif I_USE_ENDSTOP == _ZDIAG_ + #warning "Auto-assigned I_DIAG_PIN to Z_DIAG_PIN." + #elif I_USE_ENDSTOP == _E0DIAG_ + #warning "Auto-assigned I_DIAG_PIN to E0_DIAG_PIN." + #elif I_USE_ENDSTOP == _E1DIAG_ + #warning "Auto-assigned I_DIAG_PIN to E1_DIAG_PIN." + #elif I_USE_ENDSTOP == _E2DIAG_ + #warning "Auto-assigned I_DIAG_PIN to E2_DIAG_PIN." + #elif I_USE_ENDSTOP == _E3DIAG_ + #warning "Auto-assigned I_DIAG_PIN to E3_DIAG_PIN." + #elif I_USE_ENDSTOP == _E4DIAG_ + #warning "Auto-assigned I_DIAG_PIN to E4_DIAG_PIN." + #elif I_USE_ENDSTOP == _E5DIAG_ + #warning "Auto-assigned I_DIAG_PIN to E5_DIAG_PIN." + #elif I_USE_ENDSTOP == _E6DIAG_ + #warning "Auto-assigned I_DIAG_PIN to E6_DIAG_PIN." + #elif I_USE_ENDSTOP == _E7DIAG_ + #warning "Auto-assigned I_DIAG_PIN to E7_DIAG_PIN." + #endif +#endif +#if AUTO_ASSIGNED_J_STEPPER + #warning "Auto-assigned J STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." +#endif +#if AUTO_ASSIGNED_J_CS + #warning "Auto-assigned J_CS_PIN to an unused En_CS_PIN." +#endif +#if AUTO_ASSIGNED_J_MS1 + #warning "Auto-assigned J_MS1_PIN to an unused En_MS1_PIN." +#endif +#if AUTO_ASSIGNED_J_MS2 + #warning "Auto-assigned J_MS2_PIN to an unused En_MS2_PIN." +#endif +#if AUTO_ASSIGNED_J_MS3 + #warning "Auto-assigned J_MS3_PIN to an unused En_MS3_PIN." +#endif +#if AUTO_ASSIGNED_J_DIAG + #if J_USE_ENDSTOP == _XMIN_ + #warning "Auto-assigned J_DIAG_PIN to X_MIN_PIN." + #elif J_USE_ENDSTOP == _XMAX_ + #warning "Auto-assigned J_DIAG_PIN to X_MAX_PIN." + #elif J_USE_ENDSTOP == _YMIN_ + #warning "Auto-assigned J_DIAG_PIN to Y_MIN_PIN." + #elif J_USE_ENDSTOP == _YMAX_ + #warning "Auto-assigned J_DIAG_PIN to Y_MAX_PIN." + #elif J_USE_ENDSTOP == _ZMIN_ + #warning "Auto-assigned J_DIAG_PIN to Z_MIN_PIN." + #elif J_USE_ENDSTOP == _ZMAX_ + #warning "Auto-assigned J_DIAG_PIN to Z_MAX_PIN." + #elif J_USE_ENDSTOP == _XDIAG_ + #warning "Auto-assigned J_DIAG_PIN to X_DIAG_PIN." + #elif J_USE_ENDSTOP == _YDIAG_ + #warning "Auto-assigned J_DIAG_PIN to Y_DIAG_PIN." + #elif J_USE_ENDSTOP == _ZDIAG_ + #warning "Auto-assigned J_DIAG_PIN to Z_DIAG_PIN." + #elif J_USE_ENDSTOP == _E0DIAG_ + #warning "Auto-assigned J_DIAG_PIN to E0_DIAG_PIN." + #elif J_USE_ENDSTOP == _E1DIAG_ + #warning "Auto-assigned J_DIAG_PIN to E1_DIAG_PIN." + #elif J_USE_ENDSTOP == _E2DIAG_ + #warning "Auto-assigned J_DIAG_PIN to E2_DIAG_PIN." + #elif J_USE_ENDSTOP == _E3DIAG_ + #warning "Auto-assigned J_DIAG_PIN to E3_DIAG_PIN." + #elif J_USE_ENDSTOP == _E4DIAG_ + #warning "Auto-assigned J_DIAG_PIN to E4_DIAG_PIN." + #elif J_USE_ENDSTOP == _E5DIAG_ + #warning "Auto-assigned J_DIAG_PIN to E5_DIAG_PIN." + #elif J_USE_ENDSTOP == _E6DIAG_ + #warning "Auto-assigned J_DIAG_PIN to E6_DIAG_PIN." + #elif J_USE_ENDSTOP == _E7DIAG_ + #warning "Auto-assigned J_DIAG_PIN to E7_DIAG_PIN." + #endif +#endif +#if AUTO_ASSIGNED_K_STEPPER + #warning "Auto-assigned K STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." +#endif +#if AUTO_ASSIGNED_K_CS + #warning "Auto-assigned K_CS_PIN to an unused En_CS_PIN." +#endif +#if AUTO_ASSIGNED_K_MS1 + #warning "Auto-assigned K_MS1_PIN to an unused En_MS1_PIN." +#endif +#if AUTO_ASSIGNED_K_MS2 + #warning "Auto-assigned K_MS2_PIN to an unused En_MS2_PIN." +#endif +#if AUTO_ASSIGNED_K_MS3 + #warning "Auto-assigned K_MS3_PIN to an unused En_MS3_PIN." +#endif +#if AUTO_ASSIGNED_K_DIAG + #if K_USE_ENDSTOP == _XMIN_ + #warning "Auto-assigned K_DIAG_PIN to X_MIN_PIN." + #elif K_USE_ENDSTOP == _XMAX_ + #warning "Auto-assigned K_DIAG_PIN to X_MAX_PIN." + #elif K_USE_ENDSTOP == _YMIN_ + #warning "Auto-assigned K_DIAG_PIN to Y_MIN_PIN." + #elif K_USE_ENDSTOP == _YMAX_ + #warning "Auto-assigned K_DIAG_PIN to Y_MAX_PIN." + #elif K_USE_ENDSTOP == _ZMIN_ + #warning "Auto-assigned K_DIAG_PIN to Z_MIN_PIN." + #elif K_USE_ENDSTOP == _ZMAX_ + #warning "Auto-assigned K_DIAG_PIN to Z_MAX_PIN." + #elif K_USE_ENDSTOP == _XDIAG_ + #warning "Auto-assigned K_DIAG_PIN to X_DIAG_PIN." + #elif K_USE_ENDSTOP == _YDIAG_ + #warning "Auto-assigned K_DIAG_PIN to Y_DIAG_PIN." + #elif K_USE_ENDSTOP == _ZDIAG_ + #warning "Auto-assigned K_DIAG_PIN to Z_DIAG_PIN." + #elif K_USE_ENDSTOP == _E0DIAG_ + #warning "Auto-assigned K_DIAG_PIN to E0_DIAG_PIN." + #elif K_USE_ENDSTOP == _E1DIAG_ + #warning "Auto-assigned K_DIAG_PIN to E1_DIAG_PIN." + #elif K_USE_ENDSTOP == _E2DIAG_ + #warning "Auto-assigned K_DIAG_PIN to E2_DIAG_PIN." + #elif K_USE_ENDSTOP == _E3DIAG_ + #warning "Auto-assigned K_DIAG_PIN to E3_DIAG_PIN." + #elif K_USE_ENDSTOP == _E4DIAG_ + #warning "Auto-assigned K_DIAG_PIN to E4_DIAG_PIN." + #elif K_USE_ENDSTOP == _E5DIAG_ + #warning "Auto-assigned K_DIAG_PIN to E5_DIAG_PIN." + #elif K_USE_ENDSTOP == _E6DIAG_ + #warning "Auto-assigned K_DIAG_PIN to E6_DIAG_PIN." + #elif K_USE_ENDSTOP == _E7DIAG_ + #warning "Auto-assigned K_DIAG_PIN to E7_DIAG_PIN." + #endif +#endif diff --git a/buildroot/share/PlatformIO/scripts/preflight-checks.py b/buildroot/share/PlatformIO/scripts/preflight-checks.py index 27e5c9d70a789..b949df97c8c69 100644 --- a/buildroot/share/PlatformIO/scripts/preflight-checks.py +++ b/buildroot/share/PlatformIO/scripts/preflight-checks.py @@ -75,14 +75,21 @@ def sanity_check_target(): err = "ERROR: Config files found in directory %s. Please move them into the Marlin subfolder." % p raise SystemExit(err) + # + # Give warnings on every build + # + warnfile = os.path.join(env['PROJECT_BUILD_DIR'], build_env, "src", "src", "inc", "Warnings.cpp.o") + if os.path.exists(warnfile): + os.remove(warnfile) + # # Check for old files indicating an entangled Marlin (mixing old and new code) # mixedin = [] - for p in [ os.path.join(env['PROJECT_DIR'], "Marlin/src/lcd/dogm") ]: - for f in [ "ultralcd_DOGM.cpp", "ultralcd_DOGM.h" ]: - if os.path.isfile(os.path.join(p, f)): - mixedin += [ f ] + p = os.path.join(env['PROJECT_DIR'], "Marlin", "src", "lcd", "dogm") + for f in [ "ultralcd_DOGM.cpp", "ultralcd_DOGM.h" ]: + if os.path.isfile(os.path.join(p, f)): + mixedin += [ f ] if mixedin: err = "ERROR: Old files fell into your Marlin folder. Remove %s and try again" % ", ".join(mixedin) raise SystemExit(err) @@ -90,4 +97,4 @@ def sanity_check_target(): # Detect that 'vscode init' is running from SCons.Script import COMMAND_LINE_TARGETS if "idedata" not in COMMAND_LINE_TARGETS: - sanity_check_target() + sanity_check_target()