diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index c896f0f92..39ebfda3c 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -14,7 +14,7 @@ #define CONFIGURATION_LCD - #if defined(MAKRPANEL) + #if ENABLED(MAKRPANEL) #define DOGLCD #define SDSUPPORT #define DEFAULT_LCD_CONTRAST 17 @@ -22,16 +22,16 @@ #define NEWPANEL #endif - #if defined(miniVIKI) || defined(VIKI2) || defined(ELB_FULL_GRAPHIC_CONTROLLER) + #if ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) #define ULTRA_LCD //general LCD support, also 16x2 #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. - #ifdef miniVIKI + #if ENABLED(miniVIKI) #define DEFAULT_LCD_CONTRAST 95 - #elif defined(VIKI2) + #elif ENABLED(VIKI2) #define DEFAULT_LCD_CONTRAST 40 - #elif defined(ELB_FULL_GRAPHIC_CONTROLLER) + #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) #define DEFAULT_LCD_CONTRAST 110 #define U8GLIB_LM6059_AF #endif @@ -41,34 +41,34 @@ #endif // Generic support for SSD1306 OLED based LCDs. - #if defined(U8GLIB_SSD1306) + #if ENABLED(U8GLIB_SSD1306) #define ULTRA_LCD //general LCD support, also 16x2 #define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 graphic Display Family) #endif - #ifdef PANEL_ONE + #if ENABLED(PANEL_ONE) #define SDSUPPORT #define ULTIMAKERCONTROLLER #endif - #ifdef REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define DOGLCD #define U8GLIB_ST7920 #define REPRAP_DISCOUNT_SMART_CONTROLLER #endif - #if defined(ULTIMAKERCONTROLLER) || defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL) || defined(RIGIDBOT_PANEL) + #if ENABLED(ULTIMAKERCONTROLLER) || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) || ENABLED(G3D_PANEL) #define ULTIPANEL #define NEWPANEL #endif - #ifdef REPRAPWORLD_KEYPAD + #if ENABLED(REPRAPWORLD_KEYPAD) #define ULTIPANEL #define NEWPANEL #endif - #ifdef RA_CONTROL_PANEL + #if ENABLED(RA_CONTROL_PANEL) #define LCD_I2C_TYPE_PCA8574 #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander #define ULTIPANEL @@ -87,7 +87,7 @@ * I2C PANELS */ - #ifdef LCD_I2C_SAINSMART_YWROBOT + #if ENABLED(LCD_I2C_SAINSMART_YWROBOT) // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home ) // Make sure it is placed in the Arduino libraries directory. #define LCD_I2C_TYPE_PCF8575 @@ -97,7 +97,7 @@ #endif // PANELOLU2 LCD with status LEDs, separate encoder and click inputs - #ifdef LCD_I2C_PANELOLU2 + #if ENABLED(LCD_I2C_PANELOLU2) #define LCD_I2C_TYPE_MCP23017 #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD @@ -110,7 +110,7 @@ #define ENCODER_STEPS_PER_MENU_ITEM 1 #endif - #ifdef LCD_USE_I2C_BUZZER + #if ENABLED(LCD_USE_I2C_BUZZER) #define LCD_FEEDBACK_FREQUENCY_HZ 1000 #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 #endif @@ -120,7 +120,7 @@ #endif // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs - #ifdef LCD_I2C_VIKI + #if ENABLED(LCD_I2C_VIKI) // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 ) // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory. // Note: The pause/stop/resume LCD button pin should be connected to the Arduino @@ -137,17 +137,17 @@ // 2 wire Non-latching LCD SR from: // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection - #ifdef SAV_3DLCD + #if ENABLED(SAV_3DLCD) #define SR_LCD_2W_NL // Non latching 2 wire shiftregister #define ULTIPANEL #define NEWPANEL #endif - #ifdef ULTIPANEL + #if ENABLED(ULTIPANEL) #define NEWPANEL //enable this if you have a click-encoder panel #define SDSUPPORT #define ULTRA_LCD - #ifdef DOGLCD // Change number of lines to match the DOG graphic display + #if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display #define LCD_WIDTH 22 #define LCD_HEIGHT 5 #else @@ -155,8 +155,8 @@ #define LCD_HEIGHT 4 #endif #else //no panel but just LCD - #ifdef ULTRA_LCD - #ifdef DOGLCD // Change number of lines to match the 128x64 graphics display + #if ENABLED(ULTRA_LCD) + #if ENABLED(DOGLCD) // Change number of lines to match the 128x64 graphics display #define LCD_WIDTH 22 #define LCD_HEIGHT 5 #else @@ -166,7 +166,7 @@ #endif #endif - #ifdef DOGLCD + #if ENABLED(DOGLCD) /* Custom characters defined in font font_6x10_marlin_symbols */ // \x00 intentionally skipped to avoid problems in strings #define LCD_STR_REFRESH "\x01" @@ -198,16 +198,16 @@ /** * Default LCD contrast for dogm-like LCD displays */ - #if defined(DOGLCD) && !defined(DEFAULT_LCD_CONTRAST) + #if ENABLED(DOGLCD) && DISABLED(DEFAULT_LCD_CONTRAST) #define DEFAULT_LCD_CONTRAST 32 #endif - #ifdef DOGLCD + #if ENABLED(DOGLCD) #define HAS_LCD_CONTRAST - #ifdef U8GLIB_ST7920 + #if ENABLED(U8GLIB_ST7920) #undef HAS_LCD_CONTRAST #endif - #ifdef U8GLIB_SSD1306 + #if ENABLED(U8GLIB_SSD1306) #undef HAS_LCD_CONTRAST #endif #endif @@ -227,18 +227,18 @@ /** * ENDSTOPPULLUPS */ - #ifdef ENDSTOPPULLUPS - #ifndef DISABLE_MAX_ENDSTOPS + #if ENABLED(ENDSTOPPULLUPS) + #if DISABLED(DISABLE_MAX_ENDSTOPS) #define ENDSTOPPULLUP_XMAX #define ENDSTOPPULLUP_YMAX #define ENDSTOPPULLUP_ZMAX #endif - #ifndef DISABLE_MIN_ENDSTOPS + #if DISABLED(DISABLE_MIN_ENDSTOPS) #define ENDSTOPPULLUP_XMIN #define ENDSTOPPULLUP_YMIN #define ENDSTOPPULLUP_ZMIN #endif - #ifndef DISABLE_Z_PROBE_ENDSTOP + #if DISABLED(DISABLE_Z_PROBE_ENDSTOP) #define ENDSTOPPULLUP_ZPROBE #endif #endif @@ -253,7 +253,7 @@ /** * SCARA */ - #ifdef SCARA + #if ENABLED(SCARA) #undef SLOWDOWN #define QUICK_HOME //SCARA needs Quickhome #endif @@ -261,12 +261,12 @@ /** * AUTOSET LOCATIONS OF LIMIT SWITCHES */ - #ifdef MANUAL_HOME_POSITIONS // Use manual limit switch locations + #if ENABLED(MANUAL_HOME_POSITIONS) // Use manual limit switch locations #define X_HOME_POS MANUAL_X_HOME_POS #define Y_HOME_POS MANUAL_Y_HOME_POS #define Z_HOME_POS MANUAL_Z_HOME_POS #else //!MANUAL_HOME_POSITIONS – Use home switch positions based on homing direction and travel limits - #ifdef BED_CENTER_AT_0_0 + #if ENABLED(BED_CENTER_AT_0_0) #define X_HOME_POS X_MAX_LENGTH * X_HOME_DIR * 0.5 #define Y_HOME_POS Y_MAX_LENGTH * Y_HOME_DIR * 0.5 #else @@ -279,7 +279,7 @@ /** * Auto Bed Leveling */ - #ifdef ENABLE_AUTO_BED_LEVELING + #if ENABLED(ENABLE_AUTO_BED_LEVELING) // Boundaries for probing based on set limits #define MIN_PROBE_X (max(X_MIN_POS, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) #define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) @@ -292,14 +292,14 @@ /** * Sled Options */ - #ifdef Z_PROBE_SLED + #if ENABLED(Z_PROBE_SLED) #define Z_SAFE_HOMING #endif /** * MAX_STEP_FREQUENCY differs for TOSHIBA */ - #ifdef CONFIG_STEPPERS_TOSHIBA + #if ENABLED(CONFIG_STEPPERS_TOSHIBA) #define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers #else #define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step) @@ -315,12 +315,12 @@ /** * Advance calculated values */ - #ifdef ADVANCE + #if ENABLED(ADVANCE) #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * M_PI) #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS] / EXTRUSION_AREA) #endif - #if defined(ULTIPANEL) && !defined(ELB_FULL_GRAPHIC_CONTROLLER) + #if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) #undef SDCARDDETECTINVERTED #endif @@ -428,11 +428,12 @@ #define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3) #define HAS_FAN (PIN_EXISTS(FAN)) #define HAS_CONTROLLERFAN (PIN_EXISTS(CONTROLLERFAN)) + #define HAS_SERVOS (defined(NUM_SERVOS) && NUM_SERVOS > 0) #define HAS_SERVO_0 (PIN_EXISTS(SERVO0)) #define HAS_SERVO_1 (PIN_EXISTS(SERVO1)) #define HAS_SERVO_2 (PIN_EXISTS(SERVO2)) #define HAS_SERVO_3 (PIN_EXISTS(SERVO3)) - #define HAS_FILAMENT_SENSOR (defined(FILAMENT_SENSOR) && PIN_EXISTS(FILWIDTH)) + #define HAS_FILAMENT_SENSOR (ENABLED(FILAMENT_SENSOR) && PIN_EXISTS(FILWIDTH)) #define HAS_FILRUNOUT (PIN_EXISTS(FILRUNOUT)) #define HAS_HOME (PIN_EXISTS(HOME)) #define HAS_KILL (PIN_EXISTS(KILL)) @@ -490,7 +491,7 @@ * Helper Macros for heaters and extruder fan */ #define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, v) - #if EXTRUDERS > 1 || defined(HEATERS_PARALLEL) + #if EXTRUDERS > 1 || ENABLED(HEATERS_PARALLEL) #define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, v) #if EXTRUDERS > 2 #define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, v) @@ -499,7 +500,7 @@ #endif #endif #endif - #ifdef HEATERS_PARALLEL + #if ENABLED(HEATERS_PARALLEL) #define WRITE_HEATER_0(v) { WRITE_HEATER_0P(v); WRITE_HEATER_1(v); } #else #define WRITE_HEATER_0(v) WRITE_HEATER_0P(v) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index c441c2467..dfcfaebee 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated: // @section info -#ifdef HAS_AUTOMATIC_VERSIONING +#if ENABLED(HAS_AUTOMATIC_VERSIONING) #include "_Version.h" #else #include "Default_Version.h" @@ -195,7 +195,7 @@ Here are some standard links for getting your machine calibrated: #define PIDTEMP #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay @@ -248,7 +248,7 @@ Here are some standard links for getting your machine calibrated: //#define PID_BED_DEBUG // Sends debug data to the serial port. -#ifdef PIDTEMPBED +#if ENABLED(PIDTEMPBED) #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term @@ -318,7 +318,7 @@ Here are some standard links for getting your machine calibrated: // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors -#ifndef ENDSTOPPULLUPS +#if DISABLED(ENDSTOPPULLUPS) // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined // #define ENDSTOPPULLUP_XMAX // #define ENDSTOPPULLUP_YMAX @@ -408,7 +408,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -#ifdef FILAMENT_RUNOUT_SENSOR +#if ENABLED(FILAMENT_RUNOUT_SENSOR) const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" @@ -421,11 +421,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#ifdef MANUAL_BED_LEVELING +#if ENABLED(MANUAL_BED_LEVELING) #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis #endif // MANUAL_BED_LEVELING -#ifdef MESH_BED_LEVELING +#if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -444,7 +444,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line) #define Z_PROBE_REPEATABILITY_TEST // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled. -#ifdef ENABLE_AUTO_BED_LEVELING +#if ENABLED(ENABLE_AUTO_BED_LEVELING) // There are 2 different ways to specify probing locations // @@ -461,7 +461,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Note: this feature generates 10KB extra code size #define AUTO_BED_LEVELING_GRID - #ifdef AUTO_BED_LEVELING_GRID + #if ENABLED(AUTO_BED_LEVELING_GRID) #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 @@ -518,7 +518,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // - Position the probe in a defined XY point before Z Homing when homing all axis (G28) // - Block Z homing only when the probe is outside bed area. - #ifdef Z_SAFE_HOMING + #if ENABLED(Z_SAFE_HOMING) #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28) #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28) @@ -550,7 +550,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Manual homing switch locations: // For deltabots this means top and center of the Cartesian print volume. -#ifdef MANUAL_HOME_POSITIONS +#if ENABLED(MANUAL_HOME_POSITIONS) #define MANUAL_X_HOME_POS 0 #define MANUAL_Y_HOME_POS 0 #define MANUAL_Z_HOME_POS 0 @@ -589,8 +589,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Custom M code points #define CUSTOM_M_CODES -#ifdef CUSTOM_M_CODES - #ifdef ENABLE_AUTO_BED_LEVELING +#if ENABLED(CUSTOM_M_CODES) + #if ENABLED(ENABLE_AUTO_BED_LEVELING) #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 @@ -607,7 +607,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //define this to enable EEPROM support //#define EEPROM_SETTINGS -#ifdef EEPROM_SETTINGS +#if ENABLED(EEPROM_SETTINGS) // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: #define EEPROM_CHITCHAT // Please keep turned on if you can. #endif @@ -796,7 +796,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#ifdef DEACTIVATE_SERVOS_AFTER_MOVE +#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) // Delay (in microseconds) before turning the servo off. This depends on the servo speed. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index e6c954d58..94d96d01a 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -9,7 +9,7 @@ //=============================Thermal Settings ============================ //=========================================================================== -#ifdef BED_LIMIT_SWITCHING +#if ENABLED(BED_LIMIT_SWITCHING) #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS #endif #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control @@ -17,7 +17,7 @@ /** * Thermal Protection parameters */ -#ifdef THERMAL_PROTECTION_HOTENDS +#if ENABLED(THERMAL_PROTECTION_HOTENDS) #define THERMAL_PROTECTION_PERIOD 40 // Seconds #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius @@ -31,16 +31,16 @@ #define WATCH_TEMP_INCREASE 4 // Degrees Celsius #endif -#ifdef THERMAL_PROTECTION_BED +#if ENABLED(THERMAL_PROTECTION_BED) #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius #endif -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. #define PID_ADD_EXTRUSION_RATE - #ifdef PID_ADD_EXTRUSION_RATE + #if ENABLED(PID_ADD_EXTRUSION_RATE) #define DEFAULT_Kc (1) //heating power=Kc*(e_speed) #endif #endif @@ -56,7 +56,7 @@ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode */ #define AUTOTEMP -#ifdef AUTOTEMP +#if ENABLED(AUTOTEMP) #define AUTOTEMP_OLDWEIGHT 0.98 #endif @@ -133,7 +133,7 @@ // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. //#define Z_DUAL_STEPPER_DRIVERS -#ifdef Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper. // That way the machine is capable to align the bed during home, since both Z steppers are homed. @@ -150,7 +150,7 @@ // #define Z_DUAL_ENDSTOPS - #ifdef Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) const bool Z2_MAX_ENDSTOP_INVERTING = false; #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. @@ -169,7 +169,7 @@ // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage // allowing faster printing speeds. //#define DUAL_X_CARRIAGE -#ifdef DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. @@ -240,7 +240,7 @@ // @section lcd -#ifdef ULTIPANEL +#if ENABLED(ULTIPANEL) #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder #endif @@ -289,7 +289,7 @@ // @section lcd -#ifdef SDSUPPORT +#if ENABLED(SDSUPPORT) // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT @@ -310,7 +310,7 @@ // Show a progress bar on HD44780 LCDs for SD printing //#define LCD_PROGRESS_BAR - #ifdef LCD_PROGRESS_BAR + #if ENABLED(LCD_PROGRESS_BAR) // Amount of time (ms) to show the bar #define PROGRESS_BAR_BAR_TIME 2000 // Amount of time (ms) to show the status message @@ -333,7 +333,7 @@ #endif // SDSUPPORT // for dogm lcd displays you can choose some additional fonts: -#ifdef DOGLCD +#if ENABLED(DOGLCD) // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT // we don't have a big font for Cyrillic, Kana //#define USE_BIG_EDIT_FONT @@ -348,7 +348,7 @@ // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG -#ifdef USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on. // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset. // However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled. @@ -361,7 +361,7 @@ // it can e.g. be used to change z-positions in the print startup phase in real-time // does not respect endstops! //#define BABYSTEPPING -#ifdef BABYSTEPPING +#if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements @@ -378,7 +378,7 @@ // so: v ^ 2 is proportional to number of steps we advance the extruder //#define ADVANCE -#ifdef ADVANCE +#if ENABLED(ADVANCE) #define EXTRUDER_ADVANCE_K .0 #define D_FILAMENT 2.85 #define STEPS_MM_E 836 @@ -405,7 +405,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. -#ifdef SDSUPPORT +#if ENABLED(SDSUPPORT) #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller #else #define BLOCK_BUFFER_SIZE 16 // maximize block buffer @@ -435,7 +435,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // the moves are than replaced by the firmware controlled ones. // #define FWRETRACT //ONLY PARTIALLY TESTED -#ifdef FWRETRACT +#if ENABLED(FWRETRACT) #define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt #define RETRACT_LENGTH 3 //default retract length (positive mm) #define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change @@ -447,9 +447,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st #endif // Add support for experimental filament exchange support M600; requires display -#ifdef ULTIPANEL +#if ENABLED(ULTIPANEL) //#define FILAMENTCHANGEENABLE - #ifdef FILAMENTCHANGEENABLE + #if ENABLED(FILAMENTCHANGEENABLE) #define FILAMENTCHANGE_XPOS 3 #define FILAMENTCHANGE_YPOS 3 #define FILAMENTCHANGE_ZADD 10 @@ -469,7 +469,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // @section tmc //#define HAVE_TMCDRIVER -#ifdef HAVE_TMCDRIVER +#if ENABLED(HAVE_TMCDRIVER) // #define X_IS_TMC #define X_MAX_CURRENT 1000 //in mA @@ -531,7 +531,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // @section l6470 //#define HAVE_L6470DRIVER -#ifdef HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) // #define X_IS_L6470 #define X_MICROSTEPS 16 //number of microsteps diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index b6bd644b4..9e8b86c1f 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -9,21 +9,21 @@ /** * Dual Stepper Drivers */ - #if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Y_DUAL_STEPPER_DRIVERS) + #if ENABLED(Z_DUAL_STEPPER_DRIVERS) && ENABLED(Y_DUAL_STEPPER_DRIVERS) #error You cannot have dual stepper drivers for both Y and Z. #endif /** * Progress Bar */ - #ifdef LCD_PROGRESS_BAR - #ifndef SDSUPPORT + #if ENABLED(LCD_PROGRESS_BAR) + #if DISABLED(SDSUPPORT) #error LCD_PROGRESS_BAR requires SDSUPPORT. #endif - #ifdef DOGLCD + #if ENABLED(DOGLCD) #error LCD_PROGRESS_BAR does not apply to graphical displays. #endif - #ifdef FILAMENT_LCD_DISPLAY + #if ENABLED(FILAMENT_LCD_DISPLAY) #error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both. #endif #endif @@ -31,14 +31,14 @@ /** * Babystepping */ - #ifdef BABYSTEPPING - #ifdef COREXY + #if ENABLED(BABYSTEPPING) + #if ENABLED(COREXY) #error BABYSTEPPING not implemented for COREXY yet. #endif - #ifdef SCARA + #if ENABLED(SCARA) #error BABYSTEPPING is not implemented for SCARA yet. #endif - #if defined(DELTA) && defined(BABYSTEP_XY) + #if ENABLED(DELTA) && ENABLED(BABYSTEP_XY) #error BABYSTEPPING only implemented for Z axis on deltabots. #endif #endif @@ -46,7 +46,7 @@ /** * Filament Change with Extruder Runout Prevention */ - #if defined(FILAMENTCHANGEENABLE) && defined(EXTRUDER_RUNOUT_PREVENT) + #if ENABLED(FILAMENTCHANGEENABLE) && ENABLED(EXTRUDER_RUNOUT_PREVENT) #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE. #endif @@ -59,19 +59,19 @@ #error The maximum number of EXTRUDERS in Marlin is 4. #endif - #ifdef TEMP_SENSOR_1_AS_REDUNDANT + #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) #error EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT. #endif - #ifdef HEATERS_PARALLEL + #if ENABLED(HEATERS_PARALLEL) #error EXTRUDERS must be 1 with HEATERS_PARALLEL. #endif - #ifdef Y_DUAL_STEPPER_DRIVERS + #if ENABLED(Y_DUAL_STEPPER_DRIVERS) #error EXTRUDERS must be 1 with Y_DUAL_STEPPER_DRIVERS. #endif - #ifdef Z_DUAL_STEPPER_DRIVERS + #if ENABLED(Z_DUAL_STEPPER_DRIVERS) #error EXTRUDERS must be 1 with Z_DUAL_STEPPER_DRIVERS. #endif @@ -98,25 +98,25 @@ /** * Servo deactivation depends on servo endstops */ - #if defined(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_SERVO_ENDSTOPS + #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_SERVO_ENDSTOPS #error At least one of the ?_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE. #endif /** * Required LCD language */ - #if !defined(DOGLCD) && defined(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780_JAPAN) && !defined(DISPLAY_CHARSET_HD44780_WESTERN)&& !defined(DISPLAY_CHARSET_HD44780_CYRILLIC) + #if DISABLED(DOGLCD) && ENABLED(ULTRA_LCD) && DISABLED(DISPLAY_CHARSET_HD44780_JAPAN) && DISABLED(DISPLAY_CHARSET_HD44780_WESTERN) && DISABLED(DISPLAY_CHARSET_HD44780_CYRILLIC) #error You must enable either DISPLAY_CHARSET_HD44780_JAPAN or DISPLAY_CHARSET_HD44780_WESTERN or DISPLAY_CHARSET_HD44780_CYRILLIC for your LCD controller. #endif /** * Mesh Bed Leveling */ - #ifdef MESH_BED_LEVELING - #ifdef DELTA + #if ENABLED(MESH_BED_LEVELING) + #if ENABLED(DELTA) #error MESH_BED_LEVELING does not yet support DELTA printers. #endif - #ifdef ENABLE_AUTO_BED_LEVELING + #if ENABLED(ENABLE_AUTO_BED_LEVELING) #error Select ENABLE_AUTO_BED_LEVELING or MESH_BED_LEVELING, not both. #endif #if MESH_NUM_X_POINTS > 7 || MESH_NUM_Y_POINTS > 7 @@ -127,14 +127,14 @@ /** * Auto Bed Leveling */ - #ifdef ENABLE_AUTO_BED_LEVELING + #if ENABLED(ENABLE_AUTO_BED_LEVELING) /** * Require a Z Min pin */ #if Z_MIN_PIN == -1 - #if Z_PROBE_PIN == -1 || (!defined(Z_PROBE_ENDSTOP) || defined(DISABLE_Z_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z Probe, but not enable it. - #ifdef Z_PROBE_REPEATABILITY_TEST + #if Z_PROBE_PIN == -1 || (DISABLED(Z_PROBE_ENDSTOP) || ENABLED(DISABLE_Z_PROBE_ENDSTOP)) // It's possible for someone to set a pin for the Z Probe, but not enable it. + #if ENABLED(Z_PROBE_REPEATABILITY_TEST) #error You must have a Z_MIN or Z_PROBE endstop to enable Z_PROBE_REPEATABILITY_TEST. #else #error ENABLE_AUTO_BED_LEVELING requires a Z_MIN or Z_PROBE endstop. Z_MIN_PIN or Z_PROBE_PIN must point to a valid hardware pin. @@ -145,7 +145,7 @@ /** * Require a Z Probe Pin if Z_PROBE_ENDSTOP is enabled. */ - #if defined(Z_PROBE_ENDSTOP) + #if ENABLED(Z_PROBE_ENDSTOP) #ifndef Z_PROBE_PIN #error You must have a Z_PROBE_PIN defined in your pins_XXXX.h file if you enable Z_PROBE_ENDSTOP. #endif @@ -169,7 +169,7 @@ /** * Check if Probe_Offset * Grid Points is greater than Probing Range */ - #ifdef AUTO_BED_LEVELING_GRID + #if ENABLED(AUTO_BED_LEVELING_GRID) #ifndef DELTA_PROBABLE_RADIUS // Be sure points are in the right order #if LEFT_PROBE_BED_POSITION > RIGHT_PROBE_BED_POSITION @@ -212,26 +212,26 @@ /** * ULTIPANEL encoder */ - #if defined(ULTIPANEL) && !defined(NEWPANEL) && !defined(SR_LCD_2W_NL) && !defined(SHIFT_CLK) + #if ENABLED(ULTIPANEL) && DISABLED(NEWPANEL) && DISABLED(SR_LCD_2W_NL) && !defined(SHIFT_CLK) #error ULTIPANEL requires some kind of encoder. #endif /** * Delta has limited bed leveling options */ - #ifdef DELTA + #if ENABLED(DELTA) - #ifdef ENABLE_AUTO_BED_LEVELING + #if ENABLED(ENABLE_AUTO_BED_LEVELING) - #ifndef AUTO_BED_LEVELING_GRID + #if DISABLED(AUTO_BED_LEVELING_GRID) #error Only AUTO_BED_LEVELING_GRID is supported with DELTA. #endif - #ifdef Z_PROBE_SLED + #if ENABLED(Z_PROBE_SLED) #error You cannot use Z_PROBE_SLED with DELTA. #endif - #ifdef Z_PROBE_REPEATABILITY_TEST + #if ENABLED(Z_PROBE_REPEATABILITY_TEST) #error Z_PROBE_REPEATABILITY_TEST is not supported with DELTA yet. #endif @@ -242,15 +242,15 @@ /** * Allen Key Z Probe requires Auto Bed Leveling grid and Delta */ - #if defined(Z_PROBE_ALLEN_KEY) && !(defined(AUTO_BED_LEVELING_GRID) && defined(DELTA)) + #if ENABLED(Z_PROBE_ALLEN_KEY) && !(ENABLED(AUTO_BED_LEVELING_GRID) && ENABLED(DELTA)) #error Invalid use of Z_PROBE_ALLEN_KEY. #endif /** * Dual X Carriage requirements */ - #ifdef DUAL_X_CARRIAGE - #if EXTRUDERS == 1 || defined(COREXY) \ + #if ENABLED(DUAL_X_CARRIAGE) + #if EXTRUDERS == 1 || ENABLED(COREXY) \ || !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR \ || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \ || !HAS_X_MAX @@ -311,7 +311,7 @@ #endif #endif - #if EXTRUDERS > 1 || defined(HEATERS_PARALLEL) + #if EXTRUDERS > 1 || ENABLED(HEATERS_PARALLEL) #if !HAS_HEATER_1 #error HEATER_1_PIN not defined for this board. #endif @@ -346,11 +346,11 @@ #error WATCH_TEMP_PERIOD now uses seconds instead of milliseconds. #endif - #if !defined(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD)) + #if DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD)) #error Thermal Runaway Protection for hotends must now be enabled with THERMAL_PROTECTION_HOTENDS. #endif - #if !defined(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD) + #if DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD) #error Thermal Runaway Protection for the bed must now be enabled with THERMAL_PROTECTION_BED. #endif diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index c441c2467..dfcfaebee 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated: // @section info -#ifdef HAS_AUTOMATIC_VERSIONING +#if ENABLED(HAS_AUTOMATIC_VERSIONING) #include "_Version.h" #else #include "Default_Version.h" @@ -195,7 +195,7 @@ Here are some standard links for getting your machine calibrated: #define PIDTEMP #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay @@ -248,7 +248,7 @@ Here are some standard links for getting your machine calibrated: //#define PID_BED_DEBUG // Sends debug data to the serial port. -#ifdef PIDTEMPBED +#if ENABLED(PIDTEMPBED) #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term @@ -318,7 +318,7 @@ Here are some standard links for getting your machine calibrated: // coarse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors -#ifndef ENDSTOPPULLUPS +#if DISABLED(ENDSTOPPULLUPS) // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined // #define ENDSTOPPULLUP_XMAX // #define ENDSTOPPULLUP_YMAX @@ -408,7 +408,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -#ifdef FILAMENT_RUNOUT_SENSOR +#if ENABLED(FILAMENT_RUNOUT_SENSOR) const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" @@ -421,11 +421,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#ifdef MANUAL_BED_LEVELING +#if ENABLED(MANUAL_BED_LEVELING) #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis #endif // MANUAL_BED_LEVELING -#ifdef MESH_BED_LEVELING +#if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -444,7 +444,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line) #define Z_PROBE_REPEATABILITY_TEST // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled. -#ifdef ENABLE_AUTO_BED_LEVELING +#if ENABLED(ENABLE_AUTO_BED_LEVELING) // There are 2 different ways to specify probing locations // @@ -461,7 +461,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Note: this feature generates 10KB extra code size #define AUTO_BED_LEVELING_GRID - #ifdef AUTO_BED_LEVELING_GRID + #if ENABLED(AUTO_BED_LEVELING_GRID) #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 @@ -518,7 +518,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // - Position the probe in a defined XY point before Z Homing when homing all axis (G28) // - Block Z homing only when the probe is outside bed area. - #ifdef Z_SAFE_HOMING + #if ENABLED(Z_SAFE_HOMING) #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28) #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28) @@ -550,7 +550,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Manual homing switch locations: // For deltabots this means top and center of the Cartesian print volume. -#ifdef MANUAL_HOME_POSITIONS +#if ENABLED(MANUAL_HOME_POSITIONS) #define MANUAL_X_HOME_POS 0 #define MANUAL_Y_HOME_POS 0 #define MANUAL_Z_HOME_POS 0 @@ -589,8 +589,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Custom M code points #define CUSTOM_M_CODES -#ifdef CUSTOM_M_CODES - #ifdef ENABLE_AUTO_BED_LEVELING +#if ENABLED(CUSTOM_M_CODES) + #if ENABLED(ENABLE_AUTO_BED_LEVELING) #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 @@ -607,7 +607,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //define this to enable EEPROM support //#define EEPROM_SETTINGS -#ifdef EEPROM_SETTINGS +#if ENABLED(EEPROM_SETTINGS) // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: #define EEPROM_CHITCHAT // Please keep turned on if you can. #endif @@ -796,7 +796,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#ifdef DEACTIVATE_SERVOS_AFTER_MOVE +#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) // Delay (in microseconds) before turning the servo off. This depends on the servo speed. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. diff --git a/Marlin/configurator/config/Configuration_adv.h b/Marlin/configurator/config/Configuration_adv.h index e6c954d58..94d96d01a 100644 --- a/Marlin/configurator/config/Configuration_adv.h +++ b/Marlin/configurator/config/Configuration_adv.h @@ -9,7 +9,7 @@ //=============================Thermal Settings ============================ //=========================================================================== -#ifdef BED_LIMIT_SWITCHING +#if ENABLED(BED_LIMIT_SWITCHING) #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS #endif #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control @@ -17,7 +17,7 @@ /** * Thermal Protection parameters */ -#ifdef THERMAL_PROTECTION_HOTENDS +#if ENABLED(THERMAL_PROTECTION_HOTENDS) #define THERMAL_PROTECTION_PERIOD 40 // Seconds #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius @@ -31,16 +31,16 @@ #define WATCH_TEMP_INCREASE 4 // Degrees Celsius #endif -#ifdef THERMAL_PROTECTION_BED +#if ENABLED(THERMAL_PROTECTION_BED) #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius #endif -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. #define PID_ADD_EXTRUSION_RATE - #ifdef PID_ADD_EXTRUSION_RATE + #if ENABLED(PID_ADD_EXTRUSION_RATE) #define DEFAULT_Kc (1) //heating power=Kc*(e_speed) #endif #endif @@ -56,7 +56,7 @@ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode */ #define AUTOTEMP -#ifdef AUTOTEMP +#if ENABLED(AUTOTEMP) #define AUTOTEMP_OLDWEIGHT 0.98 #endif @@ -133,7 +133,7 @@ // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. //#define Z_DUAL_STEPPER_DRIVERS -#ifdef Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper. // That way the machine is capable to align the bed during home, since both Z steppers are homed. @@ -150,7 +150,7 @@ // #define Z_DUAL_ENDSTOPS - #ifdef Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) const bool Z2_MAX_ENDSTOP_INVERTING = false; #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. @@ -169,7 +169,7 @@ // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage // allowing faster printing speeds. //#define DUAL_X_CARRIAGE -#ifdef DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. @@ -240,7 +240,7 @@ // @section lcd -#ifdef ULTIPANEL +#if ENABLED(ULTIPANEL) #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder #endif @@ -289,7 +289,7 @@ // @section lcd -#ifdef SDSUPPORT +#if ENABLED(SDSUPPORT) // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT @@ -310,7 +310,7 @@ // Show a progress bar on HD44780 LCDs for SD printing //#define LCD_PROGRESS_BAR - #ifdef LCD_PROGRESS_BAR + #if ENABLED(LCD_PROGRESS_BAR) // Amount of time (ms) to show the bar #define PROGRESS_BAR_BAR_TIME 2000 // Amount of time (ms) to show the status message @@ -333,7 +333,7 @@ #endif // SDSUPPORT // for dogm lcd displays you can choose some additional fonts: -#ifdef DOGLCD +#if ENABLED(DOGLCD) // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT // we don't have a big font for Cyrillic, Kana //#define USE_BIG_EDIT_FONT @@ -348,7 +348,7 @@ // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG -#ifdef USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on. // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset. // However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled. @@ -361,7 +361,7 @@ // it can e.g. be used to change z-positions in the print startup phase in real-time // does not respect endstops! //#define BABYSTEPPING -#ifdef BABYSTEPPING +#if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements @@ -378,7 +378,7 @@ // so: v ^ 2 is proportional to number of steps we advance the extruder //#define ADVANCE -#ifdef ADVANCE +#if ENABLED(ADVANCE) #define EXTRUDER_ADVANCE_K .0 #define D_FILAMENT 2.85 #define STEPS_MM_E 836 @@ -405,7 +405,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. -#ifdef SDSUPPORT +#if ENABLED(SDSUPPORT) #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller #else #define BLOCK_BUFFER_SIZE 16 // maximize block buffer @@ -435,7 +435,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // the moves are than replaced by the firmware controlled ones. // #define FWRETRACT //ONLY PARTIALLY TESTED -#ifdef FWRETRACT +#if ENABLED(FWRETRACT) #define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt #define RETRACT_LENGTH 3 //default retract length (positive mm) #define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change @@ -447,9 +447,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st #endif // Add support for experimental filament exchange support M600; requires display -#ifdef ULTIPANEL +#if ENABLED(ULTIPANEL) //#define FILAMENTCHANGEENABLE - #ifdef FILAMENTCHANGEENABLE + #if ENABLED(FILAMENTCHANGEENABLE) #define FILAMENTCHANGE_XPOS 3 #define FILAMENTCHANGE_YPOS 3 #define FILAMENTCHANGE_ZADD 10 @@ -469,7 +469,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // @section tmc //#define HAVE_TMCDRIVER -#ifdef HAVE_TMCDRIVER +#if ENABLED(HAVE_TMCDRIVER) // #define X_IS_TMC #define X_MAX_CURRENT 1000 //in mA @@ -531,7 +531,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // @section l6470 //#define HAVE_L6470DRIVER -#ifdef HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) // #define X_IS_L6470 #define X_MICROSTEPS 16 //number of microsteps diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 5d7918dc1..ff5a0f0e7 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated: // @section info -#ifdef HAS_AUTOMATIC_VERSIONING +#if ENABLED(HAS_AUTOMATIC_VERSIONING) #include "_Version.h" #else #include "Default_Version.h" @@ -195,7 +195,7 @@ Here are some standard links for getting your machine calibrated: #define PIDTEMP #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay @@ -237,7 +237,7 @@ Here are some standard links for getting your machine calibrated: //#define PID_BED_DEBUG // Sends debug data to the serial port. -#ifdef PIDTEMPBED +#if ENABLED(PIDTEMPBED) #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term @@ -390,7 +390,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -#ifdef FILAMENT_RUNOUT_SENSOR +#if ENABLED(FILAMENT_RUNOUT_SENSOR) const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" @@ -403,11 +403,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#ifdef MANUAL_BED_LEVELING +#if ENABLED(MANUAL_BED_LEVELING) #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis #endif // MANUAL_BED_LEVELING -#ifdef MESH_BED_LEVELING +#if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -426,7 +426,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line) //#define Z_PROBE_REPEATABILITY_TEST // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled. -#ifdef ENABLE_AUTO_BED_LEVELING +#if ENABLED(ENABLE_AUTO_BED_LEVELING) // There are 2 different ways to specify probing locations // @@ -443,7 +443,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Note: this feature generates 10KB extra code size #define AUTO_BED_LEVELING_GRID - #ifdef AUTO_BED_LEVELING_GRID + #if ENABLED(AUTO_BED_LEVELING_GRID) #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 @@ -500,7 +500,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // - Position the probe in a defined XY point before Z Homing when homing all axis (G28) // - Block Z homing only when the probe is outside bed area. - #ifdef Z_SAFE_HOMING + #if ENABLED(Z_SAFE_HOMING) #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28) #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28) @@ -532,7 +532,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Manual homing switch locations: // For deltabots this means top and center of the Cartesian print volume. -#ifdef MANUAL_HOME_POSITIONS +#if ENABLED(MANUAL_HOME_POSITIONS) #define MANUAL_X_HOME_POS 0 #define MANUAL_Y_HOME_POS 0 #define MANUAL_Z_HOME_POS 0 @@ -572,8 +572,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Custom M code points #define CUSTOM_M_CODES -#ifdef CUSTOM_M_CODES - #ifdef ENABLE_AUTO_BED_LEVELING +#if ENABLED(CUSTOM_M_CODES) + #if ENABLED(ENABLE_AUTO_BED_LEVELING) #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 @@ -590,7 +590,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //define this to enable EEPROM support //#define EEPROM_SETTINGS -#ifdef EEPROM_SETTINGS +#if ENABLED(EEPROM_SETTINGS) // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: #define EEPROM_CHITCHAT // Please keep turned on if you can. #endif @@ -774,7 +774,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#ifdef DEACTIVATE_SERVOS_AFTER_MOVE +#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) // Delay (in microseconds) before turning the servo off. This depends on the servo speed. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index 581a0ab48..a11017815 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated: // @section info -#ifdef HAS_AUTOMATIC_VERSIONING +#if ENABLED(HAS_AUTOMATIC_VERSIONING) #include "_Version.h" #else #include "Default_Version.h" @@ -184,7 +184,7 @@ Here are some standard links for getting your machine calibrated: #define PIDTEMP #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay @@ -226,7 +226,7 @@ Here are some standard links for getting your machine calibrated: //#define PID_BED_DEBUG // Sends debug data to the serial port. -#ifdef PIDTEMPBED +#if ENABLED(PIDTEMPBED) // Felix Foil Heater #define DEFAULT_bedKp 103.37 #define DEFAULT_bedKi 2.79 @@ -353,7 +353,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -#ifdef FILAMENT_RUNOUT_SENSOR +#if ENABLED(FILAMENT_RUNOUT_SENSOR) const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" @@ -366,7 +366,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#ifdef MESH_BED_LEVELING +#if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -383,7 +383,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line) //#define Z_PROBE_REPEATABILITY_TEST // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled. -#ifdef ENABLE_AUTO_BED_LEVELING +#if ENABLED(ENABLE_AUTO_BED_LEVELING) // There are 2 different ways to specify probing locations // @@ -400,7 +400,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Note: this feature generates 10KB extra code size #define AUTO_BED_LEVELING_GRID - #ifdef AUTO_BED_LEVELING_GRID + #if ENABLED(AUTO_BED_LEVELING_GRID) #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 @@ -461,7 +461,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // - Position the probe in a defined XY point before Z Homing when homing all axis (G28) // - Block Z homing only when the probe is outside bed area. - #ifdef Z_SAFE_HOMING + #if ENABLED(Z_SAFE_HOMING) #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28) #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28) @@ -491,7 +491,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Manual homing switch locations: // For deltabots this means top and center of the Cartesian print volume. -#ifdef MANUAL_HOME_POSITIONS +#if ENABLED(MANUAL_HOME_POSITIONS) #define MANUAL_X_HOME_POS 0 #define MANUAL_Y_HOME_POS 0 #define MANUAL_Z_HOME_POS 0 @@ -533,8 +533,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Custom M code points #define CUSTOM_M_CODES -#ifdef CUSTOM_M_CODES - #ifdef ENABLE_AUTO_BED_LEVELING +#if ENABLED(CUSTOM_M_CODES) + #if ENABLED(ENABLE_AUTO_BED_LEVELING) #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 @@ -550,7 +550,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //define this to enable EEPROM support //#define EEPROM_SETTINGS -#ifdef EEPROM_SETTINGS +#if ENABLED(EEPROM_SETTINGS) // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: #define EEPROM_CHITCHAT // please keep turned on if you can. #endif diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 29a2cf7e2..9da7c6093 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -9,7 +9,7 @@ //=============================Thermal Settings ============================ //=========================================================================== -#ifdef BED_LIMIT_SWITCHING +#if ENABLED(BED_LIMIT_SWITCHING) #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS #endif #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control @@ -17,7 +17,7 @@ /** * Thermal Protection parameters */ -#ifdef THERMAL_PROTECTION_HOTENDS +#if ENABLED(THERMAL_PROTECTION_HOTENDS) #define THERMAL_PROTECTION_PERIOD 40 // Seconds #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius @@ -31,7 +31,7 @@ #define WATCH_TEMP_INCREASE 4 // Degrees Celsius #endif -#ifdef THERMAL_PROTECTION_BED +#if ENABLED(THERMAL_PROTECTION_BED) #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius #endif @@ -46,11 +46,11 @@ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode */ -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. #define PID_ADD_EXTRUSION_RATE - #ifdef PID_ADD_EXTRUSION_RATE + #if ENABLED(PID_ADD_EXTRUSION_RATE) #define DEFAULT_Kc (1) //heating power=Kc*(e_speed) #endif #endif @@ -64,7 +64,7 @@ // Also, if the temperature is set to a value target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS #endif #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control @@ -17,7 +17,7 @@ /** * Thermal Protection parameters */ -#ifdef THERMAL_PROTECTION_HOTENDS +#if ENABLED(THERMAL_PROTECTION_HOTENDS) #define THERMAL_PROTECTION_PERIOD 40 // Seconds #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius @@ -31,7 +31,7 @@ #define WATCH_TEMP_INCREASE 4 // Degrees Celsius #endif -#ifdef THERMAL_PROTECTION_BED +#if ENABLED(THERMAL_PROTECTION_BED) #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius #endif @@ -46,11 +46,11 @@ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode */ -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. #define PID_ADD_EXTRUSION_RATE - #ifdef PID_ADD_EXTRUSION_RATE + #if ENABLED(PID_ADD_EXTRUSION_RATE) #define DEFAULT_Kc (1) //heating power=Kc*(e_speed) #endif #endif @@ -64,7 +64,7 @@ // Also, if the temperature is set to a value target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS #endif #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control @@ -17,7 +17,7 @@ /** * Thermal Protection parameters */ -#ifdef THERMAL_PROTECTION_HOTENDS +#if ENABLED(THERMAL_PROTECTION_HOTENDS) #define THERMAL_PROTECTION_PERIOD 40 // Seconds #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius @@ -31,7 +31,7 @@ #define WATCH_TEMP_INCREASE 4 // Degrees Celsius #endif -#ifdef THERMAL_PROTECTION_BED +#if ENABLED(THERMAL_PROTECTION_BED) #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius #endif @@ -46,11 +46,11 @@ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode */ -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. #define PID_ADD_EXTRUSION_RATE - #ifdef PID_ADD_EXTRUSION_RATE + #if ENABLED(PID_ADD_EXTRUSION_RATE) #define DEFAULT_Kc (1) //heating power=Kc*(e_speed) #endif #endif @@ -64,7 +64,7 @@ // Also, if the temperature is set to a value target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS #endif #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control @@ -17,7 +17,7 @@ /** * Thermal Protection parameters */ -#ifdef THERMAL_PROTECTION_HOTENDS +#if ENABLED(THERMAL_PROTECTION_HOTENDS) #define THERMAL_PROTECTION_PERIOD 40 // Seconds #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius @@ -31,16 +31,16 @@ #define WATCH_TEMP_INCREASE 4 // Degrees Celsius #endif -#ifdef THERMAL_PROTECTION_BED +#if ENABLED(THERMAL_PROTECTION_BED) #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius #endif -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. #define PID_ADD_EXTRUSION_RATE - #ifdef PID_ADD_EXTRUSION_RATE + #if ENABLED(PID_ADD_EXTRUSION_RATE) #define DEFAULT_Kc (1) //heating power=Kc*(e_speed) #endif #endif @@ -56,7 +56,7 @@ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode */ #define AUTOTEMP -#ifdef AUTOTEMP +#if ENABLED(AUTOTEMP) #define AUTOTEMP_OLDWEIGHT 0.98 #endif @@ -133,7 +133,7 @@ // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. //#define Z_DUAL_STEPPER_DRIVERS -#ifdef Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper. // That way the machine is capable to align the bed during home, since both Z steppers are homed. @@ -150,7 +150,7 @@ // #define Z_DUAL_ENDSTOPS - #ifdef Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) #define Z2_MAX_PIN 36 //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36) const bool Z2_MAX_ENDSTOP_INVERTING = false; #define DISABLE_XMAX_ENDSTOP //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis. @@ -169,7 +169,7 @@ // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage // allowing faster printing speeds. //#define DUAL_X_CARRIAGE -#ifdef DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. @@ -240,7 +240,7 @@ // @section lcd -#ifdef ULTIPANEL +#if ENABLED(ULTIPANEL) #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder #endif @@ -289,7 +289,7 @@ // @section lcd -#ifdef SDSUPPORT +#if ENABLED(SDSUPPORT) // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT @@ -310,7 +310,7 @@ // Show a progress bar on HD44780 LCDs for SD printing //#define LCD_PROGRESS_BAR - #ifdef LCD_PROGRESS_BAR + #if ENABLED(LCD_PROGRESS_BAR) // Amount of time (ms) to show the bar #define PROGRESS_BAR_BAR_TIME 2000 // Amount of time (ms) to show the status message @@ -333,7 +333,7 @@ #endif // SDSUPPORT // for dogm lcd displays you can choose some additional fonts: -#ifdef DOGLCD +#if ENABLED(DOGLCD) // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT // we don't have a big font for Cyrillic, Kana //#define USE_BIG_EDIT_FONT @@ -348,7 +348,7 @@ // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG -#ifdef USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on. // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset. // However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled. @@ -361,7 +361,7 @@ // it can e.g. be used to change z-positions in the print startup phase in real-time // does not respect endstops! //#define BABYSTEPPING -#ifdef BABYSTEPPING +#if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements @@ -378,7 +378,7 @@ // so: v ^ 2 is proportional to number of steps we advance the extruder //#define ADVANCE -#ifdef ADVANCE +#if ENABLED(ADVANCE) #define EXTRUDER_ADVANCE_K .0 #define D_FILAMENT 1.75 #define STEPS_MM_E 836 @@ -405,7 +405,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering. -#ifdef SDSUPPORT +#if ENABLED(SDSUPPORT) #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller #else #define BLOCK_BUFFER_SIZE 16 // maximize block buffer @@ -435,7 +435,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // the moves are than replaced by the firmware controlled ones. // #define FWRETRACT //ONLY PARTIALLY TESTED -#ifdef FWRETRACT +#if ENABLED(FWRETRACT) #define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt #define RETRACT_LENGTH 3 //default retract length (positive mm) #define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change @@ -447,9 +447,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st #endif // Add support for experimental filament exchange support M600; requires display -#ifdef ULTIPANEL +#if ENABLED(ULTIPANEL) //#define FILAMENTCHANGEENABLE - #ifdef FILAMENTCHANGEENABLE + #if ENABLED(FILAMENTCHANGEENABLE) #define FILAMENTCHANGE_XPOS 3 #define FILAMENTCHANGE_YPOS 3 #define FILAMENTCHANGE_ZADD 10 @@ -469,7 +469,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // @section tmc //#define HAVE_TMCDRIVER -#ifdef HAVE_TMCDRIVER +#if ENABLED(HAVE_TMCDRIVER) // #define X_IS_TMC #define X_MAX_CURRENT 1000 //in mA @@ -531,7 +531,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // @section l6470 //#define HAVE_L6470DRIVER -#ifdef HAVE_L6470DRIVER +#if ENABLED(HAVE_L6470DRIVER) // #define X_IS_L6470 #define X_MICROSTEPS 16 //number of microsteps diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index c889dd73f..41304db43 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -63,7 +63,7 @@ Here are some standard links for getting your machine calibrated: // @section info -#ifdef HAS_AUTOMATIC_VERSIONING +#if ENABLED(HAS_AUTOMATIC_VERSIONING) #include "_Version.h" #else #include "Default_Version.h" @@ -220,7 +220,7 @@ Here are some standard links for getting your machine calibrated: #define PIDTEMP #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay @@ -262,7 +262,7 @@ Here are some standard links for getting your machine calibrated: //#define PID_BED_DEBUG // Sends debug data to the serial port. -#ifdef PIDTEMPBED +#if ENABLED(PIDTEMPBED) #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term @@ -416,7 +416,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -#ifdef FILAMENT_RUNOUT_SENSOR +#if ENABLED(FILAMENT_RUNOUT_SENSOR) const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" @@ -429,11 +429,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#ifdef MANUAL_BED_LEVELING +#if ENABLED(MANUAL_BED_LEVELING) #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis #endif // MANUAL_BED_LEVELING -#ifdef MESH_BED_LEVELING +#if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -452,7 +452,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line) #define Z_PROBE_REPEATABILITY_TEST // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled. -#ifdef ENABLE_AUTO_BED_LEVELING +#if ENABLED(ENABLE_AUTO_BED_LEVELING) // There are 2 different ways to specify probing locations // @@ -469,7 +469,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Note: this feature generates 10KB extra code size #define AUTO_BED_LEVELING_GRID - #ifdef AUTO_BED_LEVELING_GRID + #if ENABLED(AUTO_BED_LEVELING_GRID) #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 @@ -526,7 +526,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // - Position the probe in a defined XY point before Z Homing when homing all axis (G28) // - Block Z homing only when the probe is outside bed area. - #ifdef Z_SAFE_HOMING + #if ENABLED(Z_SAFE_HOMING) #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28) #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28) @@ -558,7 +558,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Manual homing switch locations: // For deltabots this means top and center of the Cartesian print volume. -#ifdef MANUAL_HOME_POSITIONS +#if ENABLED(MANUAL_HOME_POSITIONS) // For SCARA: Offset between HomingPosition and Bed X=0 / Y=0 #define MANUAL_X_HOME_POS -22. #define MANUAL_Y_HOME_POS -52. @@ -597,8 +597,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Custom M code points //#define CUSTOM_M_CODES -#ifdef CUSTOM_M_CODES - #ifdef ENABLE_AUTO_BED_LEVELING +#if ENABLED(CUSTOM_M_CODES) + #if ENABLED(ENABLE_AUTO_BED_LEVELING) #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 @@ -615,7 +615,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //define this to enable EEPROM support //#define EEPROM_SETTINGS -#ifdef EEPROM_SETTINGS +#if ENABLED(EEPROM_SETTINGS) // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: #define EEPROM_CHITCHAT // Please keep turned on if you can. #endif @@ -799,7 +799,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#ifdef DEACTIVATE_SERVOS_AFTER_MOVE +#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) // Delay (in microseconds) before turning the servo off. This depends on the servo speed. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 399c65ca5..8fa955e37 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -9,7 +9,7 @@ //=============================Thermal Settings ============================ //=========================================================================== -#ifdef BED_LIMIT_SWITCHING +#if ENABLED(BED_LIMIT_SWITCHING) #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS #endif #define BED_CHECK_INTERVAL 3000 //ms between checks in bang-bang control @@ -17,7 +17,7 @@ /** * Thermal Protection parameters */ -#ifdef THERMAL_PROTECTION_HOTENDS +#if ENABLED(THERMAL_PROTECTION_HOTENDS) #define THERMAL_PROTECTION_PERIOD 40 // Seconds #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius @@ -31,7 +31,7 @@ #define WATCH_TEMP_INCREASE 4 // Degrees Celsius #endif -#ifdef THERMAL_PROTECTION_BED +#if ENABLED(THERMAL_PROTECTION_BED) #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius #endif @@ -46,11 +46,11 @@ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode */ -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. #define PID_ADD_EXTRUSION_RATE - #ifdef PID_ADD_EXTRUSION_RATE + #if ENABLED(PID_ADD_EXTRUSION_RATE) #define DEFAULT_Kc (1) //heating power=Kc*(e_speed) #endif #endif @@ -64,7 +64,7 @@ // Also, if the temperature is set to a value target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS #endif #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control @@ -17,7 +17,7 @@ /** * Thermal Protection parameters */ -#ifdef THERMAL_PROTECTION_HOTENDS +#if ENABLED(THERMAL_PROTECTION_HOTENDS) #define THERMAL_PROTECTION_PERIOD 40 // Seconds #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius @@ -31,7 +31,7 @@ #define WATCH_TEMP_INCREASE 4 // Degrees Celsius #endif -#ifdef THERMAL_PROTECTION_BED +#if ENABLED(THERMAL_PROTECTION_BED) #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius #endif @@ -46,11 +46,11 @@ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode */ -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. #define PID_ADD_EXTRUSION_RATE - #ifdef PID_ADD_EXTRUSION_RATE + #if ENABLED(PID_ADD_EXTRUSION_RATE) #define DEFAULT_Kc (1) //heating power=Kc*(e_speed) #endif #endif @@ -64,7 +64,7 @@ // Also, if the temperature is set to a value target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS #endif #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control @@ -17,7 +17,7 @@ /** * Thermal Protection parameters */ -#ifdef THERMAL_PROTECTION_HOTENDS +#if ENABLED(THERMAL_PROTECTION_HOTENDS) #define THERMAL_PROTECTION_PERIOD 40 // Seconds #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius @@ -31,7 +31,7 @@ #define WATCH_TEMP_INCREASE 4 // Degrees Celsius #endif -#ifdef THERMAL_PROTECTION_BED +#if ENABLED(THERMAL_PROTECTION_BED) #define THERMAL_PROTECTION_BED_PERIOD 120 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 4 // Degrees Celsius #endif @@ -46,11 +46,11 @@ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode */ -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. #define PID_ADD_EXTRUSION_RATE - #ifdef PID_ADD_EXTRUSION_RATE + #if ENABLED(PID_ADD_EXTRUSION_RATE) #define DEFAULT_Kc (1) //heating power=Kc*(e_speed) #endif #endif @@ -64,7 +64,7 @@ // Also, if the temperature is set to a value target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS #endif #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control @@ -17,7 +17,7 @@ /** * Thermal Protection parameters */ -#ifdef THERMAL_PROTECTION_HOTENDS +#if ENABLED(THERMAL_PROTECTION_HOTENDS) #define THERMAL_PROTECTION_PERIOD 40 // Seconds #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius @@ -31,7 +31,7 @@ #define WATCH_TEMP_INCREASE 4 // Degrees Celsius #endif -#ifdef THERMAL_PROTECTION_BED +#if ENABLED(THERMAL_PROTECTION_BED) #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius #endif @@ -46,11 +46,11 @@ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode */ -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. #define PID_ADD_EXTRUSION_RATE - #ifdef PID_ADD_EXTRUSION_RATE + #if ENABLED(PID_ADD_EXTRUSION_RATE) #define DEFAULT_Kc (1) //heating power=Kc*(e_speed) #endif #endif @@ -64,7 +64,7 @@ // Also, if the temperature is set to a value target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS #endif #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control @@ -17,7 +17,7 @@ /** * Thermal Protection parameters */ -#ifdef THERMAL_PROTECTION_HOTENDS +#if ENABLED(THERMAL_PROTECTION_HOTENDS) #define THERMAL_PROTECTION_PERIOD 40 // Seconds #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius @@ -31,7 +31,7 @@ #define WATCH_TEMP_INCREASE 4 // Degrees Celsius #endif -#ifdef THERMAL_PROTECTION_BED +#if ENABLED(THERMAL_PROTECTION_BED) #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius #endif @@ -46,11 +46,11 @@ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode */ -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. #define PID_ADD_EXTRUSION_RATE - #ifdef PID_ADD_EXTRUSION_RATE + #if ENABLED(PID_ADD_EXTRUSION_RATE) #define DEFAULT_Kc (1) //heating power=Kc*(e_speed) #endif #endif @@ -64,7 +64,7 @@ // Also, if the temperature is set to a value target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS #endif #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control @@ -21,7 +21,7 @@ /** * Thermal Protection parameters */ -#ifdef THERMAL_PROTECTION_HOTENDS +#if ENABLED(THERMAL_PROTECTION_HOTENDS) #define THERMAL_PROTECTION_PERIOD 40 // Seconds #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius @@ -35,16 +35,16 @@ #define WATCH_TEMP_INCREASE 4 // Degrees Celsius #endif -#ifdef THERMAL_PROTECTION_BED +#if ENABLED(THERMAL_PROTECTION_BED) #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius #endif -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. #define PID_ADD_EXTRUSION_RATE - #ifdef PID_ADD_EXTRUSION_RATE + #if ENABLED(PID_ADD_EXTRUSION_RATE) #define DEFAULT_Kc (1) //heating power=Kc*(e_speed) #endif #endif @@ -60,7 +60,7 @@ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode */ #define AUTOTEMP -#ifdef AUTOTEMP +#if ENABLED(AUTOTEMP) #define AUTOTEMP_OLDWEIGHT 0.98 #endif @@ -130,20 +130,20 @@ //// AUTOSET LOCATIONS OF LIMIT SWITCHES //// Added by ZetaPhoenix 09-15-2012 -#ifdef MANUAL_HOME_POSITIONS // Use manual limit switch locations +#if ENABLED(MANUAL_HOME_POSITIONS) // Use manual limit switch locations #define X_HOME_POS MANUAL_X_HOME_POS #define Y_HOME_POS MANUAL_Y_HOME_POS #define Z_HOME_POS MANUAL_Z_HOME_POS #else //Set min/max homing switch positions based upon homing direction and min/max travel limits //X axis #if X_HOME_DIR == -1 - #ifdef BED_CENTER_AT_0_0 + #if ENABLED(BED_CENTER_AT_0_0) #define X_HOME_POS X_MAX_LENGTH * -0.5 #else #define X_HOME_POS X_MIN_POS #endif //BED_CENTER_AT_0_0 #else - #ifdef BED_CENTER_AT_0_0 + #if ENABLED(BED_CENTER_AT_0_0) #define X_HOME_POS X_MAX_LENGTH * 0.5 #else #define X_HOME_POS X_MAX_POS @@ -152,13 +152,13 @@ //Y axis #if Y_HOME_DIR == -1 - #ifdef BED_CENTER_AT_0_0 + #if ENABLED(BED_CENTER_AT_0_0) #define Y_HOME_POS Y_MAX_LENGTH * -0.5 #else #define Y_HOME_POS Y_MIN_POS #endif //BED_CENTER_AT_0_0 #else - #ifdef BED_CENTER_AT_0_0 + #if ENABLED(BED_CENTER_AT_0_0) #define Y_HOME_POS Y_MAX_LENGTH * 0.5 #else #define Y_HOME_POS Y_MAX_POS @@ -184,7 +184,7 @@ // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. //#define Z_DUAL_STEPPER_DRIVERS -#ifdef Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) #undef EXTRUDERS #define EXTRUDERS 1 #endif @@ -195,7 +195,7 @@ // Define if the two Y drives need to rotate in opposite directions #define INVERT_Y2_VS_Y_DIR true -#ifdef Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) #undef EXTRUDERS #define EXTRUDERS 1 #endif @@ -209,7 +209,7 @@ // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage // allowing faster printing speeds. //#define DUAL_X_CARRIAGE -#ifdef DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) // Configuration for second X-carriage // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // the second x-carriage always homes to the maximum endstop. @@ -266,7 +266,7 @@ // @section machine -#ifdef CONFIG_STEPPERS_TOSHIBA +#if ENABLED(CONFIG_STEPPERS_TOSHIBA) #define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers #else #define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step) @@ -285,7 +285,7 @@ // @section lcd -#ifdef ULTIPANEL +#if ENABLED(ULTIPANEL) #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder #endif @@ -338,7 +338,7 @@ // @section lcd -#ifdef SDSUPPORT +#if ENABLED(SDSUPPORT) // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT @@ -357,7 +357,7 @@ // Show a progress bar on HD44780 LCDs for SD printing //#define LCD_PROGRESS_BAR - #ifdef LCD_PROGRESS_BAR + #if ENABLED(LCD_PROGRESS_BAR) // Amount of time (ms) to show the bar #define PROGRESS_BAR_BAR_TIME 2000 // Amount of time (ms) to show the status message @@ -380,7 +380,7 @@ #endif // SDSUPPORT // for dogm lcd displays you can choose some additional fonts: -#ifdef DOGLCD +#if ENABLED(DOGLCD) // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT // we don't have a big font for Cyrillic, Kana //#define USE_BIG_EDIT_FONT @@ -395,7 +395,7 @@ // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. //#define USE_WATCHDOG -#ifdef USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on. // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset. // However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled. @@ -408,18 +408,18 @@ // it can e.g. be used to change z-positions in the print startup phase in real-time // does not respect endstops! //#define BABYSTEPPING -#ifdef BABYSTEPPING +#if ENABLED(BABYSTEPPING) #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements // @section extruder - #ifdef COREXY + #if ENABLED(COREXY) #error BABYSTEPPING not implemented for COREXY yet. #endif - #ifdef DELTA - #ifdef BABYSTEP_XY + #if ENABLED(DELTA) + #if ENABLED(BABYSTEP_XY) #error BABYSTEPPING only implemented for Z axis on deltabots. #endif #endif @@ -434,7 +434,7 @@ // so: v ^ 2 is proportional to number of steps we advance the extruder //#define ADVANCE -#ifdef ADVANCE +#if ENABLED(ADVANCE) #define EXTRUDER_ADVANCE_K .0 #define D_FILAMENT 2.85 @@ -451,7 +451,7 @@ const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement -#ifdef ULTIPANEL +#if ENABLED(ULTIPANEL) #undef SDCARDDETECTINVERTED #endif @@ -512,7 +512,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // the moves are than replaced by the firmware controlled ones. // #define FWRETRACT //ONLY PARTIALLY TESTED -#ifdef FWRETRACT +#if ENABLED(FWRETRACT) #define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt #define RETRACT_LENGTH 3 //default retract length (positive mm) #define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change @@ -524,9 +524,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st #endif // Add support for experimental filament exchange support M600; requires display -#ifdef ULTIPANEL +#if ENABLED(ULTIPANEL) #define FILAMENTCHANGEENABLE - #ifdef FILAMENTCHANGEENABLE + #if ENABLED(FILAMENTCHANGEENABLE) #define FILAMENTCHANGE_XPOS 3 #define FILAMENTCHANGE_YPOS 3 #define FILAMENTCHANGE_ZADD 10 @@ -543,7 +543,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st // @section tmc //#define HAVE_TMCDRIVER -#ifdef HAVE_TMCDRIVER +#if ENABLED(HAVE_TMCDRIVER) // #define X_IS_TMC #define X_MAX_CURRENT 1000 //in mA @@ -597,8 +597,8 @@ const unsigned int dropsegments=5; //everything with less than this number of st #endif -#ifdef FILAMENTCHANGEENABLE - #ifdef EXTRUDER_RUNOUT_PREVENT +#if ENABLED(FILAMENTCHANGEENABLE) + #if ENABLED(EXTRUDER_RUNOUT_PREVENT) #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE #endif #endif diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 13cc50002..9b8ae1f77 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -38,7 +38,7 @@ Here are some standard links for getting your machine calibrated: // @section info -#ifdef HAS_AUTOMATIC_VERSIONING +#if ENABLED(HAS_AUTOMATIC_VERSIONING) #include "_Version.h" #else #include "Default_Version.h" @@ -195,7 +195,7 @@ Here are some standard links for getting your machine calibrated: #define PIDTEMP #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) //#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay @@ -251,7 +251,7 @@ Here are some standard links for getting your machine calibrated: //#define PID_BED_DEBUG // Sends debug data to the serial port. -#ifdef PIDTEMPBED +#if ENABLED(PIDTEMPBED) #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term @@ -411,7 +411,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made. // It is assumed that when logic high = filament available // when logic low = filament ran out -#ifdef FILAMENT_RUNOUT_SENSOR +#if ENABLED(FILAMENT_RUNOUT_SENSOR) const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined. #define FILAMENT_RUNOUT_SCRIPT "M600" @@ -424,11 +424,11 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // #define MANUAL_BED_LEVELING // Add display menu option for bed leveling // #define MESH_BED_LEVELING // Enable mesh bed leveling -#ifdef MANUAL_BED_LEVELING +#if ENABLED(MANUAL_BED_LEVELING) #define MBL_Z_STEP 0.025 // Step size while manually probing Z axis #endif // MANUAL_BED_LEVELING -#ifdef MESH_BED_LEVELING +#if ENABLED(MESH_BED_LEVELING) #define MESH_MIN_X 10 #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X) #define MESH_MIN_Y 10 @@ -447,7 +447,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line) #define Z_PROBE_REPEATABILITY_TEST // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled. -#ifdef ENABLE_AUTO_BED_LEVELING +#if ENABLED(ENABLE_AUTO_BED_LEVELING) // There are 2 different ways to specify probing locations // @@ -464,7 +464,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Note: this feature generates 10KB extra code size #define AUTO_BED_LEVELING_GRID - #ifdef AUTO_BED_LEVELING_GRID + #if ENABLED(AUTO_BED_LEVELING_GRID) #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 @@ -521,7 +521,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // - Position the probe in a defined XY point before Z Homing when homing all axis (G28) // - Block Z homing only when the probe is outside bed area. - #ifdef Z_SAFE_HOMING + #if ENABLED(Z_SAFE_HOMING) #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28) #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28) @@ -553,7 +553,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Manual homing switch locations: // For deltabots this means top and center of the Cartesian print volume. -#ifdef MANUAL_HOME_POSITIONS +#if ENABLED(MANUAL_HOME_POSITIONS) #define MANUAL_X_HOME_POS 0 #define MANUAL_Y_HOME_POS 0 #define MANUAL_Z_HOME_POS 0 @@ -592,8 +592,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // Custom M code points #define CUSTOM_M_CODES -#ifdef CUSTOM_M_CODES - #ifdef ENABLE_AUTO_BED_LEVELING +#if ENABLED(CUSTOM_M_CODES) + #if ENABLED(ENABLE_AUTO_BED_LEVELING) #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 @@ -610,7 +610,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //define this to enable EEPROM support #define EEPROM_SETTINGS -#ifdef EEPROM_SETTINGS +#if ENABLED(EEPROM_SETTINGS) // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: #define EEPROM_CHITCHAT // Please keep turned on if you can. #endif @@ -794,7 +794,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#ifdef DEACTIVATE_SERVOS_AFTER_MOVE +#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) // Delay (in microseconds) before turning the servo off. This depends on the servo speed. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 9fc87aaa6..04c3c85e0 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -9,7 +9,7 @@ //=============================Thermal Settings ============================ //=========================================================================== -#ifdef BED_LIMIT_SWITCHING +#if ENABLED(BED_LIMIT_SWITCHING) #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS #endif #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control @@ -17,7 +17,7 @@ /** * Thermal Protection parameters */ -#ifdef THERMAL_PROTECTION_HOTENDS +#if ENABLED(THERMAL_PROTECTION_HOTENDS) #define THERMAL_PROTECTION_PERIOD 40 // Seconds #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius @@ -31,7 +31,7 @@ #define WATCH_TEMP_INCREASE 4 // Degrees Celsius #endif -#ifdef THERMAL_PROTECTION_BED +#if ENABLED(THERMAL_PROTECTION_BED) #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius #endif @@ -46,11 +46,11 @@ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode */ -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. #define PID_ADD_EXTRUSION_RATE - #ifdef PID_ADD_EXTRUSION_RATE + #if ENABLED(PID_ADD_EXTRUSION_RATE) #define DEFAULT_Kc (1) //heating power=Kc*(e_speed) #endif #endif @@ -64,7 +64,7 @@ // Also, if the temperature is set to a value target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS #endif #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control @@ -17,7 +17,7 @@ /** * Thermal Protection parameters */ -#ifdef THERMAL_PROTECTION_HOTENDS +#if ENABLED(THERMAL_PROTECTION_HOTENDS) #define THERMAL_PROTECTION_PERIOD 40 // Seconds #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius @@ -31,7 +31,7 @@ #define WATCH_TEMP_INCREASE 4 // Degrees Celsius #endif -#ifdef THERMAL_PROTECTION_BED +#if ENABLED(THERMAL_PROTECTION_BED) #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius #endif @@ -46,11 +46,11 @@ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode */ -#ifdef PIDTEMP +#if ENABLED(PIDTEMP) // this adds an experimental additional term to the heating power, proportional to the extrusion speed. // if Kc is chosen well, the additional required power due to increased melting should be compensated. #define PID_ADD_EXTRUSION_RATE - #ifdef PID_ADD_EXTRUSION_RATE + #if ENABLED(PID_ADD_EXTRUSION_RATE) #define DEFAULT_Kc (1) //heating power=Kc*(e_speed) #endif #endif @@ -64,7 +64,7 @@ // Also, if the temperature is set to a value