commit
433a22189b
@ -1,20 +1,116 @@
|
||||
// Our automatic versioning scheme generates the following file
|
||||
// NEVER put it in the repository
|
||||
_Version.h
|
||||
#
|
||||
# Marlin 3D Printer Firmware
|
||||
# Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
#
|
||||
# Based on Sprinter and grbl.
|
||||
# Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
// All of the following OS, IDE and compiler generated file
|
||||
// references should be moved from this file
|
||||
// They are needed, but they belong in your global .gitignore
|
||||
// rather than in a per-project file such as this
|
||||
# Our automatic versioning scheme generates the following file
|
||||
# NEVER put it in the repository
|
||||
_Version.h
|
||||
|
||||
*.o
|
||||
#
|
||||
# OS
|
||||
#
|
||||
applet/
|
||||
*.DS_Store
|
||||
|
||||
|
||||
#
|
||||
# Misc
|
||||
#
|
||||
*~
|
||||
*.orig
|
||||
*.rej
|
||||
*.bak
|
||||
*.DS_Store
|
||||
*.idea
|
||||
*.s
|
||||
*.i
|
||||
*.ii
|
||||
*.swp
|
||||
|
||||
|
||||
#
|
||||
# C++
|
||||
#
|
||||
# Compiled Object files
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
*.dylib
|
||||
*.dll
|
||||
|
||||
# Fortran module files
|
||||
*.mod
|
||||
*.smod
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai
|
||||
*.la
|
||||
*.a
|
||||
*.lib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
|
||||
|
||||
#
|
||||
# C
|
||||
#
|
||||
# Object files
|
||||
*.o
|
||||
*.ko
|
||||
*.obj
|
||||
*.elf
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Libraries
|
||||
*.lib
|
||||
*.a
|
||||
*.la
|
||||
*.lo
|
||||
|
||||
# Shared objects (inc. Windows DLLs)
|
||||
*.dll
|
||||
*.so
|
||||
*.so.*
|
||||
*.dylib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
*.i*86
|
||||
*.x86_64
|
||||
*.hex
|
||||
|
||||
# Debug files
|
||||
*.dSYM/
|
||||
*.su
|
||||
|
@ -0,0 +1,319 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Conditionals_LCD.h
|
||||
* LCD Defines that depend on configuration but are not editable.
|
||||
*/
|
||||
|
||||
#ifndef CONDITIONALS_LCD_H // Get the LCD defines which are needed first
|
||||
#define CONDITIONALS_LCD_H
|
||||
|
||||
#define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT))
|
||||
|
||||
#if ENABLED(CARTESIO_UI)
|
||||
#define DOGLCD
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
#define DEFAULT_LCD_CONTRAST 90
|
||||
#define LCD_CONTRAST_MIN 60
|
||||
#define LCD_CONTRAST_MAX 140
|
||||
#endif
|
||||
|
||||
#if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL)
|
||||
#define DOGLCD
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
#define DEFAULT_LCD_CONTRAST 17
|
||||
#endif
|
||||
|
||||
#if ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
|
||||
#define ULTRA_LCD //general LCD support, also 16x2
|
||||
#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
|
||||
#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
|
||||
|
||||
#if ENABLED(miniVIKI)
|
||||
#define LCD_CONTRAST_MIN 75
|
||||
#define LCD_CONTRAST_MAX 115
|
||||
#define DEFAULT_LCD_CONTRAST 95
|
||||
#elif ENABLED(VIKI2)
|
||||
#define DEFAULT_LCD_CONTRAST 40
|
||||
#elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
|
||||
#define LCD_CONTRAST_MIN 90
|
||||
#define LCD_CONTRAST_MAX 130
|
||||
#define DEFAULT_LCD_CONTRAST 110
|
||||
#define U8GLIB_LM6059_AF
|
||||
#define SD_DETECT_INVERTED
|
||||
#endif
|
||||
|
||||
#ifndef ENCODER_PULSES_PER_STEP
|
||||
#define ENCODER_PULSES_PER_STEP 4
|
||||
#endif
|
||||
#ifndef ENCODER_STEPS_PER_MENU_ITEM
|
||||
#define ENCODER_STEPS_PER_MENU_ITEM 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Generic support for SSD1306 / SH1106 OLED based LCDs.
|
||||
#if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SH1106)
|
||||
#define ULTRA_LCD //general LCD support, also 16x2
|
||||
#define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 / SH1106 graphic Display Family)
|
||||
#endif
|
||||
|
||||
#if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106)
|
||||
#define ULTIMAKERCONTROLLER
|
||||
#endif
|
||||
|
||||
#if ENABLED(BQ_LCD_SMART_CONTROLLER)
|
||||
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
|
||||
|
||||
#ifndef ENCODER_PULSES_PER_STEP
|
||||
#define ENCODER_PULSES_PER_STEP 4
|
||||
#endif
|
||||
#ifndef ENCODER_STEPS_PER_MENU_ITEM
|
||||
#define ENCODER_STEPS_PER_MENU_ITEM 1
|
||||
#endif
|
||||
|
||||
#ifndef LONG_FILENAME_HOST_SUPPORT
|
||||
#define LONG_FILENAME_HOST_SUPPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
|
||||
#define DOGLCD
|
||||
#define U8GLIB_ST7920
|
||||
#define REPRAP_DISCOUNT_SMART_CONTROLLER
|
||||
#endif
|
||||
|
||||
#if ENABLED(ULTIMAKERCONTROLLER) \
|
||||
|| ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
|
||||
|| ENABLED(G3D_PANEL) \
|
||||
|| ENABLED(RIGIDBOT_PANEL) \
|
||||
|| ENABLED(REPRAPWORLD_KEYPAD)
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
#endif
|
||||
|
||||
#if ENABLED(RA_CONTROL_PANEL)
|
||||
#define LCD_I2C_TYPE_PCA8574
|
||||
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
#endif
|
||||
|
||||
#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
|
||||
#define DOGLCD
|
||||
#define U8GLIB_ST7920
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
#endif
|
||||
|
||||
/**
|
||||
* I2C PANELS
|
||||
*/
|
||||
|
||||
#if ENABLED(LCD_I2C_SAINSMART_YWROBOT)
|
||||
// This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
|
||||
// Make sure it is placed in the Arduino libraries directory.
|
||||
#define LCD_I2C_TYPE_PCF8575
|
||||
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
#endif
|
||||
|
||||
// PANELOLU2 LCD with status LEDs, separate encoder and click inputs
|
||||
#if ENABLED(LCD_I2C_PANELOLU2)
|
||||
#define LCD_I2C_TYPE_MCP23017
|
||||
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
|
||||
#define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
|
||||
|
||||
#ifndef ENCODER_PULSES_PER_STEP
|
||||
#define ENCODER_PULSES_PER_STEP 4
|
||||
#endif
|
||||
#ifndef ENCODER_STEPS_PER_MENU_ITEM
|
||||
#define ENCODER_STEPS_PER_MENU_ITEM 1
|
||||
#endif
|
||||
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
#endif
|
||||
|
||||
// Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
|
||||
#if ENABLED(LCD_I2C_VIKI)
|
||||
// This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
|
||||
// Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
|
||||
// Note: The pause/stop/resume LCD button pin should be connected to the Arduino
|
||||
// BTN_ENC pin (or set BTN_ENC to -1 if not used)
|
||||
#define LCD_I2C_TYPE_MCP23017
|
||||
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
|
||||
#define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
|
||||
#define ENCODER_FEEDRATE_DEADZONE 4
|
||||
|
||||
#ifndef ENCODER_PULSES_PER_STEP
|
||||
#define ENCODER_PULSES_PER_STEP 1
|
||||
#endif
|
||||
#ifndef ENCODER_STEPS_PER_MENU_ITEM
|
||||
#define ENCODER_STEPS_PER_MENU_ITEM 2
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Shift register panels
|
||||
// ---------------------
|
||||
// 2 wire Non-latching LCD SR from:
|
||||
// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
|
||||
|
||||
#if ENABLED(SAV_3DLCD)
|
||||
#define SR_LCD_2W_NL // Non latching 2 wire shift register
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
#endif
|
||||
|
||||
#if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display
|
||||
#ifndef LCD_WIDTH
|
||||
#define LCD_WIDTH 22
|
||||
#endif
|
||||
#ifndef LCD_HEIGHT
|
||||
#define LCD_HEIGHT 5
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(ULTIPANEL)
|
||||
#define NEWPANEL //enable this if you have a click-encoder panel
|
||||
#define ULTRA_LCD
|
||||
#ifndef LCD_WIDTH
|
||||
#define LCD_WIDTH 20
|
||||
#endif
|
||||
#ifndef LCD_HEIGHT
|
||||
#define LCD_HEIGHT 4
|
||||
#endif
|
||||
#else //no panel but just LCD
|
||||
#if ENABLED(ULTRA_LCD)
|
||||
#ifndef LCD_WIDTH
|
||||
#define LCD_WIDTH 16
|
||||
#endif
|
||||
#ifndef LCD_HEIGHT
|
||||
#define LCD_HEIGHT 2
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(DOGLCD)
|
||||
/* Custom characters defined in font dogm_font_data_Marlin_symbols.h / Marlin_symbols.fon */
|
||||
// \x00 intentionally skipped to avoid problems in strings
|
||||
#define LCD_STR_REFRESH "\x01"
|
||||
#define LCD_STR_FOLDER "\x02"
|
||||
#define LCD_STR_ARROW_RIGHT "\x03"
|
||||
#define LCD_STR_UPLEVEL "\x04"
|
||||
#define LCD_STR_CLOCK "\x05"
|
||||
#define LCD_STR_FEEDRATE "\x06"
|
||||
#define LCD_STR_BEDTEMP "\x07"
|
||||
#define LCD_STR_THERMOMETER "\x08"
|
||||
#define LCD_STR_DEGREE "\x09"
|
||||
|
||||
#define LCD_STR_SPECIAL_MAX '\x09'
|
||||
// Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin.
|
||||
// Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here.
|
||||
#else
|
||||
/* Custom characters defined in the first 8 characters of the LCD */
|
||||
#define LCD_STR_BEDTEMP "\x00" // Print only as a char. This will have 'unexpected' results when used in a string!
|
||||
#define LCD_STR_DEGREE "\x01"
|
||||
#define LCD_STR_THERMOMETER "\x02"
|
||||
#define LCD_STR_UPLEVEL "\x03"
|
||||
#define LCD_STR_REFRESH "\x04"
|
||||
#define LCD_STR_FOLDER "\x05"
|
||||
#define LCD_STR_FEEDRATE "\x06"
|
||||
#define LCD_STR_CLOCK "\x07"
|
||||
#define LCD_STR_ARROW_RIGHT ">" /* from the default character set */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Default LCD contrast for dogm-like LCD displays
|
||||
*/
|
||||
#if ENABLED(DOGLCD)
|
||||
|
||||
#define HAS_LCD_CONTRAST ( \
|
||||
ENABLED(MAKRPANEL) \
|
||||
|| ENABLED(CARTESIO_UI) \
|
||||
|| ENABLED(VIKI2) \
|
||||
|| ENABLED(miniVIKI) \
|
||||
|| ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
|
||||
)
|
||||
|
||||
#if HAS_LCD_CONTRAST
|
||||
#ifndef LCD_CONTRAST_MIN
|
||||
#define LCD_CONTRAST_MIN 0
|
||||
#endif
|
||||
#ifndef LCD_CONTRAST_MAX
|
||||
#define LCD_CONTRAST_MAX 63
|
||||
#endif
|
||||
#ifndef DEFAULT_LCD_CONTRAST
|
||||
#define DEFAULT_LCD_CONTRAST 32
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef BOOTSCREEN_TIMEOUT
|
||||
#define BOOTSCREEN_TIMEOUT 2500
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Extruders have some combination of stepper motors and hotends
|
||||
* so we separate these concepts into the defines:
|
||||
*
|
||||
* EXTRUDERS - Number of Selectable Tools
|
||||
* HOTENDS - Number of hotends, whether connected or separate
|
||||
* E_STEPPERS - Number of actual E stepper motors
|
||||
* TOOL_E_INDEX - Index to use when getting/setting the tool state
|
||||
*
|
||||
*/
|
||||
#if ENABLED(SINGLENOZZLE) // One hotend, multi-extruder
|
||||
#define HOTENDS 1
|
||||
#define E_STEPPERS EXTRUDERS
|
||||
#define E_MANUAL EXTRUDERS
|
||||
#define TOOL_E_INDEX current_block->active_extruder
|
||||
#undef TEMP_SENSOR_1_AS_REDUNDANT
|
||||
#undef HOTEND_OFFSET_X
|
||||
#undef HOTEND_OFFSET_Y
|
||||
#elif ENABLED(SWITCHING_EXTRUDER) // One E stepper, unified E axis, two hotends
|
||||
#define HOTENDS EXTRUDERS
|
||||
#define E_STEPPERS 1
|
||||
#define E_MANUAL 1
|
||||
#define TOOL_E_INDEX 0
|
||||
#ifndef HOTEND_OFFSET_Z
|
||||
#define HOTEND_OFFSET_Z { 0 }
|
||||
#endif
|
||||
#elif ENABLED(MIXING_EXTRUDER) // Multi-stepper, unified E axis, one hotend
|
||||
#define HOTENDS 1
|
||||
#define E_STEPPERS MIXING_STEPPERS
|
||||
#define E_MANUAL 1
|
||||
#define TOOL_E_INDEX 0
|
||||
#else // One stepper, E axis, and hotend per tool
|
||||
#define HOTENDS EXTRUDERS
|
||||
#define E_STEPPERS EXTRUDERS
|
||||
#define E_MANUAL EXTRUDERS
|
||||
#define TOOL_E_INDEX current_block->active_extruder
|
||||
#endif
|
||||
|
||||
#endif //CONDITIONALS_LCD_H
|
@ -0,0 +1,663 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Conditionals_post.h
|
||||
* Defines that depend on configuration but are not editable.
|
||||
*/
|
||||
|
||||
#ifndef CONDITIONALS_POST_H
|
||||
#define CONDITIONALS_POST_H
|
||||
|
||||
#if ENABLED(EMERGENCY_PARSER)
|
||||
#define EMERGENCY_PARSER_CAPABILITIES " EMERGENCY_CODES:M108,M112,M410"
|
||||
#else
|
||||
#define EMERGENCY_PARSER_CAPABILITIES ""
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Set ENDSTOPPULLUPS for unused endstop switches
|
||||
*/
|
||||
#if ENABLED(ENDSTOPPULLUPS)
|
||||
#if ENABLED(USE_XMAX_PLUG)
|
||||
#define ENDSTOPPULLUP_XMAX
|
||||
#endif
|
||||
#if ENABLED(USE_YMAX_PLUG)
|
||||
#define ENDSTOPPULLUP_YMAX
|
||||
#endif
|
||||
#if ENABLED(USE_ZMAX_PLUG)
|
||||
#define ENDSTOPPULLUP_ZMAX
|
||||
#endif
|
||||
#if ENABLED(USE_XMIN_PLUG)
|
||||
#define ENDSTOPPULLUP_XMIN
|
||||
#endif
|
||||
#if ENABLED(USE_YMIN_PLUG)
|
||||
#define ENDSTOPPULLUP_YMIN
|
||||
#endif
|
||||
#if ENABLED(USE_ZMIN_PLUG)
|
||||
#define ENDSTOPPULLUP_ZMIN
|
||||
#endif
|
||||
#if DISABLED(DISABLE_Z_MIN_PROBE_ENDSTOP)
|
||||
#define ENDSTOPPULLUP_ZMIN_PROBE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Axis lengths
|
||||
*/
|
||||
#define X_MAX_LENGTH (X_MAX_POS - (X_MIN_POS))
|
||||
#define Y_MAX_LENGTH (Y_MAX_POS - (Y_MIN_POS))
|
||||
#define Z_MAX_LENGTH (Z_MAX_POS - (Z_MIN_POS))
|
||||
|
||||
/**
|
||||
* CoreXY and CoreXZ
|
||||
*/
|
||||
#if ENABLED(COREXY)
|
||||
#define CORE_AXIS_1 A_AXIS // XY from A + B
|
||||
#define CORE_AXIS_2 B_AXIS
|
||||
#define NORMAL_AXIS Z_AXIS
|
||||
#elif ENABLED(COREXZ)
|
||||
#define CORE_AXIS_1 A_AXIS // XZ from A + C
|
||||
#define CORE_AXIS_2 C_AXIS
|
||||
#define NORMAL_AXIS Y_AXIS
|
||||
#elif ENABLED(COREYZ)
|
||||
#define CORE_AXIS_1 B_AXIS // YZ from B + C
|
||||
#define CORE_AXIS_2 C_AXIS
|
||||
#define NORMAL_AXIS X_AXIS
|
||||
#endif
|
||||
|
||||
/**
|
||||
* SCARA
|
||||
*/
|
||||
#if ENABLED(SCARA)
|
||||
#undef SLOWDOWN
|
||||
#define QUICK_HOME //SCARA needs Quickhome
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Set the home position based on settings or manual overrides
|
||||
*/
|
||||
#ifdef MANUAL_X_HOME_POS
|
||||
#define X_HOME_POS MANUAL_X_HOME_POS
|
||||
#elif ENABLED(BED_CENTER_AT_0_0)
|
||||
#if ENABLED(DELTA)
|
||||
#define X_HOME_POS 0
|
||||
#else
|
||||
#define X_HOME_POS ((X_MAX_LENGTH) * (X_HOME_DIR) * 0.5)
|
||||
#endif
|
||||
#else
|
||||
#if ENABLED(DELTA)
|
||||
#define X_HOME_POS ((X_MAX_LENGTH) * 0.5)
|
||||
#else
|
||||
#define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MANUAL_Y_HOME_POS
|
||||
#define Y_HOME_POS MANUAL_Y_HOME_POS
|
||||
#elif ENABLED(BED_CENTER_AT_0_0)
|
||||
#if ENABLED(DELTA)
|
||||
#define Y_HOME_POS 0
|
||||
#else
|
||||
#define Y_HOME_POS ((Y_MAX_LENGTH) * (Y_HOME_DIR) * 0.5)
|
||||
#endif
|
||||
#else
|
||||
#if ENABLED(DELTA)
|
||||
#define Y_HOME_POS ((Y_MAX_LENGTH) * 0.5)
|
||||
#else
|
||||
#define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MANUAL_Z_HOME_POS
|
||||
#define Z_HOME_POS MANUAL_Z_HOME_POS
|
||||
#else
|
||||
#define Z_HOME_POS (Z_HOME_DIR < 0 ? Z_MIN_POS : Z_MAX_POS)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The BLTouch Probe emulates a servo probe
|
||||
*/
|
||||
#if ENABLED(BLTOUCH)
|
||||
#undef Z_ENDSTOP_SERVO_NR
|
||||
#undef Z_SERVO_ANGLES
|
||||
#define Z_ENDSTOP_SERVO_NR 0
|
||||
#define Z_SERVO_ANGLES {10,90} // For BLTouch 10=deploy, 90=retract
|
||||
#undef DEACTIVATE_SERVOS_AFTER_MOVE
|
||||
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
|
||||
#undef Z_MIN_ENDSTOP_INVERTING
|
||||
#define Z_MIN_ENDSTOP_INVERTING false
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Auto Bed Leveling and Z Probe Repeatability Test
|
||||
*/
|
||||
#define HAS_PROBING_PROCEDURE (ENABLED(AUTO_BED_LEVELING_FEATURE) || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST))
|
||||
|
||||
// Boundaries for probing based on set limits
|
||||
#define MIN_PROBE_X (max(X_MIN_POS, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
|
||||
#define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
|
||||
#define MIN_PROBE_Y (max(Y_MIN_POS, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
|
||||
#define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
|
||||
|
||||
#define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0)
|
||||
|
||||
/**
|
||||
* Z Sled Probe requires Z_SAFE_HOMING
|
||||
*/
|
||||
#if ENABLED(Z_PROBE_SLED)
|
||||
#define Z_SAFE_HOMING
|
||||
#endif
|
||||
|
||||
/**
|
||||
* DELTA should ignore Z_SAFE_HOMING
|
||||
*/
|
||||
#if ENABLED(DELTA)
|
||||
#undef Z_SAFE_HOMING
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Safe Homing Options
|
||||
*/
|
||||
#if ENABLED(Z_SAFE_HOMING)
|
||||
#ifndef Z_SAFE_HOMING_X_POINT
|
||||
#define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)
|
||||
#endif
|
||||
#ifndef Z_SAFE_HOMING_Y_POINT
|
||||
#define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Host keep alive
|
||||
*/
|
||||
#ifndef DEFAULT_KEEPALIVE_INTERVAL
|
||||
#define DEFAULT_KEEPALIVE_INTERVAL 2
|
||||
#endif
|
||||
|
||||
/**
|
||||
* MAX_STEP_FREQUENCY differs for TOSHIBA
|
||||
*/
|
||||
#if ENABLED(CONFIG_STEPPERS_TOSHIBA)
|
||||
#define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers
|
||||
#else
|
||||
#define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step)
|
||||
#endif
|
||||
|
||||
// MS1 MS2 Stepper Driver Microstepping mode table
|
||||
#define MICROSTEP1 LOW,LOW
|
||||
#define MICROSTEP2 HIGH,LOW
|
||||
#define MICROSTEP4 LOW,HIGH
|
||||
#define MICROSTEP8 HIGH,HIGH
|
||||
#define MICROSTEP16 HIGH,HIGH
|
||||
|
||||
/**
|
||||
* Advance calculated values
|
||||
*/
|
||||
#if ENABLED(ADVANCE)
|
||||
#define EXTRUSION_AREA (0.25 * (D_FILAMENT) * (D_FILAMENT) * M_PI)
|
||||
#define STEPS_PER_CUBIC_MM_E (axis_steps_per_mm[E_AXIS] / (EXTRUSION_AREA))
|
||||
#endif
|
||||
|
||||
#if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER)
|
||||
#undef SD_DETECT_INVERTED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Set defaults for missing (newer) options
|
||||
*/
|
||||
#ifndef DISABLE_INACTIVE_X
|
||||
#define DISABLE_INACTIVE_X DISABLE_X
|
||||
#endif
|
||||
#ifndef DISABLE_INACTIVE_Y
|
||||
#define DISABLE_INACTIVE_Y DISABLE_Y
|
||||
#endif
|
||||
#ifndef DISABLE_INACTIVE_Z
|
||||
#define DISABLE_INACTIVE_Z DISABLE_Z
|
||||
#endif
|
||||
#ifndef DISABLE_INACTIVE_E
|
||||
#define DISABLE_INACTIVE_E DISABLE_E
|
||||
#endif
|
||||
|
||||
// Power Signal Control Definitions
|
||||
// By default use ATX definition
|
||||
#ifndef POWER_SUPPLY
|
||||
#define POWER_SUPPLY 1
|
||||
#endif
|
||||
#if (POWER_SUPPLY == 1) // 1 = ATX
|
||||
#define PS_ON_AWAKE LOW
|
||||
#define PS_ON_ASLEEP HIGH
|
||||
#elif (POWER_SUPPLY == 2) // 2 = X-Box 360 203W
|
||||
#define PS_ON_AWAKE HIGH
|
||||
#define PS_ON_ASLEEP LOW
|
||||
#endif
|
||||
#define HAS_POWER_SWITCH (POWER_SUPPLY > 0 && PIN_EXISTS(PS_ON))
|
||||
|
||||
/**
|
||||
* Temp Sensor defines
|
||||
*/
|
||||
#if TEMP_SENSOR_0 == -3
|
||||
#define HEATER_0_USES_MAX6675
|
||||
#define MAX6675_IS_MAX31855
|
||||
#elif TEMP_SENSOR_0 == -2
|
||||
#define HEATER_0_USES_MAX6675
|
||||
#elif TEMP_SENSOR_0 == -1
|
||||
#define HEATER_0_USES_AD595
|
||||
#elif TEMP_SENSOR_0 == 0
|
||||
#undef HEATER_0_MINTEMP
|
||||
#undef HEATER_0_MAXTEMP
|
||||
#elif TEMP_SENSOR_0 > 0
|
||||
#define THERMISTORHEATER_0 TEMP_SENSOR_0
|
||||
#define HEATER_0_USES_THERMISTOR
|
||||
#endif
|
||||
|
||||
#if TEMP_SENSOR_1 <= -2
|
||||
#error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_1"
|
||||
#elif TEMP_SENSOR_1 == -1
|
||||
#define HEATER_1_USES_AD595
|
||||
#elif TEMP_SENSOR_1 == 0
|
||||
#undef HEATER_1_MINTEMP
|
||||
#undef HEATER_1_MAXTEMP
|
||||
#elif TEMP_SENSOR_1 > 0
|
||||
#define THERMISTORHEATER_1 TEMP_SENSOR_1
|
||||
#define HEATER_1_USES_THERMISTOR
|
||||
#endif
|
||||
|
||||
#if TEMP_SENSOR_2 <= -2
|
||||
#error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_2"
|
||||
#elif TEMP_SENSOR_2 == -1
|
||||
#define HEATER_2_USES_AD595
|
||||
#elif TEMP_SENSOR_2 == 0
|
||||
#undef HEATER_2_MINTEMP
|
||||
#undef HEATER_2_MAXTEMP
|
||||
#elif TEMP_SENSOR_2 > 0
|
||||
#define THERMISTORHEATER_2 TEMP_SENSOR_2
|
||||
#define HEATER_2_USES_THERMISTOR
|
||||
#endif
|
||||
|
||||
#if TEMP_SENSOR_3 <= -2
|
||||
#error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_3"
|
||||
#elif TEMP_SENSOR_3 == -1
|
||||
#define HEATER_3_USES_AD595
|
||||
#elif TEMP_SENSOR_3 == 0
|
||||
#undef HEATER_3_MINTEMP
|
||||
#undef HEATER_3_MAXTEMP
|
||||
#elif TEMP_SENSOR_3 > 0
|
||||
#define THERMISTORHEATER_3 TEMP_SENSOR_3
|
||||
#define HEATER_3_USES_THERMISTOR
|
||||
#endif
|
||||
|
||||
#if TEMP_SENSOR_BED <= -2
|
||||
#error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_BED"
|
||||
#elif TEMP_SENSOR_BED == -1
|
||||
#define BED_USES_AD595
|
||||
#elif TEMP_SENSOR_BED == 0
|
||||
#undef BED_MINTEMP
|
||||
#undef BED_MAXTEMP
|
||||
#elif TEMP_SENSOR_BED > 0
|
||||
#define THERMISTORBED TEMP_SENSOR_BED
|
||||
#define BED_USES_THERMISTOR
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Flags for PID handling
|
||||
*/
|
||||
#define HAS_PID_HEATING (ENABLED(PIDTEMP) || ENABLED(PIDTEMPBED))
|
||||
#define HAS_PID_FOR_BOTH (ENABLED(PIDTEMP) && ENABLED(PIDTEMPBED))
|
||||
|
||||
/**
|
||||
* Default hotend offsets, if not defined
|
||||
*/
|
||||
#if HOTENDS > 1
|
||||
#ifndef HOTEND_OFFSET_X
|
||||
#define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
|
||||
#endif
|
||||
#ifndef HOTEND_OFFSET_Y
|
||||
#define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder
|
||||
#endif
|
||||
#if !defined(HOTEND_OFFSET_Z) && (ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_EXTRUDER))
|
||||
#define HOTEND_OFFSET_Z { 0 }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ARRAY_BY_EXTRUDERS based on EXTRUDERS
|
||||
*/
|
||||
#define ARRAY_BY_EXTRUDERS(args...) ARRAY_N(EXTRUDERS, args)
|
||||
#define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1, v1, v1)
|
||||
|
||||
/**
|
||||
* ARRAY_BY_HOTENDS based on HOTENDS
|
||||
*/
|
||||
#define ARRAY_BY_HOTENDS(args...) ARRAY_N(HOTENDS, args)
|
||||
#define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1)
|
||||
|
||||
/**
|
||||
* Z_DUAL_ENDSTOPS endstop reassignment
|
||||
*/
|
||||
#if ENABLED(Z_DUAL_ENDSTOPS)
|
||||
#define _XMIN_ 100
|
||||
#define _YMIN_ 200
|
||||
#define _ZMIN_ 300
|
||||
#define _XMAX_ 101
|
||||
#define _YMAX_ 201
|
||||
#define _ZMAX_ 301
|
||||
#if Z2_USE_ENDSTOP == _XMAX_
|
||||
#define Z2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
|
||||
#define Z2_MAX_PIN X_MAX_PIN
|
||||
#undef USE_XMAX_PLUG
|
||||
#elif Z2_USE_ENDSTOP == _YMAX_
|
||||
#define Z2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
|
||||
#define Z2_MAX_PIN Y_MAX_PIN
|
||||
#undef USE_YMAX_PLUG
|
||||
#elif Z2_USE_ENDSTOP == _ZMAX_
|
||||
#define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
|
||||
#define Z2_MAX_PIN Z_MAX_PIN
|
||||
#undef USE_ZMAX_PLUG
|
||||
#elif Z2_USE_ENDSTOP == _XMIN_
|
||||
#define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
|
||||
#define Z2_MAX_PIN X_MIN_PIN
|
||||
#undef USE_XMIN_PLUG
|
||||
#elif Z2_USE_ENDSTOP == _YMIN_
|
||||
#define Z2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
|
||||
#define Z2_MAX_PIN Y_MIN_PIN
|
||||
#undef USE_YMIN_PLUG
|
||||
#elif Z2_USE_ENDSTOP == _ZMIN_
|
||||
#define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
|
||||
#define Z2_MAX_PIN Z_MIN_PIN
|
||||
#undef USE_ZMIN_PLUG
|
||||
#else
|
||||
#define Z2_MAX_ENDSTOP_INVERTING false
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* 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 && TEMP_SENSOR_1 > -2)
|
||||
#define HAS_TEMP_2 (PIN_EXISTS(TEMP_2) && TEMP_SENSOR_2 != 0 && TEMP_SENSOR_2 > -2)
|
||||
#define HAS_TEMP_3 (PIN_EXISTS(TEMP_3) && TEMP_SENSOR_3 != 0 && TEMP_SENSOR_3 > -2)
|
||||
#define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0 && TEMP_SENSOR_BED > -2)
|
||||
#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_FAN0 (PIN_EXISTS(FAN))
|
||||
#define HAS_FAN1 (PIN_EXISTS(FAN1) && CONTROLLERFAN_PIN != FAN1_PIN && EXTRUDER_0_AUTO_FAN_PIN != FAN1_PIN && EXTRUDER_1_AUTO_FAN_PIN != FAN1_PIN && EXTRUDER_2_AUTO_FAN_PIN != FAN1_PIN)
|
||||
#define HAS_FAN2 (PIN_EXISTS(FAN2) && CONTROLLERFAN_PIN != FAN2_PIN && EXTRUDER_0_AUTO_FAN_PIN != FAN2_PIN && EXTRUDER_1_AUTO_FAN_PIN != FAN2_PIN && EXTRUDER_2_AUTO_FAN_PIN != FAN2_PIN)
|
||||
#define HAS_CONTROLLERFAN (PIN_EXISTS(CONTROLLERFAN))
|
||||
#define HAS_SERVOS (defined(NUM_SERVOS) && NUM_SERVOS > 0)
|
||||
#define HAS_SERVO_0 (PIN_EXISTS(SERVO0))
|
||||
#define HAS_SERVO_1 (PIN_EXISTS(SERVO1))
|
||||
#define HAS_SERVO_2 (PIN_EXISTS(SERVO2))
|
||||
#define HAS_SERVO_3 (PIN_EXISTS(SERVO3))
|
||||
#define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH))
|
||||
#define HAS_FIL_RUNOUT (PIN_EXISTS(FIL_RUNOUT))
|
||||
#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_MIN_PROBE_PIN (PIN_EXISTS(Z_MIN_PROBE))
|
||||
#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_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET))
|
||||
#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_E4_ENABLE (PIN_EXISTS(E4_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_E4_DIR (PIN_EXISTS(E4_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_E4_STEP (PIN_EXISTS(E4_STEP))
|
||||
#define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
|
||||
#define HAS_BUZZER (PIN_EXISTS(BEEPER) || ENABLED(LCD_USE_I2C_BUZZER))
|
||||
|
||||
#define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E))
|
||||
|
||||
#define HAS_TEMP_HOTEND (HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675))
|
||||
|
||||
#define HAS_THERMALLY_PROTECTED_BED (HAS_TEMP_BED && HAS_HEATER_BED && ENABLED(THERMAL_PROTECTION_BED))
|
||||
|
||||
/**
|
||||
* This value is used by M109 when trying to calculate a ballpark safe margin
|
||||
* to prevent wait-forever situation.
|
||||
*/
|
||||
#ifndef EXTRUDE_MINTEMP
|
||||
#define EXTRUDE_MINTEMP 170
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Helper Macros for heaters and extruder fan
|
||||
*/
|
||||
#define WRITE_HEATER_0P(v) WRITE(HEATER_0_PIN, v)
|
||||
#if HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)
|
||||
#define WRITE_HEATER_1(v) WRITE(HEATER_1_PIN, v)
|
||||
#if HOTENDS > 2
|
||||
#define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, v)
|
||||
#if HOTENDS > 3
|
||||
#define WRITE_HEATER_3(v) WRITE(HEATER_3_PIN, v)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#if ENABLED(HEATERS_PARALLEL)
|
||||
#define WRITE_HEATER_0(v) { WRITE_HEATER_0P(v); WRITE_HEATER_1(v); }
|
||||
#else
|
||||
#define WRITE_HEATER_0(v) WRITE_HEATER_0P(v)
|
||||
#endif
|
||||
#if HAS_HEATER_BED
|
||||
#define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, v)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Up to 3 PWM fans
|
||||
*/
|
||||
#if HAS_FAN2
|
||||
#define FAN_COUNT 3
|
||||
#elif HAS_FAN1
|
||||
#define FAN_COUNT 2
|
||||
#elif HAS_FAN0
|
||||
#define FAN_COUNT 1
|
||||
#else
|
||||
#define FAN_COUNT 0
|
||||
#endif
|
||||
|
||||
#if HAS_FAN0
|
||||
#define WRITE_FAN(v) WRITE(FAN_PIN, v)
|
||||
#define WRITE_FAN0(v) WRITE_FAN(v)
|
||||
#endif
|
||||
#if HAS_FAN1
|
||||
#define WRITE_FAN1(v) WRITE(FAN1_PIN, v)
|
||||
#endif
|
||||
#if HAS_FAN2
|
||||
#define WRITE_FAN2(v) WRITE(FAN2_PIN, v)
|
||||
#endif
|
||||
#define WRITE_FAN_N(n, v) WRITE_FAN##n(v)
|
||||
|
||||
/**
|
||||
* Servos and probes
|
||||
*/
|
||||
|
||||
#if HAS_SERVOS
|
||||
#ifndef Z_ENDSTOP_SERVO_NR
|
||||
#define Z_ENDSTOP_SERVO_NR -1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define PROBE_SELECTED (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))
|
||||
|
||||
#define PROBE_PIN_CONFIGURED (HAS_Z_MIN_PROBE_PIN || (HAS_Z_MIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)))
|
||||
|
||||
#define HAS_BED_PROBE (PROBE_SELECTED && PROBE_PIN_CONFIGURED)
|
||||
|
||||
#if ENABLED(Z_PROBE_ALLEN_KEY)
|
||||
#define PROBE_IS_TRIGGERED_WHEN_STOWED_TEST
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Bed Probe dependencies
|
||||
*/
|
||||
#if HAS_BED_PROBE
|
||||
#ifndef Z_PROBE_OFFSET_RANGE_MIN
|
||||
#define Z_PROBE_OFFSET_RANGE_MIN -20
|
||||
#endif
|
||||
#ifndef Z_PROBE_OFFSET_RANGE_MAX
|
||||
#define Z_PROBE_OFFSET_RANGE_MAX 20
|
||||
#endif
|
||||
#ifndef XY_PROBE_SPEED
|
||||
#ifdef HOMING_FEEDRATE_XY
|
||||
#define XY_PROBE_SPEED HOMING_FEEDRATE_XY
|
||||
#else
|
||||
#define XY_PROBE_SPEED 4000
|
||||
#endif
|
||||
#endif
|
||||
#if Z_RAISE_BETWEEN_PROBINGS > Z_RAISE_PROBE_DEPLOY_STOW
|
||||
#define _Z_RAISE_PROBE_DEPLOY_STOW Z_RAISE_BETWEEN_PROBINGS
|
||||
#else
|
||||
#define _Z_RAISE_PROBE_DEPLOY_STOW Z_RAISE_PROBE_DEPLOY_STOW
|
||||
#endif
|
||||
#else
|
||||
#undef X_PROBE_OFFSET_FROM_EXTRUDER
|
||||
#undef Y_PROBE_OFFSET_FROM_EXTRUDER
|
||||
#undef Z_PROBE_OFFSET_FROM_EXTRUDER
|
||||
#define X_PROBE_OFFSET_FROM_EXTRUDER 0
|
||||
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0
|
||||
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Delta radius/rod trimmers
|
||||
*/
|
||||
#if ENABLED(DELTA)
|
||||
#ifndef DELTA_RADIUS_TRIM_TOWER_1
|
||||
#define DELTA_RADIUS_TRIM_TOWER_1 0.0
|
||||
#endif
|
||||
#ifndef DELTA_RADIUS_TRIM_TOWER_2
|
||||
#define DELTA_RADIUS_TRIM_TOWER_2 0.0
|
||||
#endif
|
||||
#ifndef DELTA_RADIUS_TRIM_TOWER_3
|
||||
#define DELTA_RADIUS_TRIM_TOWER_3 0.0
|
||||
#endif
|
||||
#ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER_1
|
||||
#define DELTA_DIAGONAL_ROD_TRIM_TOWER_1 0.0
|
||||
#endif
|
||||
#ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER_2
|
||||
#define DELTA_DIAGONAL_ROD_TRIM_TOWER_2 0.0
|
||||
#endif
|
||||
#ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER_3
|
||||
#define DELTA_DIAGONAL_ROD_TRIM_TOWER_3 0.0
|
||||
#endif
|
||||
#if ENABLED(AUTO_BED_LEVELING_GRID)
|
||||
#define DELTA_BED_LEVELING_GRID
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* When not using other bed leveling...
|
||||
*/
|
||||
#if ENABLED(AUTO_BED_LEVELING_FEATURE) && DISABLED(AUTO_BED_LEVELING_GRID) && DISABLED(DELTA_BED_LEVELING_GRID)
|
||||
#define AUTO_BED_LEVELING_3POINT
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Buzzer/Speaker
|
||||
*/
|
||||
#if ENABLED(LCD_USE_I2C_BUZZER)
|
||||
#ifndef LCD_FEEDBACK_FREQUENCY_HZ
|
||||
#define LCD_FEEDBACK_FREQUENCY_HZ 1000
|
||||
#endif
|
||||
#ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS
|
||||
#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
|
||||
#endif
|
||||
#elif PIN_EXISTS(BEEPER)
|
||||
#ifndef LCD_FEEDBACK_FREQUENCY_HZ
|
||||
#define LCD_FEEDBACK_FREQUENCY_HZ 5000
|
||||
#endif
|
||||
#ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS
|
||||
#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2
|
||||
#endif
|
||||
#else
|
||||
#ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS
|
||||
#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* MIN_Z_HEIGHT_FOR_HOMING / Z_RAISE_BETWEEN_PROBINGS
|
||||
*/
|
||||
#ifndef MIN_Z_HEIGHT_FOR_HOMING
|
||||
#ifndef Z_RAISE_BETWEEN_PROBINGS
|
||||
#define MIN_Z_HEIGHT_FOR_HOMING 0
|
||||
#else
|
||||
#define MIN_Z_HEIGHT_FOR_HOMING Z_RAISE_BETWEEN_PROBINGS
|
||||
#endif
|
||||
#endif
|
||||
#ifndef Z_RAISE_BETWEEN_PROBINGS
|
||||
#define Z_RAISE_BETWEEN_PROBING MIN_Z_HEIGHT_FOR_HOMING
|
||||
#endif
|
||||
|
||||
#endif // CONDITIONALS_POST_H
|
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MARLIN_CONFIG_H
|
||||
#define MARLIN_CONFIG_H
|
||||
|
||||
#include "fastio.h"
|
||||
#include "macros.h"
|
||||
#include "boards.h"
|
||||
#include "Version.h"
|
||||
#include "Configuration.h"
|
||||
#include "Conditionals_LCD.h"
|
||||
#include "Configuration_adv.h"
|
||||
#include "pins.h"
|
||||
#ifndef USBCON
|
||||
#define HardwareSerial_h // trick to disable the standard HWserial
|
||||
#endif
|
||||
#include "Arduino.h"
|
||||
#include "Conditionals_post.h"
|
||||
#include "SanityCheck.h"
|
||||
|
||||
#endif // MARLIN_CONFIG_H
|
File diff suppressed because it is too large
Load Diff
@ -1,453 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Arduino SdFat Library
|
||||
* Copyright (C) 2010 by William Greiman
|
||||
*
|
||||
* This file is part of the Arduino Sd2Card Library
|
||||
*/
|
||||
// Warning this file was generated by a program.
|
||||
#include "Marlin.h"
|
||||
#include "macros.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#ifndef Sd2PinMap_h
|
||||
#define Sd2PinMap_h
|
||||
#include <avr/io.h>
|
||||
//------------------------------------------------------------------------------
|
||||
/** struct for mapping digital pins */
|
||||
struct pin_map_t {
|
||||
volatile uint8_t* ddr;
|
||||
volatile uint8_t* pin;
|
||||
volatile uint8_t* port;
|
||||
uint8_t bit;
|
||||
};
|
||||
//------------------------------------------------------------------------------
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) // Mega
|
||||
|
||||
// Two Wire (aka I2C) ports
|
||||
uint8_t const SDA_PIN = 20; // D1
|
||||
uint8_t const SCL_PIN = 21; // D0
|
||||
|
||||
#undef MOSI_PIN
|
||||
#undef MISO_PIN
|
||||
#undef SCK_PIN
|
||||
// SPI port
|
||||
uint8_t const SS_PIN = 53; // B0
|
||||
uint8_t const MOSI_PIN = 51; // B2
|
||||
uint8_t const MISO_PIN = 50; // B3
|
||||
uint8_t const SCK_PIN = 52; // B1
|
||||
|
||||
static const pin_map_t digitalPinMap[] = {
|
||||
{&DDRE, &PINE, &PORTE, 0}, // E0 0
|
||||
{&DDRE, &PINE, &PORTE, 1}, // E1 1
|
||||
{&DDRE, &PINE, &PORTE, 4}, // E4 2
|
||||
{&DDRE, &PINE, &PORTE, 5}, // E5 3
|
||||
{&DDRG, &PING, &PORTG, 5}, // G5 4
|
||||
{&DDRE, &PINE, &PORTE, 3}, // E3 5
|
||||
{&DDRH, &PINH, &PORTH, 3}, // H3 6
|
||||
{&DDRH, &PINH, &PORTH, 4}, // H4 7
|
||||
{&DDRH, &PINH, &PORTH, 5}, // H5 8
|
||||
{&DDRH, &PINH, &PORTH, 6}, // H6 9
|
||||
{&DDRB, &PINB, &PORTB, 4}, // B4 10
|
||||
{&DDRB, &PINB, &PORTB, 5}, // B5 11
|
||||
{&DDRB, &PINB, &PORTB, 6}, // B6 12
|
||||
{&DDRB, &PINB, &PORTB, 7}, // B7 13
|
||||
{&DDRJ, &PINJ, &PORTJ, 1}, // J1 14
|
||||
{&DDRJ, &PINJ, &PORTJ, 0}, // J0 15
|
||||
{&DDRH, &PINH, &PORTH, 1}, // H1 16
|
||||
{&DDRH, &PINH, &PORTH, 0}, // H0 17
|
||||
{&DDRD, &PIND, &PORTD, 3}, // D3 18
|
||||
{&DDRD, &PIND, &PORTD, 2}, // D2 19
|
||||
{&DDRD, &PIND, &PORTD, 1}, // D1 20
|
||||
{&DDRD, &PIND, &PORTD, 0}, // D0 21
|
||||
{&DDRA, &PINA, &PORTA, 0}, // A0 22
|
||||
{&DDRA, &PINA, &PORTA, 1}, // A1 23
|
||||
{&DDRA, &PINA, &PORTA, 2}, // A2 24
|
||||
{&DDRA, &PINA, &PORTA, 3}, // A3 25
|
||||
{&DDRA, &PINA, &PORTA, 4}, // A4 26
|
||||
{&DDRA, &PINA, &PORTA, 5}, // A5 27
|
||||
{&DDRA, &PINA, &PORTA, 6}, // A6 28
|
||||
{&DDRA, &PINA, &PORTA, 7}, // A7 29
|
||||
{&DDRC, &PINC, &PORTC, 7}, // C7 30
|
||||
{&DDRC, &PINC, &PORTC, 6}, // C6 31
|
||||
{&DDRC, &PINC, &PORTC, 5}, // C5 32
|
||||
{&DDRC, &PINC, &PORTC, 4}, // C4 33
|
||||
{&DDRC, &PINC, &PORTC, 3}, // C3 34
|
||||
{&DDRC, &PINC, &PORTC, 2}, // C2 35
|
||||
{&DDRC, &PINC, &PORTC, 1}, // C1 36
|
||||
{&DDRC, &PINC, &PORTC, 0}, // C0 37
|
||||
{&DDRD, &PIND, &PORTD, 7}, // D7 38
|
||||
{&DDRG, &PING, &PORTG, 2}, // G2 39
|
||||
{&DDRG, &PING, &PORTG, 1}, // G1 40
|
||||
{&DDRG, &PING, &PORTG, 0}, // G0 41
|
||||
{&DDRL, &PINL, &PORTL, 7}, // L7 42
|
||||
{&DDRL, &PINL, &PORTL, 6}, // L6 43
|
||||
{&DDRL, &PINL, &PORTL, 5}, // L5 44
|
||||
{&DDRL, &PINL, &PORTL, 4}, // L4 45
|
||||
{&DDRL, &PINL, &PORTL, 3}, // L3 46
|
||||
{&DDRL, &PINL, &PORTL, 2}, // L2 47
|
||||
{&DDRL, &PINL, &PORTL, 1}, // L1 48
|
||||
{&DDRL, &PINL, &PORTL, 0}, // L0 49
|
||||
{&DDRB, &PINB, &PORTB, 3}, // B3 50
|
||||
{&DDRB, &PINB, &PORTB, 2}, // B2 51
|
||||
{&DDRB, &PINB, &PORTB, 1}, // B1 52
|
||||
{&DDRB, &PINB, &PORTB, 0}, // B0 53
|
||||
{&DDRF, &PINF, &PORTF, 0}, // F0 54
|
||||
{&DDRF, &PINF, &PORTF, 1}, // F1 55
|
||||
{&DDRF, &PINF, &PORTF, 2}, // F2 56
|
||||
{&DDRF, &PINF, &PORTF, 3}, // F3 57
|
||||
{&DDRF, &PINF, &PORTF, 4}, // F4 58
|
||||
{&DDRF, &PINF, &PORTF, 5}, // F5 59
|
||||
{&DDRF, &PINF, &PORTF, 6}, // F6 60
|
||||
{&DDRF, &PINF, &PORTF, 7}, // F7 61
|
||||
{&DDRK, &PINK, &PORTK, 0}, // K0 62
|
||||
{&DDRK, &PINK, &PORTK, 1}, // K1 63
|
||||
{&DDRK, &PINK, &PORTK, 2}, // K2 64
|
||||
{&DDRK, &PINK, &PORTK, 3}, // K3 65
|
||||
{&DDRK, &PINK, &PORTK, 4}, // K4 66
|
||||
{&DDRK, &PINK, &PORTK, 5}, // K5 67
|
||||
{&DDRK, &PINK, &PORTK, 6}, // K6 68
|
||||
{&DDRK, &PINK, &PORTK, 7} // K7 69
|
||||
};
|
||||
//------------------------------------------------------------------------------
|
||||
#elif defined(__AVR_ATmega644P__)\
|
||||
|| defined(__AVR_ATmega644__)\
|
||||
|| defined(__AVR_ATmega1284P__)
|
||||
// Sanguino
|
||||
|
||||
// Two Wire (aka I2C) ports
|
||||
uint8_t const SDA_PIN = 17; // C1
|
||||
uint8_t const SCL_PIN = 18; // C2
|
||||
|
||||
// SPI port
|
||||
uint8_t const SS_PIN = 4; // B4
|
||||
uint8_t const MOSI_PIN = 5; // B5
|
||||
uint8_t const MISO_PIN = 6; // B6
|
||||
uint8_t const SCK_PIN = 7; // B7
|
||||
|
||||
static const pin_map_t digitalPinMap[] = {
|
||||
{&DDRB, &PINB, &PORTB, 0}, // B0 0
|
||||
{&DDRB, &PINB, &PORTB, 1}, // B1 1
|
||||
{&DDRB, &PINB, &PORTB, 2}, // B2 2
|
||||
{&DDRB, &PINB, &PORTB, 3}, // B3 3
|
||||
{&DDRB, &PINB, &PORTB, 4}, // B4 4
|
||||
{&DDRB, &PINB, &PORTB, 5}, // B5 5
|
||||
{&DDRB, &PINB, &PORTB, 6}, // B6 6
|
||||
{&DDRB, &PINB, &PORTB, 7}, // B7 7
|
||||
{&DDRD, &PIND, &PORTD, 0}, // D0 8
|
||||
{&DDRD, &PIND, &PORTD, 1}, // D1 9
|
||||
{&DDRD, &PIND, &PORTD, 2}, // D2 10
|
||||
{&DDRD, &PIND, &PORTD, 3}, // D3 11
|
||||
{&DDRD, &PIND, &PORTD, 4}, // D4 12
|
||||
{&DDRD, &PIND, &PORTD, 5}, // D5 13
|
||||
{&DDRD, &PIND, &PORTD, 6}, // D6 14
|
||||
{&DDRD, &PIND, &PORTD, 7}, // D7 15
|
||||
{&DDRC, &PINC, &PORTC, 0}, // C0 16
|
||||
{&DDRC, &PINC, &PORTC, 1}, // C1 17
|
||||
{&DDRC, &PINC, &PORTC, 2}, // C2 18
|
||||
{&DDRC, &PINC, &PORTC, 3}, // C3 19
|
||||
{&DDRC, &PINC, &PORTC, 4}, // C4 20
|
||||
{&DDRC, &PINC, &PORTC, 5}, // C5 21
|
||||
{&DDRC, &PINC, &PORTC, 6}, // C6 22
|
||||
{&DDRC, &PINC, &PORTC, 7}, // C7 23
|
||||
{&DDRA, &PINA, &PORTA, 7}, // A7 24
|
||||
{&DDRA, &PINA, &PORTA, 6}, // A6 25
|
||||
{&DDRA, &PINA, &PORTA, 5}, // A5 26
|
||||
{&DDRA, &PINA, &PORTA, 4}, // A4 27
|
||||
{&DDRA, &PINA, &PORTA, 3}, // A3 28
|
||||
{&DDRA, &PINA, &PORTA, 2}, // A2 29
|
||||
{&DDRA, &PINA, &PORTA, 1}, // A1 30
|
||||
{&DDRA, &PINA, &PORTA, 0} // A0 31
|
||||
};
|
||||
//------------------------------------------------------------------------------
|
||||
#elif defined(__AVR_ATmega32U4__)
|
||||
// Teensy 2.0
|
||||
|
||||
// Two Wire (aka I2C) ports
|
||||
uint8_t const SDA_PIN = 6; // D1
|
||||
uint8_t const SCL_PIN = 5; // D0
|
||||
|
||||
// SPI port
|
||||
uint8_t const SS_PIN = 0; // B0
|
||||
uint8_t const MOSI_PIN = 2; // B2
|
||||
uint8_t const MISO_PIN = 3; // B3
|
||||
uint8_t const SCK_PIN = 1; // B1
|
||||
|
||||
static const pin_map_t digitalPinMap[] = {
|
||||
{&DDRB, &PINB, &PORTB, 0}, // B0 0
|
||||
{&DDRB, &PINB, &PORTB, 1}, // B1 1
|
||||
{&DDRB, &PINB, &PORTB, 2}, // B2 2
|
||||
{&DDRB, &PINB, &PORTB, 3}, // B3 3
|
||||
{&DDRB, &PINB, &PORTB, 7}, // B7 4
|
||||
{&DDRD, &PIND, &PORTD, 0}, // D0 5
|
||||
{&DDRD, &PIND, &PORTD, 1}, // D1 6
|
||||
{&DDRD, &PIND, &PORTD, 2}, // D2 7
|
||||
{&DDRD, &PIND, &PORTD, 3}, // D3 8
|
||||
{&DDRC, &PINC, &PORTC, 6}, // C6 9
|
||||
{&DDRC, &PINC, &PORTC, 7}, // C7 10
|
||||
{&DDRD, &PIND, &PORTD, 6}, // D6 11
|
||||
{&DDRD, &PIND, &PORTD, 7}, // D7 12
|
||||
{&DDRB, &PINB, &PORTB, 4}, // B4 13
|
||||
{&DDRB, &PINB, &PORTB, 5}, // B5 14
|
||||
{&DDRB, &PINB, &PORTB, 6}, // B6 15
|
||||
{&DDRF, &PINF, &PORTF, 7}, // F7 16
|
||||
{&DDRF, &PINF, &PORTF, 6}, // F6 17
|
||||
{&DDRF, &PINF, &PORTF, 5}, // F5 18
|
||||
{&DDRF, &PINF, &PORTF, 4}, // F4 19
|
||||
{&DDRF, &PINF, &PORTF, 1}, // F1 20
|
||||
{&DDRF, &PINF, &PORTF, 0}, // F0 21
|
||||
{&DDRD, &PIND, &PORTD, 4}, // D4 22
|
||||
{&DDRD, &PIND, &PORTD, 5}, // D5 23
|
||||
{&DDRE, &PINE, &PORTE, 6} // E6 24
|
||||
};
|
||||
//------------------------------------------------------------------------------
|
||||
#elif defined(__AVR_AT90USB646__)\
|
||||
|| defined(__AVR_AT90USB1286__)
|
||||
// Teensy++ 1.0 & 2.0
|
||||
|
||||
// Two Wire (aka I2C) ports
|
||||
uint8_t const SDA_PIN = 1; // D1
|
||||
uint8_t const SCL_PIN = 0; // D0
|
||||
|
||||
// SPI port
|
||||
uint8_t const SS_PIN = 20; // B0
|
||||
uint8_t const MOSI_PIN = 22; // B2
|
||||
uint8_t const MISO_PIN = 23; // B3
|
||||
uint8_t const SCK_PIN = 21; // B1
|
||||
|
||||
static const pin_map_t digitalPinMap[] = {
|
||||
{&DDRD, &PIND, &PORTD, 0}, // D0 0
|
||||
{&DDRD, &PIND, &PORTD, 1}, // D1 1
|
||||
{&DDRD, &PIND, &PORTD, 2}, // D2 2
|
||||
{&DDRD, &PIND, &PORTD, 3}, // D3 3
|
||||
{&DDRD, &PIND, &PORTD, 4}, // D4 4
|
||||
{&DDRD, &PIND, &PORTD, 5}, // D5 5
|
||||
{&DDRD, &PIND, &PORTD, 6}, // D6 6
|
||||
{&DDRD, &PIND, &PORTD, 7}, // D7 7
|
||||
{&DDRE, &PINE, &PORTE, 0}, // E0 8
|
||||
{&DDRE, &PINE, &PORTE, 1}, // E1 9
|
||||
{&DDRC, &PINC, &PORTC, 0}, // C0 10
|
||||
{&DDRC, &PINC, &PORTC, 1}, // C1 11
|
||||
{&DDRC, &PINC, &PORTC, 2}, // C2 12
|
||||
{&DDRC, &PINC, &PORTC, 3}, // C3 13
|
||||
{&DDRC, &PINC, &PORTC, 4}, // C4 14
|
||||
{&DDRC, &PINC, &PORTC, 5}, // C5 15
|
||||
{&DDRC, &PINC, &PORTC, 6}, // C6 16
|
||||
{&DDRC, &PINC, &PORTC, 7}, // C7 17
|
||||
{&DDRE, &PINE, &PORTE, 6}, // E6 18
|
||||
{&DDRE, &PINE, &PORTE, 7}, // E7 19
|
||||
{&DDRB, &PINB, &PORTB, 0}, // B0 20
|
||||
{&DDRB, &PINB, &PORTB, 1}, // B1 21
|
||||
{&DDRB, &PINB, &PORTB, 2}, // B2 22
|
||||
{&DDRB, &PINB, &PORTB, 3}, // B3 23
|
||||
{&DDRB, &PINB, &PORTB, 4}, // B4 24
|
||||
{&DDRB, &PINB, &PORTB, 5}, // B5 25
|
||||
{&DDRB, &PINB, &PORTB, 6}, // B6 26
|
||||
{&DDRB, &PINB, &PORTB, 7}, // B7 27
|
||||
{&DDRA, &PINA, &PORTA, 0}, // A0 28
|
||||
{&DDRA, &PINA, &PORTA, 1}, // A1 29
|
||||
{&DDRA, &PINA, &PORTA, 2}, // A2 30
|
||||
{&DDRA, &PINA, &PORTA, 3}, // A3 31
|
||||
{&DDRA, &PINA, &PORTA, 4}, // A4 32
|
||||
{&DDRA, &PINA, &PORTA, 5}, // A5 33
|
||||
{&DDRA, &PINA, &PORTA, 6}, // A6 34
|
||||
{&DDRA, &PINA, &PORTA, 7}, // A7 35
|
||||
{&DDRE, &PINE, &PORTE, 4}, // E4 36
|
||||
{&DDRE, &PINE, &PORTE, 5}, // E5 37
|
||||
{&DDRF, &PINF, &PORTF, 0}, // F0 38
|
||||
{&DDRF, &PINF, &PORTF, 1}, // F1 39
|
||||
{&DDRF, &PINF, &PORTF, 2}, // F2 40
|
||||
{&DDRF, &PINF, &PORTF, 3}, // F3 41
|
||||
{&DDRF, &PINF, &PORTF, 4}, // F4 42
|
||||
{&DDRF, &PINF, &PORTF, 5}, // F5 43
|
||||
{&DDRF, &PINF, &PORTF, 6}, // F6 44
|
||||
{&DDRF, &PINF, &PORTF, 7} // F7 45
|
||||
};
|
||||
//------------------------------------------------------------------------------
|
||||
#elif defined(__AVR_ATmega168__)\
|
||||
||defined(__AVR_ATmega168P__)\
|
||||
||defined(__AVR_ATmega328P__)
|
||||
// 168 and 328 Arduinos
|
||||
|
||||
// Two Wire (aka I2C) ports
|
||||
uint8_t const SDA_PIN = 18; // C4
|
||||
uint8_t const SCL_PIN = 19; // C5
|
||||
|
||||
// SPI port
|
||||
uint8_t const SS_PIN = 10; // B2
|
||||
uint8_t const MOSI_PIN = 11; // B3
|
||||
uint8_t const MISO_PIN = 12; // B4
|
||||
uint8_t const SCK_PIN = 13; // B5
|
||||
|
||||
static const pin_map_t digitalPinMap[] = {
|
||||
{&DDRD, &PIND, &PORTD, 0}, // D0 0
|
||||
{&DDRD, &PIND, &PORTD, 1}, // D1 1
|
||||
{&DDRD, &PIND, &PORTD, 2}, // D2 2
|
||||
{&DDRD, &PIND, &PORTD, 3}, // D3 3
|
||||
{&DDRD, &PIND, &PORTD, 4}, // D4 4
|
||||
{&DDRD, &PIND, &PORTD, 5}, // D5 5
|
||||
{&DDRD, &PIND, &PORTD, 6}, // D6 6
|
||||
{&DDRD, &PIND, &PORTD, 7}, // D7 7
|
||||
{&DDRB, &PINB, &PORTB, 0}, // B0 8
|
||||
{&DDRB, &PINB, &PORTB, 1}, // B1 9
|
||||
{&DDRB, &PINB, &PORTB, 2}, // B2 10
|
||||
{&DDRB, &PINB, &PORTB, 3}, // B3 11
|
||||
{&DDRB, &PINB, &PORTB, 4}, // B4 12
|
||||
{&DDRB, &PINB, &PORTB, 5}, // B5 13
|
||||
{&DDRC, &PINC, &PORTC, 0}, // C0 14
|
||||
{&DDRC, &PINC, &PORTC, 1}, // C1 15
|
||||
{&DDRC, &PINC, &PORTC, 2}, // C2 16
|
||||
{&DDRC, &PINC, &PORTC, 3}, // C3 17
|
||||
{&DDRC, &PINC, &PORTC, 4}, // C4 18
|
||||
{&DDRC, &PINC, &PORTC, 5} // C5 19
|
||||
};
|
||||
#elif defined(__AVR_ATmega1281__)
|
||||
// Waspmote
|
||||
|
||||
// Two Wire (aka I2C) ports
|
||||
uint8_t const SDA_PIN = 41;
|
||||
uint8_t const SCL_PIN = 40;
|
||||
|
||||
|
||||
#undef MOSI_PIN
|
||||
#undef MISO_PIN
|
||||
// SPI port
|
||||
uint8_t const SS_PIN = 16; // B0
|
||||
uint8_t const MOSI_PIN = 11; // B2
|
||||
uint8_t const MISO_PIN = 12; // B3
|
||||
uint8_t const SCK_PIN = 10; // B1
|
||||
|
||||
static const pin_map_t digitalPinMap[] = {
|
||||
{&DDRE, &PINE, &PORTE, 0}, // E0 0
|
||||
{&DDRE, &PINE, &PORTE, 1}, // E1 1
|
||||
{&DDRE, &PINE, &PORTE, 3}, // E3 2
|
||||
{&DDRE, &PINE, &PORTE, 4}, // E4 3
|
||||
{&DDRC, &PINC, &PORTC, 4}, // C4 4
|
||||
{&DDRC, &PINC, &PORTC, 5}, // C5 5
|
||||
{&DDRC, &PINC, &PORTC, 6}, // C6 6
|
||||
{&DDRC, &PINC, &PORTC, 7}, // C7 7
|
||||
{&DDRA, &PINA, &PORTA, 2}, // A2 8
|
||||
{&DDRA, &PINA, &PORTA, 3}, // A3 9
|
||||
{&DDRA, &PINA, &PORTA, 4}, // A4 10
|
||||
{&DDRD, &PIND, &PORTD, 5}, // D5 11
|
||||
{&DDRD, &PIND, &PORTD, 6}, // D6 12
|
||||
{&DDRC, &PINC, &PORTC, 1}, // C1 13
|
||||
{&DDRF, &PINF, &PORTF, 1}, // F1 14
|
||||
{&DDRF, &PINF, &PORTF, 2}, // F2 15
|
||||
{&DDRF, &PINF, &PORTF, 3}, // F3 16
|
||||
{&DDRF, &PINF, &PORTF, 4}, // F4 17
|
||||
{&DDRF, &PINF, &PORTF, 5}, // F5 18
|
||||
{&DDRF, &PINF, &PORTF, 6}, // F6 19
|
||||
{&DDRF, &PINF, &PORTF, 7}, // F7 20
|
||||
{&DDRF, &PINF, &PORTF, 0}, // F0 21
|
||||
{&DDRA, &PINA, &PORTA, 1}, // A1 22
|
||||
{&DDRD, &PIND, &PORTD, 7}, // D7 23
|
||||
{&DDRE, &PINE, &PORTE, 5}, // E5 24
|
||||
{&DDRA, &PINA, &PORTA, 6}, // A6 25
|
||||
{&DDRE, &PINE, &PORTE, 2}, // E2 26
|
||||
{&DDRA, &PINA, &PORTA, 5}, // A5 27
|
||||
{&DDRC, &PINC, &PORTC, 0}, // C0 28
|
||||
{&DDRB, &PINB, &PORTB, 0}, // B0 29
|
||||
{&DDRB, &PINB, &PORTB, 1}, // B1 30
|
||||
{&DDRB, &PINB, &PORTB, 2}, // B2 31
|
||||
{&DDRB, &PINB, &PORTB, 3}, // B3 32
|
||||
{&DDRB, &PINB, &PORTB, 4}, // B4 33
|
||||
{&DDRB, &PINB, &PORTB, 5}, // B5 34
|
||||
{&DDRA, &PINA, &PORTA, 0}, // A0 35
|
||||
{&DDRB, &PINB, &PORTB, 6}, // B6 36
|
||||
{&DDRB, &PINB, &PORTB, 7}, // B7 37
|
||||
{&DDRE, &PINE, &PORTE, 6}, // E6 38
|
||||
{&DDRE, &PINE, &PORTE, 7}, // E7 39
|
||||
{&DDRD, &PIND, &PORTD, 0}, // D0 40
|
||||
{&DDRD, &PIND, &PORTD, 1}, // D1 41
|
||||
{&DDRC, &PINC, &PORTC, 3}, // C3 42
|
||||
{&DDRD, &PIND, &PORTD, 2}, // D2 43
|
||||
{&DDRD, &PIND, &PORTD, 3}, // D3 44
|
||||
{&DDRA, &PINA, &PORTA, 7}, // A7 45
|
||||
{&DDRC, &PINC, &PORTC, 2}, // C2 46
|
||||
{&DDRD, &PIND, &PORTD, 4}, // D4 47
|
||||
{&DDRG, &PING, &PORTG, 2}, // G2 48
|
||||
{&DDRG, &PING, &PORTG, 1}, // G1 49
|
||||
{&DDRG, &PING, &PORTG, 0}, // G0 50
|
||||
};
|
||||
#else // defined(__AVR_ATmega1280__)
|
||||
#error "unknown chip"
|
||||
#endif // defined(__AVR_ATmega1280__)
|
||||
//------------------------------------------------------------------------------
|
||||
static const uint8_t digitalPinCount = COUNT(digitalPinMap);
|
||||
|
||||
uint8_t badPinNumber(void)
|
||||
__attribute__((error("Pin number is too large or not a constant")));
|
||||
|
||||
static inline __attribute__((always_inline))
|
||||
bool getPinMode(uint8_t pin) {
|
||||
if (__builtin_constant_p(pin) && pin < digitalPinCount) {
|
||||
return (*digitalPinMap[pin].ddr >> digitalPinMap[pin].bit) & 1;
|
||||
}
|
||||
else {
|
||||
return badPinNumber();
|
||||
}
|
||||
}
|
||||
static inline __attribute__((always_inline))
|
||||
void setPinMode(uint8_t pin, uint8_t mode) {
|
||||
if (__builtin_constant_p(pin) && pin < digitalPinCount) {
|
||||
if (mode) {
|
||||
SBI(*digitalPinMap[pin].ddr, digitalPinMap[pin].bit);
|
||||
}
|
||||
else {
|
||||
CBI(*digitalPinMap[pin].ddr, digitalPinMap[pin].bit);
|
||||
}
|
||||
}
|
||||
else {
|
||||
badPinNumber();
|
||||
}
|
||||
}
|
||||
static inline __attribute__((always_inline))
|
||||
bool fastDigitalRead(uint8_t pin) {
|
||||
if (__builtin_constant_p(pin) && pin < digitalPinCount) {
|
||||
return (*digitalPinMap[pin].pin >> digitalPinMap[pin].bit) & 1;
|
||||
}
|
||||
else {
|
||||
return badPinNumber();
|
||||
}
|
||||
}
|
||||
static inline __attribute__((always_inline))
|
||||
void fastDigitalWrite(uint8_t pin, uint8_t value) {
|
||||
if (__builtin_constant_p(pin) && pin < digitalPinCount) {
|
||||
if (value) {
|
||||
SBI(*digitalPinMap[pin].port, digitalPinMap[pin].bit);
|
||||
}
|
||||
else {
|
||||
CBI(*digitalPinMap[pin].port, digitalPinMap[pin].bit);
|
||||
}
|
||||
}
|
||||
else {
|
||||
badPinNumber();
|
||||
}
|
||||
}
|
||||
#endif // Sd2PinMap_h
|
||||
|
||||
|
||||
#endif
|
@ -1,57 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "Marlin.h"
|
||||
#if HAS_BUZZER
|
||||
#include "buzzer.h"
|
||||
#include "ultralcd.h"
|
||||
|
||||
void buzz(long duration, uint16_t freq) {
|
||||
if (freq > 0) {
|
||||
#if ENABLED(LCD_USE_I2C_BUZZER)
|
||||
lcd_buzz(duration, freq);
|
||||
#elif PIN_EXISTS(BEEPER) // on-board buzzers have no further condition
|
||||
SET_OUTPUT(BEEPER_PIN);
|
||||
#if ENABLED(SPEAKER) // a speaker needs a AC ore a pulsed DC
|
||||
//tone(BEEPER_PIN, freq, duration); // needs a PWMable pin
|
||||
unsigned int delay = 1000000 / freq / 2;
|
||||
int i = duration * freq / 1000;
|
||||
while (i--) {
|
||||
WRITE(BEEPER_PIN, HIGH);
|
||||
delayMicroseconds(delay);
|
||||
WRITE(BEEPER_PIN, LOW);
|
||||
delayMicroseconds(delay);
|
||||
}
|
||||
#else // buzzer has its own resonator - needs a DC
|
||||
WRITE(BEEPER_PIN, HIGH);
|
||||
delay(duration);
|
||||
WRITE(BEEPER_PIN, LOW);
|
||||
#endif
|
||||
#else
|
||||
delay(duration);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
delay(duration);
|
||||
}
|
||||
}
|
||||
#endif
|
@ -0,0 +1,145 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __CIRCULARQUEUE_H__
|
||||
#define __CIRCULARQUEUE_H__
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
/**
|
||||
* @brief Circular Queue class
|
||||
* @details Implementation of the classic ring buffer data structure
|
||||
*/
|
||||
template<typename T, uint8_t N>
|
||||
class CircularQueue {
|
||||
private:
|
||||
|
||||
/**
|
||||
* @brief Buffer structure
|
||||
* @details This structure consolidates all the overhead required to handle
|
||||
* a circular queue such as the pointers and the buffer vector.
|
||||
*/
|
||||
struct buffer_t {
|
||||
uint8_t head;
|
||||
uint8_t tail;
|
||||
uint8_t count;
|
||||
uint8_t size;
|
||||
T queue[N];
|
||||
} buffer;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Class constructor
|
||||
* @details This class requires two template parameters, T defines the type
|
||||
* of item this queue will handle and N defines the maximum number of
|
||||
* items that can be stored on the queue.
|
||||
*/
|
||||
CircularQueue<T, N>() {
|
||||
this->buffer.size = N;
|
||||
this->buffer.count = this->buffer.head = this->buffer.tail = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Removes and returns a item from the queue
|
||||
* @details Removes the oldest item on the queue, pointed to by the
|
||||
* buffer_t head field. The item is returned to the caller.
|
||||
* @return type T item
|
||||
*/
|
||||
T dequeue() {
|
||||
if (this->isEmpty()) return T();
|
||||
|
||||
uint8_t index = this->buffer.head;
|
||||
|
||||
--this->buffer.count;
|
||||
if (++this->buffer.head == this->buffer.size)
|
||||
this->buffer.head = 0;
|
||||
|
||||
return this->buffer.queue[index];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Adds an item to the queue
|
||||
* @details Adds an item to the queue on the location pointed by the buffer_t
|
||||
* tail variable. Returns false if no queue space is available.
|
||||
* @param item Item to be added to the queue
|
||||
* @return true if the operation was successful
|
||||
*/
|
||||
bool enqueue(T const &item) {
|
||||
if (this->isFull()) return false;
|
||||
|
||||
this->buffer.queue[this->buffer.tail] = item;
|
||||
|
||||
++this->buffer.count;
|
||||
if (++this->buffer.tail == this->buffer.size)
|
||||
this->buffer.tail = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Checks if the queue has no items
|
||||
* @details Returns true if there are no items on the queue, false otherwise.
|
||||
* @return true if queue is empty
|
||||
*/
|
||||
bool isEmpty() {
|
||||
return this->buffer.count == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Checks if the queue is full
|
||||
* @details Returns true if the queue is full, false otherwise.
|
||||
* @return true if queue is full
|
||||
*/
|
||||
bool isFull() {
|
||||
return this->buffer.count == this->buffer.size;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the queue size
|
||||
* @details Returns the maximum number of items a queue can have.
|
||||
* @return the queue size
|
||||
*/
|
||||
uint8_t size() {
|
||||
return this->buffer.size;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the next item from the queue without removing it
|
||||
* @details Returns the next item in the queue without removing it
|
||||
* or updating the pointers.
|
||||
* @return first item in the queue
|
||||
*/
|
||||
T peek() {
|
||||
return this->buffer.queue[this->buffer.head];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the number of items on the queue
|
||||
* @details Returns the current number of items stored on the queue.
|
||||
* @return number of items in the queue
|
||||
*/
|
||||
uint8_t count() {
|
||||
return this->buffer.count;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,206 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
Fontname: ISO10646_4_Greek
|
||||
Copyright: A. Hardtung, public domain
|
||||
Capital A Height: 7, '1' Height: 7
|
||||
Calculated Max Values w= 5 h=10 x= 2 y= 6 dx= 6 dy= 0 ascent= 8 len=10
|
||||
Font Bounding box w= 6 h= 9 x= 0 y=-2
|
||||
Calculated Min Values x= 0 y=-2 dx= 0 dy= 0
|
||||
Pure Font ascent = 7 descent=-1
|
||||
X Font ascent = 7 descent=-1
|
||||
Max Font ascent = 8 descent=-2
|
||||
*/
|
||||
#include <U8glib.h>
|
||||
const u8g_fntpgm_uint8_t ISO10646_Greek_5x7[2728] U8G_SECTION(".progmem.ISO10646_Greek_5x7") = {
|
||||
0,6,9,0,254,7,1,145,3,32,32,255,255,8,254,7,
|
||||
255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128,
|
||||
128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6,
|
||||
0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32,
|
||||
120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32,
|
||||
64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104,
|
||||
2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32,
|
||||
64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32,
|
||||
32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5,
|
||||
5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192,
|
||||
64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192,
|
||||
192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6,
|
||||
0,0,112,136,152,168,200,136,112,3,7,7,6,1,0,64,
|
||||
192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112,
|
||||
128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240,
|
||||
5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7,
|
||||
6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0,
|
||||
48,64,128,240,136,136,112,5,7,7,6,0,0,248,8,16,
|
||||
32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136,
|
||||
112,5,7,7,6,0,0,112,136,136,120,8,16,96,2,5,
|
||||
5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192,
|
||||
192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64,
|
||||
32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1,
|
||||
0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136,
|
||||
8,16,32,0,32,5,6,6,6,0,0,112,136,8,104,168,
|
||||
112,5,7,7,6,0,0,112,136,136,248,136,136,136,5,7,
|
||||
7,6,0,0,240,136,136,240,136,136,240,5,7,7,6,0,
|
||||
0,112,136,128,128,128,136,112,5,7,7,6,0,0,224,144,
|
||||
136,136,136,144,224,5,7,7,6,0,0,248,128,128,240,128,
|
||||
128,248,5,7,7,6,0,0,248,128,128,240,128,128,128,5,
|
||||
7,7,6,0,0,112,136,128,184,136,136,112,5,7,7,6,
|
||||
0,0,136,136,136,248,136,136,136,1,7,7,6,2,0,128,
|
||||
128,128,128,128,128,128,5,7,7,6,0,0,56,16,16,16,
|
||||
16,144,96,5,7,7,6,0,0,136,144,160,192,160,144,136,
|
||||
5,7,7,6,0,0,128,128,128,128,128,128,248,5,7,7,
|
||||
6,0,0,136,216,168,136,136,136,136,5,7,7,6,0,0,
|
||||
136,136,200,168,152,136,136,5,7,7,6,0,0,112,136,136,
|
||||
136,136,136,112,5,7,7,6,0,0,240,136,136,240,128,128,
|
||||
128,5,7,7,6,0,0,112,136,136,136,168,144,104,5,7,
|
||||
7,6,0,0,240,136,136,240,160,144,136,5,7,7,6,0,
|
||||
0,120,128,128,112,8,8,240,5,7,7,6,0,0,248,32,
|
||||
32,32,32,32,32,5,7,7,6,0,0,136,136,136,136,136,
|
||||
136,112,5,7,7,6,0,0,136,136,136,136,136,80,32,5,
|
||||
7,7,6,0,0,136,136,136,136,136,168,80,5,7,7,6,
|
||||
0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,136,
|
||||
136,136,80,32,32,32,5,7,7,6,0,0,248,8,16,32,
|
||||
64,128,248,3,7,7,6,1,0,224,128,128,128,128,128,224,
|
||||
5,5,5,6,0,1,128,64,32,16,8,3,7,7,6,1,
|
||||
0,224,32,32,32,32,32,224,5,3,3,6,0,4,32,80,
|
||||
136,5,1,1,6,0,0,248,2,2,2,6,2,5,128,64,
|
||||
5,5,5,6,0,0,112,8,120,136,120,5,7,7,6,0,
|
||||
0,128,128,176,200,136,136,240,5,5,5,6,0,0,112,128,
|
||||
128,136,112,5,7,7,6,0,0,8,8,104,152,136,136,120,
|
||||
5,5,5,6,0,0,112,136,248,128,112,5,7,7,6,0,
|
||||
0,48,72,224,64,64,64,64,5,6,6,6,0,255,112,136,
|
||||
136,120,8,112,5,7,7,6,0,0,128,128,176,200,136,136,
|
||||
136,1,7,7,6,2,0,128,0,128,128,128,128,128,3,8,
|
||||
8,6,1,255,32,0,32,32,32,32,160,64,4,7,7,6,
|
||||
0,0,128,128,144,160,192,160,144,3,7,7,6,1,0,192,
|
||||
64,64,64,64,64,224,5,5,5,6,0,0,208,168,168,168,
|
||||
168,5,5,5,6,0,0,176,200,136,136,136,5,5,5,6,
|
||||
0,0,112,136,136,136,112,5,6,6,6,0,255,240,136,136,
|
||||
240,128,128,5,6,6,6,0,255,120,136,136,120,8,8,5,
|
||||
5,5,6,0,0,176,200,128,128,128,5,5,5,6,0,0,
|
||||
112,128,112,8,240,5,7,7,6,0,0,64,64,224,64,64,
|
||||
72,48,5,5,5,6,0,0,136,136,136,152,104,5,5,5,
|
||||
6,0,0,136,136,136,80,32,5,5,5,6,0,0,136,136,
|
||||
168,168,80,5,5,5,6,0,0,136,80,32,80,136,5,6,
|
||||
6,6,0,255,136,136,136,120,8,112,5,5,5,6,0,0,
|
||||
248,16,32,64,248,3,7,7,6,1,0,32,64,64,128,64,
|
||||
64,32,1,7,7,6,2,0,128,128,128,128,128,128,128,3,
|
||||
7,7,6,1,0,128,64,64,32,64,64,128,5,2,2,6,
|
||||
0,3,104,144,0,0,0,6,0,0,0,0,0,6,0,0,
|
||||
0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,
|
||||
0,0,2,2,2,6,1,6,64,128,3,3,3,6,1,5,
|
||||
32,64,160,5,8,8,6,0,0,64,160,80,80,136,248,136,
|
||||
136,2,2,2,6,1,2,192,192,5,8,8,6,0,0,64,
|
||||
128,248,128,240,128,128,248,5,8,8,6,0,0,64,128,136,
|
||||
136,248,136,136,136,4,8,8,6,0,0,64,128,112,32,32,
|
||||
32,32,112,0,0,0,6,0,0,5,8,8,6,0,0,64,
|
||||
128,112,136,136,136,136,112,0,0,0,6,0,0,5,8,8,
|
||||
6,0,0,64,128,8,136,112,32,32,32,5,8,8,6,0,
|
||||
0,64,128,112,136,136,136,80,216,3,8,8,6,1,0,32,
|
||||
64,160,0,64,64,64,32,5,7,7,6,0,0,32,80,136,
|
||||
136,248,136,136,5,7,7,6,0,0,240,72,72,112,72,72,
|
||||
240,5,7,7,6,0,0,248,128,128,128,128,128,128,5,6,
|
||||
6,6,0,0,32,80,80,136,136,248,5,7,7,6,0,0,
|
||||
248,128,128,240,128,128,248,5,7,7,6,0,0,248,8,16,
|
||||
32,64,128,248,5,7,7,6,0,0,136,136,136,248,136,136,
|
||||
136,5,7,7,6,0,0,112,136,136,168,136,136,112,3,7,
|
||||
7,6,1,0,224,64,64,64,64,64,224,5,7,7,6,0,
|
||||
0,136,144,160,192,160,144,136,5,7,7,6,0,0,32,80,
|
||||
136,136,136,136,136,5,7,7,6,0,0,136,216,168,168,136,
|
||||
136,136,5,7,7,6,0,0,136,200,200,168,152,152,136,5,
|
||||
7,7,6,0,0,248,0,0,112,0,0,248,5,7,7,6,
|
||||
0,0,112,136,136,136,136,136,112,5,7,7,6,0,0,248,
|
||||
80,80,80,80,80,80,5,7,7,6,0,0,240,136,136,240,
|
||||
128,128,128,0,0,0,6,0,0,5,7,7,6,0,0,248,
|
||||
128,64,32,64,128,248,5,7,7,6,0,0,248,32,32,32,
|
||||
32,32,32,5,7,7,6,0,0,136,136,80,32,32,32,32,
|
||||
5,7,7,6,0,0,112,32,112,168,112,32,112,5,7,7,
|
||||
6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,
|
||||
168,168,168,168,112,32,32,5,6,6,6,0,0,112,136,136,
|
||||
80,80,216,3,8,8,6,1,0,160,0,224,64,64,64,64,
|
||||
224,5,8,8,6,0,0,80,0,136,136,136,80,32,32,5,
|
||||
8,8,6,0,0,32,64,8,104,152,144,144,104,5,8,8,
|
||||
6,0,0,32,64,0,112,136,224,136,112,5,10,10,6,0,
|
||||
254,32,64,0,112,136,136,136,136,8,8,2,8,8,6,1,
|
||||
0,64,128,0,128,128,128,128,64,5,8,8,6,0,0,16,
|
||||
32,80,0,136,136,136,112,5,6,6,6,0,0,8,104,152,
|
||||
144,144,104,4,7,7,6,0,254,96,144,240,144,224,128,128,
|
||||
5,6,6,6,0,255,136,72,80,32,32,64,5,6,6,6,
|
||||
0,0,48,64,112,136,136,112,5,5,5,6,0,0,112,136,
|
||||
224,136,112,5,9,9,6,0,254,128,112,64,128,128,128,112,
|
||||
8,112,5,7,7,6,0,254,184,200,136,136,136,8,8,5,
|
||||
5,5,6,0,0,112,136,248,136,112,3,5,5,6,1,0,
|
||||
128,128,128,128,96,4,5,5,6,0,0,144,160,192,160,144,
|
||||
5,6,6,6,0,0,64,32,32,80,80,136,5,7,7,6,
|
||||
0,254,136,136,136,216,168,128,128,5,5,5,6,0,0,136,
|
||||
136,80,96,32,5,10,10,6,0,254,128,224,128,112,32,64,
|
||||
128,112,8,112,5,5,5,6,0,0,112,136,136,136,112,5,
|
||||
5,5,6,0,0,248,80,80,80,80,5,7,7,6,0,254,
|
||||
112,136,136,200,176,128,128,5,7,7,6,0,254,48,64,128,
|
||||
64,48,8,112,5,5,5,6,0,0,104,144,144,144,96,4,
|
||||
5,5,6,0,0,240,64,64,64,48,5,5,5,6,0,0,
|
||||
136,136,144,144,224,5,8,8,6,0,254,48,168,168,168,168,
|
||||
112,32,32,5,6,6,6,0,255,136,80,32,32,80,136,5,
|
||||
7,7,6,0,254,168,168,168,168,112,32,32,5,5,5,6,
|
||||
0,0,80,136,136,168,112,4,7,7,6,0,0,160,0,64,
|
||||
64,64,64,48,5,7,7,6,0,0,80,0,136,136,144,144,
|
||||
224,4,8,8,6,0,0,32,64,0,96,144,144,144,96,5,
|
||||
8,8,6,0,0,32,64,0,136,136,144,144,96,5,8,8,
|
||||
6,0,0,32,64,0,80,136,136,168,112,5,7,7,6,0,
|
||||
255,144,160,192,160,144,136,16,5,8,8,6,0,0,96,144,
|
||||
160,128,240,136,136,112,5,7,7,6,0,0,112,80,56,144,
|
||||
144,144,96,5,6,6,6,0,0,152,80,32,32,32,32,5,
|
||||
8,8,6,0,0,64,128,152,80,32,32,32,32,5,8,8,
|
||||
6,0,0,80,0,152,80,32,32,32,32,5,7,7,6,0,
|
||||
255,48,168,168,168,168,112,32,5,5,5,6,0,0,248,80,
|
||||
80,80,88,5,6,6,6,0,255,136,80,112,80,136,16,5,
|
||||
7,7,6,0,255,112,136,136,136,112,32,112,5,6,6,6,
|
||||
0,255,112,136,136,112,32,112,5,6,6,6,0,0,112,136,
|
||||
128,112,32,112,5,7,7,6,0,254,8,112,128,128,112,16,
|
||||
96,5,6,6,6,0,0,248,128,128,240,128,128,4,5,5,
|
||||
6,0,0,240,128,224,128,128,5,6,6,6,0,0,248,0,
|
||||
0,112,0,248,4,5,5,6,0,0,64,128,240,16,32,5,
|
||||
7,7,6,0,0,224,80,40,40,8,8,16,5,7,7,6,
|
||||
0,0,192,32,80,40,8,8,8,5,8,8,6,0,254,168,
|
||||
168,168,168,168,88,8,112,5,7,7,6,0,254,168,168,168,
|
||||
168,88,8,112,5,6,6,6,0,0,104,136,136,120,8,8,
|
||||
5,6,6,6,0,255,104,136,136,120,8,8,4,8,8,6,
|
||||
0,254,128,224,144,144,144,144,32,192,5,5,5,6,0,0,
|
||||
104,144,112,16,224,5,6,6,6,0,0,96,144,16,96,136,
|
||||
112,4,6,6,6,0,0,96,144,16,96,128,112,5,6,6,
|
||||
6,0,0,136,80,32,80,136,248,5,5,5,6,0,0,136,
|
||||
80,32,80,112,5,6,6,6,0,0,120,128,240,136,136,112,
|
||||
4,5,5,6,0,0,240,128,224,144,96,3,6,6,6,1,
|
||||
0,64,224,64,64,64,64,3,6,6,6,1,255,64,224,64,
|
||||
64,64,128,5,5,5,6,0,0,136,80,112,80,136,5,7,
|
||||
7,6,0,254,112,136,136,136,240,128,112,4,5,5,6,0,
|
||||
0,112,128,128,128,112,2,8,8,6,1,255,64,0,192,64,
|
||||
64,64,64,128,5,7,7,6,0,0,112,136,136,248,136,136,
|
||||
112,4,5,5,6,0,0,112,128,224,128,112,4,5,5,6,
|
||||
0,0,224,16,112,16,224,5,7,7,6,0,0,128,240,136,
|
||||
136,136,240,128,4,7,7,6,0,255,128,224,144,144,144,224,
|
||||
128,5,6,6,6,0,0,112,136,128,128,136,112,5,6,6,
|
||||
6,0,0,136,216,168,136,136,136,5,7,7,6,0,254,136,
|
||||
216,168,136,136,128,128,5,8,8,6,0,254,112,136,136,136,
|
||||
112,64,224,64,5,6,6,6,0,0,112,136,8,8,136,112,
|
||||
5,6,6,6,0,0,112,136,160,128,136,112,5,6,6,6,
|
||||
0,0,112,136,40,8,136,112};
|
@ -0,0 +1,155 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __DURATION_T__
|
||||
#define __DURATION_T__
|
||||
|
||||
struct duration_t {
|
||||
/**
|
||||
* @brief Duration is stored in seconds
|
||||
*/
|
||||
uint32_t value;
|
||||
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
duration_t()
|
||||
: duration_t(0) {};
|
||||
|
||||
/**
|
||||
* @brief Constructor
|
||||
*
|
||||
* @param seconds The number of seconds
|
||||
*/
|
||||
duration_t(uint32_t const &seconds) {
|
||||
this->value = seconds;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Equality comparison
|
||||
* @details Overloads the equality comparison operator
|
||||
*
|
||||
* @param value The number of seconds to compare to
|
||||
* @return True if both durations are equal
|
||||
*/
|
||||
bool operator==(const uint32_t &value) const {
|
||||
return (this->value == value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Inequality comparison
|
||||
* @details Overloads the inequality comparison operator
|
||||
*
|
||||
* @param value The number of seconds to compare to
|
||||
* @return False if both durations are equal
|
||||
*/
|
||||
bool operator!=(const uint32_t &value) const {
|
||||
return ! this->operator==(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Formats the duration as years
|
||||
* @return The number of years
|
||||
*/
|
||||
inline uint8_t year() const {
|
||||
return this->day() / 365;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Formats the duration as days
|
||||
* @return The number of days
|
||||
*/
|
||||
inline uint16_t day() const {
|
||||
return this->hour() / 24;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Formats the duration as hours
|
||||
* @return The number of hours
|
||||
*/
|
||||
inline uint32_t hour() const {
|
||||
return this->minute() / 60;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Formats the duration as minutes
|
||||
* @return The number of minutes
|
||||
*/
|
||||
inline uint32_t minute() const {
|
||||
return this->second() / 60;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Formats the duration as seconds
|
||||
* @return The number of seconds
|
||||
*/
|
||||
inline uint32_t second() const {
|
||||
return this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Formats the duration as a string
|
||||
* @details String will be formated using a "full" representation of duration
|
||||
*
|
||||
* @param buffer The array pointed to must be able to accommodate 21 bytes
|
||||
*
|
||||
* Output examples:
|
||||
* 123456789012345678901 (strlen)
|
||||
* 135y 364d 23h 59m 59s
|
||||
* 364d 23h 59m 59s
|
||||
* 23h 59m 59s
|
||||
* 59m 59s
|
||||
* 59s
|
||||
*/
|
||||
void toString(char *buffer) const {
|
||||
int y = this->year(),
|
||||
d = this->day() % 365,
|
||||
h = this->hour() % 24,
|
||||
m = this->minute() % 60,
|
||||
s = this->second() % 60;
|
||||
|
||||
if (y) sprintf_P(buffer, PSTR("%iy %id %ih %im %is"), y, d, h, m, s);
|
||||
else if (d) sprintf_P(buffer, PSTR("%id %ih %im %is"), d, h, m, s);
|
||||
else if (h) sprintf_P(buffer, PSTR("%ih %im %is"), h, m, s);
|
||||
else if (m) sprintf_P(buffer, PSTR("%im %is"), m, s);
|
||||
else sprintf_P(buffer, PSTR("%is"), s);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Formats the duration as a string
|
||||
* @details String will be formated using a "digital" representation of duration
|
||||
*
|
||||
* @param buffer The array pointed to must be able to accommodate 10 bytes
|
||||
*
|
||||
* Output examples:
|
||||
* 1234567890 (strlen)
|
||||
* 1193046:59
|
||||
*/
|
||||
void toDigital(char *buffer) const {
|
||||
int h = this->hour() % 24,
|
||||
m = this->minute() % 60;
|
||||
|
||||
sprintf_P(buffer, PSTR("%02i:%02i"), h, m);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // __DURATION_T__
|
@ -0,0 +1,193 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __ENUM_H__
|
||||
#define __ENUM_H__
|
||||
|
||||
/**
|
||||
* Axis indices as enumerated constants
|
||||
*
|
||||
* Special axis:
|
||||
* - A_AXIS and B_AXIS are used by COREXY printers
|
||||
* - X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship
|
||||
* between X_AXIS and X Head movement, like CoreXY bots
|
||||
*/
|
||||
enum AxisEnum {
|
||||
NO_AXIS = -1,
|
||||
X_AXIS = 0,
|
||||
A_AXIS = 0,
|
||||
Y_AXIS = 1,
|
||||
B_AXIS = 1,
|
||||
Z_AXIS = 2,
|
||||
C_AXIS = 2,
|
||||
E_AXIS = 3,
|
||||
X_HEAD = 4,
|
||||
Y_HEAD = 5,
|
||||
Z_HEAD = 6
|
||||
};
|
||||
|
||||
#define LOOP_XYZ(VAR) for (uint8_t VAR=X_AXIS; VAR<=Z_AXIS; VAR++)
|
||||
#define LOOP_XYZE(VAR) for (uint8_t VAR=X_AXIS; VAR<=E_AXIS; VAR++)
|
||||
|
||||
typedef enum {
|
||||
LINEARUNIT_MM,
|
||||
LINEARUNIT_INCH
|
||||
} LinearUnit;
|
||||
|
||||
typedef enum {
|
||||
TEMPUNIT_C,
|
||||
TEMPUNIT_K,
|
||||
TEMPUNIT_F
|
||||
} TempUnit;
|
||||
|
||||
/**
|
||||
* Debug flags
|
||||
* Not yet widely applied
|
||||
*/
|
||||
enum DebugFlags {
|
||||
DEBUG_NONE = 0,
|
||||
DEBUG_ECHO = _BV(0), ///< Echo commands in order as they are processed
|
||||
DEBUG_INFO = _BV(1), ///< Print messages for code that has debug output
|
||||
DEBUG_ERRORS = _BV(2), ///< Not implemented
|
||||
DEBUG_DRYRUN = _BV(3), ///< Ignore temperature setting and E movement commands
|
||||
DEBUG_COMMUNICATION = _BV(4), ///< Not implemented
|
||||
DEBUG_LEVELING = _BV(5) ///< Print detailed output for homing and leveling
|
||||
};
|
||||
|
||||
enum EndstopEnum {
|
||||
X_MIN,
|
||||
Y_MIN,
|
||||
Z_MIN,
|
||||
Z_MIN_PROBE,
|
||||
X_MAX,
|
||||
Y_MAX,
|
||||
Z_MAX,
|
||||
Z2_MIN,
|
||||
Z2_MAX
|
||||
};
|
||||
|
||||
/**
|
||||
* Temperature
|
||||
* Stages in the ISR loop
|
||||
*/
|
||||
enum TempState {
|
||||
PrepareTemp_0,
|
||||
MeasureTemp_0,
|
||||
PrepareTemp_BED,
|
||||
MeasureTemp_BED,
|
||||
PrepareTemp_1,
|
||||
MeasureTemp_1,
|
||||
PrepareTemp_2,
|
||||
MeasureTemp_2,
|
||||
PrepareTemp_3,
|
||||
MeasureTemp_3,
|
||||
Prepare_FILWIDTH,
|
||||
Measure_FILWIDTH,
|
||||
StartupDelay // Startup, delay initial temp reading a tiny bit so the hardware can settle
|
||||
};
|
||||
|
||||
#if ENABLED(EMERGENCY_PARSER)
|
||||
enum e_parser_state {
|
||||
state_RESET,
|
||||
state_N,
|
||||
state_M,
|
||||
state_M1,
|
||||
state_M10,
|
||||
state_M108,
|
||||
state_M11,
|
||||
state_M112,
|
||||
state_M4,
|
||||
state_M41,
|
||||
state_M410,
|
||||
state_IGNORE // to '\n'
|
||||
};
|
||||
#endif
|
||||
|
||||
#if ENABLED(FILAMENT_CHANGE_FEATURE)
|
||||
enum FilamentChangeMenuResponse {
|
||||
FILAMENT_CHANGE_RESPONSE_WAIT_FOR,
|
||||
FILAMENT_CHANGE_RESPONSE_EXTRUDE_MORE,
|
||||
FILAMENT_CHANGE_RESPONSE_RESUME_PRINT
|
||||
};
|
||||
|
||||
#if ENABLED(ULTIPANEL)
|
||||
enum FilamentChangeMessage {
|
||||
FILAMENT_CHANGE_MESSAGE_INIT,
|
||||
FILAMENT_CHANGE_MESSAGE_UNLOAD,
|
||||
FILAMENT_CHANGE_MESSAGE_INSERT,
|
||||
FILAMENT_CHANGE_MESSAGE_LOAD,
|
||||
FILAMENT_CHANGE_MESSAGE_EXTRUDE,
|
||||
FILAMENT_CHANGE_MESSAGE_OPTION,
|
||||
FILAMENT_CHANGE_MESSAGE_RESUME,
|
||||
FILAMENT_CHANGE_MESSAGE_STATUS
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* States for managing Marlin and host communication
|
||||
* Marlin sends messages if blocked or busy
|
||||
*/
|
||||
#if ENABLED(HOST_KEEPALIVE_FEATURE)
|
||||
enum MarlinBusyState {
|
||||
NOT_BUSY, // Not in a handler
|
||||
IN_HANDLER, // Processing a GCode
|
||||
IN_PROCESS, // Known to be blocking command input (as in G29)
|
||||
PAUSED_FOR_USER, // Blocking pending any input
|
||||
PAUSED_FOR_INPUT // Blocking pending text input (concept)
|
||||
};
|
||||
#endif
|
||||
|
||||
#if ENABLED(MESH_BED_LEVELING)
|
||||
enum MeshLevelingState {
|
||||
MeshReport,
|
||||
MeshStart,
|
||||
MeshNext,
|
||||
MeshSet,
|
||||
MeshSetZOffset,
|
||||
MeshReset
|
||||
};
|
||||
|
||||
enum MBLStatus {
|
||||
MBL_STATUS_NONE = 0,
|
||||
MBL_STATUS_HAS_MESH_BIT = 0,
|
||||
MBL_STATUS_ACTIVE_BIT = 1
|
||||
};
|
||||
#endif
|
||||
|
||||
/**
|
||||
* SD Card
|
||||
*/
|
||||
enum LsAction { LS_SerialPrint, LS_Count, LS_GetFilename };
|
||||
|
||||
/**
|
||||
* Ultra LCD
|
||||
*/
|
||||
enum LCDViewAction {
|
||||
LCDVIEW_NONE,
|
||||
LCDVIEW_REDRAW_NOW,
|
||||
LCDVIEW_CALL_REDRAW_NEXT,
|
||||
LCDVIEW_CLEAR_CALL_REDRAW,
|
||||
LCDVIEW_CALL_NO_REDRAW
|
||||
};
|
||||
|
||||
#endif // __ENUM_H__
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,799 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Configuration_adv.h
|
||||
*
|
||||
* Advanced settings.
|
||||
* Only change these if you know exactly what you're doing.
|
||||
* Some of these settings can damage your printer if improperly set!
|
||||
*
|
||||
* Basic settings can be found in Configuration.h
|
||||
*
|
||||
*/
|
||||
#ifndef CONFIGURATION_ADV_H
|
||||
#define CONFIGURATION_ADV_H
|
||||
|
||||
/**
|
||||
*
|
||||
* ***********************************
|
||||
* ** ATTENTION TO ALL DEVELOPERS **
|
||||
* ***********************************
|
||||
*
|
||||
* You must increment this version number for every significant change such as,
|
||||
* but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
|
||||
*
|
||||
* Note: Update also Version.h !
|
||||
*/
|
||||
#define CONFIGURATION_ADV_H_VERSION 010100
|
||||
|
||||
// @section temperature
|
||||
|
||||
//===========================================================================
|
||||
//=============================Thermal Settings ============================
|
||||
//===========================================================================
|
||||
|
||||
#if DISABLED(PIDTEMPBED)
|
||||
#define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control
|
||||
#if ENABLED(BED_LIMIT_SWITCHING)
|
||||
#define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Thermal Protection protects your printer from damage and fire if a
|
||||
* thermistor falls out or temperature sensors fail in any way.
|
||||
*
|
||||
* The issue: If a thermistor falls out or a temperature sensor fails,
|
||||
* Marlin can no longer sense the actual temperature. Since a disconnected
|
||||
* thermistor reads as a low temperature, the firmware will keep the heater on.
|
||||
*
|
||||
* The solution: Once the temperature reaches the target, start observing.
|
||||
* If the temperature stays too far below the target (hysteresis) for too long (period),
|
||||
* the firmware will halt the machine as a safety precaution.
|
||||
*
|
||||
* If you get false positives for "Thermal Runaway" increase THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD
|
||||
*/
|
||||
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
|
||||
#define THERMAL_PROTECTION_PERIOD 40 // Seconds
|
||||
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
|
||||
|
||||
/**
|
||||
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the
|
||||
* WATCH_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
|
||||
* degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
|
||||
* but only if the current temperature is far enough below the target for a reliable test.
|
||||
*
|
||||
* If you get false positives for "Heating failed" increase WATCH_TEMP_PERIOD and/or decrease WATCH_TEMP_INCREASE
|
||||
* WATCH_TEMP_INCREASE should not be below 2.
|
||||
*/
|
||||
#define WATCH_TEMP_PERIOD 20 // Seconds
|
||||
#define WATCH_TEMP_INCREASE 2 // Degrees Celsius
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Thermal Protection parameters for the bed are just as above for hotends.
|
||||
*/
|
||||
#if ENABLED(THERMAL_PROTECTION_BED)
|
||||
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
|
||||
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
|
||||
|
||||
/**
|
||||
* Whenever an M140 or M190 increases the target temperature the firmware will wait for the
|
||||
* WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
|
||||
* degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
|
||||
* but only if the current temperature is far enough below the target for a reliable test.
|
||||
*
|
||||
* If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
|
||||
* WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
|
||||
*/
|
||||
#define WATCH_BED_TEMP_PERIOD 60 // Seconds
|
||||
#define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
|
||||
#endif
|
||||
|
||||
#if ENABLED(PIDTEMP)
|
||||
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
|
||||
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
|
||||
//#define PID_EXTRUSION_SCALING
|
||||
#if ENABLED(PID_EXTRUSION_SCALING)
|
||||
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
|
||||
#define LPQ_MAX_LEN 50
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Automatic Temperature:
|
||||
* The hotend target temperature is calculated by all the buffered lines of gcode.
|
||||
* The maximum buffered steps/sec of the extruder motor is called "se".
|
||||
* Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
|
||||
* The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
|
||||
* mintemp and maxtemp. Turn this off by executing M109 without F*
|
||||
* Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
|
||||
* On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
|
||||
*/
|
||||
#define AUTOTEMP
|
||||
#if ENABLED(AUTOTEMP)
|
||||
#define AUTOTEMP_OLDWEIGHT 0.98
|
||||
#endif
|
||||
|
||||
//Show Temperature ADC value
|
||||
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
|
||||
//#define SHOW_TEMP_ADC_VALUES
|
||||
|
||||
/**
|
||||
* High Temperature Thermistor Support
|
||||
*
|
||||
* Thermistors able to support high temperature tend to have a hard time getting
|
||||
* good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
|
||||
* will probably be caught when the heating element first turns on during the
|
||||
* preheating process, which will trigger a min_temp_error as a safety measure
|
||||
* and force stop everything.
|
||||
* To circumvent this limitation, we allow for a preheat time (during which,
|
||||
* min_temp_error won't be triggered) and add a min_temp buffer to handle
|
||||
* aberrant readings.
|
||||
*
|
||||
* If you want to enable this feature for your hotend thermistor(s)
|
||||
* uncomment and set values > 0 in the constants below
|
||||
*/
|
||||
|
||||
// The number of consecutive low temperature errors that can occur
|
||||
// before a min_temp_error is triggered. (Shouldn't be more than 10.)
|
||||
//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
|
||||
|
||||
// The number of milliseconds a hotend will preheat before starting to check
|
||||
// the temperature. This value should NOT be set to the time it takes the
|
||||
// hot end to reach the target temperature, but the time it takes to reach
|
||||
// the minimum temperature your thermistor can read. The lower the better/safer.
|
||||
// This shouldn't need to be more than 30 seconds (30000)
|
||||
//#define MILLISECONDS_PREHEAT_TIME 0
|
||||
|
||||
// @section extruder
|
||||
|
||||
// extruder run-out prevention.
|
||||
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
|
||||
//#define EXTRUDER_RUNOUT_PREVENT
|
||||
#define EXTRUDER_RUNOUT_MINTEMP 190
|
||||
#define EXTRUDER_RUNOUT_SECONDS 30
|
||||
#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
|
||||
#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
|
||||
#define EXTRUDER_RUNOUT_EXTRUDE 100
|
||||
|
||||
// @section temperature
|
||||
|
||||
//These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements.
|
||||
//The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET"
|
||||
#define TEMP_SENSOR_AD595_OFFSET 3.0
|
||||
#define TEMP_SENSOR_AD595_GAIN 2.0
|
||||
|
||||
//This is for controlling a fan to cool down the stepper drivers
|
||||
//it will turn on when any driver is enabled
|
||||
//and turn off after the set amount of seconds from last driver being disabled again
|
||||
#define CONTROLLERFAN_PIN -1 //Pin used for the fan to cool controller (-1 to disable)
|
||||
#define CONTROLLERFAN_SECS 60 //How many seconds, after all motors were disabled, the fan should run
|
||||
#define CONTROLLERFAN_SPEED 255 // == full speed
|
||||
|
||||
// When first starting the main fan, run it at full speed for the
|
||||
// given number of milliseconds. This gets the fan spinning reliably
|
||||
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
|
||||
//#define FAN_KICKSTART_TIME 100
|
||||
|
||||
// This defines the minimal speed for the main fan, run in PWM mode
|
||||
// to enable uncomment and set minimal PWM speed for reliable running (1-255)
|
||||
// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM
|
||||
//#define FAN_MIN_PWM 50
|
||||
|
||||
// @section extruder
|
||||
|
||||
// Extruder cooling fans
|
||||
// Configure fan pin outputs to automatically turn on/off when the associated
|
||||
// extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE.
|
||||
// Multiple extruders can be assigned to the same pin in which case
|
||||
// the fan will turn on when any selected extruder is above the threshold.
|
||||
#define EXTRUDER_0_AUTO_FAN_PIN 7
|
||||
#define EXTRUDER_1_AUTO_FAN_PIN 7
|
||||
#define EXTRUDER_2_AUTO_FAN_PIN -1
|
||||
#define EXTRUDER_3_AUTO_FAN_PIN -1
|
||||
#define EXTRUDER_AUTO_FAN_TEMPERATURE 35
|
||||
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
|
||||
|
||||
//===========================================================================
|
||||
//============================ Mechanical Settings ==========================
|
||||
//===========================================================================
|
||||
|
||||
// @section homing
|
||||
|
||||
// If you want endstops to stay on (by default) even when not homing
|
||||
// enable this option. Override at any time with M120, M121.
|
||||
//#define ENDSTOPS_ALWAYS_ON_DEFAULT
|
||||
|
||||
// @section extras
|
||||
|
||||
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
|
||||
|
||||
// Dual X Steppers
|
||||
// Uncomment this option to drive two X axis motors.
|
||||
// The next unused E driver will be assigned to the second X stepper.
|
||||
//#define X_DUAL_STEPPER_DRIVERS
|
||||
#if ENABLED(X_DUAL_STEPPER_DRIVERS)
|
||||
// Set true if the two X motors need to rotate in opposite directions
|
||||
#define INVERT_X2_VS_X_DIR true
|
||||
#endif
|
||||
|
||||
|
||||
// Dual Y Steppers
|
||||
// Uncomment this option to drive two Y axis motors.
|
||||
// The next unused E driver will be assigned to the second Y stepper.
|
||||
//#define Y_DUAL_STEPPER_DRIVERS
|
||||
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
|
||||
// Set true if the two Y motors need to rotate in opposite directions
|
||||
#define INVERT_Y2_VS_Y_DIR true
|
||||
#endif
|
||||
|
||||
// A single Z stepper driver is usually used to drive 2 stepper motors.
|
||||
// Uncomment this option to use a separate stepper driver for each Z axis motor.
|
||||
// The next unused E driver will be assigned to the second Z stepper.
|
||||
//#define Z_DUAL_STEPPER_DRIVERS
|
||||
|
||||
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
|
||||
|
||||
// Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
|
||||
// That way the machine is capable to align the bed during home, since both Z steppers are homed.
|
||||
// There is also an implementation of M666 (software endstops adjustment) to this feature.
|
||||
// After Z homing, this adjustment is applied to just one of the steppers in order to align the bed.
|
||||
// One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2.
|
||||
// If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it is.. think about it) and the Z adjust would be positive.
|
||||
// Play a little bit with small adjustments (0.5mm) and check the behaviour.
|
||||
// The M119 (endstops report) will start reporting the Z2 Endstop as well.
|
||||
|
||||
//#define Z_DUAL_ENDSTOPS
|
||||
|
||||
#if ENABLED(Z_DUAL_ENDSTOPS)
|
||||
#define Z2_USE_ENDSTOP _XMAX_
|
||||
#endif
|
||||
|
||||
#endif // Z_DUAL_STEPPER_DRIVERS
|
||||
|
||||
// Enable this for dual x-carriage printers.
|
||||
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
|
||||
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
|
||||
// allowing faster printing speeds. Connect your X2 stepper to the first unused E plug.
|
||||
//#define DUAL_X_CARRIAGE
|
||||
#if ENABLED(DUAL_X_CARRIAGE)
|
||||
// Configuration for second X-carriage
|
||||
// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
|
||||
// the second x-carriage always homes to the maximum endstop.
|
||||
#define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage
|
||||
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
|
||||
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
|
||||
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
|
||||
// However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
|
||||
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
|
||||
// without modifying the firmware (through the "M218 T1 X???" command).
|
||||
// Remember: you should set the second extruder x-offset to 0 in your slicer.
|
||||
|
||||
// There are a few selectable movement modes for dual x-carriages using M605 S<mode>
|
||||
// Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results
|
||||
// as long as it supports dual x-carriages. (M605 S0)
|
||||
// Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so
|
||||
// that additional slicer support is not required. (M605 S1)
|
||||
// Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all
|
||||
// actions of the first x-carriage. This allows the printer to print 2 arbitrary items at
|
||||
// once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
|
||||
|
||||
// This is the default power-up mode which can be later using M605.
|
||||
#define DEFAULT_DUAL_X_CARRIAGE_MODE 0
|
||||
|
||||
// Default settings in "Auto-park Mode"
|
||||
#define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder
|
||||
#define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder
|
||||
|
||||
// Default x offset in duplication mode (typically set to half print bed width)
|
||||
#define DEFAULT_DUPLICATION_X_OFFSET 100
|
||||
|
||||
#endif //DUAL_X_CARRIAGE
|
||||
|
||||
// @section homing
|
||||
|
||||
//homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
|
||||
#define X_HOME_BUMP_MM 5
|
||||
#define Y_HOME_BUMP_MM 5
|
||||
#define Z_HOME_BUMP_MM 2
|
||||
#define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate)
|
||||
//#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
|
||||
|
||||
// When G28 is called, this option will make Y home before X
|
||||
#define HOME_Y_BEFORE_X
|
||||
|
||||
// @section machine
|
||||
|
||||
#define AXIS_RELATIVE_MODES {false, false, false, false}
|
||||
|
||||
// Allow duplication mode with a basic dual-nozzle extruder
|
||||
//#define DUAL_NOZZLE_DUPLICATION_MODE
|
||||
|
||||
// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
|
||||
#define INVERT_X_STEP_PIN false
|
||||
#define INVERT_Y_STEP_PIN false
|
||||
#define INVERT_Z_STEP_PIN false
|
||||
#define INVERT_E_STEP_PIN false
|
||||
|
||||
// Default stepper release if idle. Set to 0 to deactivate.
|
||||
// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true.
|
||||
// Time can be set by M18 and M84.
|
||||
#define DEFAULT_STEPPER_DEACTIVE_TIME 120
|
||||
#define DISABLE_INACTIVE_X true
|
||||
#define DISABLE_INACTIVE_Y true
|
||||
#define DISABLE_INACTIVE_Z true // set to false if the nozzle will fall down on your printed part when print has finished.
|
||||
#define DISABLE_INACTIVE_E true
|
||||
|
||||
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
|
||||
#define DEFAULT_MINTRAVELFEEDRATE 0.0
|
||||
|
||||
// @section lcd
|
||||
|
||||
#if ENABLED(ULTIPANEL)
|
||||
#define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
|
||||
#define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder
|
||||
#endif
|
||||
|
||||
// @section extras
|
||||
|
||||
// minimum time in microseconds that a movement needs to take if the buffer is emptied.
|
||||
#define DEFAULT_MINSEGMENTTIME 20000
|
||||
|
||||
// If defined the movements slow down when the look ahead buffer is only half full
|
||||
#define SLOWDOWN
|
||||
|
||||
// Frequency limit
|
||||
// See nophead's blog for more info
|
||||
// Not working O
|
||||
//#define XY_FREQUENCY_LIMIT 15
|
||||
|
||||
// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
|
||||
// of the buffer and all stops. This should not be much greater than zero and should only be changed
|
||||
// if unwanted behavior is observed on a user's machine when running at very slow speeds.
|
||||
#define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
|
||||
|
||||
// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
|
||||
#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
|
||||
|
||||
// Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
|
||||
#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
|
||||
|
||||
// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
|
||||
//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
|
||||
|
||||
// uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
|
||||
//#define DIGIPOT_I2C
|
||||
// Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
|
||||
#define DIGIPOT_I2C_NUM_CHANNELS 8
|
||||
// actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
|
||||
#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}
|
||||
|
||||
//===========================================================================
|
||||
//=============================Additional Features===========================
|
||||
//===========================================================================
|
||||
|
||||
#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
|
||||
#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
|
||||
#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
|
||||
|
||||
//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
|
||||
#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
|
||||
|
||||
// @section lcd
|
||||
|
||||
// Include a page of printer information in the LCD Main Menu
|
||||
//#define LCD_INFO_MENU
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
|
||||
// around this by connecting a push button or single throw switch to the pin defined
|
||||
// as SD_DETECT_PIN in your board's pins definitions.
|
||||
// This setting should be disabled unless you are using a push button, pulling the pin to ground.
|
||||
// Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER).
|
||||
#define SD_DETECT_INVERTED
|
||||
|
||||
#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers?
|
||||
#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
|
||||
|
||||
#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.
|
||||
// using:
|
||||
//#define MENU_ADDAUTOSTART
|
||||
|
||||
// Show a progress bar on HD44780 LCDs for SD printing
|
||||
//#define LCD_PROGRESS_BAR
|
||||
|
||||
#if ENABLED(LCD_PROGRESS_BAR)
|
||||
// Amount of time (ms) to show the bar
|
||||
#define PROGRESS_BAR_BAR_TIME 2000
|
||||
// Amount of time (ms) to show the status message
|
||||
#define PROGRESS_BAR_MSG_TIME 3000
|
||||
// Amount of time (ms) to retain the status message (0=forever)
|
||||
#define PROGRESS_MSG_EXPIRE 0
|
||||
// Enable this to show messages for MSG_TIME then hide them
|
||||
//#define PROGRESS_MSG_ONCE
|
||||
#endif
|
||||
|
||||
// This allows hosts to request long names for files and folders with M33
|
||||
//#define LONG_FILENAME_HOST_SUPPORT
|
||||
|
||||
// This option allows you to abort SD printing when any endstop is triggered.
|
||||
// This feature must be enabled with "M540 S1" or from the LCD menu.
|
||||
// To have any effect, endstops must be enabled during SD printing.
|
||||
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
|
||||
|
||||
#endif // SDSUPPORT
|
||||
|
||||
// for dogm lcd displays you can choose some additional fonts:
|
||||
#if ENABLED(DOGLCD)
|
||||
// save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
|
||||
// we don't have a big font for Cyrillic, Kana
|
||||
//#define USE_BIG_EDIT_FONT
|
||||
|
||||
// If you have spare 2300Byte of progmem and want to use a
|
||||
// smaller font on the Info-screen uncomment the next line.
|
||||
//#define USE_SMALL_INFOFONT
|
||||
#endif // DOGLCD
|
||||
|
||||
// @section safety
|
||||
|
||||
// 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
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
// If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
|
||||
// The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
|
||||
// However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
|
||||
//#define WATCHDOG_RESET_MANUAL
|
||||
#endif
|
||||
|
||||
// @section lcd
|
||||
|
||||
// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process
|
||||
// it can e.g. be used to change z-positions in the print startup phase in real-time
|
||||
// does not respect endstops!
|
||||
//#define BABYSTEPPING
|
||||
#if ENABLED(BABYSTEPPING)
|
||||
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions
|
||||
//not implemented for deltabots!
|
||||
#define BABYSTEP_INVERT_Z false //true for inverse movements in Z
|
||||
#define BABYSTEP_MULTIPLICATOR 1 //faster movements
|
||||
#endif
|
||||
|
||||
// @section extruder
|
||||
|
||||
// extruder advance constant (s2/mm3)
|
||||
//
|
||||
// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
|
||||
//
|
||||
// Hooke's law says: force = k * distance
|
||||
// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant
|
||||
// so: v ^ 2 is proportional to number of steps we advance the extruder
|
||||
//#define ADVANCE
|
||||
|
||||
#if ENABLED(ADVANCE)
|
||||
#define EXTRUDER_ADVANCE_K .0
|
||||
#define D_FILAMENT 2.85
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
#define LIN_ADVANCE_K 75
|
||||
#endif
|
||||
|
||||
// @section leveling
|
||||
|
||||
// Default mesh area is an area with an inset margin on the print area.
|
||||
// Below are the macros that are used to define the borders for the mesh area,
|
||||
// made available here for specialized needs, ie dual extruder setup.
|
||||
#if ENABLED(MESH_BED_LEVELING)
|
||||
#define MESH_MIN_X (X_MIN_POS + MESH_INSET)
|
||||
#define MESH_MAX_X (X_MAX_POS - (MESH_INSET))
|
||||
#define MESH_MIN_Y (Y_MIN_POS + MESH_INSET)
|
||||
#define MESH_MAX_Y (Y_MAX_POS - (MESH_INSET))
|
||||
#endif
|
||||
|
||||
// @section extras
|
||||
|
||||
// Arc interpretation settings:
|
||||
#define ARC_SUPPORT // Disabling this saves ~2738 bytes
|
||||
#define MM_PER_ARC_SEGMENT 1
|
||||
#define N_ARC_CORRECTION 25
|
||||
|
||||
// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes.
|
||||
//#define BEZIER_CURVE_SUPPORT
|
||||
|
||||
const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement
|
||||
|
||||
// @section temperature
|
||||
|
||||
// Control heater 0 and heater 1 in parallel.
|
||||
//#define HEATERS_PARALLEL
|
||||
|
||||
//===========================================================================
|
||||
//================================= Buffers =================================
|
||||
//===========================================================================
|
||||
|
||||
// @section hidden
|
||||
|
||||
// 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.
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
|
||||
#else
|
||||
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
|
||||
#endif
|
||||
|
||||
// @section serial
|
||||
|
||||
// The ASCII buffer for serial input
|
||||
#define MAX_CMD_SIZE 96
|
||||
#define BUFSIZE 4
|
||||
|
||||
// Transfer Buffer Size
|
||||
// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
|
||||
// To buffer a simple "ok" you need 4 bytes.
|
||||
// For ADVANCED_OK (M105) you need 32 bytes.
|
||||
// For debug-echo: 128 bytes for the optimal speed.
|
||||
// Other output doesn't need to be that speedy.
|
||||
// :[0,2,4,8,16,32,64,128,256]
|
||||
#define TX_BUFFER_SIZE 0
|
||||
|
||||
// Enable an emergency-command parser to intercept certain commands as they
|
||||
// enter the serial receive buffer, so they cannot be blocked.
|
||||
// Currently handles M108, M112, M410
|
||||
// Does not work on boards using AT90USB (USBCON) processors!
|
||||
//#define EMERGENCY_PARSER
|
||||
|
||||
// Bad Serial-connections can miss a received command by sending an 'ok'
|
||||
// Therefore some clients abort after 30 seconds in a timeout.
|
||||
// Some other clients start sending commands while receiving a 'wait'.
|
||||
// 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.
|
||||
//#define ADVANCED_OK
|
||||
|
||||
// @section fwretract
|
||||
|
||||
// Firmware based and LCD controlled retract
|
||||
// M207 and M208 can be used to define parameters for the retraction.
|
||||
// The retraction can be called by the slicer using G10 and G11
|
||||
// until then, intended retractions can be detected by moves that only extrude and the direction.
|
||||
// the moves are than replaced by the firmware controlled ones.
|
||||
|
||||
//#define FWRETRACT //ONLY PARTIALLY TESTED
|
||||
#if ENABLED(FWRETRACT)
|
||||
#define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt
|
||||
#define RETRACT_LENGTH 3 //default retract length (positive mm)
|
||||
#define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change
|
||||
#define RETRACT_FEEDRATE 45 //default feedrate for retracting (mm/s)
|
||||
#define RETRACT_ZLIFT 0 //default retract Z-lift
|
||||
#define RETRACT_RECOVER_LENGTH 0 //default additional recover length (mm, added to retract length when recovering)
|
||||
#define RETRACT_RECOVER_LENGTH_SWAP 0 //default additional swap recover length (mm, added to retract length when recovering from extruder change)
|
||||
#define RETRACT_RECOVER_FEEDRATE 8 //default feedrate for recovering from retraction (mm/s)
|
||||
#endif
|
||||
|
||||
// Add support for experimental filament exchange support M600; requires display
|
||||
#if ENABLED(ULTIPANEL)
|
||||
// #define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
|
||||
#if ENABLED(FILAMENT_CHANGE_FEATURE)
|
||||
#define FILAMENT_CHANGE_X_POS 30 // X position of hotend
|
||||
#define FILAMENT_CHANGE_Y_POS 10 // Y position of hotend
|
||||
#define FILAMENT_CHANGE_Z_ADD 10 // Z addition of hotend (lift)
|
||||
#define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
|
||||
#define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
|
||||
#define FILAMENT_CHANGE_RETRACT_LENGTH 1 // Initial retract in mm
|
||||
// It is a short retract used immediately after print interrupt before move to filament exchange position
|
||||
#define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
|
||||
//#define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // Unload filament length from hotend in mm
|
||||
// Longer length for bowden printers to unload filament from whole bowden tube,
|
||||
// shorter lenght for printers without bowden to unload filament from extruder only,
|
||||
// 0 to disable unloading for manual unloading
|
||||
#define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
|
||||
#define FILAMENT_CHANGE_LOAD_LENGTH 0 // Load filament length over hotend in mm
|
||||
// Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
|
||||
// Short or zero length for printers without bowden where loading is not used
|
||||
#define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
|
||||
#define FILAMENT_CHANGE_EXTRUDE_LENGTH 50 // Extrude filament length in mm after filament is load over the hotend,
|
||||
// 0 to disable for manual extrusion
|
||||
// Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
|
||||
// or until outcoming filament color is not clear for filament color change
|
||||
#define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/******************************************************************************\
|
||||
* enable this section if you have TMC26X motor drivers.
|
||||
* you need to import the TMC26XStepper library into the Arduino IDE for this
|
||||
******************************************************************************/
|
||||
|
||||
// @section tmc
|
||||
|
||||
//#define HAVE_TMCDRIVER
|
||||
#if ENABLED(HAVE_TMCDRIVER)
|
||||
|
||||
//#define X_IS_TMC
|
||||
#define X_MAX_CURRENT 1000 //in mA
|
||||
#define X_SENSE_RESISTOR 91 //in mOhms
|
||||
#define X_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define X2_IS_TMC
|
||||
#define X2_MAX_CURRENT 1000 //in mA
|
||||
#define X2_SENSE_RESISTOR 91 //in mOhms
|
||||
#define X2_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define Y_IS_TMC
|
||||
#define Y_MAX_CURRENT 1000 //in mA
|
||||
#define Y_SENSE_RESISTOR 91 //in mOhms
|
||||
#define Y_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define Y2_IS_TMC
|
||||
#define Y2_MAX_CURRENT 1000 //in mA
|
||||
#define Y2_SENSE_RESISTOR 91 //in mOhms
|
||||
#define Y2_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define Z_IS_TMC
|
||||
#define Z_MAX_CURRENT 1000 //in mA
|
||||
#define Z_SENSE_RESISTOR 91 //in mOhms
|
||||
#define Z_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define Z2_IS_TMC
|
||||
#define Z2_MAX_CURRENT 1000 //in mA
|
||||
#define Z2_SENSE_RESISTOR 91 //in mOhms
|
||||
#define Z2_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define E0_IS_TMC
|
||||
#define E0_MAX_CURRENT 1000 //in mA
|
||||
#define E0_SENSE_RESISTOR 91 //in mOhms
|
||||
#define E0_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define E1_IS_TMC
|
||||
#define E1_MAX_CURRENT 1000 //in mA
|
||||
#define E1_SENSE_RESISTOR 91 //in mOhms
|
||||
#define E1_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define E2_IS_TMC
|
||||
#define E2_MAX_CURRENT 1000 //in mA
|
||||
#define E2_SENSE_RESISTOR 91 //in mOhms
|
||||
#define E2_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define E3_IS_TMC
|
||||
#define E3_MAX_CURRENT 1000 //in mA
|
||||
#define E3_SENSE_RESISTOR 91 //in mOhms
|
||||
#define E3_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
#endif
|
||||
|
||||
/******************************************************************************\
|
||||
* enable this section if you have L6470 motor drivers.
|
||||
* you need to import the L6470 library into the Arduino IDE for this
|
||||
******************************************************************************/
|
||||
|
||||
// @section l6470
|
||||
|
||||
//#define HAVE_L6470DRIVER
|
||||
#if ENABLED(HAVE_L6470DRIVER)
|
||||
|
||||
//#define X_IS_L6470
|
||||
#define X_MICROSTEPS 16 //number of microsteps
|
||||
#define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define X2_IS_L6470
|
||||
#define X2_MICROSTEPS 16 //number of microsteps
|
||||
#define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define Y_IS_L6470
|
||||
#define Y_MICROSTEPS 16 //number of microsteps
|
||||
#define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define Y2_IS_L6470
|
||||
#define Y2_MICROSTEPS 16 //number of microsteps
|
||||
#define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define Z_IS_L6470
|
||||
#define Z_MICROSTEPS 16 //number of microsteps
|
||||
#define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define Z2_IS_L6470
|
||||
#define Z2_MICROSTEPS 16 //number of microsteps
|
||||
#define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define E0_IS_L6470
|
||||
#define E0_MICROSTEPS 16 //number of microsteps
|
||||
#define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define E1_IS_L6470
|
||||
#define E1_MICROSTEPS 16 //number of microsteps
|
||||
#define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define E2_IS_L6470
|
||||
#define E2_MICROSTEPS 16 //number of microsteps
|
||||
#define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define E3_IS_L6470
|
||||
#define E3_MICROSTEPS 16 //number of microsteps
|
||||
#define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* TWI/I2C BUS
|
||||
*
|
||||
* This feature is an EXPERIMENTAL feature so it shall not be used on production
|
||||
* machines. Enabling this will allow you to send and receive I2C data from slave
|
||||
* devices on the bus.
|
||||
*
|
||||
* ; Example #1
|
||||
* ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
|
||||
* ; It uses multiple M155 commands with one B<base 10> arg
|
||||
* M155 A99 ; Target slave address
|
||||
* M155 B77 ; M
|
||||
* M155 B97 ; a
|
||||
* M155 B114 ; r
|
||||
* M155 B108 ; l
|
||||
* M155 B105 ; i
|
||||
* M155 B110 ; n
|
||||
* M155 S1 ; Send the current buffer
|
||||
*
|
||||
* ; Example #2
|
||||
* ; Request 6 bytes from slave device with address 0x63 (99)
|
||||
* M156 A99 B5
|
||||
*
|
||||
* ; Example #3
|
||||
* ; Example serial output of a M156 request
|
||||
* echo:i2c-reply: from:99 bytes:5 data:hello
|
||||
*/
|
||||
|
||||
// @section i2cbus
|
||||
|
||||
//#define EXPERIMENTAL_I2CBUS
|
||||
|
||||
#endif // CONFIGURATION_ADV_H
|
@ -0,0 +1,103 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Custom Bitmap for splashscreen
|
||||
*
|
||||
* You may use one of the following tools to generate the C++ bitmap array from
|
||||
* a black and white image:
|
||||
*
|
||||
* - http://www.marlinfw.org/tools/u8glib/converter.html
|
||||
* - http://www.digole.com/tools/PicturetoC_Hex_converter.php
|
||||
*/
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
#define CUSTOM_BOOTSCREEN_TIMEOUT 2500
|
||||
#define CUSTOM_BOOTSCREEN_BMPWIDTH 63
|
||||
#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64
|
||||
|
||||
const unsigned char custom_start_bmp[512] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x03, 0xff, 0xff, 0xc0, 0x00, 0x00,
|
||||
0x00, 0x00, 0x1f, 0xff, 0xff, 0xf0, 0x00, 0x00,
|
||||
0x00, 0x00, 0x7f, 0xff, 0xff, 0xfc, 0x00, 0x00,
|
||||
0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
|
||||
0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00,
|
||||
0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00,
|
||||
0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
|
||||
0x00, 0x0f, 0x07, 0x87, 0xff, 0xff, 0xe0, 0x00,
|
||||
0x00, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x00,
|
||||
0x01, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x80,
|
||||
0x03, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x80,
|
||||
0x07, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xe1, 0xc0,
|
||||
0x07, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xe0,
|
||||
0x0f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xe0,
|
||||
0x0f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xf0,
|
||||
0x1f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xf0,
|
||||
0x1f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xe1, 0xf0,
|
||||
0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0xf8,
|
||||
0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0xf8,
|
||||
0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0xf8,
|
||||
0x3f, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xe1, 0xf8,
|
||||
0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc,
|
||||
0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc,
|
||||
0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc,
|
||||
0x7f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xfc,
|
||||
0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc,
|
||||
0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc,
|
||||
0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc,
|
||||
0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc,
|
||||
0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc,
|
||||
0x7f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xfc,
|
||||
0x7f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xfc,
|
||||
0x7f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xfc,
|
||||
0x3f, 0x0f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8,
|
||||
0x3f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8,
|
||||
0x3f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8,
|
||||
0x3f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf8,
|
||||
0x1f, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf0,
|
||||
0x1f, 0x0f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xf0,
|
||||
0x1f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xe0,
|
||||
0x0f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xe0,
|
||||
0x0f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xc0,
|
||||
0x07, 0x0f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xc0,
|
||||
0x03, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0x80,
|
||||
0x03, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0x00,
|
||||
0x01, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf0, 0x00,
|
||||
0x00, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf0, 0x00,
|
||||
0x00, 0x0f, 0xff, 0xff, 0xc3, 0xc1, 0xe0, 0x00,
|
||||
0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
|
||||
0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00,
|
||||
0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00,
|
||||
0x00, 0x01, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00,
|
||||
0x00, 0x00, 0x7f, 0xff, 0xff, 0xfc, 0x00, 0x00,
|
||||
0x00, 0x00, 0x1f, 0xff, 0xff, 0xf0, 0x00, 0x00,
|
||||
0x00, 0x00, 0x07, 0xff, 0xff, 0x80, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
@ -0,0 +1,103 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Custom Bitmap for splashscreen
|
||||
*
|
||||
* You may use one of the following tools to generate the C++ bitmap array from
|
||||
* a black and white image:
|
||||
*
|
||||
* - http://www.marlinfw.org/tools/u8glib/converter.html
|
||||
* - http://www.digole.com/tools/PicturetoC_Hex_converter.php
|
||||
*/
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
#define CUSTOM_BOOTSCREEN_TIMEOUT 2500
|
||||
#define CUSTOM_BOOTSCREEN_BMPWIDTH 62
|
||||
#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64
|
||||
|
||||
const unsigned char custom_start_bmp[512] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x00,
|
||||
0x00, 0x03, 0xc0, 0x0f, 0xf0, 0x07, 0x80, 0x00,
|
||||
0x00, 0x07, 0xe0, 0x07, 0xe0, 0x0f, 0xc0, 0x00,
|
||||
0x00, 0x0f, 0xf0, 0x03, 0xc0, 0x1f, 0xe0, 0x00,
|
||||
0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00,
|
||||
0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00,
|
||||
0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00,
|
||||
0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00,
|
||||
0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xf0, 0x00,
|
||||
0x00, 0x0f, 0xf0, 0x00, 0x00, 0x1f, 0xe0, 0x00,
|
||||
0x00, 0x07, 0xe0, 0x00, 0x00, 0x0f, 0xc0, 0x00,
|
||||
0x00, 0x03, 0xc0, 0x00, 0x00, 0x07, 0x80, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf8,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfc,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfc,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf8,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x1e, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
|
||||
0x3f, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
|
||||
0x7f, 0x80, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
|
||||
0xff, 0xc0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
|
||||
0xff, 0xc0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
|
||||
0xff, 0xc0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
|
||||
0xff, 0xc0, 0x00, 0x00, 0xf7, 0xc0, 0x1f, 0x80,
|
||||
0xff, 0xc0, 0x00, 0x00, 0xff, 0xf0, 0x7f, 0xc0,
|
||||
0x7f, 0x80, 0x00, 0x00, 0xff, 0xf8, 0xff, 0xe0,
|
||||
0x3f, 0x00, 0x00, 0x00, 0xfc, 0xf8, 0xf0, 0xf8,
|
||||
0x1e, 0x00, 0x00, 0x00, 0xf8, 0x7d, 0xe0, 0x78,
|
||||
0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78,
|
||||
0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78,
|
||||
0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78,
|
||||
0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78,
|
||||
0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78,
|
||||
0x00, 0x00, 0x00, 0x00, 0xf0, 0x3d, 0xe0, 0x78,
|
||||
0x00, 0x00, 0x00, 0x00, 0xf8, 0x79, 0xf0, 0xf8,
|
||||
0x00, 0x00, 0x00, 0x00, 0xff, 0xf8, 0xff, 0xf8,
|
||||
0x00, 0x00, 0x00, 0x00, 0x3f, 0xf0, 0x7f, 0xf8,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0f, 0xe0, 0x3f, 0xf8,
|
||||
0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x0e, 0x78,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78,
|
||||
};
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,799 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Configuration_adv.h
|
||||
*
|
||||
* Advanced settings.
|
||||
* Only change these if you know exactly what you're doing.
|
||||
* Some of these settings can damage your printer if improperly set!
|
||||
*
|
||||
* Basic settings can be found in Configuration.h
|
||||
*
|
||||
*/
|
||||
#ifndef CONFIGURATION_ADV_H
|
||||
#define CONFIGURATION_ADV_H
|
||||
|
||||
/**
|
||||
*
|
||||
* ***********************************
|
||||
* ** ATTENTION TO ALL DEVELOPERS **
|
||||
* ***********************************
|
||||
*
|
||||
* You must increment this version number for every significant change such as,
|
||||
* but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option.
|
||||
*
|
||||
* Note: Update also Version.h !
|
||||
*/
|
||||
#define CONFIGURATION_ADV_H_VERSION 010100
|
||||
|
||||
// @section temperature
|
||||
|
||||
//===========================================================================
|
||||
//=============================Thermal Settings ============================
|
||||
//===========================================================================
|
||||
|
||||
#if DISABLED(PIDTEMPBED)
|
||||
#define BED_CHECK_INTERVAL 1000 // ms between checks in bang-bang control
|
||||
#if ENABLED(BED_LIMIT_SWITCHING)
|
||||
#define BED_HYSTERESIS 1 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Thermal Protection protects your printer from damage and fire if a
|
||||
* thermistor falls out or temperature sensors fail in any way.
|
||||
*
|
||||
* The issue: If a thermistor falls out or a temperature sensor fails,
|
||||
* Marlin can no longer sense the actual temperature. Since a disconnected
|
||||
* thermistor reads as a low temperature, the firmware will keep the heater on.
|
||||
*
|
||||
* The solution: Once the temperature reaches the target, start observing.
|
||||
* If the temperature stays too far below the target (hysteresis) for too long (period),
|
||||
* the firmware will halt the machine as a safety precaution.
|
||||
*
|
||||
* If you get false positives for "Thermal Runaway" increase THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD
|
||||
*/
|
||||
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
|
||||
#define THERMAL_PROTECTION_PERIOD 40 // Seconds
|
||||
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
|
||||
|
||||
/**
|
||||
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the
|
||||
* WATCH_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
|
||||
* degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
|
||||
* but only if the current temperature is far enough below the target for a reliable test.
|
||||
*
|
||||
* If you get false positives for "Heating failed" increase WATCH_TEMP_PERIOD and/or decrease WATCH_TEMP_INCREASE
|
||||
* WATCH_TEMP_INCREASE should not be below 2.
|
||||
*/
|
||||
#define WATCH_TEMP_PERIOD 20 // Seconds
|
||||
#define WATCH_TEMP_INCREASE 2 // Degrees Celsius
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Thermal Protection parameters for the bed are just as above for hotends.
|
||||
*/
|
||||
#if ENABLED(THERMAL_PROTECTION_BED)
|
||||
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
|
||||
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
|
||||
|
||||
/**
|
||||
* Whenever an M140 or M190 increases the target temperature the firmware will wait for the
|
||||
* WATCH_BED_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_BED_TEMP_INCREASE
|
||||
* degrees, the machine is halted, requiring a hard reset. This test restarts with any M140/M190,
|
||||
* but only if the current temperature is far enough below the target for a reliable test.
|
||||
*
|
||||
* If you get too many "Heating failed" errors, increase WATCH_BED_TEMP_PERIOD and/or decrease
|
||||
* WATCH_BED_TEMP_INCREASE. (WATCH_BED_TEMP_INCREASE should not be below 2.)
|
||||
*/
|
||||
#define WATCH_BED_TEMP_PERIOD 60 // Seconds
|
||||
#define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
|
||||
#endif
|
||||
|
||||
#if ENABLED(PIDTEMP)
|
||||
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
|
||||
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
|
||||
//#define PID_EXTRUSION_SCALING
|
||||
#if ENABLED(PID_EXTRUSION_SCALING)
|
||||
#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
|
||||
#define LPQ_MAX_LEN 50
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Automatic Temperature:
|
||||
* The hotend target temperature is calculated by all the buffered lines of gcode.
|
||||
* The maximum buffered steps/sec of the extruder motor is called "se".
|
||||
* Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
|
||||
* The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
|
||||
* mintemp and maxtemp. Turn this off by executing M109 without F*
|
||||
* Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
|
||||
* On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
|
||||
*/
|
||||
#define AUTOTEMP
|
||||
#if ENABLED(AUTOTEMP)
|
||||
#define AUTOTEMP_OLDWEIGHT 0.98
|
||||
#endif
|
||||
|
||||
//Show Temperature ADC value
|
||||
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
|
||||
//#define SHOW_TEMP_ADC_VALUES
|
||||
|
||||
/**
|
||||
* High Temperature Thermistor Support
|
||||
*
|
||||
* Thermistors able to support high temperature tend to have a hard time getting
|
||||
* good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
|
||||
* will probably be caught when the heating element first turns on during the
|
||||
* preheating process, which will trigger a min_temp_error as a safety measure
|
||||
* and force stop everything.
|
||||
* To circumvent this limitation, we allow for a preheat time (during which,
|
||||
* min_temp_error won't be triggered) and add a min_temp buffer to handle
|
||||
* aberrant readings.
|
||||
*
|
||||
* If you want to enable this feature for your hotend thermistor(s)
|
||||
* uncomment and set values > 0 in the constants below
|
||||
*/
|
||||
|
||||
// The number of consecutive low temperature errors that can occur
|
||||
// before a min_temp_error is triggered. (Shouldn't be more than 10.)
|
||||
//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
|
||||
|
||||
// The number of milliseconds a hotend will preheat before starting to check
|
||||
// the temperature. This value should NOT be set to the time it takes the
|
||||
// hot end to reach the target temperature, but the time it takes to reach
|
||||
// the minimum temperature your thermistor can read. The lower the better/safer.
|
||||
// This shouldn't need to be more than 30 seconds (30000)
|
||||
//#define MILLISECONDS_PREHEAT_TIME 0
|
||||
|
||||
// @section extruder
|
||||
|
||||
// extruder run-out prevention.
|
||||
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
|
||||
//#define EXTRUDER_RUNOUT_PREVENT
|
||||
#define EXTRUDER_RUNOUT_MINTEMP 190
|
||||
#define EXTRUDER_RUNOUT_SECONDS 30
|
||||
#define EXTRUDER_RUNOUT_ESTEPS 14 // mm filament
|
||||
#define EXTRUDER_RUNOUT_SPEED 1500 // extrusion speed
|
||||
#define EXTRUDER_RUNOUT_EXTRUDE 100
|
||||
|
||||
// @section temperature
|
||||
|
||||
//These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements.
|
||||
//The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET"
|
||||
#define TEMP_SENSOR_AD595_OFFSET 0.0
|
||||
#define TEMP_SENSOR_AD595_GAIN 1.0
|
||||
|
||||
//This is for controlling a fan to cool down the stepper drivers
|
||||
//it will turn on when any driver is enabled
|
||||
//and turn off after the set amount of seconds from last driver being disabled again
|
||||
#define CONTROLLERFAN_PIN 2 //Pin used for the fan to cool controller (-1 to disable)
|
||||
#define CONTROLLERFAN_SECS 60 //How many seconds, after all motors were disabled, the fan should run
|
||||
#define CONTROLLERFAN_SPEED 255 // == full speed
|
||||
|
||||
// When first starting the main fan, run it at full speed for the
|
||||
// given number of milliseconds. This gets the fan spinning reliably
|
||||
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
|
||||
//#define FAN_KICKSTART_TIME 100
|
||||
|
||||
// This defines the minimal speed for the main fan, run in PWM mode
|
||||
// to enable uncomment and set minimal PWM speed for reliable running (1-255)
|
||||
// if fan speed is [1 - (FAN_MIN_PWM-1)] it is set to FAN_MIN_PWM
|
||||
//#define FAN_MIN_PWM 50
|
||||
|
||||
// @section extruder
|
||||
|
||||
// Extruder cooling fans
|
||||
// Configure fan pin outputs to automatically turn on/off when the associated
|
||||
// extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE.
|
||||
// Multiple extruders can be assigned to the same pin in which case
|
||||
// the fan will turn on when any selected extruder is above the threshold.
|
||||
#define EXTRUDER_0_AUTO_FAN_PIN -1
|
||||
#define EXTRUDER_1_AUTO_FAN_PIN -1
|
||||
#define EXTRUDER_2_AUTO_FAN_PIN -1
|
||||
#define EXTRUDER_3_AUTO_FAN_PIN -1
|
||||
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
|
||||
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
|
||||
|
||||
//===========================================================================
|
||||
//============================ Mechanical Settings ==========================
|
||||
//===========================================================================
|
||||
|
||||
// @section homing
|
||||
|
||||
// If you want endstops to stay on (by default) even when not homing
|
||||
// enable this option. Override at any time with M120, M121.
|
||||
//#define ENDSTOPS_ALWAYS_ON_DEFAULT
|
||||
|
||||
// @section extras
|
||||
|
||||
//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
|
||||
|
||||
// Dual X Steppers
|
||||
// Uncomment this option to drive two X axis motors.
|
||||
// The next unused E driver will be assigned to the second X stepper.
|
||||
//#define X_DUAL_STEPPER_DRIVERS
|
||||
#if ENABLED(X_DUAL_STEPPER_DRIVERS)
|
||||
// Set true if the two X motors need to rotate in opposite directions
|
||||
#define INVERT_X2_VS_X_DIR true
|
||||
#endif
|
||||
|
||||
|
||||
// Dual Y Steppers
|
||||
// Uncomment this option to drive two Y axis motors.
|
||||
// The next unused E driver will be assigned to the second Y stepper.
|
||||
//#define Y_DUAL_STEPPER_DRIVERS
|
||||
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
|
||||
// Set true if the two Y motors need to rotate in opposite directions
|
||||
#define INVERT_Y2_VS_Y_DIR true
|
||||
#endif
|
||||
|
||||
// A single Z stepper driver is usually used to drive 2 stepper motors.
|
||||
// Uncomment this option to use a separate stepper driver for each Z axis motor.
|
||||
// The next unused E driver will be assigned to the second Z stepper.
|
||||
//#define Z_DUAL_STEPPER_DRIVERS
|
||||
|
||||
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
|
||||
|
||||
// Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
|
||||
// That way the machine is capable to align the bed during home, since both Z steppers are homed.
|
||||
// There is also an implementation of M666 (software endstops adjustment) to this feature.
|
||||
// After Z homing, this adjustment is applied to just one of the steppers in order to align the bed.
|
||||
// One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2.
|
||||
// If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it is.. think about it) and the Z adjust would be positive.
|
||||
// Play a little bit with small adjustments (0.5mm) and check the behaviour.
|
||||
// The M119 (endstops report) will start reporting the Z2 Endstop as well.
|
||||
|
||||
//#define Z_DUAL_ENDSTOPS
|
||||
|
||||
#if ENABLED(Z_DUAL_ENDSTOPS)
|
||||
#define Z2_USE_ENDSTOP _XMAX_
|
||||
#endif
|
||||
|
||||
#endif // Z_DUAL_STEPPER_DRIVERS
|
||||
|
||||
// Enable this for dual x-carriage printers.
|
||||
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
|
||||
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
|
||||
// allowing faster printing speeds. Connect your X2 stepper to the first unused E plug.
|
||||
//#define DUAL_X_CARRIAGE
|
||||
#if ENABLED(DUAL_X_CARRIAGE)
|
||||
// Configuration for second X-carriage
|
||||
// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
|
||||
// the second x-carriage always homes to the maximum endstop.
|
||||
#define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage
|
||||
#define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed
|
||||
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
|
||||
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
|
||||
// However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software
|
||||
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
|
||||
// without modifying the firmware (through the "M218 T1 X???" command).
|
||||
// Remember: you should set the second extruder x-offset to 0 in your slicer.
|
||||
|
||||
// There are a few selectable movement modes for dual x-carriages using M605 S<mode>
|
||||
// Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results
|
||||
// as long as it supports dual x-carriages. (M605 S0)
|
||||
// Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so
|
||||
// that additional slicer support is not required. (M605 S1)
|
||||
// Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all
|
||||
// actions of the first x-carriage. This allows the printer to print 2 arbitrary items at
|
||||
// once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
|
||||
|
||||
// This is the default power-up mode which can be later using M605.
|
||||
#define DEFAULT_DUAL_X_CARRIAGE_MODE 0
|
||||
|
||||
// Default settings in "Auto-park Mode"
|
||||
#define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder
|
||||
#define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder
|
||||
|
||||
// Default x offset in duplication mode (typically set to half print bed width)
|
||||
#define DEFAULT_DUPLICATION_X_OFFSET 100
|
||||
|
||||
#endif //DUAL_X_CARRIAGE
|
||||
|
||||
// @section homing
|
||||
|
||||
//homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
|
||||
#define X_HOME_BUMP_MM 10
|
||||
#define Y_HOME_BUMP_MM 10
|
||||
#define Z_HOME_BUMP_MM 3
|
||||
#define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate)
|
||||
#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
|
||||
|
||||
// When G28 is called, this option will make Y home before X
|
||||
//#define HOME_Y_BEFORE_X
|
||||
|
||||
// @section machine
|
||||
|
||||
#define AXIS_RELATIVE_MODES {false, false, false, false}
|
||||
|
||||
// Allow duplication mode with a basic dual-nozzle extruder
|
||||
//#define DUAL_NOZZLE_DUPLICATION_MODE
|
||||
|
||||
// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
|
||||
#define INVERT_X_STEP_PIN false
|
||||
#define INVERT_Y_STEP_PIN false
|
||||
#define INVERT_Z_STEP_PIN false
|
||||
#define INVERT_E_STEP_PIN false
|
||||
|
||||
// Default stepper release if idle. Set to 0 to deactivate.
|
||||
// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true.
|
||||
// Time can be set by M18 and M84.
|
||||
#define DEFAULT_STEPPER_DEACTIVE_TIME 120
|
||||
#define DISABLE_INACTIVE_X true
|
||||
#define DISABLE_INACTIVE_Y true
|
||||
#define DISABLE_INACTIVE_Z true // set to false if the nozzle will fall down on your printed part when print has finished.
|
||||
#define DISABLE_INACTIVE_E true
|
||||
|
||||
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
|
||||
#define DEFAULT_MINTRAVELFEEDRATE 0.0
|
||||
|
||||
// @section lcd
|
||||
|
||||
#if ENABLED(ULTIPANEL)
|
||||
#define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
|
||||
#define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder
|
||||
#endif
|
||||
|
||||
// @section extras
|
||||
|
||||
// minimum time in microseconds that a movement needs to take if the buffer is emptied.
|
||||
#define DEFAULT_MINSEGMENTTIME 20000
|
||||
|
||||
// If defined the movements slow down when the look ahead buffer is only half full
|
||||
#define SLOWDOWN
|
||||
|
||||
// Frequency limit
|
||||
// See nophead's blog for more info
|
||||
// Not working O
|
||||
//#define XY_FREQUENCY_LIMIT 15
|
||||
|
||||
// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
|
||||
// of the buffer and all stops. This should not be much greater than zero and should only be changed
|
||||
// if unwanted behavior is observed on a user's machine when running at very slow speeds.
|
||||
#define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
|
||||
|
||||
// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
|
||||
#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
|
||||
|
||||
// Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
|
||||
#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
|
||||
|
||||
// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
|
||||
//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
|
||||
|
||||
// uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
|
||||
//#define DIGIPOT_I2C
|
||||
// Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
|
||||
#define DIGIPOT_I2C_NUM_CHANNELS 8
|
||||
// actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
|
||||
#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}
|
||||
|
||||
//===========================================================================
|
||||
//=============================Additional Features===========================
|
||||
//===========================================================================
|
||||
|
||||
#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
|
||||
#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
|
||||
#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
|
||||
|
||||
//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
|
||||
#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
|
||||
|
||||
// @section lcd
|
||||
|
||||
// Include a page of printer information in the LCD Main Menu
|
||||
//#define LCD_INFO_MENU
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
|
||||
// around this by connecting a push button or single throw switch to the pin defined
|
||||
// as SD_DETECT_PIN in your board's pins definitions.
|
||||
// This setting should be disabled unless you are using a push button, pulling the pin to ground.
|
||||
// Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER).
|
||||
#define SD_DETECT_INVERTED
|
||||
|
||||
#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers?
|
||||
#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
|
||||
|
||||
#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.
|
||||
// using:
|
||||
//#define MENU_ADDAUTOSTART
|
||||
|
||||
// Show a progress bar on HD44780 LCDs for SD printing
|
||||
//#define LCD_PROGRESS_BAR
|
||||
|
||||
#if ENABLED(LCD_PROGRESS_BAR)
|
||||
// Amount of time (ms) to show the bar
|
||||
#define PROGRESS_BAR_BAR_TIME 2000
|
||||
// Amount of time (ms) to show the status message
|
||||
#define PROGRESS_BAR_MSG_TIME 3000
|
||||
// Amount of time (ms) to retain the status message (0=forever)
|
||||
#define PROGRESS_MSG_EXPIRE 0
|
||||
// Enable this to show messages for MSG_TIME then hide them
|
||||
//#define PROGRESS_MSG_ONCE
|
||||
#endif
|
||||
|
||||
// This allows hosts to request long names for files and folders with M33
|
||||
//#define LONG_FILENAME_HOST_SUPPORT
|
||||
|
||||
// This option allows you to abort SD printing when any endstop is triggered.
|
||||
// This feature must be enabled with "M540 S1" or from the LCD menu.
|
||||
// To have any effect, endstops must be enabled during SD printing.
|
||||
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
|
||||
|
||||
#endif // SDSUPPORT
|
||||
|
||||
// for dogm lcd displays you can choose some additional fonts:
|
||||
#if ENABLED(DOGLCD)
|
||||
// save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
|
||||
// we don't have a big font for Cyrillic, Kana
|
||||
//#define USE_BIG_EDIT_FONT
|
||||
|
||||
// If you have spare 2300Byte of progmem and want to use a
|
||||
// smaller font on the Info-screen uncomment the next line.
|
||||
//#define USE_SMALL_INFOFONT
|
||||
#endif // DOGLCD
|
||||
|
||||
// @section safety
|
||||
|
||||
// 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
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
// If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
|
||||
// The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
|
||||
// However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
|
||||
//#define WATCHDOG_RESET_MANUAL
|
||||
#endif
|
||||
|
||||
// @section lcd
|
||||
|
||||
// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process
|
||||
// it can e.g. be used to change z-positions in the print startup phase in real-time
|
||||
// does not respect endstops!
|
||||
//#define BABYSTEPPING
|
||||
#if ENABLED(BABYSTEPPING)
|
||||
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions
|
||||
//not implemented for deltabots!
|
||||
#define BABYSTEP_INVERT_Z false //true for inverse movements in Z
|
||||
#define BABYSTEP_MULTIPLICATOR 1 //faster movements
|
||||
#endif
|
||||
|
||||
// @section extruder
|
||||
|
||||
// extruder advance constant (s2/mm3)
|
||||
//
|
||||
// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
|
||||
//
|
||||
// Hooke's law says: force = k * distance
|
||||
// Bernoulli's principle says: v ^ 2 / 2 + g . h + pressure / density = constant
|
||||
// so: v ^ 2 is proportional to number of steps we advance the extruder
|
||||
//#define ADVANCE
|
||||
|
||||
#if ENABLED(ADVANCE)
|
||||
#define EXTRUDER_ADVANCE_K .0
|
||||
#define D_FILAMENT 2.85
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
#define LIN_ADVANCE_K 75
|
||||
#endif
|
||||
|
||||
// @section leveling
|
||||
|
||||
// Default mesh area is an area with an inset margin on the print area.
|
||||
// Below are the macros that are used to define the borders for the mesh area,
|
||||
// made available here for specialized needs, ie dual extruder setup.
|
||||
#if ENABLED(MESH_BED_LEVELING)
|
||||
#define MESH_MIN_X (X_MIN_POS + MESH_INSET)
|
||||
#define MESH_MAX_X (X_MAX_POS - (MESH_INSET))
|
||||
#define MESH_MIN_Y (Y_MIN_POS + MESH_INSET)
|
||||
#define MESH_MAX_Y (Y_MAX_POS - (MESH_INSET))
|
||||
#endif
|
||||
|
||||
// @section extras
|
||||
|
||||
// Arc interpretation settings:
|
||||
#define ARC_SUPPORT // Disabling this saves ~2738 bytes
|
||||
#define MM_PER_ARC_SEGMENT 1
|
||||
#define N_ARC_CORRECTION 25
|
||||
|
||||
// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes.
|
||||
//#define BEZIER_CURVE_SUPPORT
|
||||
|
||||
const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement
|
||||
|
||||
// @section temperature
|
||||
|
||||
// Control heater 0 and heater 1 in parallel.
|
||||
//#define HEATERS_PARALLEL
|
||||
|
||||
//===========================================================================
|
||||
//================================= Buffers =================================
|
||||
//===========================================================================
|
||||
|
||||
// @section hidden
|
||||
|
||||
// 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.
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
|
||||
#else
|
||||
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
|
||||
#endif
|
||||
|
||||
// @section serial
|
||||
|
||||
// The ASCII buffer for serial input
|
||||
#define MAX_CMD_SIZE 96
|
||||
#define BUFSIZE 26
|
||||
|
||||
// Transfer Buffer Size
|
||||
// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
|
||||
// To buffer a simple "ok" you need 4 bytes.
|
||||
// For ADVANCED_OK (M105) you need 32 bytes.
|
||||
// For debug-echo: 128 bytes for the optimal speed.
|
||||
// Other output doesn't need to be that speedy.
|
||||
// :[0,2,4,8,16,32,64,128,256]
|
||||
#define TX_BUFFER_SIZE 0
|
||||
|
||||
// Enable an emergency-command parser to intercept certain commands as they
|
||||
// enter the serial receive buffer, so they cannot be blocked.
|
||||
// Currently handles M108, M112, M410
|
||||
// Does not work on boards using AT90USB (USBCON) processors!
|
||||
//#define EMERGENCY_PARSER
|
||||
|
||||
// Bad Serial-connections can miss a received command by sending an 'ok'
|
||||
// Therefore some clients abort after 30 seconds in a timeout.
|
||||
// Some other clients start sending commands while receiving a 'wait'.
|
||||
// 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.
|
||||
//#define ADVANCED_OK
|
||||
|
||||
// @section fwretract
|
||||
|
||||
// Firmware based and LCD controlled retract
|
||||
// M207 and M208 can be used to define parameters for the retraction.
|
||||
// The retraction can be called by the slicer using G10 and G11
|
||||
// until then, intended retractions can be detected by moves that only extrude and the direction.
|
||||
// the moves are than replaced by the firmware controlled ones.
|
||||
|
||||
//#define FWRETRACT //ONLY PARTIALLY TESTED
|
||||
#if ENABLED(FWRETRACT)
|
||||
#define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt
|
||||
#define RETRACT_LENGTH 3 //default retract length (positive mm)
|
||||
#define RETRACT_LENGTH_SWAP 13 //default swap retract length (positive mm), for extruder change
|
||||
#define RETRACT_FEEDRATE 45 //default feedrate for retracting (mm/s)
|
||||
#define RETRACT_ZLIFT 0 //default retract Z-lift
|
||||
#define RETRACT_RECOVER_LENGTH 0 //default additional recover length (mm, added to retract length when recovering)
|
||||
#define RETRACT_RECOVER_LENGTH_SWAP 0 //default additional swap recover length (mm, added to retract length when recovering from extruder change)
|
||||
#define RETRACT_RECOVER_FEEDRATE 8 //default feedrate for recovering from retraction (mm/s)
|
||||
#endif
|
||||
|
||||
// Add support for experimental filament exchange support M600; requires display
|
||||
#if ENABLED(ULTIPANEL)
|
||||
#define FILAMENT_CHANGE_FEATURE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
|
||||
#if ENABLED(FILAMENT_CHANGE_FEATURE)
|
||||
#define FILAMENT_CHANGE_X_POS 100 // X position of hotend
|
||||
#define FILAMENT_CHANGE_Y_POS 100 // Y position of hotend
|
||||
#define FILAMENT_CHANGE_Z_ADD 20 // Z addition of hotend (lift)
|
||||
#define FILAMENT_CHANGE_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
|
||||
#define FILAMENT_CHANGE_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
|
||||
#define FILAMENT_CHANGE_RETRACT_LENGTH 5 // Initial retract in mm
|
||||
// It is a short retract used immediately after print interrupt before move to filament exchange position
|
||||
#define FILAMENT_CHANGE_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s
|
||||
#define FILAMENT_CHANGE_UNLOAD_LENGTH 600 // Unload filament length from hotend in mm
|
||||
// Longer length for bowden printers to unload filament from whole bowden tube,
|
||||
// shorter lenght for printers without bowden to unload filament from extruder only,
|
||||
// 0 to disable unloading for manual unloading
|
||||
#define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // Unload filament feedrate in mm/s - filament unloading can be fast
|
||||
#define FILAMENT_CHANGE_LOAD_LENGTH 600 // Load filament length over hotend in mm
|
||||
// Longer length for bowden printers to fast load filament into whole bowden tube over the hotend,
|
||||
// Short or zero length for printers without bowden where loading is not used
|
||||
#define FILAMENT_CHANGE_LOAD_FEEDRATE 10 // Load filament feedrate in mm/s - filament loading into the bowden tube can be fast
|
||||
#define FILAMENT_CHANGE_EXTRUDE_LENGTH 100 // Extrude filament length in mm after filament is load over the hotend,
|
||||
// 0 to disable for manual extrusion
|
||||
// Filament can be extruded repeatedly from the filament exchange menu to fill the hotend,
|
||||
// or until outcoming filament color is not clear for filament color change
|
||||
#define FILAMENT_CHANGE_EXTRUDE_FEEDRATE 3 // Extrude filament feedrate in mm/s - must be slower than load feedrate
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/******************************************************************************\
|
||||
* enable this section if you have TMC26X motor drivers.
|
||||
* you need to import the TMC26XStepper library into the Arduino IDE for this
|
||||
******************************************************************************/
|
||||
|
||||
// @section tmc
|
||||
|
||||
//#define HAVE_TMCDRIVER
|
||||
#if ENABLED(HAVE_TMCDRIVER)
|
||||
|
||||
//#define X_IS_TMC
|
||||
#define X_MAX_CURRENT 1000 //in mA
|
||||
#define X_SENSE_RESISTOR 91 //in mOhms
|
||||
#define X_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define X2_IS_TMC
|
||||
#define X2_MAX_CURRENT 1000 //in mA
|
||||
#define X2_SENSE_RESISTOR 91 //in mOhms
|
||||
#define X2_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define Y_IS_TMC
|
||||
#define Y_MAX_CURRENT 1000 //in mA
|
||||
#define Y_SENSE_RESISTOR 91 //in mOhms
|
||||
#define Y_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define Y2_IS_TMC
|
||||
#define Y2_MAX_CURRENT 1000 //in mA
|
||||
#define Y2_SENSE_RESISTOR 91 //in mOhms
|
||||
#define Y2_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define Z_IS_TMC
|
||||
#define Z_MAX_CURRENT 1000 //in mA
|
||||
#define Z_SENSE_RESISTOR 91 //in mOhms
|
||||
#define Z_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define Z2_IS_TMC
|
||||
#define Z2_MAX_CURRENT 1000 //in mA
|
||||
#define Z2_SENSE_RESISTOR 91 //in mOhms
|
||||
#define Z2_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define E0_IS_TMC
|
||||
#define E0_MAX_CURRENT 1000 //in mA
|
||||
#define E0_SENSE_RESISTOR 91 //in mOhms
|
||||
#define E0_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define E1_IS_TMC
|
||||
#define E1_MAX_CURRENT 1000 //in mA
|
||||
#define E1_SENSE_RESISTOR 91 //in mOhms
|
||||
#define E1_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define E2_IS_TMC
|
||||
#define E2_MAX_CURRENT 1000 //in mA
|
||||
#define E2_SENSE_RESISTOR 91 //in mOhms
|
||||
#define E2_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
//#define E3_IS_TMC
|
||||
#define E3_MAX_CURRENT 1000 //in mA
|
||||
#define E3_SENSE_RESISTOR 91 //in mOhms
|
||||
#define E3_MICROSTEPS 16 //number of microsteps
|
||||
|
||||
#endif
|
||||
|
||||
/******************************************************************************\
|
||||
* enable this section if you have L6470 motor drivers.
|
||||
* you need to import the L6470 library into the Arduino IDE for this
|
||||
******************************************************************************/
|
||||
|
||||
// @section l6470
|
||||
|
||||
//#define HAVE_L6470DRIVER
|
||||
#if ENABLED(HAVE_L6470DRIVER)
|
||||
|
||||
//#define X_IS_L6470
|
||||
#define X_MICROSTEPS 16 //number of microsteps
|
||||
#define X_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define X_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define X2_IS_L6470
|
||||
#define X2_MICROSTEPS 16 //number of microsteps
|
||||
#define X2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define X2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define Y_IS_L6470
|
||||
#define Y_MICROSTEPS 16 //number of microsteps
|
||||
#define Y_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define Y_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define Y2_IS_L6470
|
||||
#define Y2_MICROSTEPS 16 //number of microsteps
|
||||
#define Y2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define Y2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define Z_IS_L6470
|
||||
#define Z_MICROSTEPS 16 //number of microsteps
|
||||
#define Z_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define Z_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define Z2_IS_L6470
|
||||
#define Z2_MICROSTEPS 16 //number of microsteps
|
||||
#define Z2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define Z2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define E0_IS_L6470
|
||||
#define E0_MICROSTEPS 16 //number of microsteps
|
||||
#define E0_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define E0_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define E1_IS_L6470
|
||||
#define E1_MICROSTEPS 16 //number of microsteps
|
||||
#define E1_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define E1_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define E2_IS_L6470
|
||||
#define E2_MICROSTEPS 16 //number of microsteps
|
||||
#define E2_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define E2_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
//#define E3_IS_L6470
|
||||
#define E3_MICROSTEPS 16 //number of microsteps
|
||||
#define E3_K_VAL 50 // 0 - 255, Higher values, are higher power. Be careful not to go too high
|
||||
#define E3_OVERCURRENT 2000 //maxc current in mA. If the current goes over this value, the driver will switch off
|
||||
#define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* TWI/I2C BUS
|
||||
*
|
||||
* This feature is an EXPERIMENTAL feature so it shall not be used on production
|
||||
* machines. Enabling this will allow you to send and receive I2C data from slave
|
||||
* devices on the bus.
|
||||
*
|
||||
* ; Example #1
|
||||
* ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
|
||||
* ; It uses multiple M155 commands with one B<base 10> arg
|
||||
* M155 A99 ; Target slave address
|
||||
* M155 B77 ; M
|
||||
* M155 B97 ; a
|
||||
* M155 B114 ; r
|
||||
* M155 B108 ; l
|
||||
* M155 B105 ; i
|
||||
* M155 B110 ; n
|
||||
* M155 S1 ; Send the current buffer
|
||||
*
|
||||
* ; Example #2
|
||||
* ; Request 6 bytes from slave device with address 0x63 (99)
|
||||
* M156 A99 B5
|
||||
*
|
||||
* ; Example #3
|
||||
* ; Example serial output of a M156 request
|
||||
* echo:i2c-reply: from:99 bytes:5 data:hello
|
||||
*/
|
||||
|
||||
// @section i2cbus
|
||||
|
||||
//#define EXPERIMENTAL_I2CBUS
|
||||
|
||||
#endif // CONFIGURATION_ADV_H
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,15 @@
|
||||
# Configuration for Velleman K8400 Vertex
|
||||
http://www.k8400.eu/
|
||||
|
||||
Configuration files for the K8400, ported upstream from the official Velleman firmware.
|
||||
Like it's predecessor, (K8200), the K8400 is a 3Drag clone. There are some minor differences, documented in pins_K8400.h.
|
||||
|
||||
Single and dual head configurations provided. Copy the correct Configuration.h and Configuration_adv.h to the /Marlin/ directory.
|
||||
|
||||
**NOTE: This configuration includes the community sourced feed rate fix. Use 100% feed rate in Repetier!**
|
||||
|
||||
For implementation and updated K8400 firmware, see https://github.com/birkett/Velleman-K8400-Firmware
|
||||
|
||||
### Original Sources
|
||||
Credit to Velleman for the original 1.0.x based code:<br />
|
||||
http://www.vertex3dprinter.eu/downloads/files/vertex/firmware/vertex-m1-v1.4-h2.zip
|
@ -1,30 +0,0 @@
|
||||
The fonts are created with Fony.exe (http://hukka.ncn.fi/?fony) because Fontforge didn't do what I want (probably lack of experience).
|
||||
|
||||
In Fony export the fonts to bdf-format. (Maybe another one can edit them with Fontforge.) Then run `make_fonts.bat` which calls `bdf2u8g.exe` with the parameters needed to produce the `.h` files. The `.h` files must be edited and moved:
|
||||
- Replace `#include "u8g.h"` with `#include <utility/u8g.h>`,
|
||||
- Replace `U8G_FONT_SECTION` with `U8G_SECTION`,
|
||||
- Insert `.progmem.` right after the first quote `"`,
|
||||
- Move the file to the main directory.
|
||||
|
||||
How to integrate a new font:
|
||||
Currently we are limited to 256 symbols per font. We use a menu system with 5 lines, on a display with 64 pixel height. That means we have 12 pixels per line. So to have any space between the lines we can use no more than 10 pixel height for the symbols. For up to 11 pixels set TALL_FONT_CORRECTION 1 when loading the font.
|
||||
To fit 22 Symbols on the 128 pixel wide screen, the symbols can't be wider than 5 pixel, for the first 128 symbols.
|
||||
For the second half of the font we now support up to 11x11 pixel.
|
||||
|
||||
- Get `Fony.exe` from [hukka.ncn.fi](http://hukka.ncn.fi/?fony)
|
||||
- Copy one of the existing `*.fon` files and use the copy for your work.
|
||||
- Only change the pixels. Don't change width or height.
|
||||
- Export as a `*.bdf` file
|
||||
- Use `bdf2u8g.exe` to produce the `.h` file. Examples for the existing fonts are in `make_fonts.bat`.
|
||||
- Edit the produced `.h` file to match our needs. Find hints in the `dogm_font_data_.h` files.
|
||||
- Make a new entry in the font list in `dogm_lcd_implementation.h` before the `#else // fall-back` line:
|
||||
```cpp
|
||||
#elif ENABLED(DISPLAY_CHARSET_NEWNAME)
|
||||
#include "dogm_font_data_yourfont.h"
|
||||
#define FONT_MENU_NAME YOURFONTNAME
|
||||
#else // fall-back
|
||||
```
|
||||
- Add your font to the list of permitted fonts in 'language_en.h'
|
||||
```cpp
|
||||
... || ENABLED(DISPLAY_CHARSET_YOUR_NEW_FONT) ... )
|
||||
```
|
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue