Commit 768a1272 authored by MagoKimbra's avatar MagoKimbra

Update

parent 7bd1de66
#ifndef CONFIGURATION_H #ifndef CONFIGURATION_H
#define CONFIGURATION_H #define CONFIGURATION_H
// This configuration file contains basic settings. Select your: #include "boards.h"
// - board type #include "macros.h"
// - Mechanism type (cartesian-corexy-delta-scara)
// - temperature sensor type
//
// Mechanisms-settings can be found in configuration_xxxxxx.h
// Advanced settings can be found in Configuration_adv.h
//===========================================================================
//============================= Getting Started =============================
//===========================================================================
#include "boards.h" /*
// Choose your board type. * This configuration file contains basic settings. Select your:
// Either an numeric ID or name defined in boards.h is valid. * - board type
// See: https://github.com/MagoKimbra/MarlinKimbra/blob/master/Documentation/Hardware.md * - Mechanism type (cartesian-corexy-delta-scara)
* - temperature sensor type
*
* Mechanisms-settings can be found in configuration_xxxxxx.h
* Advanced settings can be found in Configuration_adv.h
*/
/*
* Choose your board type.
* Either an numeric ID or name defined in boards.h is valid.
* See: https://github.com/MagoKimbra/MarlinKimbra/blob/master/Documentation/Hardware.md
*/
#define MOTHERBOARD BOARD_RAMPS_13_EFB #define MOTHERBOARD BOARD_RAMPS_13_EFB
// User-specified version info of this build to display in [Pronterface, etc] terminal window during // User-specified version info of this build to display in [Pronterface, etc] terminal window during
...@@ -57,13 +65,13 @@ ...@@ -57,13 +65,13 @@
/***********************************************************************\ /***********************************************************************\
********************** Do not touch this section ********************** ********************** Do not touch this section **********************
***********************************************************************/ ***********************************************************************/
#if defined(CARTESIAN) #if ENABLED(CARTESIAN)
#include "Configuration_Cartesian.h" #include "Configuration_Cartesian.h"
#elif defined(COREXY) #elif ENABLED(COREXY)
#include "Configuration_Corexy.h" #include "Configuration_Corexy.h"
#elif defined(DELTA) #elif ENABLED(DELTA)
#include "Configuration_Delta.h" #include "Configuration_Delta.h"
#elif defined(SCARA) #elif ENABLED(SCARA)
#include "Configuration_Scara.h" #include "Configuration_Scara.h"
#endif #endif
/***********************************************************************/ /***********************************************************************/
...@@ -594,7 +602,7 @@ ...@@ -594,7 +602,7 @@
//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
// It is assumed that when logic high = filament available // It is assumed that when logic high = filament available
// when logic low = filament run out // when logic low = filament run out
#ifdef FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR)
const bool FILRUNOUT_PIN_INVERTING = true; // Should be uncommented and true or false should assigned const bool FILRUNOUT_PIN_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 ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600" // Script execute when filament run out #define FILAMENT_RUNOUT_SCRIPT "M600" // Script execute when filament run out
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
// coarse Endstop Settings // coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors #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 // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX // #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX // #define ENDSTOPPULLUP_YMAX
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
//If you have enabled the Auto Bed Levelling and are using the same Z Probe for Z Homing, //If you have enabled the Auto Bed Levelling and are using the same Z Probe for Z Homing,
//it is highly recommended you let this Z_SAFE_HOMING enabled!!! //it is highly recommended you let this Z_SAFE_HOMING enabled!!!
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING
#ifdef Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING)
#define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2) // X point for Z homing when homing all axis (G28) or homing Z #define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2) // X point for Z homing when homing all axis (G28) or homing Z
#define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2) // Y point for Z homing when homing all axis (G28) or homing Z #define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2) // Y point for Z homing when homing all axis (G28) or homing Z
#endif #endif
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (ABL) //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (ABL)
//#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable //#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable
#ifdef ENABLE_AUTO_BED_LEVELING #if ENABLED(ENABLE_AUTO_BED_LEVELING)
// There are 2 different ways to specify probing locations // There are 2 different ways to specify probing locations
// //
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
// Note: this feature generates 10KB extra code size // Note: this feature generates 10KB extra code size
#define AUTO_BED_LEVELING_GRID #define AUTO_BED_LEVELING_GRID
#ifdef AUTO_BED_LEVELING_GRID #if ENABLED(AUTO_BED_LEVELING_GRID)
#define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) //#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
//Manual homing switch locations: //Manual homing switch locations:
#ifdef MANUAL_HOME_POSITIONS #if ENABLED(MANUAL_HOME_POSITIONS)
#define MANUAL_X_HOME_POS 0 #define MANUAL_X_HOME_POS 0
#define MANUAL_Y_HOME_POS 0 #define MANUAL_Y_HOME_POS 0
#define MANUAL_Z_HOME_POS 0 #define MANUAL_Z_HOME_POS 0
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
// Custom M code points // Custom M code points
//#define CUSTOM_M_CODES //#define CUSTOM_M_CODES
#ifdef CUSTOM_M_CODES #if ENABLED(CUSTOM_M_CODES)
#define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
#define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MIN -20
#define Z_PROBE_OFFSET_RANGE_MAX 20 #define Z_PROBE_OFFSET_RANGE_MAX 20
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
// coarse Endstop Settings // coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors #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 // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX // #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX // #define ENDSTOPPULLUP_YMAX
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
//If you have enabled the Auto Bed Levelling and are using the same Z Probe for Z Homing, //If you have enabled the Auto Bed Levelling and are using the same Z Probe for Z Homing,
//it is highly recommended you let this Z_SAFE_HOMING enabled!!! //it is highly recommended you let this Z_SAFE_HOMING enabled!!!
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING
#ifdef Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING)
#define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2) // X point for Z homing when homing all axis (G28) or homing Z #define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2) // X point for Z homing when homing all axis (G28) or homing Z
#define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2) // Y point for Z homing when homing all axis (G28) or homing Z #define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2) // Y point for Z homing when homing all axis (G28) or homing Z
#endif #endif
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (ABL) //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (ABL)
//#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable //#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable
#ifdef ENABLE_AUTO_BED_LEVELING #if ENABLED(ENABLE_AUTO_BED_LEVELING)
// There are 2 different ways to specify probing locations // There are 2 different ways to specify probing locations
// //
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
// Note: this feature generates 10KB extra code size // Note: this feature generates 10KB extra code size
#define AUTO_BED_LEVELING_GRID #define AUTO_BED_LEVELING_GRID
#ifdef AUTO_BED_LEVELING_GRID #if ENABLED(AUTO_BED_LEVELING_GRID)
#define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0) //#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
//Manual homing switch locations: //Manual homing switch locations:
#ifdef MANUAL_HOME_POSITIONS #if ENABLED(MANUAL_HOME_POSITIONS)
#define MANUAL_X_HOME_POS 0 #define MANUAL_X_HOME_POS 0
#define MANUAL_Y_HOME_POS 0 #define MANUAL_Y_HOME_POS 0
#define MANUAL_Z_HOME_POS 0 #define MANUAL_Z_HOME_POS 0
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
// Custom M code points // Custom M code points
//#define CUSTOM_M_CODES //#define CUSTOM_M_CODES
#ifdef CUSTOM_M_CODES #if ENABLED(CUSTOM_M_CODES)
#define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851 #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
#define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MIN -20
#define Z_PROBE_OFFSET_RANGE_MAX 20 #define Z_PROBE_OFFSET_RANGE_MAX 20
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
// coarse Endstop Settings // coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors #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 // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX // #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX // #define ENDSTOPPULLUP_YMAX
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
//=============================Thermal Settings ============================ //=============================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 #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
#endif #endif
#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
/** /**
* Thermal Protection parameters * Thermal Protection parameters
*/ */
#ifdef THERMAL_PROTECTION_HOTENDS #if ENABLED(THERMAL_PROTECTION_HOTENDS)
#define THERMAL_PROTECTION_PERIOD 40 // Seconds #define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#define WATCH_TEMP_INCREASE 4 // Degrees Celsius #define WATCH_TEMP_INCREASE 4 // Degrees Celsius
#endif #endif
#ifdef THERMAL_PROTECTION_BED #if ENABLED(THERMAL_PROTECTION_BED)
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
#endif #endif
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
* On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
*/ */
#define AUTOTEMP #define AUTOTEMP
#ifdef AUTOTEMP #if ENABLED(AUTOTEMP)
#define AUTOTEMP_OLDWEIGHT 0.98 #define AUTOTEMP_OLDWEIGHT 0.98
#endif #endif
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder. // On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
//#define Z_DUAL_STEPPER_DRIVERS //#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. // 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. // That way the machine is capable to align the bed during home, since both Z steppers are homed.
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
#define Z_DUAL_ENDSTOPS #define Z_DUAL_ENDSTOPS
#ifdef Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS)
#define Z2_STEP_PIN E2_STEP_PIN // Stepper to be used to Z2 axis. #define Z2_STEP_PIN E2_STEP_PIN // Stepper to be used to Z2 axis.
#define Z2_DIR_PIN E2_DIR_PIN #define Z2_DIR_PIN E2_DIR_PIN
#define Z2_ENABLE_PIN E2_ENABLE_PIN #define Z2_ENABLE_PIN E2_ENABLE_PIN
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
// allowing faster printing speeds. // allowing faster printing speeds.
//#define DUAL_X_CARRIAGE //#define DUAL_X_CARRIAGE
#ifdef DUAL_X_CARRIAGE #if ENABLED(DUAL_X_CARRIAGE)
// Configuration for second X-carriage // Configuration for second X-carriage
// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop; // 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. // the second x-carriage always homes to the maximum endstop.
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
#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 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 #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder
#endif #endif
...@@ -294,11 +294,8 @@ ...@@ -294,11 +294,8 @@
// be commented out otherwise // be commented out otherwise
#define SDCARDDETECTINVERTED #define SDCARDDETECTINVERTED
// Disable steppers when the file is done printing #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers?
#define SD_FINISHED_STEPPERRELEASE true #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
// Command to send. You may want to keep Z enabled so your bed stays in place.
#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E"
#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order. #define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the file system block order.
// if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that. // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that.
...@@ -308,7 +305,7 @@ ...@@ -308,7 +305,7 @@
// Show a progress bar on HD44780 LCDs for SD printing // Show a progress bar on HD44780 LCDs for SD printing
//#define LCD_PROGRESS_BAR //#define LCD_PROGRESS_BAR
#ifdef LCD_PROGRESS_BAR #if ENABLED(LCD_PROGRESS_BAR)
// Amount of time (ms) to show the bar // Amount of time (ms) to show the bar
#define PROGRESS_BAR_BAR_TIME 5000 #define PROGRESS_BAR_BAR_TIME 5000
// Amount of time (ms) to show the status message // Amount of time (ms) to show the status message
...@@ -325,7 +322,7 @@ ...@@ -325,7 +322,7 @@
#endif // SDSUPPORT #endif // SDSUPPORT
// for dogm lcd displays you can choose some additional fonts: // 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 // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
// we don't have a big font for Cyrillic, Kana // we don't have a big font for Cyrillic, Kana
//#define USE_BIG_EDIT_FONT //#define USE_BIG_EDIT_FONT
...@@ -338,7 +335,7 @@ ...@@ -338,7 +335,7 @@
// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. // 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 //#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. // 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. // 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. // 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.
...@@ -352,7 +349,7 @@ ...@@ -352,7 +349,7 @@
// it can e.g. be used to change z-positions in the print startup phase in real-time // it can e.g. be used to change z-positions in the print startup phase in real-time
// does not respect endstops! // does not respect endstops!
//#define BABYSTEPPING //#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_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_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
...@@ -367,7 +364,7 @@ ...@@ -367,7 +364,7 @@
// so: v ^ 2 is proportional to number of steps we advance the extruder // so: v ^ 2 is proportional to number of steps we advance the extruder
//#define ADVANCE //#define ADVANCE
#ifdef ADVANCE #if ENABLED(ADVANCE)
#define EXTRUDER_ADVANCE_K .0 #define EXTRUDER_ADVANCE_K .0
#define D_FILAMENT 2.85 #define D_FILAMENT 2.85
#define STEPS_MM_E 836 #define STEPS_MM_E 836
...@@ -388,7 +385,7 @@ const unsigned int dropsegments = 5; // everything with less than this number of ...@@ -388,7 +385,7 @@ const unsigned int dropsegments = 5; // everything with less than this number of
// The number of linear motions that can be in the plan at any give time. // 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. // 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 #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
#else #else
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
...@@ -400,9 +397,10 @@ const unsigned int dropsegments = 5; // everything with less than this number of ...@@ -400,9 +397,10 @@ const unsigned int dropsegments = 5; // everything with less than this number of
#define BUFSIZE 4 #define BUFSIZE 4
// Bad Serial-connections can miss a received command by sending an 'ok' // Bad Serial-connections can miss a received command by sending an 'ok'
// Therefore some clients go after 30 seconds in a timeout. Some other clients start sending commands while receiving a 'wait'. // Therefore some clients abort after 30 seconds in a timeout.
// This wait is only send when the buffer is empty. The timeout-length is in milliseconds. 1000 is a good value. // Some other clients start sending commands while receiving a 'wait'.
#define NO_TIMEOUTS 1000 // This "wait" is only sent when the buffer is empty. 1 second is a good value here.
#define NO_TIMEOUTS 1000 // Milliseconds
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
#define ADVANCED_OK #define ADVANCED_OK
...@@ -414,7 +412,7 @@ const unsigned int dropsegments = 5; // everything with less than this number of ...@@ -414,7 +412,7 @@ const unsigned int dropsegments = 5; // everything with less than this number of
// the moves are than replaced by the firmware controlled ones. // the moves are than replaced by the firmware controlled ones.
//#define FWRETRACT //ONLY PARTIALLY TESTED //#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 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 3 //default retract length (positive mm)
#define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change #define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change
...@@ -425,10 +423,10 @@ const unsigned int dropsegments = 5; // everything with less than this number of ...@@ -425,10 +423,10 @@ const unsigned int dropsegments = 5; // everything with less than this number of
#define RETRACT_RECOVER_FEEDRATE 8 //default feedrate for recovering from retraction (mm/s) #define RETRACT_RECOVER_FEEDRATE 8 //default feedrate for recovering from retraction (mm/s)
#endif #endif
// Add support for experimental filament exchange support M600; requires display // Add support for filament exchange support M600; requires display
#ifdef ULTIPANEL #if ENABLED(ULTIPANEL)
#define FILAMENTCHANGEENABLE #define FILAMENTCHANGEENABLE
#ifdef FILAMENTCHANGEENABLE #if ENABLED(FILAMENTCHANGEENABLE)
#define FILAMENTCHANGE_XPOS 3 #define FILAMENTCHANGE_XPOS 3
#define FILAMENTCHANGE_YPOS 3 #define FILAMENTCHANGE_YPOS 3
#define FILAMENTCHANGE_ZADD 10 #define FILAMENTCHANGE_ZADD 10
...@@ -444,7 +442,7 @@ const unsigned int dropsegments = 5; // everything with less than this number of ...@@ -444,7 +442,7 @@ const unsigned int dropsegments = 5; // everything with less than this number of
******************************************************************************/ ******************************************************************************/
//#define HAVE_TMCDRIVER //#define HAVE_TMCDRIVER
#ifdef HAVE_TMCDRIVER #if ENABLED(HAVE_TMCDRIVER)
// #define X_IS_TMC // #define X_IS_TMC
#define X_MAX_CURRENT 1000 //in mA #define X_MAX_CURRENT 1000 //in mA
...@@ -504,7 +502,7 @@ const unsigned int dropsegments = 5; // everything with less than this number of ...@@ -504,7 +502,7 @@ const unsigned int dropsegments = 5; // everything with less than this number of
******************************************************************************/ ******************************************************************************/
//#define HAVE_L6470DRIVER //#define HAVE_L6470DRIVER
#ifdef HAVE_L6470DRIVER #if ENABLED(HAVE_L6470DRIVER)
// #define X_IS_L6470 // #define X_IS_L6470
#define X_MICROSTEPS 16 //number of microsteps #define X_MICROSTEPS 16 //number of microsteps
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include "Configuration.h" #include "Configuration.h"
#include "pins.h"
#ifndef SANITYCHECK_H #ifndef SANITYCHECK_H
#error Your Configuration.h and Configuration_adv.h files are outdated! #error Your Configuration.h and Configuration_adv.h files are outdated!
...@@ -34,14 +35,6 @@ ...@@ -34,14 +35,6 @@
#include "WProgram.h" #include "WProgram.h"
#endif #endif
#define BIT(b) (1<<(b))
#define TEST(n,b) (((n)&BIT(b))!=0)
#define SET_BIT(n,b,value) (n) ^= ((-value)^(n)) & (BIT(b))
#define RADIANS(d) ((d)*M_PI/180.0)
#define DEGREES(r) ((d)*180.0/M_PI)
#define NOLESS(v,n) do{ if (v < n) v = n; }while(0)
#define NOMORE(v,n) do{ if (v > n) v = n; }while(0)
typedef unsigned long millis_t; typedef unsigned long millis_t;
// Arduino < 1.0.0 does not define this, so we need to do it ourselves // Arduino < 1.0.0 does not define this, so we need to do it ourselves
...@@ -53,9 +46,11 @@ typedef unsigned long millis_t; ...@@ -53,9 +46,11 @@ typedef unsigned long millis_t;
void get_command(); void get_command();
void idle(bool ignore_stepper_queue = false);
void manage_inactivity(bool ignore_stepper_queue=false); void manage_inactivity(bool ignore_stepper_queue=false);
#if defined(DUAL_X_CARRIAGE) && HAS_X_ENABLE && HAS_X2_ENABLE #if ENABLED(DUAL_X_CARRIAGE) && HAS_X_ENABLE && HAS_X2_ENABLE
#define enable_x() do { X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); } while (0) #define enable_x() do { X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); } while (0)
#define disable_x() do { X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; } while (0) #define disable_x() do { X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; } while (0)
#elif HAS_X_ENABLE #elif HAS_X_ENABLE
...@@ -67,7 +62,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); ...@@ -67,7 +62,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#endif #endif
#if HAS_Y_ENABLE #if HAS_Y_ENABLE
#ifdef Y_DUAL_STEPPER_DRIVERS #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
#define enable_y() { Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); } #define enable_y() { Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }
#define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; } #define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }
#else #else
...@@ -80,7 +75,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); ...@@ -80,7 +75,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#endif #endif
#if HAS_Z_ENABLE #if HAS_Z_ENABLE
#ifdef Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS)
#define enable_z() { Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); } #define enable_z() { Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }
#define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; } #define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }
#else #else
...@@ -147,7 +142,7 @@ void disable_all_steppers(); ...@@ -147,7 +142,7 @@ void disable_all_steppers();
void FlushSerialRequestResend(); void FlushSerialRequestResend();
void ok_to_send(); void ok_to_send();
#ifdef DELTA #if ENABLED(DELTA)
float probe_bed(float x, float y); float probe_bed(float x, float y);
void set_delta_constants(); void set_delta_constants();
void home_delta_axis(); void home_delta_axis();
...@@ -165,7 +160,7 @@ extern float delta_tower1_x, delta_tower1_y; ...@@ -165,7 +160,7 @@ extern float delta_tower1_x, delta_tower1_y;
extern float delta_tower2_x, delta_tower2_y; extern float delta_tower2_x, delta_tower2_y;
extern float delta_tower3_x, delta_tower3_y; extern float delta_tower3_x, delta_tower3_y;
#endif #endif
#ifdef SCARA #if ENABLED(SCARA)
void calculate_delta(float cartesian[3]); void calculate_delta(float cartesian[3]);
void calculate_SCARA_forward_Transform(float f_scara[3]); void calculate_SCARA_forward_Transform(float f_scara[3]);
#endif #endif
...@@ -173,7 +168,7 @@ void prepare_move(); ...@@ -173,7 +168,7 @@ void prepare_move();
void kill(const char *); void kill(const char *);
void Stop(); void Stop();
#ifdef FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR)
void filrunout(); void filrunout();
#endif #endif
...@@ -202,7 +197,7 @@ void clamp_to_software_endstops(float target[3]); ...@@ -202,7 +197,7 @@ void clamp_to_software_endstops(float target[3]);
extern millis_t previous_cmd_ms; extern millis_t previous_cmd_ms;
inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); } inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); }
#ifdef FAST_PWM_FAN #if ENABLED(FAST_PWM_FAN)
void setPwmFrequency(uint8_t pin, int val); void setPwmFrequency(uint8_t pin, int val);
#endif #endif
...@@ -224,7 +219,7 @@ extern float home_offset[3]; ...@@ -224,7 +219,7 @@ extern float home_offset[3];
// Hotend offset // Hotend offset
#if HOTENDS > 1 #if HOTENDS > 1
#ifndef DUAL_X_CARRIAGE #if DISABLED(DUAL_X_CARRIAGE)
#define NUM_HOTEND_OFFSETS 2 // only in XY plane #define NUM_HOTEND_OFFSETS 2 // only in XY plane
#else #else
#define NUM_HOTEND_OFFSETS 3 // supports offsets in XYZ plane #define NUM_HOTEND_OFFSETS 3 // supports offsets in XYZ plane
...@@ -232,22 +227,22 @@ extern float home_offset[3]; ...@@ -232,22 +227,22 @@ extern float home_offset[3];
extern float hotend_offset[NUM_HOTEND_OFFSETS][HOTENDS]; extern float hotend_offset[NUM_HOTEND_OFFSETS][HOTENDS];
#endif // HOTENDS > 1 #endif // HOTENDS > 1
#ifdef NPR2 #if ENABLED(NPR2)
extern int old_color; // old color for system NPR2 extern int old_color; // old color for system NPR2
#endif #endif
#ifdef DELTA #if ENABLED(DELTA)
extern float z_probe_offset[3]; extern float z_probe_offset[3];
extern float endstop_adj[3]; extern float endstop_adj[3];
extern float tower_adj[6]; extern float tower_adj[6];
extern float delta_radius; extern float delta_radius;
extern float delta_diagonal_rod; extern float delta_diagonal_rod;
extern float delta_segments_per_second; extern float delta_segments_per_second;
#elif defined(Z_DUAL_ENDSTOPS) #elif ENABLED(Z_DUAL_ENDSTOPS)
extern float z_endstop_adj; extern float z_endstop_adj;
#endif #endif
#ifdef SCARA #if ENABLED(SCARA)
extern float axis_scaling[3]; // Build size scaling extern float axis_scaling[3]; // Build size scaling
#endif #endif
...@@ -260,18 +255,18 @@ extern float zprobe_zoffset; ...@@ -260,18 +255,18 @@ extern float zprobe_zoffset;
// Lifetime stats // Lifetime stats
extern unsigned long printer_usage_seconds; //this can old about 136 year before go overflow. If you belive that you can live more than this please contact me. extern unsigned long printer_usage_seconds; //this can old about 136 year before go overflow. If you belive that you can live more than this please contact me.
#ifdef PREVENT_DANGEROUS_EXTRUDE #if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
extern float extrude_min_temp; extern float extrude_min_temp;
#endif #endif
extern int fanSpeed; extern int fanSpeed;
#ifdef BARICUDA #if ENABLED(BARICUDA)
extern int ValvePressure; extern int ValvePressure;
extern int EtoPPressure; extern int EtoPPressure;
#endif #endif
#ifdef FAN_SOFT_PWM #if ENABLED(FAN_SOFT_PWM)
extern unsigned char fanSpeedSoftPwm; extern unsigned char fanSpeedSoftPwm;
#endif #endif
...@@ -292,26 +287,26 @@ extern int fanSpeed; ...@@ -292,26 +287,26 @@ extern int fanSpeed;
extern unsigned long stoppower; extern unsigned long stoppower;
#endif #endif
#ifdef IDLE_OOZING_PREVENT #if ENABLED(IDLE_OOZING_PREVENT)
extern bool idleoozing_enabled; extern bool idleoozing_enabled;
#endif #endif
#ifdef FWRETRACT #if ENABLED(FWRETRACT)
extern bool autoretract_enabled; extern bool autoretract_enabled;
extern bool retracted[EXTRUDERS]; extern bool retracted[EXTRUDERS];
extern float retract_length, retract_length_swap, retract_feedrate, retract_zlift; extern float retract_length, retract_length_swap, retract_feedrate, retract_zlift;
extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate; extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate;
#endif #endif
#ifdef EASY_LOAD #if ENABLED(EASY_LOAD)
extern bool allow_lengthy_extrude_once; // for load/unload extern bool allow_lengthy_extrude_once; // for load/unload
#endif #endif
#ifdef LASERBEAM #if ENABLED(LASERBEAM)
extern int laser_ttl_modulation; extern int laser_ttl_modulation;
#endif #endif
#if defined(SDSUPPORT) && defined(SD_SETTINGS) #if ENABLED(SDSUPPORT) && ENABLED(SD_SETTINGS)
extern millis_t config_last_update; extern millis_t config_last_update;
extern bool config_readed; extern bool config_readed;
#endif #endif
...@@ -323,12 +318,12 @@ extern millis_t print_job_stop_ms; ...@@ -323,12 +318,12 @@ extern millis_t print_job_stop_ms;
extern uint8_t active_extruder; extern uint8_t active_extruder;
extern uint8_t active_driver; extern uint8_t active_driver;
#ifdef DIGIPOT_I2C #if ENABLED(DIGIPOT_I2C)
extern void digipot_i2c_set_current( int channel, float current ); extern void digipot_i2c_set_current( int channel, float current );
extern void digipot_i2c_init(); extern void digipot_i2c_init();
#endif #endif
#ifdef FIRMWARE_TEST #if ENABLED(FIRMWARE_TEST)
void FirmwareTest(); void FirmwareTest();
#endif #endif
......
...@@ -287,6 +287,6 @@ MarlinSerial MSerial; ...@@ -287,6 +287,6 @@ MarlinSerial MSerial;
#endif // !AT90USB #endif // !AT90USB
// For AT90USB targets use the UART for BT interfacing // For AT90USB targets use the UART for BT interfacing
#if defined(AT90USB) && defined(BTENABLED) #if defined(AT90USB) && ENABLED(BTENABLED)
HardwareSerial bt; HardwareSerial bt;
#endif #endif
...@@ -153,7 +153,7 @@ extern MarlinSerial MSerial; ...@@ -153,7 +153,7 @@ extern MarlinSerial MSerial;
#endif // !AT90USB #endif // !AT90USB
// Use the UART for BT in AT90USB configurations // Use the UART for BT in AT90USB configurations
#if defined(AT90USB) && defined(BTENABLED) #if defined(AT90USB) && ENABLED(BTENABLED)
extern HardwareSerial bt; extern HardwareSerial bt;
#endif #endif
......
This diff is collapsed.
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Created by Tim Koster, August 21 2013. Created by Tim Koster, August 21 2013.
*/ */
#include "Marlin.h" #include "Marlin.h"
#ifdef BLINKM #if ENABLED(BLINKM)
#include "blinkm.h" #include "blinkm.h"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "temperature.h" #include "temperature.h"
#include "language.h" #include "language.h"
#ifdef SDSUPPORT #if ENABLED(SDSUPPORT)
CardReader::CardReader() { CardReader::CardReader() {
filesize = 0; filesize = 0;
...@@ -20,6 +20,7 @@ CardReader::CardReader() { ...@@ -20,6 +20,7 @@ CardReader::CardReader() {
autostart_stilltocheck = true; //the SD start is delayed, because otherwise the serial cannot answer fast enough to make contact with the host software. autostart_stilltocheck = true; //the SD start is delayed, because otherwise the serial cannot answer fast enough to make contact with the host software.
autostart_index = 0; autostart_index = 0;
//power to SD reader //power to SD reader
#if SDPOWER > -1 #if SDPOWER > -1
OUT_WRITE(SDPOWER, HIGH); OUT_WRITE(SDPOWER, HIGH);
...@@ -125,7 +126,7 @@ void CardReader::ls() { ...@@ -125,7 +126,7 @@ void CardReader::ls() {
lsDive("", root); lsDive("", root);
} }
#ifdef LONG_FILENAME_HOST_SUPPORT #if ENABLED(LONG_FILENAME_HOST_SUPPORT)
/** /**
* Get a long pretty path based on a DOS 8.3 path * Get a long pretty path based on a DOS 8.3 path
...@@ -190,7 +191,7 @@ void CardReader::initsd() { ...@@ -190,7 +191,7 @@ void CardReader::initsd() {
cardOK = false; cardOK = false;
if (root.isOpen()) root.close(); if (root.isOpen()) root.close();
#ifdef SDSLOW #if ENABLED(SDSLOW)
#define SPI_SPEED SPI_HALF_SPEED #define SPI_SPEED SPI_HALF_SPEED
#else #else
#define SPI_SPEED SPI_FULL_SPEED #define SPI_SPEED SPI_FULL_SPEED
...@@ -448,7 +449,7 @@ void CardReader::checkautostart(bool force) { ...@@ -448,7 +449,7 @@ void CardReader::checkautostart(bool force) {
if (!cardOK) return; // fail if (!cardOK) return; // fail
} }
char autoname[30]; char autoname[10];
sprintf_P(autoname, PSTR("auto%i.g"), autostart_index); sprintf_P(autoname, PSTR("auto%i.g"), autostart_index);
for (int8_t i = 0; i < (int8_t)strlen(autoname); i++) autoname[i] = tolower(autoname[i]); for (int8_t i = 0; i < (int8_t)strlen(autoname); i++) autoname[i] = tolower(autoname[i]);
...@@ -460,7 +461,7 @@ void CardReader::checkautostart(bool force) { ...@@ -460,7 +461,7 @@ void CardReader::checkautostart(bool force) {
while (root.readDir(p, NULL) > 0) { while (root.readDir(p, NULL) > 0) {
for (int8_t i = 0; i < (int8_t)strlen((char*)p.name); i++) p.name[i] = tolower(p.name[i]); for (int8_t i = 0; i < (int8_t)strlen((char*)p.name); i++) p.name[i] = tolower(p.name[i]);
if (p.name[9] != '~' && strncmp((char*)p.name, autoname, 5) == 0) { if (p.name[9] != '~' && strncmp((char*)p.name, autoname, 5) == 0) {
char cmd[30]; char cmd[4 + (FILENAME_LENGTH + 1) * MAX_DIR_DEPTH + 2];
sprintf_P(cmd, PSTR("M23 %s"), autoname); sprintf_P(cmd, PSTR("M23 %s"), autoname);
enqueuecommand(cmd); enqueuecommand(cmd);
enqueuecommands_P(PSTR("M24")); enqueuecommands_P(PSTR("M24"));
...@@ -607,22 +608,22 @@ void CardReader::chdir(const char * relpath) { ...@@ -607,22 +608,22 @@ void CardReader::chdir(const char * relpath) {
if (workDir.isOpen()) parent = &workDir; if (workDir.isOpen()) parent = &workDir;
if (newfile.open(*parent, relpath, O_READ)) { if (!newfile.open(*parent, relpath, O_READ)) {
ECHO_LMV(ER, MSG_SD_CANT_ENTER_SUBDIR, relpath);
}
else {
if (workDirDepth < MAX_DIR_DEPTH) { if (workDirDepth < MAX_DIR_DEPTH) {
workDirDepth++; ++workDirDepth;
for (int d = workDirDepth; d--;) workDirParents[d + 1] = workDirParents[d]; for (int d = workDirDepth; d--;) workDirParents[d + 1] = workDirParents[d];
workDirParents[0] = *parent; workDirParents[0] = *parent;
} }
workDir = newfile; workDir = newfile;
} }
else {
ECHO_LMV(ER, MSG_SD_CANT_ENTER_SUBDIR, relpath);
}
} }
void CardReader::updir() { void CardReader::updir() {
if (workDirDepth > 0) { if (workDirDepth > 0) {
workDirDepth--; --workDirDepth;
workDir = workDirParents[0]; workDir = workDirParents[0];
for (uint16_t d = 0; d < workDirDepth; d++) for (uint16_t d = 0; d < workDirDepth; d++)
workDirParents[d] = workDirParents[d+1]; workDirParents[d] = workDirParents[d+1];
......
#ifndef CARDREADER_H #ifndef CARDREADER_H
#define CARDREADER_H #define CARDREADER_H
#ifdef SDSUPPORT #if ENABLED(SDSUPPORT)
#define MAX_DIR_DEPTH 10 // Maximum folder depth #define MAX_DIR_DEPTH 10 // Maximum folder depth
...@@ -84,7 +84,7 @@ extern CardReader card; ...@@ -84,7 +84,7 @@ extern CardReader card;
#define IS_SD_PRINTING (card.sdprinting) #define IS_SD_PRINTING (card.sdprinting)
#if (SDCARDDETECT > -1) #if (SDCARDDETECT > -1)
#ifdef SDCARDDETECTINVERTED #if ENABLED(SDCARDDETECTINVERTED)
#define IS_SD_INSERTED (READ(SDCARDDETECT) != 0) #define IS_SD_INSERTED (READ(SDCARDDETECT) != 0)
#else #else
#define IS_SD_INSERTED (READ(SDCARDDETECT) == 0) #define IS_SD_INSERTED (READ(SDCARDDETECT) == 0)
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#define OK "ok" //ok answer for host #define OK "ok" //ok answer for host
#define ER "Error: " //error for host #define ER "Error: " //error for host
#define WT "wait" //wait for host #define WT "wait" //wait for host
#define DB "MK4: " //message for user #define DB "echo: " //message for user
#define RS "Resend: " //resend for host #define RS "Resend: " //resend for host
#define PAUSE "//action:pause" //command for host that support action #define PAUSE "//action:pause" //command for host that support action
#define RESUME "//action:resume" //command for host that support action #define RESUME "//action:resume" //command for host that support action
......
This diff is collapsed.
This diff is collapsed.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
void Config_ResetDefault(); void Config_ResetDefault();
void ConfigSD_ResetDefault(); void ConfigSD_ResetDefault();
#ifndef DISABLE_M503 #if DISABLED(DISABLE_M503)
void Config_PrintSettings(bool forReplay = false); void Config_PrintSettings(bool forReplay = false);
void ConfigSD_PrintSettings(bool forReplay = false); void ConfigSD_PrintSettings(bool forReplay = false);
#else #else
...@@ -22,7 +22,7 @@ void ConfigSD_ResetDefault(); ...@@ -22,7 +22,7 @@ void ConfigSD_ResetDefault();
FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); } FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); }
#endif #endif
#if defined(SDSUPPORT) && defined(SD_SETTINGS) #if ENABLED(SDSUPPORT) && ENABLED(SD_SETTINGS)
static const char *cfgSD_KEY[] = { //Keep this in lexicographical order for better search performance(O(Nlog2(N)) insted of O(N*N)) (if you don't keep this sorted, the algorithm for find the key index won't work, keep attention.) static const char *cfgSD_KEY[] = { //Keep this in lexicographical order for better search performance(O(Nlog2(N)) insted of O(N*N)) (if you don't keep this sorted, the algorithm for find the key index won't work, keep attention.)
#ifdef POWER_CONSUMPTION #ifdef POWER_CONSUMPTION
"PWR", "PWR",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// Please note that using the high-res version takes 402Bytes of PROGMEM. // Please note that using the high-res version takes 402Bytes of PROGMEM.
//#define START_BMPHIGH //#define START_BMPHIGH
#ifdef START_BMPHIGH #if ENABLED(START_BMPHIGH)
#define START_BMPWIDTH 112 #define START_BMPWIDTH 112
#define START_BMPHEIGHT 38 #define START_BMPHEIGHT 38
#define START_BMPBYTEWIDTH 14 #define START_BMPBYTEWIDTH 14
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* Implementation of the LCD display routines for a DOGM128 graphic display. These are common LCD 128x64 pixel graphic displays. * Implementation of the LCD display routines for a DOGM128 graphic display. These are common LCD 128x64 pixel graphic displays.
*/ */
#ifdef ULTIPANEL #if ENABLED(ULTIPANEL)
#define BLEN_A 0 #define BLEN_A 0
#define BLEN_B 1 #define BLEN_B 1
#define BLEN_C 2 #define BLEN_C 2
...@@ -35,12 +35,12 @@ ...@@ -35,12 +35,12 @@
#include "ultralcd_st7920_u8glib_rrd.h" #include "ultralcd_st7920_u8glib_rrd.h"
#include "Configuration.h" #include "Configuration.h"
#if !defined(MAPPER_C2C3) && !defined(MAPPER_NON) && defined(USE_BIG_EDIT_FONT) #if DISABLED(MAPPER_C2C3) && DISABLED(MAPPER_NON) && ENABLED(USE_BIG_EDIT_FONT)
#undef USE_BIG_EDIT_FONT #undef USE_BIG_EDIT_FONT
#endif #endif
#ifdef USE_SMALL_INFOFONT #if ENABLED(USE_SMALL_INFOFONT)
#include "dogm_font_data_6x9_marlin.h" #include "dogm_font_data_6x9_marlin.h"
#define FONT_STATUSMENU_NAME u8g_font_6x9 #define FONT_STATUSMENU_NAME u8g_font_6x9
#else #else
...@@ -50,17 +50,17 @@ ...@@ -50,17 +50,17 @@
#include "dogm_font_data_Marlin_symbols.h" // The Marlin special symbols #include "dogm_font_data_Marlin_symbols.h" // The Marlin special symbols
#define FONT_SPECIAL_NAME Marlin_symbols #define FONT_SPECIAL_NAME Marlin_symbols
#ifndef SIMULATE_ROMFONT #if DISABLED(SIMULATE_ROMFONT)
#if defined( DISPLAY_CHARSET_ISO10646_1 ) #if ENABLED(DISPLAY_CHARSET_ISO10646_1)
#include "dogm_font_data_ISO10646_1.h" #include "dogm_font_data_ISO10646_1.h"
#define FONT_MENU_NAME ISO10646_1_5x7 #define FONT_MENU_NAME ISO10646_1_5x7
#elif defined( DISPLAY_CHARSET_ISO10646_5 ) #elif ENABLED(DISPLAY_CHARSET_ISO10646_5)
#include "dogm_font_data_ISO10646_5_Cyrillic.h" #include "dogm_font_data_ISO10646_5_Cyrillic.h"
#define FONT_MENU_NAME ISO10646_5_Cyrillic_5x7 #define FONT_MENU_NAME ISO10646_5_Cyrillic_5x7
#elif defined( DISPLAY_CHARSET_ISO10646_KANA ) #elif ENABLED(DISPLAY_CHARSET_ISO10646_KANA)
#include "dogm_font_data_ISO10646_Kana.h" #include "dogm_font_data_ISO10646_Kana.h"
#define FONT_MENU_NAME ISO10646_Kana_5x7 #define FONT_MENU_NAME ISO10646_Kana_5x7
#elif defined( DISPLAY_CHARSET_ISO10646_CN ) #elif ENABLED(DISPLAY_CHARSET_ISO10646_CN)
#include "dogm_font_data_ISO10646_CN.h" #include "dogm_font_data_ISO10646_CN.h"
#define FONT_MENU_NAME ISO10646_CN #define FONT_MENU_NAME ISO10646_CN
#define TALL_FONT_CORRECTION 1 #define TALL_FONT_CORRECTION 1
...@@ -69,13 +69,13 @@ ...@@ -69,13 +69,13 @@
#define FONT_MENU_NAME ISO10646_1_5x7 #define FONT_MENU_NAME ISO10646_1_5x7
#endif #endif
#else // SIMULATE_ROMFONT #else // SIMULATE_ROMFONT
#if defined( DISPLAY_CHARSET_HD44780_JAPAN ) #if ENABLED(DISPLAY_CHARSET_HD44780_JAPAN)
#include "dogm_font_data_HD44780_J.h" #include "dogm_font_data_HD44780_J.h"
#define FONT_MENU_NAME HD44780_J_5x7 #define FONT_MENU_NAME HD44780_J_5x7
#elif defined( DISPLAY_CHARSET_HD44780_WESTERN ) #elif ENABLED(DISPLAY_CHARSET_HD44780_WESTERN)
#include "dogm_font_data_HD44780_W.h" #include "dogm_font_data_HD44780_W.h"
#define FONT_MENU_NAME HD44780_W_5x7 #define FONT_MENU_NAME HD44780_W_5x7
#elif defined( DISPLAY_CHARSET_HD44780_CYRILLIC ) #elif ENABLED(DISPLAY_CHARSET_HD44780_CYRILLIC)
#include "dogm_font_data_HD44780_C.h" #include "dogm_font_data_HD44780_C.h"
#define FONT_MENU_NAME HD44780_C_5x7 #define FONT_MENU_NAME HD44780_C_5x7
#else // fall-back #else // fall-back
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
// DOGM parameters (size in pixels) // DOGM parameters (size in pixels)
#define DOG_CHAR_WIDTH 6 #define DOG_CHAR_WIDTH 6
#define DOG_CHAR_HEIGHT 12 #define DOG_CHAR_HEIGHT 12
#ifdef USE_BIG_EDIT_FONT #if ENABLED(USE_BIG_EDIT_FONT)
#define FONT_MENU_EDIT_NAME u8g_font_9x18 #define FONT_MENU_EDIT_NAME u8g_font_9x18
#define DOG_CHAR_WIDTH_EDIT 9 #define DOG_CHAR_WIDTH_EDIT 9
#define DOG_CHAR_HEIGHT_EDIT 18 #define DOG_CHAR_HEIGHT_EDIT 18
...@@ -113,16 +113,16 @@ ...@@ -113,16 +113,16 @@
#define START_ROW 0 #define START_ROW 0
// LCD selection // LCD selection
#ifdef U8GLIB_ST7920 #if ENABLED(U8GLIB_ST7920)
//U8GLIB_ST7920_128X64_RRD u8g(0,0,0); //U8GLIB_ST7920_128X64_RRD u8g(0,0,0);
U8GLIB_ST7920_128X64_RRD u8g(0); U8GLIB_ST7920_128X64_RRD u8g(0);
#elif defined(MAKRPANEL) #elif ENABLED(MAKRPANEL)
// The MaKrPanel display, ST7565 controller as well // The MaKrPanel display, ST7565 controller as well
U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0); U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0);
#elif defined(VIKI2) || defined(miniVIKI) #elif ENABLED(VIKI2) || ENABLED(miniVIKI)
// Mini Viki and Viki 2.0 LCD, ST7565 controller as well // Mini Viki and Viki 2.0 LCD, ST7565 controller as well
U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0); U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0);
#elif defined(U8GLIB_LM6059_AF) #elif ENABLED(U8GLIB_LM6059_AF)
// Based on the Adafruit ST7565 (http://www.adafruit.com/products/250) // Based on the Adafruit ST7565 (http://www.adafruit.com/products/250)
U8GLIB_LM6059 u8g(DOGLCD_CS, DOGLCD_A0); U8GLIB_LM6059 u8g(DOGLCD_CS, DOGLCD_A0);
#else #else
...@@ -189,7 +189,7 @@ static bool show_splashscreen = true; ...@@ -189,7 +189,7 @@ static bool show_splashscreen = true;
/* Warning: This function is called from interrupt context */ /* Warning: This function is called from interrupt context */
static void lcd_implementation_init() { static void lcd_implementation_init() {
#ifdef LCD_PIN_BL // Enable LCD backlight #if ENABLED(LCD_PIN_BL) // Enable LCD backlight
pinMode(LCD_PIN_BL, OUTPUT); pinMode(LCD_PIN_BL, OUTPUT);
digitalWrite(LCD_PIN_BL, HIGH); digitalWrite(LCD_PIN_BL, HIGH);
#endif #endif
...@@ -200,17 +200,17 @@ static void lcd_implementation_init() { ...@@ -200,17 +200,17 @@ static void lcd_implementation_init() {
// pinMode(17, OUTPUT); // Enable LCD backlight // pinMode(17, OUTPUT); // Enable LCD backlight
// digitalWrite(17, HIGH); // digitalWrite(17, HIGH);
#ifdef LCD_SCREEN_ROT_90 #if ENABLED(LCD_SCREEN_ROT_90)
u8g.setRot90(); // Rotate screen by 90° u8g.setRot90(); // Rotate screen by 90°
#elif defined(LCD_SCREEN_ROT_180) #elif ENABLED(LCD_SCREEN_ROT_180)
u8g.setRot180(); // Rotate screen by 180° u8g.setRot180(); // Rotate screen by 180°
#elif defined(LCD_SCREEN_ROT_270) #elif ENABLED(LCD_SCREEN_ROT_270)
u8g.setRot270(); // Rotate screen by 270° u8g.setRot270(); // Rotate screen by 270°
#endif #endif
// Show splashscreen // Show splashscreen
int offx = (u8g.getWidth() - START_BMPWIDTH) / 2; int offx = (u8g.getWidth() - START_BMPWIDTH) / 2;
#ifdef START_BMPHIGH #if ENABLED(START_BMPHIGH)
int offy = 0; int offy = 0;
#else #else
int offy = DOG_CHAR_HEIGHT; int offy = DOG_CHAR_HEIGHT;
...@@ -265,7 +265,7 @@ static void lcd_implementation_status_screen() { ...@@ -265,7 +265,7 @@ static void lcd_implementation_status_screen() {
// Symbols menu graphics, animated fan // Symbols menu graphics, animated fan
u8g.drawBitmapP(9,1,STATUS_SCREENBYTEWIDTH,STATUS_SCREENHEIGHT, (blink % 2) && fanSpeed ? status_screen0_bmp : status_screen1_bmp); u8g.drawBitmapP(9,1,STATUS_SCREENBYTEWIDTH,STATUS_SCREENHEIGHT, (blink % 2) && fanSpeed ? status_screen0_bmp : status_screen1_bmp);
#ifdef SDSUPPORT #if ENABLED(SDSUPPORT)
// SD Card Symbol // SD Card Symbol
u8g.drawBox(42, 42 - TALL_FONT_CORRECTION, 8, 7); u8g.drawBox(42, 42 - TALL_FONT_CORRECTION, 8, 7);
u8g.drawBox(50, 44 - TALL_FONT_CORRECTION, 2, 5); u8g.drawBox(50, 44 - TALL_FONT_CORRECTION, 2, 5);
...@@ -333,7 +333,7 @@ static void lcd_implementation_status_screen() { ...@@ -333,7 +333,7 @@ static void lcd_implementation_status_screen() {
#define XYZ_BASELINE 38 #define XYZ_BASELINE 38
lcd_setFont(FONT_STATUSMENU); lcd_setFont(FONT_STATUSMENU);
#ifdef USE_SMALL_INFOFONT #if ENABLED(USE_SMALL_INFOFONT)
u8g.drawBox(0,30,LCD_PIXEL_WIDTH,10); u8g.drawBox(0,30,LCD_PIXEL_WIDTH,10);
#else #else
u8g.drawBox(0,30,LCD_PIXEL_WIDTH,9); u8g.drawBox(0,30,LCD_PIXEL_WIDTH,9);
...@@ -379,7 +379,7 @@ static void lcd_implementation_status_screen() { ...@@ -379,7 +379,7 @@ static void lcd_implementation_status_screen() {
// Status line // Status line
lcd_setFont(FONT_STATUSMENU); lcd_setFont(FONT_STATUSMENU);
#ifdef USE_SMALL_INFOFONT #if ENABLED(USE_SMALL_INFOFONT)
u8g.setPrintPos(0,62); u8g.setPrintPos(0,62);
#else #else
u8g.setPrintPos(0,63); u8g.setPrintPos(0,63);
...@@ -491,7 +491,7 @@ void lcd_implementation_drawedit(const char* pstr, char* value) { ...@@ -491,7 +491,7 @@ void lcd_implementation_drawedit(const char* pstr, char* value) {
uint8_t lcd_width = LCD_WIDTH, char_width = DOG_CHAR_WIDTH; uint8_t lcd_width = LCD_WIDTH, char_width = DOG_CHAR_WIDTH;
uint8_t vallen = lcd_strlen(value); uint8_t vallen = lcd_strlen(value);
#ifdef USE_BIG_EDIT_FONT #if ENABLED(USE_BIG_EDIT_FONT)
if (lcd_strlen_P(pstr) <= LCD_WIDTH_EDIT - 1) { if (lcd_strlen_P(pstr) <= LCD_WIDTH_EDIT - 1) {
lcd_setFont(FONT_MENU_EDIT); lcd_setFont(FONT_MENU_EDIT);
lcd_width = LCD_WIDTH_EDIT + 1; lcd_width = LCD_WIDTH_EDIT + 1;
......
...@@ -104,14 +104,8 @@ ...@@ -104,14 +104,8 @@
#define MSG_FILE_PRINTED "Done printing file" #define MSG_FILE_PRINTED "Done printing file"
#define MSG_BEGIN_FILE_LIST "Begin file list" #define MSG_BEGIN_FILE_LIST "Begin file list"
#define MSG_END_FILE_LIST "End file list" #define MSG_END_FILE_LIST "End file list"
#define MSG_INVALID_EXTRUDER "Invalid extruder" #define MSG_INVALID_EXTRUDER " Invalid extruder "
#define MSG_INVALID_SOLENOID "Invalid solenoid" #define MSG_INVALID_SOLENOID "Invalid solenoid"
#define MSG_M104_INVALID_EXTRUDER "M104 " MSG_INVALID_EXTRUDER " "
#define MSG_M105_INVALID_EXTRUDER "M105 " MSG_INVALID_EXTRUDER " "
#define MSG_M109_INVALID_EXTRUDER "M109 " MSG_INVALID_EXTRUDER " "
#define MSG_M200_INVALID_EXTRUDER "M200 " MSG_INVALID_EXTRUDER " "
#define MSG_M218_INVALID_EXTRUDER "M218 " MSG_INVALID_EXTRUDER " "
#define MSG_M221_INVALID_EXTRUDER "M221 " MSG_INVALID_EXTRUDER " "
#define MSG_ERR_NO_THERMISTORS "No thermistors - no temperature" #define MSG_ERR_NO_THERMISTORS "No thermistors - no temperature"
#define MSG_HEATING "Heating..." #define MSG_HEATING "Heating..."
#define MSG_HEATING_COMPLETE "Heating done." #define MSG_HEATING_COMPLETE "Heating done."
...@@ -238,7 +232,7 @@ ...@@ -238,7 +232,7 @@
#define MSG_BED_LEVELLING_Z " Z: " #define MSG_BED_LEVELLING_Z " Z: "
// LCD Menu Messages // LCD Menu Messages
#if !(defined( DISPLAY_CHARSET_HD44780_JAPAN ) || defined( DISPLAY_CHARSET_HD44780_WESTERN ) || defined( DISPLAY_CHARSET_HD44780_CYRILLIC )) #if !(ENABLED(DISPLAY_CHARSET_HD44780_JAPAN) || ENABLED(DISPLAY_CHARSET_HD44780_WESTERN) || ENABLED(DISPLAY_CHARSET_HD44780_CYRILLIC))
#define DISPLAY_CHARSET_HD44780_JAPAN #define DISPLAY_CHARSET_HD44780_JAPAN
#endif #endif
......
#ifndef MACROS_H
#define MACROS_H
// Macros for bit masks
#define BIT(b) (1<<(b))
#define TEST(n,b) (((n)&BIT(b))!=0)
#define SET_BIT(n,b,value) (n) ^= ((-value)^(n)) & (BIT(b))
// Macros for maths shortcuts
#define M_PI 3.1415926536
#define RADIANS(d) ((d)*M_PI/180.0)
#define DEGREES(r) ((r)*180.0/M_PI)
#define SIN_60 0.8660254037844386
#define COS_60 0.5
// Macros to contrain values
#define NOLESS(v,n) do{ if (v < n) v = n; }while(0)
#define NOMORE(v,n) do{ if (v > n) v = n; }while(0)
// Macros to support option testing
#define _CAT(a, ...) a ## __VA_ARGS__
#define SWITCH_ENABLED_0 0
#define SWITCH_ENABLED_1 1
#define SWITCH_ENABLED_ 1
#define ENABLED(b) _CAT(SWITCH_ENABLED_, b)
#define DISABLED(b) (!_CAT(SWITCH_ENABLED_, b))
// Macros for check PIN
#define PIN_EXISTS(PN) (defined(PN##_PIN) && PN##_PIN >= 0)
/**
* Shorthand for pin tests, used wherever needed
*/
#define HAS_TEMP_0 (PIN_EXISTS(TEMP_0) && TEMP_SENSOR_0 != 0 && TEMP_SENSOR_0 != -2)
#define HAS_TEMP_1 (PIN_EXISTS(TEMP_1) && TEMP_SENSOR_1 != 0)
#define HAS_TEMP_2 (PIN_EXISTS(TEMP_2) && TEMP_SENSOR_2 != 0)
#define HAS_TEMP_3 (PIN_EXISTS(TEMP_3) && TEMP_SENSOR_3 != 0)
#define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0)
#define HAS_HEATER_0 (PIN_EXISTS(HEATER_0))
#define HAS_HEATER_1 (PIN_EXISTS(HEATER_1))
#define HAS_HEATER_2 (PIN_EXISTS(HEATER_2))
#define HAS_HEATER_3 (PIN_EXISTS(HEATER_3))
#define HAS_HEATER_BED (PIN_EXISTS(HEATER_BED))
#define HAS_AUTO_FAN_0 (PIN_EXISTS(EXTRUDER_0_AUTO_FAN))
#define HAS_AUTO_FAN_1 (PIN_EXISTS(EXTRUDER_1_AUTO_FAN))
#define HAS_AUTO_FAN_2 (PIN_EXISTS(EXTRUDER_2_AUTO_FAN))
#define HAS_AUTO_FAN_3 (PIN_EXISTS(EXTRUDER_3_AUTO_FAN))
#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_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 (ENABLED(FILAMENT_SENSOR) && PIN_EXISTS(FILWIDTH))
#define HAS_POWER_CONSUMPTION_SENSOR (ENABLED(POWER_CONSUMPTION) && PIN_EXISTS(POWER_CONSUMPTION))
#define HAS_FILRUNOUT (ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FILRUNOUT))
#define HAS_HOME (PIN_EXISTS(HOME))
#define HAS_KILL (PIN_EXISTS(KILL))
#define HAS_SUICIDE (PIN_EXISTS(SUICIDE))
#define HAS_PHOTOGRAPH (PIN_EXISTS(PHOTOGRAPH))
#define HAS_X_MIN (PIN_EXISTS(X_MIN))
#define HAS_X_MAX (PIN_EXISTS(X_MAX))
#define HAS_Y_MIN (PIN_EXISTS(Y_MIN))
#define HAS_Y_MAX (PIN_EXISTS(Y_MAX))
#define HAS_Z_MIN (PIN_EXISTS(Z_MIN))
#define HAS_Z_MAX (PIN_EXISTS(Z_MAX))
#define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN))
#define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX))
#define HAS_Z_PROBE (PIN_EXISTS(Z_PROBE))
#define HAS_E_MIN (PIN_EXISTS(E_MIN))
#define HAS_SOLENOID_1 (PIN_EXISTS(SOL1))
#define HAS_SOLENOID_2 (PIN_EXISTS(SOL2))
#define HAS_SOLENOID_3 (PIN_EXISTS(SOL3))
#define HAS_MICROSTEPS (PIN_EXISTS(X_MS1))
#define HAS_MICROSTEPS_E0 (PIN_EXISTS(E0_MS1))
#define HAS_MICROSTEPS_E1 (PIN_EXISTS(E1_MS1))
#define HAS_MICROSTEPS_E2 (PIN_EXISTS(E2_MS1))
#define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE))
#define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE))
#define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE))
#define HAS_Y2_ENABLE (PIN_EXISTS(Y2_ENABLE))
#define HAS_Z_ENABLE (PIN_EXISTS(Z_ENABLE))
#define HAS_Z2_ENABLE (PIN_EXISTS(Z2_ENABLE))
#define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE))
#define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE))
#define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE))
#define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE))
#define HAS_X_DIR (PIN_EXISTS(X_DIR))
#define HAS_X2_DIR (PIN_EXISTS(X2_DIR))
#define HAS_Y_DIR (PIN_EXISTS(Y_DIR))
#define HAS_Y2_DIR (PIN_EXISTS(Y2_DIR))
#define HAS_Z_DIR (PIN_EXISTS(Z_DIR))
#define HAS_Z2_DIR (PIN_EXISTS(Z2_DIR))
#define HAS_E0_DIR (PIN_EXISTS(E0_DIR))
#define HAS_E1_DIR (PIN_EXISTS(E1_DIR))
#define HAS_E2_DIR (PIN_EXISTS(E2_DIR))
#define HAS_E3_DIR (PIN_EXISTS(E3_DIR))
#define HAS_X_STEP (PIN_EXISTS(X_STEP))
#define HAS_X2_STEP (PIN_EXISTS(X2_STEP))
#define HAS_Y_STEP (PIN_EXISTS(Y_STEP))
#define HAS_Y2_STEP (PIN_EXISTS(Y2_STEP))
#define HAS_Z_STEP (PIN_EXISTS(Z_STEP))
#define HAS_Z2_STEP (PIN_EXISTS(Z2_STEP))
#define HAS_E0_STEP (PIN_EXISTS(E0_STEP))
#define HAS_E1_STEP (PIN_EXISTS(E1_STEP))
#define HAS_E2_STEP (PIN_EXISTS(E2_STEP))
#define HAS_E3_STEP (PIN_EXISTS(E3_STEP))
#define HAS_E0E1 (PIN_EXISTS(E0E1_CHOICE))
#define HAS_E0E2 (PIN_EXISTS(E0E2_CHOICE))
#define HAS_E0E3 (PIN_EXISTS(E0E3_CHOICE))
#define HAS_E0E4 (PIN_EXISTS(E0E4_CHOICE))
#define HAS_E1E3 (PIN_EXISTS(E1E3_CHOICE))
#define HAS_BTN_BACK (PIN_EXISTS(BTN_BACK))
/**
* Shorthand for filament sensor and power sensor for ultralcd.cpp, dogm_lcd_implementation.h, ultralcd_implementation_hitachi_HD44780.h
*/
#define HAS_LCD_FILAMENT_SENSOR (HAS_FILAMENT_SENSOR && defined(FILAMENT_LCD_DISPLAY))
#define HAS_LCD_POWER_SENSOR (HAS_POWER_CONSUMPTION_SENSOR && defined(POWER_CONSUMPTION_LCD_DISPLAY))
#endif //__MACROS_H
...@@ -4909,7 +4909,7 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a ...@@ -4909,7 +4909,7 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
********************************* END MOTHERBOARD *************************************** ********************************* END MOTHERBOARD ***************************************
/****************************************************************************************/ /****************************************************************************************/
#ifndef KNOWN_BOARD #if DISABLED(KNOWN_BOARD)
#error Unknown MOTHERBOARD value in configuration.h #error Unknown MOTHERBOARD value in configuration.h
#endif #endif
...@@ -4980,35 +4980,35 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a ...@@ -4980,35 +4980,35 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
#define Z_MAX_PIN -1 #define Z_MAX_PIN -1
#endif //Z_HOME_DIR > 0 #endif //Z_HOME_DIR > 0
#ifndef Z_PROBE_ENDSTOP // Allow code to compile regardless of Z_PROBE_ENDSTOP setting. #if DISABLED(Z_PROBE_ENDSTOP) // Allow code to compile regardless of Z_PROBE_ENDSTOP setting.
#define Z_PROBE_PIN -1 #define Z_PROBE_PIN -1
#endif #endif
#ifdef DISABLE_XMAX_ENDSTOP #if ENABLED(DISABLE_XMAX_ENDSTOP)
#undef X_MAX_PIN #undef X_MAX_PIN
#define X_MAX_PIN -1 #define X_MAX_PIN -1
#endif #endif
#ifdef DISABLE_XMIN_ENDSTOP #if ENABLED(DISABLE_XMIN_ENDSTOP)
#undef X_MIN_PIN #undef X_MIN_PIN
#define X_MIN_PIN -1 #define X_MIN_PIN -1
#endif #endif
#ifdef DISABLE_YMAX_ENDSTOP #if ENABLED(DISABLE_YMAX_ENDSTOP)
#define Y_MAX_PIN -1 #define Y_MAX_PIN -1
#endif #endif
#ifdef DISABLE_YMIN_ENDSTOP #if ENABLED(DISABLE_YMIN_ENDSTOP)
#undef Y_MIN_PIN #undef Y_MIN_PIN
#define Y_MIN_PIN -1 #define Y_MIN_PIN -1
#endif #endif
#ifdef DISABLE_ZMAX_ENDSTOP #if ENABLED(DISABLE_ZMAX_ENDSTOP)
#undef Z_MAX_PIN #undef Z_MAX_PIN
#define Z_MAX_PIN -1 #define Z_MAX_PIN -1
#endif #endif
#ifdef DISABLE_ZMIN_ENDSTOP #if ENABLED(DISABLE_ZMIN_ENDSTOP)
#undef Z_MIN_PIN #undef Z_MIN_PIN
#define Z_MIN_PIN -1 #define Z_MIN_PIN -1
#endif #endif
...@@ -5049,7 +5049,7 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a ...@@ -5049,7 +5049,7 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
#define TEMP_3_PIN -1 #define TEMP_3_PIN -1
#endif #endif
#ifdef MKR4 #if ENABLED(MKR4)
#if (EXTRUDERS == 2) && (DRIVER_EXTRUDERS == 1) // Use this for one driver and two extruder #if (EXTRUDERS == 2) && (DRIVER_EXTRUDERS == 1) // Use this for one driver and two extruder
#define E0E1_CHOICE_PIN 5 #define E0E1_CHOICE_PIN 5
#elif (EXTRUDERS == 3) && (DRIVER_EXTRUDERS == 1) // Use this for one driver and 3 extruder #elif (EXTRUDERS == 3) && (DRIVER_EXTRUDERS == 1) // Use this for one driver and 3 extruder
...@@ -5067,20 +5067,20 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a ...@@ -5067,20 +5067,20 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
#endif //EXTRUDERS #endif //EXTRUDERS
#endif //MKR4 #endif //MKR4
#ifdef NPR2 #if ENABLED(NPR2)
#define E_MIN_PIN -1 #define E_MIN_PIN -1
#endif //NPR2 #endif //NPR2
#ifdef LASERBEAM #if ENABLED(LASERBEAM)
#define LASER_PWR_PIN 41 #define LASER_PWR_PIN 41
#define LASER_TTL_PIN 42 #define LASER_TTL_PIN 42
#endif #endif
#ifdef FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR)
#define FILRUNOUT_PIN -1 #define FILRUNOUT_PIN -1
#endif #endif
#ifdef FILAMENT_SENSOR #if ENABLED(FILAMENT_SENSOR)
// FMM added for Filament Extruder // FMM added for Filament Extruder
//define analog pin for the filament width sensor input //define analog pin for the filament width sensor input
//Use the RAMPS 1.4 Analog input 5 on the AUX2 connector //Use the RAMPS 1.4 Analog input 5 on the AUX2 connector
......
This diff is collapsed.
...@@ -37,7 +37,7 @@ typedef struct { ...@@ -37,7 +37,7 @@ typedef struct {
long acceleration_rate; // The acceleration rate used for acceleration calculation long acceleration_rate; // The acceleration rate used for acceleration calculation
unsigned char direction_bits; // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h) unsigned char direction_bits; // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h)
unsigned char active_driver; // Selects the active driver unsigned char active_driver; // Selects the active driver
#ifdef ADVANCE #if ENABLED(ADVANCE)
long advance_rate; long advance_rate;
volatile long initial_advance; volatile long initial_advance;
volatile long final_advance; volatile long final_advance;
...@@ -60,11 +60,11 @@ typedef struct { ...@@ -60,11 +60,11 @@ typedef struct {
unsigned long final_rate; // The minimal rate at exit unsigned long final_rate; // The minimal rate at exit
unsigned long acceleration_st; // acceleration steps/sec^2 unsigned long acceleration_st; // acceleration steps/sec^2
unsigned long fan_speed; unsigned long fan_speed;
#ifdef BARICUDA #if ENABLED(BARICUDA)
unsigned long valve_pressure; unsigned long valve_pressure;
unsigned long e_to_p_pressure; unsigned long e_to_p_pressure;
#endif #endif
#ifdef LASERBEAM #if ENABLED(LASERBEAM)
unsigned long laser_ttlmodulation; unsigned long laser_ttlmodulation;
#endif #endif
volatile char busy; volatile char busy;
...@@ -82,7 +82,7 @@ extern volatile unsigned char block_buffer_head; ...@@ -82,7 +82,7 @@ extern volatile unsigned char block_buffer_head;
extern volatile unsigned char block_buffer_tail; extern volatile unsigned char block_buffer_tail;
FORCE_INLINE uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_tail + BLOCK_BUFFER_SIZE); } FORCE_INLINE uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_tail + BLOCK_BUFFER_SIZE); }
#ifdef ENABLE_AUTO_BED_LEVELING #if ENABLED(ENABLE_AUTO_BED_LEVELING)
#include "vector_3.h" #include "vector_3.h"
...@@ -132,7 +132,7 @@ extern float max_e_jerk; ...@@ -132,7 +132,7 @@ extern float max_e_jerk;
extern float mintravelfeedrate; extern float mintravelfeedrate;
extern unsigned long axis_steps_per_sqr_second[3 + EXTRUDERS]; extern unsigned long axis_steps_per_sqr_second[3 + EXTRUDERS];
#ifdef AUTOTEMP #if ENABLED(AUTOTEMP)
extern bool autotemp_enabled; extern bool autotemp_enabled;
extern float autotemp_max; extern float autotemp_max;
extern float autotemp_min; extern float autotemp_min;
......
#include "qr_solve.h" #include "qr_solve.h"
#ifdef AUTO_BED_LEVELING_GRID #if ENABLED(AUTO_BED_LEVELING_GRID)
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
......
#include "Configuration.h" #include "Configuration.h"
#ifdef AUTO_BED_LEVELING_GRID #if ENABLED(AUTO_BED_LEVELING_GRID)
void daxpy ( int n, double da, double dx[], int incx, double dy[], int incy ); void daxpy ( int n, double da, double dx[], int incx, double dy[], int incy );
double ddot ( int n, double dx[], int incx, double dy[], int incy ); double ddot ( int n, double dx[], int incx, double dy[], int incy );
......
...@@ -9,24 +9,24 @@ ...@@ -9,24 +9,24 @@
/** /**
* Dual Stepper Drivers * 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. #error You cannot have dual stepper drivers for both Y and Z.
#endif #endif
/** /**
* Progress Bar * Progress Bar
*/ */
#ifdef LCD_PROGRESS_BAR #if ENABLED(LCD_PROGRESS_BAR)
#ifndef SDSUPPORT #if DISABLED(SDSUPPORT)
#error LCD_PROGRESS_BAR requires SDSUPPORT. #error LCD_PROGRESS_BAR requires SDSUPPORT.
#endif #endif
#ifdef DOGLCD #if ENABLED(DOGLCD)
#error LCD_PROGRESS_BAR does not apply to graphical displays. #error LCD_PROGRESS_BAR does not apply to graphical displays.
#endif #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. #error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
#endif #endif
#ifdef POWER_CONSUMPTION_LCD_DISPLAY #if ENABLED(POWER_CONSUMPTION_LCD_DISPLAY)
#error LCD_PROGRESS_BAR and POWER_CONSUMPTION_LCD_DISPLAY are not fully compatible. Comment out this line to use both. #error LCD_PROGRESS_BAR and POWER_CONSUMPTION_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
#endif #endif
#endif #endif
...@@ -34,14 +34,14 @@ ...@@ -34,14 +34,14 @@
/** /**
* Babystepping * Babystepping
*/ */
#ifdef BABYSTEPPING #if ENABLED(BABYSTEPPING)
#ifdef COREXY #if ENABLED(COREXY)
#error BABYSTEPPING not implemented for COREXY yet. #error BABYSTEPPING not implemented for COREXY yet.
#endif #endif
#ifdef SCARA #if ENABLED(SCARA)
#error BABYSTEPPING is not implemented for SCARA yet. #error BABYSTEPPING is not implemented for SCARA yet.
#endif #endif
#if defined(DELTA) && defined(BABYSTEP_XY) #if ENABLED(DELTA) && ENABLED(BABYSTEP_XY)
#error BABYSTEPPING only implemented for Z axis on deltabots. #error BABYSTEPPING only implemented for Z axis on deltabots.
#endif #endif
#endif #endif
...@@ -49,28 +49,28 @@ ...@@ -49,28 +49,28 @@
/** /**
* Filament Change with Extruder Runout Prevention * 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. #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE.
#endif #endif
/** /**
* Extruder Runout Prevention * Extruder Runout Prevention
*/ */
#if defined(EXTRUDER_RUNOUT_PREVENT) && EXTRUDER_RUNOUT_MINTEMP < EXTRUDE_MINTEMP #if ENABLED(EXTRUDER_RUNOUT_PREVENT) && EXTRUDER_RUNOUT_MINTEMP < EXTRUDE_MINTEMP
#error EXTRUDER_RUNOUT_MINTEMP have to be greater than EXTRUDE_MINTEMP #error EXTRUDER_RUNOUT_MINTEMP have to be greater than EXTRUDE_MINTEMP
#endif #endif
/** /**
* Idle oozing prevent with Extruder Runout Prevention * Idle oozing prevent with Extruder Runout Prevention
*/ */
#if defined(EXTRUDER_RUNOUT_PREVENT) && defined(IDLE_OOZING_PREVENT) #if ENABLED(EXTRUDER_RUNOUT_PREVENT) && defined(IDLE_OOZING_PREVENT)
#error EXTRUDER_RUNOUT_PREVENT and IDLE_OOZING_PREVENT are incopatible. Please comment one of them. #error EXTRUDER_RUNOUT_PREVENT and IDLE_OOZING_PREVENT are incopatible. Please comment one of them.
#endif #endif
/** /**
* Idle oozing prevent * Idle oozing prevent
*/ */
#if defined(IDLE_OOZING_PREVENT) && IDLE_OOZING_MINTEMP < EXTRUDE_MINTEMP #if ENABLED(IDLE_OOZING_PREVENT) && IDLE_OOZING_MINTEMP < EXTRUDE_MINTEMP
#error IDLE_OOZING_MINTEMP have to be greater than EXTRUDE_MINTEMP #error IDLE_OOZING_MINTEMP have to be greater than EXTRUDE_MINTEMP
#endif #endif
...@@ -83,19 +83,19 @@ ...@@ -83,19 +83,19 @@
#error The maximum number of EXTRUDERS is 4. #error The maximum number of EXTRUDERS is 4.
#endif #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. #error EXTRUDERS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT.
#endif #endif
#ifdef HEATERS_PARALLEL #if ENABLED(HEATERS_PARALLEL)
#error EXTRUDERS must be 1 with HEATERS_PARALLEL. #error EXTRUDERS must be 1 with HEATERS_PARALLEL.
#endif #endif
#ifdef Y_DUAL_STEPPER_DRIVERS #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
#error EXTRUDERS must be 1 with Y_DUAL_STEPPER_DRIVERS. #error EXTRUDERS must be 1 with Y_DUAL_STEPPER_DRIVERS.
#endif #endif
#ifdef Z_DUAL_STEPPER_DRIVERS #if ENABLED(Z_DUAL_STEPPER_DRIVERS)
#error EXTRUDERS must be 1 with Z_DUAL_STEPPER_DRIVERS. #error EXTRUDERS must be 1 with Z_DUAL_STEPPER_DRIVERS.
#endif #endif
...@@ -111,21 +111,21 @@ ...@@ -111,21 +111,21 @@
/** /**
* Required LCD language * 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. #error You must enable either DISPLAY_CHARSET_HD44780_JAPAN or DISPLAY_CHARSET_HD44780_WESTERN or DISPLAY_CHARSET_HD44780_CYRILLIC for your LCD controller.
#endif #endif
/** /**
* Auto Bed Leveling * Auto Bed Leveling
*/ */
#ifdef ENABLE_AUTO_BED_LEVELING #if ENABLED(ENABLE_AUTO_BED_LEVELING)
/** /**
* Require a Z Min pin * Require a Z Min pin
*/ */
#if Z_MIN_PIN == -1 #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. #if Z_PROBE_PIN == -1 || (DISABLED(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 ENABLED(Z_PROBE_REPEATABILITY_TEST)
#error You must have a Z_MIN or Z_PROBE endstop to enable Z_PROBE_REPEATABILITY_TEST. #error You must have a Z_MIN or Z_PROBE endstop to enable Z_PROBE_REPEATABILITY_TEST.
#else #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. #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.
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
/** /**
* Require a Z Probe Pin if Z_PROBE_ENDSTOP is enabled. * 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 #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 #error You must have a Z_PROBE_PIN defined in your pins_XXXX.h file if you enable Z_PROBE_ENDSTOP
#endif #endif
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
/** /**
* Check if Probe_Offset * Grid Points is greater than Probing Range * Check if Probe_Offset * Grid Points is greater than Probing Range
*/ */
#ifdef AUTO_BED_LEVELING_GRID #if ENABLED(AUTO_BED_LEVELING_GRID)
// Make sure probing points are reachable // Make sure probing points are reachable
#if LEFT_PROBE_BED_POSITION < MIN_PROBE_X #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X
...@@ -227,14 +227,14 @@ ...@@ -227,14 +227,14 @@
/** /**
* ULTIPANEL encoder * 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) && DISABLED(SHIFT_CLK)
#error ULTIPANEL requires some kind of encoder. #error ULTIPANEL requires some kind of encoder.
#endif #endif
/** /**
* Delta & Z_PROBE_ENDSTOP * Delta & Z_PROBE_ENDSTOP
*/ */
#if defined(DELTA) && defined(Z_PROBE_ENDSTOP) #if ENABLED(DELTA) && ENABLED(Z_PROBE_ENDSTOP)
#ifndef Z_PROBE_PIN #ifndef Z_PROBE_PIN
#error You must have a Z_PROBE_PIN defined in your pins2tool.h file if you enable Z_PROBE_ENDSTOP #error You must have a Z_PROBE_PIN defined in your pins2tool.h file if you enable Z_PROBE_ENDSTOP
#endif #endif
...@@ -243,18 +243,11 @@ ...@@ -243,18 +243,11 @@
#endif #endif
#endif #endif
/**
* Allen Key Z Probe requires Auto Bed Leveling grid and Delta
*/
#if defined(Z_PROBE_ALLEN_KEY) && !(defined(AUTO_BED_LEVELING_GRID) && defined(DELTA))
#error Invalid use of Z_PROBE_ALLEN_KEY.
#endif
/** /**
* Dual X Carriage requirements * Dual X Carriage requirements
*/ */
#ifdef DUAL_X_CARRIAGE #if ENABLED(DUAL_X_CARRIAGE)
#if EXTRUDERS == 1 || defined(COREXY) \ #if EXTRUDERS == 1 || ENABLED(COREXY) \
|| !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR \ || !HAS_X2_ENABLE || !HAS_X2_STEP || !HAS_X2_DIR \
|| !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \ || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
|| !HAS_X_MAX || !HAS_X_MAX
...@@ -295,7 +288,7 @@ ...@@ -295,7 +288,7 @@
#if !HAS_HEATER_2 #if !HAS_HEATER_2
#error HEATER_2_PIN not defined for this board #error HEATER_2_PIN not defined for this board
#endif #endif
#elif HOTENDS > 1 || defined(HEATERS_PARALLEL) #elif HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)
#if !HAS_HEATER_1 #if !HAS_HEATER_1
#error HEATER_1_PIN not defined for this board #error HEATER_1_PIN not defined for this board
#endif #endif
...@@ -315,11 +308,11 @@ ...@@ -315,11 +308,11 @@
#error WATCH_TEMP_PERIOD now uses seconds instead of milliseconds #error WATCH_TEMP_PERIOD now uses seconds instead of milliseconds
#endif #endif
#if !defined(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD)) #if DISABLED(THERMAL_PROTECTION_HOTENDS) && (ENABLED(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
#error Thermal Runaway Protection for hotends must now be enabled with THERMAL_PROTECTION_HOTENDS #error Thermal Runaway Protection for hotends must now be enabled with THERMAL_PROTECTION_HOTENDS
#endif #endif
#if !defined(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD) #if DISABLED(THERMAL_PROTECTION_BED) && ENABLED(THERMAL_PROTECTION_BED_PERIOD)
#error Thermal Runaway Protection for the bed must now be enabled with THERMAL_PROTECTION_BED #error Thermal Runaway Protection for the bed must now be enabled with THERMAL_PROTECTION_BED
#endif #endif
......
/* /*
Servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
Copyright (c) 2009 Michael Margolis. All right reserved. Copyright (c) 2009 Michael Margolis. All right reserved.
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
......
This diff is collapsed.
...@@ -53,8 +53,8 @@ ...@@ -53,8 +53,8 @@
#define REV_E_DIR() E0_DIR_WRITE(INVERT_E0_DIR) #define REV_E_DIR() E0_DIR_WRITE(INVERT_E0_DIR)
#endif //DRIVER_EXTRUDERS #endif //DRIVER_EXTRUDERS
#ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
extern bool abort_on_endstop_hit; extern bool abort_on_endstop_hit;
#endif #endif
// Initialize and start the stepper motor subsystem // Initialize and start the stepper motor subsystem
...@@ -70,7 +70,7 @@ void st_set_e_position(const long &e); ...@@ -70,7 +70,7 @@ void st_set_e_position(const long &e);
// Get current position in steps // Get current position in steps
long st_get_position(uint8_t axis); long st_get_position(uint8_t axis);
#ifdef ENABLE_AUTO_BED_LEVELING #if ENABLED(ENABLE_AUTO_BED_LEVELING)
// Get current position in mm // Get current position in mm
float st_get_position_mm(AxisEnum axis); float st_get_position_mm(AxisEnum axis);
#endif #endif
...@@ -101,18 +101,18 @@ void digipot_current(uint8_t driver, int current); ...@@ -101,18 +101,18 @@ void digipot_current(uint8_t driver, int current);
void microstep_init(); void microstep_init();
void microstep_readings(); void microstep_readings();
#ifdef Z_DUAL_ENDSTOPS #if ENABLED(Z_DUAL_ENDSTOPS)
void In_Homing_Process(bool state); void In_Homing_Process(bool state);
void Lock_z_motor(bool state); void Lock_z_motor(bool state);
void Lock_z2_motor(bool state); void Lock_z2_motor(bool state);
#endif #endif
#ifdef BABYSTEPPING #if ENABLED(BABYSTEPPING)
void babystep(const uint8_t axis,const bool direction); // perform a short step with a single stepper motor, outside of any convention void babystep(const uint8_t axis,const bool direction); // perform a short step with a single stepper motor, outside of any convention
#endif #endif
#ifdef NPR2 //Multiextruder #if ENABLED(NPR2) // Multiextruder
void colorstep(long csteps,const bool direction); void colorstep(long csteps,const bool direction);
#endif //NPR2 #endif // NPR2
#endif //stepper_h #endif // stepper_h
...@@ -22,203 +22,203 @@ ...@@ -22,203 +22,203 @@
#include "stepper_indirection.h" #include "stepper_indirection.h"
#include "Configuration.h" #include "Configuration.h"
#ifdef HAVE_TMCDRIVER #if ENABLED(HAVE_TMCDRIVER)
#include <SPI.h> #include <SPI.h>
#include <TMC26XStepper.h> #include <TMC26XStepper.h>
#endif #endif
// Stepper objects of TMC steppers used // Stepper objects of TMC steppers used
#ifdef X_IS_TMC #if ENABLED(X_IS_TMC)
TMC26XStepper stepperX(200,X_ENABLE_PIN,X_STEP_PIN,X_DIR_PIN,X_MAX_CURRENT,X_SENSE_RESISTOR); TMC26XStepper stepperX(200,X_ENABLE_PIN,X_STEP_PIN,X_DIR_PIN,X_MAX_CURRENT,X_SENSE_RESISTOR);
#endif #endif
#ifdef X2_IS_TMC #if ENABLED(X2_IS_TMC)
TMC26XStepper stepperX2(200,X2_ENABLE_PIN,X2_STEP_PIN,X2_DIR_PIN,X2_MAX_CURRENT,X2_SENSE_RESISTOR); TMC26XStepper stepperX2(200,X2_ENABLE_PIN,X2_STEP_PIN,X2_DIR_PIN,X2_MAX_CURRENT,X2_SENSE_RESISTOR);
#endif #endif
#ifdef Y_IS_TMC #if ENABLED(Y_IS_TMC)
TMC26XStepper stepperY(200,Y_ENABLE_PIN,Y_STEP_PIN,Y_DIR_PIN,Y_MAX_CURRENT,Y_SENSE_RESISTOR); TMC26XStepper stepperY(200,Y_ENABLE_PIN,Y_STEP_PIN,Y_DIR_PIN,Y_MAX_CURRENT,Y_SENSE_RESISTOR);
#endif #endif
#ifdef Y2_IS_TMC #if ENABLED(Y2_IS_TMC)
TMC26XStepper stepperY2(200,Y2_ENABLE_PIN,Y2_STEP_PIN,Y2_DIR_PIN,Y2_MAX_CURRENT,Y2_SENSE_RESISTOR); TMC26XStepper stepperY2(200,Y2_ENABLE_PIN,Y2_STEP_PIN,Y2_DIR_PIN,Y2_MAX_CURRENT,Y2_SENSE_RESISTOR);
#endif #endif
#ifdef Z_IS_TMC #if ENABLED(Z_IS_TMC)
TMC26XStepper stepperZ(200,Z_ENABLE_PIN,Z_STEP_PIN,Z_DIR_PIN,Z_MAX_CURRENT,Z_SENSE_RESISTOR); TMC26XStepper stepperZ(200,Z_ENABLE_PIN,Z_STEP_PIN,Z_DIR_PIN,Z_MAX_CURRENT,Z_SENSE_RESISTOR);
#endif #endif
#ifdef Z2_IS_TMC #if ENABLED(Z2_IS_TMC)
TMC26XStepper stepperZ2(200,Z2_ENABLE_PIN,Z2_STEP_PIN,Z2_DIR_PIN,Z2_MAX_CURRENT,Z2_SENSE_RESISTOR); TMC26XStepper stepperZ2(200,Z2_ENABLE_PIN,Z2_STEP_PIN,Z2_DIR_PIN,Z2_MAX_CURRENT,Z2_SENSE_RESISTOR);
#endif #endif
#ifdef E0_IS_TMC #if ENABLED(E0_IS_TMC)
TMC26XStepper stepperE0(200,E0_ENABLE_PIN,E0_STEP_PIN,E0_DIR_PIN,E0_MAX_CURRENT,E0_SENSE_RESISTOR); TMC26XStepper stepperE0(200,E0_ENABLE_PIN,E0_STEP_PIN,E0_DIR_PIN,E0_MAX_CURRENT,E0_SENSE_RESISTOR);
#endif #endif
#ifdef E1_IS_TMC #if ENABLED(E1_IS_TMC)
TMC26XStepper stepperE1(200,E1_ENABLE_PIN,E1_STEP_PIN,E1_DIR_PIN,E1_MAX_CURRENT,E1_SENSE_RESISTOR); TMC26XStepper stepperE1(200,E1_ENABLE_PIN,E1_STEP_PIN,E1_DIR_PIN,E1_MAX_CURRENT,E1_SENSE_RESISTOR);
#endif #endif
#ifdef E2_IS_TMC #if ENABLED(E2_IS_TMC)
TMC26XStepper stepperE2(200,E2_ENABLE_PIN,E2_STEP_PIN,E2_DIR_PIN,E2_MAX_CURRENT,E2_SENSE_RESISTOR); TMC26XStepper stepperE2(200,E2_ENABLE_PIN,E2_STEP_PIN,E2_DIR_PIN,E2_MAX_CURRENT,E2_SENSE_RESISTOR);
#endif #endif
#ifdef E3_IS_TMC #if ENABLED(E3_IS_TMC)
TMC26XStepper stepperE3(200,E3_ENABLE_PIN,E3_STEP_PIN,E3_DIR_PIN,E3_MAX_CURRENT,E3_SENSE_RESISTOR); TMC26XStepper stepperE3(200,E3_ENABLE_PIN,E3_STEP_PIN,E3_DIR_PIN,E3_MAX_CURRENT,E3_SENSE_RESISTOR);
#endif #endif
#ifdef HAVE_TMCDRIVER #if ENABLED(HAVE_TMCDRIVER)
void tmc_init() void tmc_init()
{ {
#ifdef X_IS_TMC #if ENABLED(X_IS_TMC)
stepperX.setMicrosteps(X_MICROSTEPS); stepperX.setMicrosteps(X_MICROSTEPS);
stepperX.start(); stepperX.start();
#endif #endif
#ifdef X2_IS_TMC #if ENABLED(X2_IS_TMC)
stepperX2.setMicrosteps(X2_MICROSTEPS); stepperX2.setMicrosteps(X2_MICROSTEPS);
stepperX2.start(); stepperX2.start();
#endif #endif
#ifdef Y_IS_TMC #if ENABLED(Y_IS_TMC)
stepperY.setMicrosteps(Y_MICROSTEPS); stepperY.setMicrosteps(Y_MICROSTEPS);
stepperY.start(); stepperY.start();
#endif #endif
#ifdef Y2_IS_TMC #if ENABLED(Y2_IS_TMC)
stepperY2.setMicrosteps(Y2_MICROSTEPS); stepperY2.setMicrosteps(Y2_MICROSTEPS);
stepperY2.start(); stepperY2.start();
#endif #endif
#ifdef Z_IS_TMC #if ENABLED(Z_IS_TMC)
stepperZ.setMicrosteps(Z_MICROSTEPS); stepperZ.setMicrosteps(Z_MICROSTEPS);
stepperZ.start(); stepperZ.start();
#endif #endif
#ifdef Z2_IS_TMC #if ENABLED(Z2_IS_TMC)
stepperZ2.setMicrosteps(Z2_MICROSTEPS); stepperZ2.setMicrosteps(Z2_MICROSTEPS);
stepperZ2.start(); stepperZ2.start();
#endif #endif
#ifdef E0_IS_TMC #if ENABLED(E0_IS_TMC)
stepperE0.setMicrosteps(E0_MICROSTEPS); stepperE0.setMicrosteps(E0_MICROSTEPS);
stepperE0.start(); stepperE0.start();
#endif #endif
#ifdef E1_IS_TMC #if ENABLED(E1_IS_TMC)
stepperE1.setMicrosteps(E1_MICROSTEPS); stepperE1.setMicrosteps(E1_MICROSTEPS);
stepperE1.start(); stepperE1.start();
#endif #endif
#ifdef E2_IS_TMC #if ENABLED(E2_IS_TMC)
stepperE2.setMicrosteps(E2_MICROSTEPS); stepperE2.setMicrosteps(E2_MICROSTEPS);
stepperE2.start(); stepperE2.start();
#endif #endif
#ifdef E3_IS_TMC #if ENABLED(E3_IS_TMC)
stepperE3.setMicrosteps(E3_MICROSTEPS); stepperE3.setMicrosteps(E3_MICROSTEPS);
stepperE3.start(); stepperE3.start();
#endif #endif
} }
#endif #endif
// L6470 Driver objects and inits // L6470 Driver objects and inits
#ifdef HAVE_L6470DRIVER #if ENABLED(HAVE_L6470DRIVER)
#include <SPI.h> #include <SPI.h>
#include <L6470.h> #include <L6470.h>
#endif #endif
// L6470 Stepper objects // L6470 Stepper objects
#ifdef X_IS_L6470 #if ENABLED(X_IS_L6470)
L6470 stepperX(X_ENABLE_PIN); L6470 stepperX(X_ENABLE_PIN);
#endif #endif
#ifdef X2_IS_L6470 #if ENABLED(X2_IS_L6470)
L6470 stepperX2(X2_ENABLE_PIN); L6470 stepperX2(X2_ENABLE_PIN);
#endif #endif
#ifdef Y_IS_L6470 #if ENABLED(Y_IS_L6470)
L6470 stepperY(Y_ENABLE_PIN); L6470 stepperY(Y_ENABLE_PIN);
#endif #endif
#ifdef Y2_IS_L6470 #if ENABLED(Y2_IS_L6470)
L6470 stepperY2(Y2_ENABLE_PIN); L6470 stepperY2(Y2_ENABLE_PIN);
#endif #endif
#ifdef Z_IS_L6470 #if ENABLED(Z_IS_L6470)
L6470 stepperZ(Z_ENABLE_PIN); L6470 stepperZ(Z_ENABLE_PIN);
#endif #endif
#ifdef Z2_IS_L6470 #if ENABLED(Z2_IS_L6470)
L6470 stepperZ2(Z2_ENABLE_PIN); L6470 stepperZ2(Z2_ENABLE_PIN);
#endif #endif
#ifdef E0_IS_L6470 #if ENABLED(E0_IS_L6470)
L6470 stepperE0(E0_ENABLE_PIN); L6470 stepperE0(E0_ENABLE_PIN);
#endif #endif
#ifdef E1_IS_L6470 #if ENABLED(E1_IS_L6470)
L6470 stepperE1(E1_ENABLE_PIN); L6470 stepperE1(E1_ENABLE_PIN);
#endif #endif
#ifdef E2_IS_L6470 #if ENABLED(E2_IS_L6470)
L6470 stepperE2(E2_ENABLE_PIN); L6470 stepperE2(E2_ENABLE_PIN);
#endif #endif
#ifdef E3_IS_L6470 #if ENABLED(E3_IS_L6470)
L6470 stepperE3(E3_ENABLE_PIN); L6470 stepperE3(E3_ENABLE_PIN);
#endif #endif
// init routine // init routine
#ifdef HAVE_L6470DRIVER #if ENABLED(HAVE_L6470DRIVER)
void L6470_init() void L6470_init()
{ {
#ifdef X_IS_L6470 #if ENABLED(X_IS_L6470)
stepperX.init(X_K_VAL); stepperX.init(X_K_VAL);
stepperX.softFree(); stepperX.softFree();
stepperX.setMicroSteps(X_MICROSTEPS); stepperX.setMicroSteps(X_MICROSTEPS);
stepperX.setOverCurrent(X_OVERCURRENT); //set overcurrent protection stepperX.setOverCurrent(X_OVERCURRENT); //set overcurrent protection
stepperX.setStallCurrent(X_STALLCURRENT); stepperX.setStallCurrent(X_STALLCURRENT);
#endif #endif
#ifdef X2_IS_L6470 #if ENABLED(X2_IS_L6470)
stepperX2.init(X2_K_VAL); stepperX2.init(X2_K_VAL);
stepperX2.softFree(); stepperX2.softFree();
stepperX2.setMicroSteps(X2_MICROSTEPS); stepperX2.setMicroSteps(X2_MICROSTEPS);
stepperX2.setOverCurrent(X2_OVERCURRENT); //set overcurrent protection stepperX2.setOverCurrent(X2_OVERCURRENT); //set overcurrent protection
stepperX2.setStallCurrent(X2_STALLCURRENT); stepperX2.setStallCurrent(X2_STALLCURRENT);
#endif #endif
#ifdef Y_IS_L6470 #if ENABLED(Y_IS_L6470)
stepperY.init(Y_K_VAL); stepperY.init(Y_K_VAL);
stepperY.softFree(); stepperY.softFree();
stepperY.setMicroSteps(Y_MICROSTEPS); stepperY.setMicroSteps(Y_MICROSTEPS);
stepperY.setOverCurrent(Y_OVERCURRENT); //set overcurrent protection stepperY.setOverCurrent(Y_OVERCURRENT); //set overcurrent protection
stepperY.setStallCurrent(Y_STALLCURRENT); stepperY.setStallCurrent(Y_STALLCURRENT);
#endif #endif
#ifdef Y2_IS_L6470 #if ENABLED(Y2_IS_L6470)
stepperY2.init(Y2_K_VAL); stepperY2.init(Y2_K_VAL);
stepperY2.softFree(); stepperY2.softFree();
stepperY2.setMicroSteps(Y2_MICROSTEPS); stepperY2.setMicroSteps(Y2_MICROSTEPS);
stepperY2.setOverCurrent(Y2_OVERCURRENT); //set overcurrent protection stepperY2.setOverCurrent(Y2_OVERCURRENT); //set overcurrent protection
stepperY2.setStallCurrent(Y2_STALLCURRENT); stepperY2.setStallCurrent(Y2_STALLCURRENT);
#endif #endif
#ifdef Z_IS_L6470 #if ENABLED(Z_IS_L6470)
stepperZ.init(Z_K_VAL); stepperZ.init(Z_K_VAL);
stepperZ.softFree(); stepperZ.softFree();
stepperZ.setMicroSteps(Z_MICROSTEPS); stepperZ.setMicroSteps(Z_MICROSTEPS);
stepperZ.setOverCurrent(Z_OVERCURRENT); //set overcurrent protection stepperZ.setOverCurrent(Z_OVERCURRENT); //set overcurrent protection
stepperZ.setStallCurrent(Z_STALLCURRENT); stepperZ.setStallCurrent(Z_STALLCURRENT);
#endif #endif
#ifdef Z2_IS_L6470 #if ENABLED(Z2_IS_L6470)
stepperZ2.init(Z2_K_VAL); stepperZ2.init(Z2_K_VAL);
stepperZ2.softFree(); stepperZ2.softFree();
stepperZ2.setMicroSteps(Z2_MICROSTEPS); stepperZ2.setMicroSteps(Z2_MICROSTEPS);
stepperZ2.setOverCurrent(Z2_OVERCURRENT); //set overcurrent protection stepperZ2.setOverCurrent(Z2_OVERCURRENT); //set overcurrent protection
stepperZ2.setStallCurrent(Z2_STALLCURRENT); stepperZ2.setStallCurrent(Z2_STALLCURRENT);
#endif #endif
#ifdef E0_IS_L6470 #if ENABLED(E0_IS_L6470)
stepperE0.init(E0_K_VAL); stepperE0.init(E0_K_VAL);
stepperE0.softFree(); stepperE0.softFree();
stepperE0.setMicroSteps(E0_MICROSTEPS); stepperE0.setMicroSteps(E0_MICROSTEPS);
stepperE0.setOverCurrent(E0_OVERCURRENT); //set overcurrent protection stepperE0.setOverCurrent(E0_OVERCURRENT); //set overcurrent protection
stepperE0.setStallCurrent(E0_STALLCURRENT); stepperE0.setStallCurrent(E0_STALLCURRENT);
#endif #endif
#ifdef E1_IS_L6470 #if ENABLED(E1_IS_L6470)
stepperE1.init(E1_K_VAL); stepperE1.init(E1_K_VAL);
stepperE1.softFree(); stepperE1.softFree();
stepperE1.setMicroSteps(E1_MICROSTEPS); stepperE1.setMicroSteps(E1_MICROSTEPS);
stepperE1.setOverCurrent(E1_OVERCURRENT); //set overcurrent protection stepperE1.setOverCurrent(E1_OVERCURRENT); //set overcurrent protection
stepperE1.setStallCurrent(E1_STALLCURRENT); stepperE1.setStallCurrent(E1_STALLCURRENT);
#endif #endif
#ifdef E2_IS_L6470 #if ENABLED(E2_IS_L6470)
stepperE2.init(E2_K_VAL); stepperE2.init(E2_K_VAL);
stepperE2.softFree(); stepperE2.softFree();
stepperE2.setMicroSteps(E2_MICROSTEPS); stepperE2.setMicroSteps(E2_MICROSTEPS);
stepperE2.setOverCurrent(E2_OVERCURRENT); //set overcurrent protection stepperE2.setOverCurrent(E2_OVERCURRENT); //set overcurrent protection
stepperE2.setStallCurrent(E2_STALLCURRENT); stepperE2.setStallCurrent(E2_STALLCURRENT);
#endif #endif
#ifdef E3_IS_L6470 #if ENABLED(E3_IS_L6470)
stepperE3.init(E3_K_VAL); stepperE3.init(E3_K_VAL);
stepperE3.softFree(); stepperE3.softFree();
stepperE3.setMicroSteps(E3_MICROSTEPS); stepperE3.setMicroSteps(E3_MICROSTEPS);
stepperE3.setOverCurrent(E3_OVERCURRENT); //set overcurrent protection stepperE3.setOverCurrent(E3_OVERCURRENT); //set overcurrent protection
stepperE3.setStallCurrent(E3_STALLCURRENT); stepperE3.setStallCurrent(E3_STALLCURRENT);
#endif #endif
} }
#endif #endif
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#ifndef STEPPER_INDIRECTION_H #ifndef STEPPER_INDIRECTION_H
#define STEPPER_INDIRECTION_H #define STEPPER_INDIRECTION_H
#include "macros.h"
// X motor // X motor
#define X_STEP_INIT SET_OUTPUT(X_STEP_PIN) #define X_STEP_INIT SET_OUTPUT(X_STEP_PIN)
#define X_STEP_WRITE(STATE) WRITE(X_STEP_PIN,STATE) #define X_STEP_WRITE(STATE) WRITE(X_STEP_PIN,STATE)
...@@ -156,12 +158,12 @@ ...@@ -156,12 +158,12 @@
// Pin redefines for TMC drivers. // Pin redefines for TMC drivers.
// TMC26X drivers have step and dir on normal pins, but everything else via SPI // TMC26X drivers have step and dir on normal pins, but everything else via SPI
////////////////////////////////// //////////////////////////////////
#ifdef HAVE_TMCDRIVER #if ENABLED(HAVE_TMCDRIVER)
#include <SPI.h> #include <SPI.h>
#include <TMC26XStepper.h> #include <TMC26XStepper.h>
void tmc_init(); void tmc_init();
#ifdef X_IS_TMC #if ENABLED(X_IS_TMC)
extern TMC26XStepper stepperX; extern TMC26XStepper stepperX;
#undef X_ENABLE_INIT #undef X_ENABLE_INIT
#define X_ENABLE_INIT ((void)0) #define X_ENABLE_INIT ((void)0)
...@@ -173,7 +175,7 @@ ...@@ -173,7 +175,7 @@
#define X_ENABLE_READ stepperX.isEnabled() #define X_ENABLE_READ stepperX.isEnabled()
#endif #endif
#ifdef X2_IS_TMC #if ENABLED(X2_IS_TMC)
extern TMC26XStepper stepperX2; extern TMC26XStepper stepperX2;
#undef X2_ENABLE_INIT #undef X2_ENABLE_INIT
#define X2_ENABLE_INIT ((void)0) #define X2_ENABLE_INIT ((void)0)
...@@ -184,7 +186,7 @@ ...@@ -184,7 +186,7 @@
#undef X2_ENABLE_READ #undef X2_ENABLE_READ
#define X2_ENABLE_READ stepperX2.isEnabled() #define X2_ENABLE_READ stepperX2.isEnabled()
#endif #endif
#ifdef Y_IS_TMC #if ENABLED(Y_IS_TMC)
extern TMC26XStepper stepperY; extern TMC26XStepper stepperY;
#undef Y_ENABLE_INIT #undef Y_ENABLE_INIT
#define Y_ENABLE_INIT ((void)0) #define Y_ENABLE_INIT ((void)0)
...@@ -195,7 +197,7 @@ ...@@ -195,7 +197,7 @@
#undef Y_ENABLE_READ #undef Y_ENABLE_READ
#define Y_ENABLE_READ stepperY.isEnabled() #define Y_ENABLE_READ stepperY.isEnabled()
#endif #endif
#ifdef Y2_IS_TMC #if ENABLED(Y2_IS_TMC)
extern TMC26XStepper stepperY2; extern TMC26XStepper stepperY2;
#undef Y2_ENABLE_INIT #undef Y2_ENABLE_INIT
#define Y2_ENABLE_INIT ((void)0) #define Y2_ENABLE_INIT ((void)0)
...@@ -206,7 +208,7 @@ ...@@ -206,7 +208,7 @@
#undef Y2_ENABLE_READ #undef Y2_ENABLE_READ
#define Y2_ENABLE_READ stepperY2.isEnabled() #define Y2_ENABLE_READ stepperY2.isEnabled()
#endif #endif
#ifdef Z_IS_TMC #if ENABLED(Z_IS_TMC)
extern TMC26XStepper stepperZ; extern TMC26XStepper stepperZ;
#undef Z_ENABLE_INIT #undef Z_ENABLE_INIT
#define Z_ENABLE_INIT ((void)0) #define Z_ENABLE_INIT ((void)0)
...@@ -217,7 +219,7 @@ ...@@ -217,7 +219,7 @@
#undef Z_ENABLE_READ #undef Z_ENABLE_READ
#define Z_ENABLE_READ stepperZ.isEnabled() #define Z_ENABLE_READ stepperZ.isEnabled()
#endif #endif
#ifdef Z2_IS_TMC #if ENABLED(Z2_IS_TMC)
extern TMC26XStepper stepperZ2; extern TMC26XStepper stepperZ2;
#undef Z2_ENABLE_INIT #undef Z2_ENABLE_INIT
#define Z2_ENABLE_INIT ((void)0) #define Z2_ENABLE_INIT ((void)0)
...@@ -228,7 +230,7 @@ ...@@ -228,7 +230,7 @@
#undef Z2_ENABLE_READ #undef Z2_ENABLE_READ
#define Z2_ENABLE_READ stepperZ2.isEnabled() #define Z2_ENABLE_READ stepperZ2.isEnabled()
#endif #endif
#ifdef E0_IS_TMC #if ENABLED(E0_IS_TMC)
extern TMC26XStepper stepperE0; extern TMC26XStepper stepperE0;
#undef E0_ENABLE_INIT #undef E0_ENABLE_INIT
#define E0_ENABLE_INIT ((void)0) #define E0_ENABLE_INIT ((void)0)
...@@ -239,7 +241,7 @@ ...@@ -239,7 +241,7 @@
#undef E0_ENABLE_READ #undef E0_ENABLE_READ
#define E0_ENABLE_READ stepperE0.isEnabled() #define E0_ENABLE_READ stepperE0.isEnabled()
#endif #endif
#ifdef E1_IS_TMC #if ENABLED(E1_IS_TMC)
extern TMC26XStepper stepperE1; extern TMC26XStepper stepperE1;
#undef E1_ENABLE_INIT #undef E1_ENABLE_INIT
#define E1_ENABLE_INIT ((void)0) #define E1_ENABLE_INIT ((void)0)
...@@ -250,7 +252,7 @@ ...@@ -250,7 +252,7 @@
#undef E1_ENABLE_READ #undef E1_ENABLE_READ
#define E1_ENABLE_READ stepperE1.isEnabled() #define E1_ENABLE_READ stepperE1.isEnabled()
#endif #endif
#ifdef E2_IS_TMC #if ENABLED(E2_IS_TMC)
extern TMC26XStepper stepperE2; extern TMC26XStepper stepperE2;
#undef E2_ENABLE_INIT #undef E2_ENABLE_INIT
#define E2_ENABLE_INIT ((void)0) #define E2_ENABLE_INIT ((void)0)
...@@ -261,7 +263,7 @@ ...@@ -261,7 +263,7 @@
#undef E2_ENABLE_READ #undef E2_ENABLE_READ
#define E2_ENABLE_READ stepperE2.isEnabled() #define E2_ENABLE_READ stepperE2.isEnabled()
#endif #endif
#ifdef E3_IS_TMC #if ENABLED(E3_IS_TMC)
extern TMC26XStepper stepperE3; extern TMC26XStepper stepperE3;
#undef E3_ENABLE_INIT #undef E3_ENABLE_INIT
#define E3_ENABLE_INIT ((void)0) #define E3_ENABLE_INIT ((void)0)
...@@ -279,13 +281,13 @@ ...@@ -279,13 +281,13 @@
// Pin redefines for L6470 drivers. // Pin redefines for L6470 drivers.
// L640 drivers have step on normal pins, but dir and everything else via SPI // L640 drivers have step on normal pins, but dir and everything else via SPI
////////////////////////////////// //////////////////////////////////
#ifdef HAVE_L6470DRIVER #if ENABLED(HAVE_L6470DRIVER)
#include <SPI.h> #include <SPI.h>
#include <L6470.h> #include <L6470.h>
void L6470_init(); void L6470_init();
#ifdef X_IS_L6470 #if ENABLED(X_IS_L6470)
extern L6470 stepperX; extern L6470 stepperX;
#undef X_ENABLE_INIT #undef X_ENABLE_INIT
#define X_ENABLE_INIT ((void)0) #define X_ENABLE_INIT ((void)0)
...@@ -306,7 +308,7 @@ ...@@ -306,7 +308,7 @@
#define X_DIR_READ (stepperX.getStatus() & STATUS_DIR) #define X_DIR_READ (stepperX.getStatus() & STATUS_DIR)
#endif #endif
#ifdef X2_IS_L6470 #if ENABLED(X2_IS_L6470)
extern L6470 stepperX2; extern L6470 stepperX2;
#undef X2_ENABLE_INIT #undef X2_ENABLE_INIT
#define X2_ENABLE_INIT ((void)0) #define X2_ENABLE_INIT ((void)0)
...@@ -326,7 +328,7 @@ ...@@ -326,7 +328,7 @@
#undef X2_DIR_READ #undef X2_DIR_READ
#define X2_DIR_READ (stepperX2.getStatus() & STATUS_DIR) #define X2_DIR_READ (stepperX2.getStatus() & STATUS_DIR)
#endif #endif
#ifdef Y_IS_L6470 #if ENABLED(Y_IS_L6470)
extern L6470 stepperY; extern L6470 stepperY;
#undef Y_ENABLE_INIT #undef Y_ENABLE_INIT
#define Y_ENABLE_INIT ((void)0) #define Y_ENABLE_INIT ((void)0)
...@@ -346,7 +348,7 @@ ...@@ -346,7 +348,7 @@
#undef Y_DIR_READ #undef Y_DIR_READ
#define Y_DIR_READ (stepperY.getStatus() & STATUS_DIR) #define Y_DIR_READ (stepperY.getStatus() & STATUS_DIR)
#endif #endif
#ifdef Y2_IS_L6470 #if ENABLED(Y2_IS_L6470)
extern L6470 stepperY2; extern L6470 stepperY2;
#undef Y2_ENABLE_INIT #undef Y2_ENABLE_INIT
#define Y2_ENABLE_INIT ((void)0) #define Y2_ENABLE_INIT ((void)0)
...@@ -366,7 +368,7 @@ ...@@ -366,7 +368,7 @@
#undef Y2_DIR_READ #undef Y2_DIR_READ
#define Y2_DIR_READ (stepperY2.getStatus() & STATUS_DIR) #define Y2_DIR_READ (stepperY2.getStatus() & STATUS_DIR)
#endif #endif
#ifdef Z_IS_L6470 #if ENABLED(Z_IS_L6470)
extern L6470 stepperZ; extern L6470 stepperZ;
#undef Z_ENABLE_INIT #undef Z_ENABLE_INIT
#define Z_ENABLE_INIT ((void)0) #define Z_ENABLE_INIT ((void)0)
...@@ -386,7 +388,7 @@ ...@@ -386,7 +388,7 @@
#undef Y_DIR_READ #undef Y_DIR_READ
#define Y_DIR_READ (stepperZ.getStatus() & STATUS_DIR) #define Y_DIR_READ (stepperZ.getStatus() & STATUS_DIR)
#endif #endif
#ifdef Z2_IS_L6470 #if ENABLED(Z2_IS_L6470)
extern L6470 stepperZ2; extern L6470 stepperZ2;
#undef Z2_ENABLE_INIT #undef Z2_ENABLE_INIT
#define Z2_ENABLE_INIT ((void)0) #define Z2_ENABLE_INIT ((void)0)
...@@ -406,7 +408,7 @@ ...@@ -406,7 +408,7 @@
#undef Y2_DIR_READ #undef Y2_DIR_READ
#define Y2_DIR_READ (stepperZ2.getStatus() & STATUS_DIR) #define Y2_DIR_READ (stepperZ2.getStatus() & STATUS_DIR)
#endif #endif
#ifdef E0_IS_L6470 #if ENABLED(E0_IS_L6470)
extern L6470 stepperE0; extern L6470 stepperE0;
#undef E0_ENABLE_INIT #undef E0_ENABLE_INIT
#define E0_ENABLE_INIT ((void)0) #define E0_ENABLE_INIT ((void)0)
...@@ -426,7 +428,7 @@ ...@@ -426,7 +428,7 @@
#undef E0_DIR_READ #undef E0_DIR_READ
#define E0_DIR_READ (stepperE0.getStatus() & STATUS_DIR) #define E0_DIR_READ (stepperE0.getStatus() & STATUS_DIR)
#endif #endif
#ifdef E1_IS_L6470 #if ENABLED(E1_IS_L6470)
extern L6470 stepperE1; extern L6470 stepperE1;
#undef E1_ENABLE_INIT #undef E1_ENABLE_INIT
#define E1_ENABLE_INIT ((void)0) #define E1_ENABLE_INIT ((void)0)
...@@ -446,7 +448,7 @@ ...@@ -446,7 +448,7 @@
#undef E1_DIR_READ #undef E1_DIR_READ
#define E1_DIR_READ (stepperE1.getStatus() & STATUS_DIR) #define E1_DIR_READ (stepperE1.getStatus() & STATUS_DIR)
#endif #endif
#ifdef E2_IS_L6470 #if ENABLED(E2_IS_L6470)
extern L6470 stepperE2; extern L6470 stepperE2;
#undef E2_ENABLE_INIT #undef E2_ENABLE_INIT
#define E2_ENABLE_INIT ((void)0) #define E2_ENABLE_INIT ((void)0)
...@@ -466,7 +468,7 @@ ...@@ -466,7 +468,7 @@
#undef E2_DIR_READ #undef E2_DIR_READ
#define E2_DIR_READ (stepperE2.getStatus() & STATUS_DIR) #define E2_DIR_READ (stepperE2.getStatus() & STATUS_DIR)
#endif #endif
#ifdef E3_IS_L6470 #if ENABLED(E3_IS_L6470)
extern L6470 stepperE3; extern L6470 stepperE3;
#undef E3_ENABLE_INIT #undef E3_ENABLE_INIT
#define E3_ENABLE_INIT ((void)0) #define E3_ENABLE_INIT ((void)0)
......
This diff is collapsed.
...@@ -50,13 +50,13 @@ void manage_heater(); //it is critical that this is called periodically. ...@@ -50,13 +50,13 @@ void manage_heater(); //it is critical that this is called periodically.
// do not use these routines and variables outside of temperature.cpp // do not use these routines and variables outside of temperature.cpp
extern int target_temperature[4]; extern int target_temperature[4];
extern float current_temperature[4]; extern float current_temperature[4];
#ifdef SHOW_TEMP_ADC_VALUES #if ENABLED(SHOW_TEMP_ADC_VALUES)
extern int current_temperature_raw[4]; extern int current_temperature_raw[4];
extern int current_temperature_bed_raw; extern int current_temperature_bed_raw;
#endif #endif
extern int target_temperature_bed; extern int target_temperature_bed;
extern float current_temperature_bed; extern float current_temperature_bed;
#ifdef TEMP_SENSOR_1_AS_REDUNDANT #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
extern float redundant_temperature; extern float redundant_temperature;
#endif #endif
...@@ -64,7 +64,7 @@ extern float current_temperature_bed; ...@@ -64,7 +64,7 @@ extern float current_temperature_bed;
extern unsigned char soft_pwm_bed; extern unsigned char soft_pwm_bed;
#endif #endif
#ifdef PIDTEMP #if ENABLED(PIDTEMP)
extern float Kp[HOTENDS], Ki[HOTENDS], Kd[HOTENDS]; extern float Kp[HOTENDS], Ki[HOTENDS], Kd[HOTENDS];
#define PID_PARAM(param, e) param[e] // use macro to point to array value #define PID_PARAM(param, e) param[e] // use macro to point to array value
float scalePID_i(float i); float scalePID_i(float i);
...@@ -72,11 +72,12 @@ extern float current_temperature_bed; ...@@ -72,11 +72,12 @@ extern float current_temperature_bed;
float unscalePID_i(float i); float unscalePID_i(float i);
float unscalePID_d(float d); float unscalePID_d(float d);
#endif #endif
#ifdef PIDTEMPBED
#if ENABLED(PIDTEMPBED)
extern float bedKp,bedKi,bedKd; extern float bedKp,bedKi,bedKd;
#endif #endif
#ifdef BABYSTEPPING #if ENABLED(BABYSTEPPING)
extern volatile int babystepsTodo[3]; extern volatile int babystepsTodo[3];
#endif #endif
...@@ -92,25 +93,30 @@ extern float current_temperature_bed; ...@@ -92,25 +93,30 @@ extern float current_temperature_bed;
FORCE_INLINE float degHotend(uint8_t hotend) { return current_temperature[HOTEND_ARG]; } FORCE_INLINE float degHotend(uint8_t hotend) { return current_temperature[HOTEND_ARG]; }
FORCE_INLINE float degBed() { return current_temperature_bed; } FORCE_INLINE float degBed() { return current_temperature_bed; }
#ifdef SHOW_TEMP_ADC_VALUES #if ENABLED(SHOW_TEMP_ADC_VALUES)
FORCE_INLINE float rawHotendTemp(uint8_t hotend) { return current_temperature_raw[HOTEND_ARG]; } FORCE_INLINE float rawHotendTemp(uint8_t hotend) { return current_temperature_raw[HOTEND_ARG]; }
FORCE_INLINE float rawBedTemp() { return current_temperature_bed_raw; } FORCE_INLINE float rawBedTemp() { return current_temperature_bed_raw; }
#endif #endif
FORCE_INLINE float degTargetHotend(uint8_t hotend) { return target_temperature[HOTEND_ARG]; } FORCE_INLINE float degTargetHotend(uint8_t hotend) { return target_temperature[HOTEND_ARG]; }
FORCE_INLINE float degTargetBed() { return target_temperature_bed; } FORCE_INLINE float degTargetBed() { return target_temperature_bed; }
FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t hotend) { target_temperature[HOTEND_ARG] = celsius; } #if ENABLED(THERMAL_PROTECTION_HOTENDS)
void start_watching_heater(int e=0);
#endif
FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t hotend) {
target_temperature[HOTEND_ARG] = celsius;
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
start_watching_heater(HOTEND_ARG);
#endif
}
FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; } FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; }
FORCE_INLINE bool isHeatingHotend(uint8_t hotend) { return target_temperature[HOTEND_ARG] > current_temperature[HOTEND_ARG]; } FORCE_INLINE bool isHeatingHotend(uint8_t hotend) { return target_temperature[HOTEND_ARG] > current_temperature[HOTEND_ARG]; }
FORCE_INLINE bool isHeatingBed() { return target_temperature_bed > current_temperature_bed; } FORCE_INLINE bool isHeatingBed() { return target_temperature_bed > current_temperature_bed; }
FORCE_INLINE bool isCoolingHotend(uint8_t hotend) { return target_temperature[HOTEND_ARG] < current_temperature[HOTEND_ARG]; } FORCE_INLINE bool isCoolingHotend(uint8_t hotend) { return target_temperature[HOTEND_ARG] < current_temperature[HOTEND_ARG]; }
FORCE_INLINE bool isCoolingBed() { return target_temperature_bed < current_temperature_bed; } FORCE_INLINE bool isCoolingBed() { return target_temperature_bed < current_temperature_bed; }
#define HOTEND_ROUTINES(NR) \ #define HOTEND_ROUTINES(NR) \
...@@ -138,7 +144,6 @@ HOTEND_ROUTINES(0); ...@@ -138,7 +144,6 @@ HOTEND_ROUTINES(0);
int getHeaterPower(int heater); int getHeaterPower(int heater);
void disable_all_heaters(); void disable_all_heaters();
void setWatch();
void updatePID(); void updatePID();
void PID_autotune(float temp, int extruder, int ncycles); void PID_autotune(float temp, int extruder, int ncycles);
...@@ -146,12 +151,8 @@ void PID_autotune(float temp, int extruder, int ncycles); ...@@ -146,12 +151,8 @@ void PID_autotune(float temp, int extruder, int ncycles);
void setExtruderAutoFanState(int pin, bool state); void setExtruderAutoFanState(int pin, bool state);
void checkExtruderAutoFans(); void checkExtruderAutoFans();
#ifdef WATCH_TEMP_PERIOD
void start_watching_heater(int e=0);
#endif
FORCE_INLINE void autotempShutdown() { FORCE_INLINE void autotempShutdown() {
#ifdef AUTOTEMP #if ENABLED(AUTOTEMP)
if (autotemp_enabled) { if (autotemp_enabled) {
autotemp_enabled = false; autotemp_enabled = false;
if (degTargetHotend(active_extruder) > autotemp_min) if (degTargetHotend(active_extruder) > autotemp_min)
......
This diff is collapsed.
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "Marlin.h" #include "Marlin.h"
#ifdef ULTRA_LCD #if ENABLED(ULTRA_LCD)
int lcd_strlen(char *s); int lcd_strlen(char *s);
int lcd_strlen_P(const char *s); int lcd_strlen_P(const char *s);
void lcd_update(); void lcd_update();
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
void lcd_reset_alert_level(); void lcd_reset_alert_level();
bool lcd_detected(void); bool lcd_detected(void);
#if defined(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
void dontExpireStatus(); void dontExpireStatus();
#endif #endif
#if defined(DOGLCD) && LCD_CONTRAST >= 0 #if ENABLED(DOGLCD) && LCD_CONTRAST >= 0
extern int lcd_contrast; extern int lcd_contrast;
void lcd_setcontrast(uint8_t value); void lcd_setcontrast(uint8_t value);
#endif #endif
...@@ -33,10 +33,10 @@ ...@@ -33,10 +33,10 @@
#define LCD_UPDATE_INTERVAL 100 #define LCD_UPDATE_INTERVAL 100
#define LCD_TIMEOUT_TO_STATUS 15000 #define LCD_TIMEOUT_TO_STATUS 15000
#ifdef ULTIPANEL #if ENABLED(ULTIPANEL)
void lcd_buttons_update(); void lcd_buttons_update();
extern volatile uint8_t buttons; //the last checked buttons in a bit array. extern volatile uint8_t buttons; //the last checked buttons in a bit array.
#ifdef REPRAPWORLD_KEYPAD #if ENABLED(REPRAPWORLD_KEYPAD)
extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
#endif #endif
#else #else
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
extern bool cancel_heatup; extern bool cancel_heatup;
#if (HAS_FILAMENT_SENSOR && defined(FILAMENT_LCD_DISPLAY)) || (HAS_POWER_CONSUMPTION_SENSOR && defined(POWER_CONSUMPTION_LCD_DISPLAY)) #if (HAS_FILAMENT_SENSOR && ENABLED(FILAMENT_LCD_DISPLAY)) || (HAS_POWER_CONSUMPTION_SENSOR && ENABLED(POWER_CONSUMPTION_LCD_DISPLAY))
extern millis_t previous_lcd_status_ms; extern millis_t previous_lcd_status_ms;
#endif #endif
...@@ -65,17 +65,17 @@ ...@@ -65,17 +65,17 @@
void lcd_ignore_click(bool b=true); void lcd_ignore_click(bool b=true);
#ifdef NEWPANEL #if ENABLED(NEWPANEL)
#define EN_C BIT(BLEN_C) #define EN_C BIT(BLEN_C)
#define EN_B BIT(BLEN_B) #define EN_B BIT(BLEN_B)
#define EN_A BIT(BLEN_A) #define EN_A BIT(BLEN_A)
#define LCD_CLICKED (buttons&EN_C) #define LCD_CLICKED (buttons&EN_C)
#if defined(BTN_BACK) && BTN_BACK > 0 #if ENABLED(BTN_BACK) && BTN_BACK > 0
#define EN_D BIT(BLEN_D) #define EN_D BIT(BLEN_D)
#define LCD_BACK_CLICKED (buttons&EN_D) #define LCD_BACK_CLICKED (buttons&EN_D)
#endif #endif
#ifdef REPRAPWORLD_KEYPAD #if ENABLED(REPRAPWORLD_KEYPAD)
#define EN_REPRAPWORLD_KEYPAD_F3 (BIT(BLEN_REPRAPWORLD_KEYPAD_F3)) #define EN_REPRAPWORLD_KEYPAD_F3 (BIT(BLEN_REPRAPWORLD_KEYPAD_F3))
#define EN_REPRAPWORLD_KEYPAD_F2 (BIT(BLEN_REPRAPWORLD_KEYPAD_F2)) #define EN_REPRAPWORLD_KEYPAD_F2 (BIT(BLEN_REPRAPWORLD_KEYPAD_F2))
#define EN_REPRAPWORLD_KEYPAD_F1 (BIT(BLEN_REPRAPWORLD_KEYPAD_F1)) #define EN_REPRAPWORLD_KEYPAD_F1 (BIT(BLEN_REPRAPWORLD_KEYPAD_F1))
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "Marlin.h" #include "Marlin.h"
#ifdef U8GLIB_ST7920 #if ENABLED(U8GLIB_ST7920)
//set optimization so ARDUINO optimizes this file //set optimization so ARDUINO optimizes this file
#pragma GCC optimize (3) #pragma GCC optimize (3)
......
This diff is collapsed.
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <math.h> #include <math.h>
#include "Marlin.h" #include "Marlin.h"
#ifdef ENABLE_AUTO_BED_LEVELING #if ENABLED(ENABLE_AUTO_BED_LEVELING)
#include "vector_3.h" #include "vector_3.h"
vector_3::vector_3() : x(0), y(0), z(0) { } vector_3::vector_3() : x(0), y(0), z(0) { }
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef VECTOR_3_H #ifndef VECTOR_3_H
#define VECTOR_3_H #define VECTOR_3_H
#ifdef ENABLE_AUTO_BED_LEVELING #if ENABLED(ENABLE_AUTO_BED_LEVELING)
class matrix_3x3; class matrix_3x3;
struct vector_3 struct vector_3
......
#include "Marlin.h" #include "Marlin.h"
#ifdef USE_WATCHDOG #if ENABLED(USE_WATCHDOG)
#include <avr/wdt.h> #include <avr/wdt.h>
#include "watchdog.h" #include "watchdog.h"
...@@ -18,15 +18,15 @@ ...@@ -18,15 +18,15 @@
/// intialise watch dog with a 4 sec interrupt time /// intialise watch dog with a 4 sec interrupt time
void watchdog_init() void watchdog_init()
{ {
#ifdef WATCHDOG_RESET_MANUAL #if ENABLED(WATCHDOG_RESET_MANUAL)
//We enable the watchdog timer, but only for the interrupt. //We enable the watchdog timer, but only for the interrupt.
//Take care, as this requires the correct order of operation, with interrupts disabled. See the datasheet of any AVR chip for details. //Take care, as this requires the correct order of operation, with interrupts disabled. See the datasheet of any AVR chip for details.
wdt_reset(); wdt_reset();
_WD_CONTROL_REG = _BV(_WD_CHANGE_BIT) | _BV(WDE); _WD_CONTROL_REG = _BV(_WD_CHANGE_BIT) | _BV(WDE);
_WD_CONTROL_REG = _BV(WDIE) | WDTO_4S; _WD_CONTROL_REG = _BV(WDIE) | WDTO_4S;
#else #else
wdt_enable(WDTO_4S); wdt_enable(WDTO_4S);
#endif #endif
} }
/// reset watchdog. MUST be called every 1s after init or avr will reset. /// reset watchdog. MUST be called every 1s after init or avr will reset.
...@@ -40,7 +40,7 @@ void watchdog_reset() ...@@ -40,7 +40,7 @@ void watchdog_reset()
//=========================================================================== //===========================================================================
// Watchdog timer interrupt, called if main program blocks >1sec and manual reset is enabled. // Watchdog timer interrupt, called if main program blocks >1sec and manual reset is enabled.
#ifdef WATCHDOG_RESET_MANUAL #if ENABLED(WATCHDOG_RESET_MANUAL)
ISR(WDT_vect) { ISR(WDT_vect) {
ECHO_LM(ER, MSG_WATCHDOG_RESET); ECHO_LM(ER, MSG_WATCHDOG_RESET);
kill(PSTR("ERR:Please Reset")); // kill blocks //16 characters so it fits on a 16x2 display kill(PSTR("ERR:Please Reset")); // kill blocks //16 characters so it fits on a 16x2 display
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "Marlin.h" #include "Marlin.h"
#ifdef USE_WATCHDOG #if ENABLED(USE_WATCHDOG)
// initialize watch dog with a 1 sec interrupt time // initialize watch dog with a 1 sec interrupt time
void watchdog_init(); void watchdog_init();
// pad the dog/reset watchdog. MUST be called at least every second after the first watchdog_init or AVR will go into emergency procedures.. // pad the dog/reset watchdog. MUST be called at least every second after the first watchdog_init or AVR will go into emergency procedures..
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment