diff --git a/.circleci/config.yml b/.circleci/config.yml index 4706bb5052..cb8c31b22b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -240,10 +240,10 @@ jobs: build_marlin_pio ./ ${TEST_PLATFORM} restore_configs echo testing STM32F1 targets... - export TEST_PLATFORM="-e STM32F1" + export TEST_PLATFORM="-e STM32F103R" restore_configs - echo use_example_configs STM32/STM32F10 - use_example_configs STM32/STM32F10 + echo use_example_configs STM32/STM32F103R + use_example_configs STM32/STM32F103R build_marlin_pio ./ ${TEST_PLATFORM} restore_configs echo use_example_configs STM32/stm32f103ret6 diff --git a/.travis.yml b/.travis.yml index 18f6e22b75..cfd6a67556 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,18 +9,46 @@ notifications: email: false env: - - TEST_PLATFORM="megaatmega2560" + # Base Environments - TEST_PLATFORM="DUE" + - TEST_PLATFORM="esp32" + - TEST_PLATFORM="linux_native" - TEST_PLATFORM="LPC1768" - TEST_PLATFORM="LPC1769" - - TEST_PLATFORM="STM32F1" + - TEST_PLATFORM="megaatmega2560" + - TEST_PLATFORM="STM32F103R" - TEST_PLATFORM="teensy31" - TEST_PLATFORM="teensy35" - - TEST_PLATFORM="linux_native" - - TEST_PLATFORM="esp32" - - TEST_PLATFORM="alfawise_U20" - - TEST_PLATFORM="black_stm32f407ve" - - TEST_PLATFORM="adafruit_grandcentral_m4" + + # Extended AVR Environments + - TEST_PLATFORM="fysetc_f6_13" + - TEST_PLATFORM="megaatmega1280" + - TEST_PLATFORM="rambo" + - TEST_PLATFORM="sanguino_atmega1284p" + - TEST_PLATFORM="sanguino_atmega644p" + + # Extended STM32 Environments + - TEST_PLATFORM="ARMED" + - TEST_PLATFORM="BIGTREE_BTT002" + - TEST_PLATFORM="BIGTREE_SKR_PRO" + - TEST_PLATFORM="STM32F103R_bigtree" + - TEST_PLATFORM="jgaurora_a5s_a1" + - TEST_PLATFORM="STM32F103V_longer" + - TEST_PLATFORM="STM32F407VE_black" + + # Non-working environment tests + #- TEST_PLATFORM="at90usb1286_cdc" + #- TEST_PLATFORM="at90usb1286_dfu" + #- TEST_PLATFORM="malyanm200" + #- TEST_PLATFORM="mks_robin" + #- TEST_PLATFORM="mks_robin_lite" + #- TEST_PLATFORM="mks_robin_mini" + #- TEST_PLATFORM="mks_robin_nano" + #- TEST_PLATFORM="SAMD51_grandcentral_m4" + #- TEST_PLATFORM="STM32F103R_bigtree" + #- TEST_PLATFORM="STM32F103R_fysetc" + #- TEST_PLATFORM="STM32F4" + #- TEST_PLATFORM="STM32F7" before_install: # diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 2fe81eeab8..b888b991b3 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -6,7 +6,7 @@ // Enable this is you have a raptor 2. // Selects pin file, runout sensor and stock TMC Drivers automatically -#define RAPTOR2 +//#define RAPTOR2 /** * Enable if you replace the stepper drivers with TMC 2208. Be sure to remove MS3 jumper @@ -15,14 +15,14 @@ * you require Linear Advance with a TMC2208 on the extruder! * If you have used a UART connection to program the driver to SpreadCycle mode, pease seect that as well */ -//#define X_2208 +#define X_2208 //#define X_SpreadCycle -//#define Y_2208 -//#define Y_SpreadCycle // Highly recommended as large prints with high mass can cause layer shifts with stealthchop at high speed +#define Y_2208 +#define Y_SpreadCycle // Highly recommended as large prints with high mass can cause layer shifts with stealthchop at high speed //#define Y_4988 // Some machines shipped with 4988 drivers across the board. Set this if you arent sure what you have and all the drivers look identical //#define Z_2208 // NOT Recommended! Dual stepper current draw is above the recommended limit for this driver //#define Z_SpreadCycle -//#define Z_4988 // Some machines shipped with 4988 drivers across the board. Set this if you arent sure what you have and all the drivers look identical +#define Z_4988 // Some machines shipped with 4988 drivers across the board. Set this if you arent sure what you have and all the drivers look identical //#define E_2208 // Not Recommended! Stealthchop mode faults with linear advance //#define E_SpreadCycle @@ -130,13 +130,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "Tinymachines3D" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -149,10 +144,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -189,8 +187,7 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #if ENABLED(RAPTOR2) #define MOTHERBOARD BOARD_FORMBOT_RAPTOR2 @@ -866,15 +863,15 @@ #define x_accel 1500 #endif - #if(ENABLED(Y_2208)) +#if(ENABLED(Y_2208)) #if(ENABLED(Y_SpreadCycle)) - #define y_accel 500 + #define y_accel 2000 #else - #define y_accel 300 + #define y_accel 1500 #endif - #else - #define y_accel 500 - #endif +#else + #define y_accel 1500 +#endif #define DEFAULT_MAX_ACCELERATION { x_accel, y_accel, 400, 4000 } /** @@ -885,9 +882,9 @@ * M204 R Retract Acceleration * M204 T Travel Acceleration */ -#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration for printing moves -#define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts -#define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves +#define DEFAULT_ACCELERATION 1500 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 1500 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1500 // X, Y, Z acceleration for travel (non printing) moves /** * Junction Deviation @@ -936,7 +933,7 @@ * * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained */ -//#define S_CURVE_ACCELERATION +#define S_CURVE_ACCELERATION //=========================================================================== //============================= Z Probe Options ============================= @@ -1041,11 +1038,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1057,10 +1053,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -22 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.5 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -22, 0, -1.5 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 5 @@ -1094,7 +1090,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1385,12 +1381,6 @@ #define GRID_MAX_POINTS_X 11 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - #define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE + 5 - #define RIGHT_PROBE_BED_POSITION ( X_BED_SIZE + X_PROBE_OFFSET_FROM_EXTRUDER - MIN_PROBE_EDGE -5) - #define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE + 5 - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1444,19 +1434,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - #define PROBE_PT_1_X 50 // Probing points for 3-Point leveling of the mesh - #define PROBE_PT_1_Y 350 - #define PROBE_PT_2_X 50 - #define PROBE_PT_2_Y 50 - #define PROBE_PT_3_X 350 - #define PROBE_PT_3_Y 50 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1483,7 +1460,7 @@ * Commands to execute at the end of G29 probing. * Useful to retract or move the Z probe out of the way. */ -//#define Z_PROBE_END_SCRIPT "M280 P0 S90" +//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // @section homing @@ -2235,7 +2212,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2248,6 +2225,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2258,11 +2238,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2390,7 +2367,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 6ccafe1db9..9945fa32bd 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' #define M114_DETAIL // Show Temperature ADC value @@ -592,7 +592,7 @@ * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. */ - //#define BLTOUCH_HS_MODE + #define BLTOUCH_HS_MODE // Safety: Enable voltage mode settings in the LCD menu. //#define BLTOUCH_LCD_VOLTAGE_MENU @@ -606,8 +606,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -624,7 +624,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -651,19 +651,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -743,8 +730,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -841,6 +828,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1213,9 +1209,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1299,6 +1343,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1359,7 +1439,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1371,7 +1451,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1506,19 +1587,19 @@ */ #define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1601,7 +1682,7 @@ #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. #define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. - //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change + #define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change #define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. #define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) @@ -1724,78 +1805,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1934,10 +2028,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1961,6 +2057,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2451,10 +2548,6 @@ #define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2535,6 +2628,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/Marlin/src/HAL/HAL_AVR/HAL.cpp b/Marlin/src/HAL/HAL_AVR/HAL.cpp index 47cf969959..4a10f73dcf 100644 --- a/Marlin/src/HAL/HAL_AVR/HAL.cpp +++ b/Marlin/src/HAL/HAL_AVR/HAL.cpp @@ -35,7 +35,7 @@ // Public functions // ------------------------ -void HAL_init(void) { +void HAL_init() { // Init Servo Pins #define INIT_SERVO(N) OUT_WRITE(SERVO##N##_PIN, LOW) #if HAS_SERVO_0 diff --git a/Marlin/src/HAL/HAL_AVR/HAL.h b/Marlin/src/HAL/HAL_AVR/HAL.h index 807f21bb6b..9c34dc1f54 100644 --- a/Marlin/src/HAL/HAL_AVR/HAL.h +++ b/Marlin/src/HAL/HAL_AVR/HAL.h @@ -20,9 +20,9 @@ #include "../shared/Marduino.h" #include "../shared/HAL_SPI.h" -#include "fastio_AVR.h" -#include "watchdog_AVR.h" -#include "math_AVR.h" +#include "fastio.h" +#include "watchdog.h" +#include "math.h" #ifdef USBCON #include "HardwareSerial.h" @@ -105,19 +105,19 @@ typedef int8_t pin_t; // Public functions // ------------------------ -void HAL_init(void); +void HAL_init(); -//void cli(void); +//void cli(); //void _delay_ms(const int delay); -inline void HAL_clear_reset_source(void) { MCUSR = 0; } -inline uint8_t HAL_get_reset_source(void) { return MCUSR; } +inline void HAL_clear_reset_source() { MCUSR = 0; } +inline uint8_t HAL_get_reset_source() { return MCUSR; } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" extern "C" { - int freeMemory(void); + int freeMemory(); } #pragma GCC diagnostic pop @@ -199,9 +199,9 @@ FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t freque /* 18 cycles maximum latency */ #define HAL_STEP_TIMER_ISR() \ -extern "C" void TIMER1_COMPA_vect (void) __attribute__ ((signal, naked, used, externally_visible)); \ -extern "C" void TIMER1_COMPA_vect_bottom (void) asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \ -void TIMER1_COMPA_vect (void) { \ +extern "C" void TIMER1_COMPA_vect() __attribute__ ((signal, naked, used, externally_visible)); \ +extern "C" void TIMER1_COMPA_vect_bottom() asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \ +void TIMER1_COMPA_vect() { \ __asm__ __volatile__ ( \ A("push r16") /* 2 Save R16 */ \ A("in r16, __SREG__") /* 1 Get SREG */ \ @@ -268,13 +268,13 @@ void TIMER1_COMPA_vect (void) { \ : \ ); \ } \ -void TIMER1_COMPA_vect_bottom(void) +void TIMER1_COMPA_vect_bottom() /* 14 cycles maximum latency */ #define HAL_TEMP_TIMER_ISR() \ -extern "C" void TIMER0_COMPB_vect (void) __attribute__ ((signal, naked, used, externally_visible)); \ -extern "C" void TIMER0_COMPB_vect_bottom(void) asm ("TIMER0_COMPB_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \ -void TIMER0_COMPB_vect (void) { \ +extern "C" void TIMER0_COMPB_vect() __attribute__ ((signal, naked, used, externally_visible)); \ +extern "C" void TIMER0_COMPB_vect_bottom() asm ("TIMER0_COMPB_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \ +void TIMER0_COMPB_vect() { \ __asm__ __volatile__ ( \ A("push r16") /* 2 Save R16 */ \ A("in r16, __SREG__") /* 1 Get SREG */ \ @@ -334,7 +334,7 @@ void TIMER0_COMPB_vect (void) { \ : \ ); \ } \ -void TIMER0_COMPB_vect_bottom(void) +void TIMER0_COMPB_vect_bottom() // ADC #ifdef DIDR2 @@ -343,7 +343,7 @@ void TIMER0_COMPB_vect_bottom(void) #define HAL_ANALOG_SELECT(pin) do{ SBI(DIDR0, pin); }while(0) #endif -inline void HAL_adc_init(void) { +inline void HAL_adc_init() { ADCSRA = _BV(ADEN) | _BV(ADSC) | _BV(ADIF) | 0x07; DIDR0 = 0; #ifdef DIDR2 diff --git a/Marlin/src/HAL/HAL_AVR/HAL_spi_AVR.cpp b/Marlin/src/HAL/HAL_AVR/HAL_SPI.cpp similarity index 99% rename from Marlin/src/HAL/HAL_AVR/HAL_spi_AVR.cpp rename to Marlin/src/HAL/HAL_AVR/HAL_SPI.cpp index 1379207bf0..68e21aae53 100644 --- a/Marlin/src/HAL/HAL_AVR/HAL_spi_AVR.cpp +++ b/Marlin/src/HAL/HAL_AVR/HAL_SPI.cpp @@ -33,7 +33,7 @@ #include "../../inc/MarlinConfig.h" -void spiBegin(void) { +void spiBegin() { OUT_WRITE(SS_PIN, HIGH); SET_OUTPUT(SCK_PIN); SET_INPUT(MISO_PIN); @@ -81,7 +81,7 @@ void spiBegin(void) { } /** SPI receive a byte */ - uint8_t spiRec(void) { + uint8_t spiRec() { SPDR = 0xFF; while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } return SPDR; diff --git a/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp b/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp index 57c1ed9550..3502aa6b0c 100644 --- a/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp +++ b/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp @@ -271,7 +271,7 @@ // (called with TX irqs disabled) template - FORCE_INLINE void MarlinSerial::_tx_udr_empty_irq(void) { + FORCE_INLINE void MarlinSerial::_tx_udr_empty_irq() { if (Cfg::TX_SIZE > 0) { // Read positions uint8_t t = tx_buffer.tail; @@ -363,13 +363,13 @@ } template - int MarlinSerial::peek(void) { + int MarlinSerial::peek() { const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail; return h == t ? -1 : rx_buffer.buffer[t]; } template - int MarlinSerial::read(void) { + int MarlinSerial::read() { const ring_buffer_pos_t h = atomic_read_rx_head(); // Read the tail. Main thread owns it, so it is safe to directly read it @@ -412,13 +412,13 @@ } template - typename MarlinSerial::ring_buffer_pos_t MarlinSerial::available(void) { + typename MarlinSerial::ring_buffer_pos_t MarlinSerial::available() { const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail; return (ring_buffer_pos_t)(Cfg::RX_SIZE + h - t) & (Cfg::RX_SIZE - 1); } template - void MarlinSerial::flush(void) { + void MarlinSerial::flush() { // Set the tail to the head: // - Read the RX head index in a safe way. (See atomic_read_rx_head.) @@ -505,7 +505,7 @@ } template - void MarlinSerial::flushTX(void) { + void MarlinSerial::flushTX() { if (Cfg::TX_SIZE == 0) { // No bytes written, no need to flush. This special case is needed since there's @@ -595,7 +595,7 @@ } template - void MarlinSerial::println(void) { + void MarlinSerial::println() { print('\r'); print('\n'); } diff --git a/Marlin/src/HAL/HAL_AVR/MarlinSerial.h b/Marlin/src/HAL/HAL_AVR/MarlinSerial.h index f3e2086b2c..7560d880e3 100644 --- a/Marlin/src/HAL/HAL_AVR/MarlinSerial.h +++ b/Marlin/src/HAL/HAL_AVR/MarlinSerial.h @@ -205,18 +205,18 @@ public: FORCE_INLINE static void store_rxd_char(); - FORCE_INLINE static void _tx_udr_empty_irq(void); + FORCE_INLINE static void _tx_udr_empty_irq(); public: MarlinSerial() {}; static void begin(const long); static void end(); - static int peek(void); - static int read(void); - static void flush(void); - static ring_buffer_pos_t available(void); + static int peek(); + static int read(); + static void flush(); + static ring_buffer_pos_t available(); static void write(const uint8_t c); - static void flushTX(void); + static void flushTX(); FORCE_INLINE static uint8_t dropped() { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; } FORCE_INLINE static uint8_t buffer_overruns() { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; } @@ -245,7 +245,7 @@ static void println(long, int = DEC); static void println(unsigned long, int = DEC); static void println(double, int = 2); - static void println(void); + static void println(); operator bool() { return true; } private: diff --git a/Marlin/src/HAL/HAL_AVR/servo_AVR.cpp b/Marlin/src/HAL/HAL_AVR/Servo.cpp similarity index 99% rename from Marlin/src/HAL/HAL_AVR/servo_AVR.cpp rename to Marlin/src/HAL/HAL_AVR/Servo.cpp index 58e220cbaf..33818edb96 100644 --- a/Marlin/src/HAL/HAL_AVR/servo_AVR.cpp +++ b/Marlin/src/HAL/HAL_AVR/Servo.cpp @@ -131,7 +131,7 @@ void initISR(timer16_Sequence_t timer) { TCCR1A = 0; // normal counting mode TCCR1B = _BV(CS11); // set prescaler of 8 TCNT1 = 0; // clear the timer count - #if defined(__AVR_ATmega8__)|| defined(__AVR_ATmega128__) + #if defined(__AVR_ATmega8__) || defined(__AVR_ATmega128__) SBI(TIFR, OCF1A); // clear any pending interrupts; SBI(TIMSK, OCIE1A); // enable the output compare interrupt #else diff --git a/Marlin/src/HAL/HAL_AVR/endstop_interrupts.h b/Marlin/src/HAL/HAL_AVR/endstop_interrupts.h index c313f95ced..b80fee610d 100644 --- a/Marlin/src/HAL/HAL_AVR/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_AVR/endstop_interrupts.h @@ -41,7 +41,7 @@ #include // One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } +void endstop_ISR() { endstops.update(); } /** * Patch for pins_arduino.h (...\Arduino\hardware\arduino\avr\variants\mega\pins_arduino.h) @@ -102,153 +102,124 @@ void pciSetup(const int8_t pin) { ISR(PCINT3_vect, ISR_ALIASOF(PCINT0_vect)); #endif -void setup_endstop_interrupts( void ) { - +void setup_endstop_interrupts() { + #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) #if HAS_X_MAX - #if (digitalPinToInterrupt(X_MAX_PIN) != NOT_AN_INTERRUPT) // if pin has an external interrupt - attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); // assign it + #if (digitalPinToInterrupt(X_MAX_PIN) != NOT_AN_INTERRUPT) + _ATTACH(X_MAX_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! - static_assert(digitalPinToPCICR(X_MAX_PIN), "X_MAX_PIN is not interrupt-capable"); // if pin has no pin change interrupt - error - pciSetup(X_MAX_PIN); // assign it + static_assert(digitalPinToPCICR(X_MAX_PIN), "X_MAX_PIN is not interrupt-capable"); + pciSetup(X_MAX_PIN); #endif #endif - #if HAS_X_MIN #if (digitalPinToInterrupt(X_MIN_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(X_MIN_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! static_assert(digitalPinToPCICR(X_MIN_PIN), "X_MIN_PIN is not interrupt-capable"); pciSetup(X_MIN_PIN); #endif #endif - #if HAS_Y_MAX #if (digitalPinToInterrupt(Y_MAX_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MAX_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! static_assert(digitalPinToPCICR(Y_MAX_PIN), "Y_MAX_PIN is not interrupt-capable"); pciSetup(Y_MAX_PIN); #endif #endif - #if HAS_Y_MIN #if (digitalPinToInterrupt(Y_MIN_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MIN_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! static_assert(digitalPinToPCICR(Y_MIN_PIN), "Y_MIN_PIN is not interrupt-capable"); pciSetup(Y_MIN_PIN); #endif #endif - #if HAS_Z_MAX #if (digitalPinToInterrupt(Z_MAX_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MAX_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! static_assert(digitalPinToPCICR(Z_MAX_PIN), "Z_MAX_PIN is not interrupt-capable"); pciSetup(Z_MAX_PIN); #endif #endif - #if HAS_Z_MIN #if (digitalPinToInterrupt(Z_MIN_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! static_assert(digitalPinToPCICR(Z_MIN_PIN), "Z_MIN_PIN is not interrupt-capable"); pciSetup(Z_MIN_PIN); #endif #endif - #if HAS_X2_MAX #if (digitalPinToInterrupt(X2_MAX_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(X2_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(X2_MAX_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! static_assert(digitalPinToPCICR(X2_MAX_PIN), "X2_MAX_PIN is not interrupt-capable"); pciSetup(X2_MAX_PIN); #endif #endif - #if HAS_X2_MIN #if (digitalPinToInterrupt(X2_MIN_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(X2_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(X2_MIN_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! static_assert(digitalPinToPCICR(X2_MIN_PIN), "X2_MIN_PIN is not interrupt-capable"); pciSetup(X2_MIN_PIN); #endif #endif - #if HAS_Y2_MAX #if (digitalPinToInterrupt(Y2_MAX_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Y2_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Y2_MAX_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! static_assert(digitalPinToPCICR(Y2_MAX_PIN), "Y2_MAX_PIN is not interrupt-capable"); pciSetup(Y2_MAX_PIN); #endif #endif - #if HAS_Y2_MIN #if (digitalPinToInterrupt(Y2_MIN_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Y2_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Y2_MIN_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! static_assert(digitalPinToPCICR(Y2_MIN_PIN), "Y2_MIN_PIN is not interrupt-capable"); pciSetup(Y2_MIN_PIN); #endif #endif - #if HAS_Z2_MAX #if (digitalPinToInterrupt(Z2_MAX_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MAX_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! static_assert(digitalPinToPCICR(Z2_MAX_PIN), "Z2_MAX_PIN is not interrupt-capable"); pciSetup(Z2_MAX_PIN); #endif #endif - #if HAS_Z2_MIN #if (digitalPinToInterrupt(Z2_MIN_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MIN_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! static_assert(digitalPinToPCICR(Z2_MIN_PIN), "Z2_MIN_PIN is not interrupt-capable"); pciSetup(Z2_MIN_PIN); #endif #endif - #if HAS_Z3_MAX #if (digitalPinToInterrupt(Z3_MAX_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MAX_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! static_assert(digitalPinToPCICR(Z3_MAX_PIN), "Z3_MAX_PIN is not interrupt-capable"); pciSetup(Z3_MAX_PIN); #endif #endif - #if HAS_Z3_MIN #if (digitalPinToInterrupt(Z3_MIN_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MIN_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! static_assert(digitalPinToPCICR(Z3_MIN_PIN), "Z3_MIN_PIN is not interrupt-capable"); pciSetup(Z3_MIN_PIN); #endif #endif - #if HAS_Z_MIN_PROBE_PIN #if (digitalPinToInterrupt(Z_MIN_PROBE_PIN) != NOT_AN_INTERRUPT) - attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PROBE_PIN); #else - // Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration! static_assert(digitalPinToPCICR(Z_MIN_PROBE_PIN), "Z_MIN_PROBE_PIN is not interrupt-capable"); pciSetup(Z_MIN_PROBE_PIN); #endif diff --git a/Marlin/src/HAL/HAL_AVR/fast_pwm.cpp b/Marlin/src/HAL/HAL_AVR/fast_pwm.cpp index 7923968fd2..282b70de71 100644 --- a/Marlin/src/HAL/HAL_AVR/fast_pwm.cpp +++ b/Marlin/src/HAL/HAL_AVR/fast_pwm.cpp @@ -59,19 +59,19 @@ Timer get_pwm_timer(const pin_t pin) { #ifdef TCCR2 case TIMER2: { Timer timer = { - /*TCCRnQ*/ { &TCCR2, nullptr, nullptr}, - /*OCRnQ*/ { (uint16_t*)&OCR2, nullptr, nullptr}, + /*TCCRnQ*/ { &TCCR2, nullptr, nullptr }, + /*OCRnQ*/ { (uint16_t*)&OCR2, nullptr, nullptr }, /*ICRn*/ nullptr, /*n, q*/ 2, 0 }; } - #elif defined TCCR2A + #elif defined(TCCR2A) #if ENABLED(USE_OCR2A_AS_TOP) case TIMER2A: break; // protect TIMER2A case TIMER2B: { Timer timer = { - /*TCCRnQ*/ { &TCCR2A, &TCCR2B, nullptr}, - /*OCRnQ*/ { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr}, + /*TCCRnQ*/ { &TCCR2A, &TCCR2B, nullptr }, + /*OCRnQ*/ { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr }, /*ICRn*/ nullptr, /*n, q*/ 2, 1 }; @@ -81,8 +81,8 @@ Timer get_pwm_timer(const pin_t pin) { case TIMER2B: ++q; case TIMER2A: { Timer timer = { - /*TCCRnQ*/ { &TCCR2A, &TCCR2B, nullptr}, - /*OCRnQ*/ { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr}, + /*TCCRnQ*/ { &TCCR2A, &TCCR2B, nullptr }, + /*OCRnQ*/ { (uint16_t*)&OCR2A, (uint16_t*)&OCR2B, nullptr }, /*ICRn*/ nullptr, 2, q }; @@ -91,13 +91,24 @@ Timer get_pwm_timer(const pin_t pin) { #endif #endif #endif - #ifdef TCCR3A + #ifdef OCR3C case TIMER3C: ++q; case TIMER3B: ++q; case TIMER3A: { Timer timer = { - /*TCCRnQ*/ { &TCCR3A, &TCCR3B, &TCCR3C}, - /*OCRnQ*/ { &OCR3A, &OCR3B, &OCR3C}, + /*TCCRnQ*/ { &TCCR3A, &TCCR3B, &TCCR3C }, + /*OCRnQ*/ { &OCR3A, &OCR3B, &OCR3C }, + /*ICRn*/ &ICR3, + /*n, q*/ 3, q + }; + return timer; + } + #elif defined(OCR3B) + case TIMER3B: ++q; + case TIMER3A: { + Timer timer = { + /*TCCRnQ*/ { &TCCR3A, &TCCR3B, nullptr }, + /*OCRnQ*/ { &OCR3A, &OCR3B, nullptr }, /*ICRn*/ &ICR3, /*n, q*/ 3, q }; @@ -109,8 +120,8 @@ Timer get_pwm_timer(const pin_t pin) { case TIMER4B: ++q; case TIMER4A: { Timer timer = { - /*TCCRnQ*/ { &TCCR4A, &TCCR4B, &TCCR4C}, - /*OCRnQ*/ { &OCR4A, &OCR4B, &OCR4C}, + /*TCCRnQ*/ { &TCCR4A, &TCCR4B, &TCCR4C }, + /*OCRnQ*/ { &OCR4A, &OCR4B, &OCR4C }, /*ICRn*/ &ICR4, /*n, q*/ 4, q }; @@ -122,7 +133,7 @@ Timer get_pwm_timer(const pin_t pin) { case TIMER5B: ++q; case TIMER5A: { Timer timer = { - /*TCCRnQ*/ { &TCCR5A, &TCCR5B, &TCCR5C}, + /*TCCRnQ*/ { &TCCR5A, &TCCR5B, &TCCR5C }, /*OCRnQ*/ { &OCR5A, &OCR5B, &OCR5C }, /*ICRn*/ &ICR5, /*n, q*/ 5, q @@ -132,8 +143,8 @@ Timer get_pwm_timer(const pin_t pin) { #endif } Timer timer = { - /*TCCRnQ*/ { nullptr, nullptr, nullptr}, - /*OCRnQ*/ { nullptr, nullptr, nullptr}, + /*TCCRnQ*/ { nullptr, nullptr, nullptr }, + /*OCRnQ*/ { nullptr, nullptr, nullptr }, /*ICRn*/ nullptr, 0, 0 }; diff --git a/Marlin/src/HAL/HAL_AVR/fastio_AVR.cpp b/Marlin/src/HAL/HAL_AVR/fastio.cpp similarity index 99% rename from Marlin/src/HAL/HAL_AVR/fastio_AVR.cpp rename to Marlin/src/HAL/HAL_AVR/fastio.cpp index 8f79555f69..f0f7688f1b 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio_AVR.cpp +++ b/Marlin/src/HAL/HAL_AVR/fastio.cpp @@ -26,7 +26,7 @@ #ifdef __AVR__ -#include "fastio_AVR.h" +#include "fastio.h" #ifdef FASTIO_EXT_START diff --git a/Marlin/src/HAL/HAL_AVR/fastio_AVR.h b/Marlin/src/HAL/HAL_AVR/fastio.h similarity index 100% rename from Marlin/src/HAL/HAL_AVR/fastio_AVR.h rename to Marlin/src/HAL/HAL_AVR/fastio.h diff --git a/Marlin/src/HAL/HAL_AVR/fastio/fastio_1280.h b/Marlin/src/HAL/HAL_AVR/fastio/fastio_1280.h index ac2b650119..62de534d53 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio/fastio_1280.h +++ b/Marlin/src/HAL/HAL_AVR/fastio/fastio_1280.h @@ -29,7 +29,7 @@ * Logical Pin : 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | 78 79 80 xx xx 84 85 71 70 xx xx xx xx xx 81 82 83 xx xx 72 72 75 76 77 74 xx xx xx xx xx */ -#include "../fastio_AVR.h" +#include "../fastio.h" // change for your board #define DEBUG_LED DIO21 diff --git a/Marlin/src/HAL/HAL_AVR/fastio/fastio_1281.h b/Marlin/src/HAL/HAL_AVR/fastio/fastio_1281.h index e3501f4849..e3d2f12851 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio/fastio_1281.h +++ b/Marlin/src/HAL/HAL_AVR/fastio/fastio_1281.h @@ -28,7 +28,7 @@ * Port: A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7 G0 G1 G2 G3 G4 G5 */ -#include "../fastio_AVR.h" +#include "../fastio.h" // change for your board #define DEBUG_LED DIO46 diff --git a/Marlin/src/HAL/HAL_AVR/fastio/fastio_168.h b/Marlin/src/HAL/HAL_AVR/fastio/fastio_168.h index 32db8cae0c..f6ee7a5d00 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio/fastio_168.h +++ b/Marlin/src/HAL/HAL_AVR/fastio/fastio_168.h @@ -28,7 +28,7 @@ * Port: B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 */ -#include "../fastio_AVR.h" +#include "../fastio.h" #define DEBUG_LED AIO5 diff --git a/Marlin/src/HAL/HAL_AVR/fastio/fastio_644.h b/Marlin/src/HAL/HAL_AVR/fastio/fastio_644.h index 582c76f7e4..180a3c4e32 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio/fastio_644.h +++ b/Marlin/src/HAL/HAL_AVR/fastio/fastio_644.h @@ -54,7 +54,7 @@ * +--------+ */ -#include "../fastio_AVR.h" +#include "../fastio.h" #define DEBUG_LED DIO0 diff --git a/Marlin/src/HAL/HAL_AVR/fastio/fastio_AT90USB.h b/Marlin/src/HAL/HAL_AVR/fastio/fastio_AT90USB.h index bd37f05990..3f17a2e261 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio/fastio_AT90USB.h +++ b/Marlin/src/HAL/HAL_AVR/fastio/fastio_AT90USB.h @@ -29,7 +29,7 @@ * The logical pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3 */ -#include "../fastio_AVR.h" +#include "../fastio.h" // change for your board #define DEBUG_LED DIO31 /* led D5 red */ diff --git a/Marlin/src/HAL/HAL_AVR/math_AVR.h b/Marlin/src/HAL/HAL_AVR/math.h similarity index 100% rename from Marlin/src/HAL/HAL_AVR/math_AVR.h rename to Marlin/src/HAL/HAL_AVR/math.h diff --git a/Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp b/Marlin/src/HAL/HAL_AVR/watchdog.cpp similarity index 99% rename from Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp rename to Marlin/src/HAL/HAL_AVR/watchdog.cpp index 3ea44e7dce..63a5031966 100644 --- a/Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp +++ b/Marlin/src/HAL/HAL_AVR/watchdog.cpp @@ -26,7 +26,7 @@ #if ENABLED(USE_WATCHDOG) -#include "watchdog_AVR.h" +#include "watchdog.h" #include "../../Marlin.h" diff --git a/Marlin/src/HAL/HAL_AVR/watchdog_AVR.h b/Marlin/src/HAL/HAL_AVR/watchdog.h similarity index 100% rename from Marlin/src/HAL/HAL_AVR/watchdog_AVR.h rename to Marlin/src/HAL/HAL_AVR/watchdog.h diff --git a/Marlin/src/HAL/HAL_DUE/DebugMonitor_Due.cpp b/Marlin/src/HAL/HAL_DUE/DebugMonitor.cpp similarity index 95% rename from Marlin/src/HAL/HAL_DUE/DebugMonitor_Due.cpp rename to Marlin/src/HAL/HAL_DUE/DebugMonitor.cpp index 3b68faac15..20f10ce405 100644 --- a/Marlin/src/HAL/HAL_DUE/DebugMonitor_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/DebugMonitor.cpp @@ -42,7 +42,7 @@ #define sw_barrier() __asm__ volatile("": : :"memory"); // (re)initialize UART0 as a monitor output to 250000,n,8,1 -static void TXBegin(void) { +static void TXBegin() { // Disable UART interrupt in NVIC NVIC_DisableIRQ( UART_IRQn ); @@ -235,7 +235,7 @@ void HardFault_HandlerC(unsigned long *sp, unsigned long lr, unsigned long cause for (;;) WDT_Restart(WDT); } -__attribute__((naked)) void NMI_Handler(void) { +__attribute__((naked)) void NMI_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -248,7 +248,7 @@ __attribute__((naked)) void NMI_Handler(void) { ); } -__attribute__((naked)) void HardFault_Handler(void) { +__attribute__((naked)) void HardFault_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -261,7 +261,7 @@ __attribute__((naked)) void HardFault_Handler(void) { ); } -__attribute__((naked)) void MemManage_Handler(void) { +__attribute__((naked)) void MemManage_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -274,7 +274,7 @@ __attribute__((naked)) void MemManage_Handler(void) { ); } -__attribute__((naked)) void BusFault_Handler(void) { +__attribute__((naked)) void BusFault_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -287,7 +287,7 @@ __attribute__((naked)) void BusFault_Handler(void) { ); } -__attribute__((naked)) void UsageFault_Handler(void) { +__attribute__((naked)) void UsageFault_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -300,7 +300,7 @@ __attribute__((naked)) void UsageFault_Handler(void) { ); } -__attribute__((naked)) void DebugMon_Handler(void) { +__attribute__((naked)) void DebugMon_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -314,7 +314,7 @@ __attribute__((naked)) void DebugMon_Handler(void) { } /* This is NOT an exception, it is an interrupt handler - Nevertheless, the framing is the same */ -__attribute__((naked)) void WDT_Handler(void) { +__attribute__((naked)) void WDT_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -327,7 +327,7 @@ __attribute__((naked)) void WDT_Handler(void) { ); } -__attribute__((naked)) void RSTC_Handler(void) { +__attribute__((naked)) void RSTC_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") diff --git a/Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp b/Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp similarity index 99% rename from Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp rename to Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp index 231e4cc048..c7b7007053 100644 --- a/Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp @@ -922,8 +922,7 @@ static void ee_Init() { if (!ee_IsPageClean(grp * PagesPerGroup + page)) { #ifdef EE_EMU_DEBUG SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("EEPROM Page ",page); - SERIAL_ECHOLNPAIR(" not clean on group ",grp); + SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on group ", grp); SERIAL_FLUSH(); #endif ee_PageErase(grp * PagesPerGroup + page); @@ -944,7 +943,7 @@ static void ee_Init() { #ifdef EE_EMU_DEBUG SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("EEPROM Active page: ",curPage); + SERIAL_ECHOLNPAIR("EEPROM Active page: ", curPage); SERIAL_FLUSH(); #endif @@ -953,8 +952,7 @@ static void ee_Init() { if (!ee_IsPageClean(curGroup * PagesPerGroup + page)) { #ifdef EE_EMU_DEBUG SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("EEPROM Page ",page); - SERIAL_ECHOLNPAIR(" not clean on active group ",curGroup); + SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on active group ", curGroup); SERIAL_FLUSH(); ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page)); #endif @@ -993,7 +991,7 @@ void eeprom_read_block(void* __dst, const void* __src, size_t __n) { } } -void eeprom_flush(void) { +void eeprom_flush() { ee_Flush(); } diff --git a/Marlin/src/HAL/HAL_DUE/HAL.cpp b/Marlin/src/HAL/HAL_DUE/HAL.cpp index c98dbbc07c..735ccc6317 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL.cpp +++ b/Marlin/src/HAL/HAL_DUE/HAL.cpp @@ -42,7 +42,7 @@ uint16_t HAL_adc_result; // ------------------------ // HAL initialization task -void HAL_init(void) { +void HAL_init() { // Initialize the USB stack #if ENABLED(SDSUPPORT) OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up @@ -51,20 +51,20 @@ void HAL_init(void) { } // HAL idle task -void HAL_idletask(void) { +void HAL_idletask() { // Perform USB stack housekeeping usb_task_idle(); } // Disable interrupts -void cli(void) { noInterrupts(); } +void cli() { noInterrupts(); } // Enable interrupts -void sei(void) { interrupts(); } +void sei() { interrupts(); } -void HAL_clear_reset_source(void) { } +void HAL_clear_reset_source() { } -uint8_t HAL_get_reset_source(void) { +uint8_t HAL_get_reset_source() { switch ((RSTC->RSTC_SR >> 8) & 0x07) { case 0: return RST_POWER_ON; case 1: return RST_BACKUP; @@ -98,7 +98,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRead(adc_pin); } -uint16_t HAL_adc_get_result(void) { +uint16_t HAL_adc_get_result() { // nop return HAL_adc_result; } diff --git a/Marlin/src/HAL/HAL_DUE/HAL.h b/Marlin/src/HAL/HAL_DUE/HAL.h index 7f45a964b6..2be95b683a 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL.h +++ b/Marlin/src/HAL/HAL_DUE/HAL.h @@ -32,9 +32,9 @@ #include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" -#include "fastio_Due.h" -#include "watchdog_Due.h" -#include "HAL_timers_Due.h" +#include "fastio.h" +#include "watchdog.h" +#include "timers.h" #include @@ -58,8 +58,8 @@ #define NUM_SERIAL 1 #endif -#include "MarlinSerial_Due.h" -#include "MarlinSerialUSB_Due.h" +#include "MarlinSerial.h" +#include "MarlinSerialUSB.h" // On AVR this is in math.h? #define square(x) ((x)*(x)) @@ -88,22 +88,11 @@ typedef int8_t pin_t; #define ENABLE_ISRS() __enable_irq() #define DISABLE_ISRS() __disable_irq() -void cli(void); // Disable interrupts -void sei(void); // Enable interrupts +void cli(); // Disable interrupts +void sei(); // Enable interrupts -void HAL_clear_reset_source(void); // clear reset reason -uint8_t HAL_get_reset_source(void); // get reset reason - -// -// SPI: Extended functions taking a channel number (Hardware SPI only) -// - -// Write single byte to specified SPI channel -void spiSend(uint32_t chan, byte b); -// Write buffer to specified SPI channel -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); -// Read single byte from specified SPI channel -uint8_t spiRec(uint32_t chan); +void HAL_clear_reset_source(); // clear reset reason +uint8_t HAL_get_reset_source(); // get reset reason // // EEPROM @@ -124,14 +113,14 @@ extern uint16_t HAL_adc_result; // result of last ADC conversion #define HAL_ANALOG_SELECT(pin) -inline void HAL_adc_init(void) {}//todo +inline void HAL_adc_init() {}//todo #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) #define HAL_READ_ADC() HAL_adc_result #define HAL_ADC_READY() true void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(void); +uint16_t HAL_adc_get_result(); // // Pin Map @@ -149,8 +138,8 @@ void noTone(const pin_t _pin); // Enable hooks into idle and setup for HAL #define HAL_IDLETASK 1 -void HAL_idletask(void); -void HAL_init(void); +void HAL_idletask(); +void HAL_init(); // // Utility functions @@ -159,7 +148,7 @@ void _delay_ms(const int delay); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" -int freeMemory(void); +int freeMemory(); #pragma GCC diagnostic pop #ifdef __cplusplus diff --git a/Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp b/Marlin/src/HAL/HAL_DUE/HAL_SPI.cpp similarity index 99% rename from Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp rename to Marlin/src/HAL/HAL_DUE/HAL_SPI.cpp index 94f90670c0..f942ff8082 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/HAL_SPI.cpp @@ -428,7 +428,7 @@ static void spiTxBlockX(const uint8_t* buf, uint32_t todo) { do { - (void) spiTransferTx(*buf++); + (void)spiTransferTx(*buf++); } while (--todo); } diff --git a/Marlin/src/HAL/HAL_DUE/InterruptVectors_Due.cpp b/Marlin/src/HAL/HAL_DUE/InterruptVectors.cpp similarity index 97% rename from Marlin/src/HAL/HAL_DUE/InterruptVectors_Due.cpp rename to Marlin/src/HAL/HAL_DUE/InterruptVectors.cpp index c92736f69e..b9f14823f6 100644 --- a/Marlin/src/HAL/HAL_DUE/InterruptVectors_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/InterruptVectors.cpp @@ -34,7 +34,7 @@ #include "../../inc/MarlinConfig.h" #include "HAL.h" -#include "InterruptVectors_Due.h" +#include "InterruptVectors.h" /* The relocated Exception/Interrupt Table - According to the ARM reference manual, alignment to 128 bytes should suffice, but in @@ -48,7 +48,7 @@ static DeviceVectors ram_tab = { nullptr }; * If it is not, then it copies the ROM table to the SRAM and relocates the table * by reprogramming the NVIC registers */ -static pfnISR_Handler* get_relocated_table_addr(void) { +static pfnISR_Handler* get_relocated_table_addr() { // Get the address of the interrupt/exception table uint32_t isrtab = SCB->VTOR; diff --git a/Marlin/src/HAL/HAL_DUE/InterruptVectors_Due.h b/Marlin/src/HAL/HAL_DUE/InterruptVectors.h similarity index 97% rename from Marlin/src/HAL/HAL_DUE/InterruptVectors_Due.h rename to Marlin/src/HAL/HAL_DUE/InterruptVectors.h index 592fb2f4cf..87dd049624 100644 --- a/Marlin/src/HAL/HAL_DUE/InterruptVectors_Due.h +++ b/Marlin/src/HAL/HAL_DUE/InterruptVectors.h @@ -37,7 +37,7 @@ #ifdef ARDUINO_ARCH_SAM // ISR handler type -typedef void (*pfnISR_Handler)(void); +typedef void (*pfnISR_Handler)(); // Install a new interrupt vector handler for the given irq, returning the old one pfnISR_Handler install_isr(IRQn_Type irq, pfnISR_Handler newHandler); diff --git a/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.cpp b/Marlin/src/HAL/HAL_DUE/MarlinSerial.cpp similarity index 98% rename from Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.cpp rename to Marlin/src/HAL/HAL_DUE/MarlinSerial.cpp index db5c93d8b4..7b88b6d43e 100644 --- a/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/MarlinSerial.cpp @@ -29,8 +29,8 @@ #include "../../inc/MarlinConfig.h" -#include "MarlinSerial_Due.h" -#include "InterruptVectors_Due.h" +#include "MarlinSerial.h" +#include "InterruptVectors.h" #include "../../Marlin.h" template typename MarlinSerial::ring_buffer_r MarlinSerial::rx_buffer = { 0, 0, { 0 } }; @@ -178,7 +178,7 @@ FORCE_INLINE void MarlinSerial::store_rxd_char() { } template -FORCE_INLINE void MarlinSerial::_tx_thr_empty_irq(void) { +FORCE_INLINE void MarlinSerial::_tx_thr_empty_irq() { if (Cfg::TX_SIZE > 0) { // Read positions uint8_t t = tx_buffer.tail; @@ -221,7 +221,7 @@ FORCE_INLINE void MarlinSerial::_tx_thr_empty_irq(void) { } template -void MarlinSerial::UART_ISR(void) { +void MarlinSerial::UART_ISR() { const uint32_t status = HWUART->UART_SR; // Data received? @@ -308,13 +308,13 @@ void MarlinSerial::end() { } template -int MarlinSerial::peek(void) { +int MarlinSerial::peek() { const int v = rx_buffer.head == rx_buffer.tail ? -1 : rx_buffer.buffer[rx_buffer.tail]; return v; } template -int MarlinSerial::read(void) { +int MarlinSerial::read() { const ring_buffer_pos_t h = rx_buffer.head; ring_buffer_pos_t t = rx_buffer.tail; @@ -354,13 +354,13 @@ int MarlinSerial::read(void) { } template -typename MarlinSerial::ring_buffer_pos_t MarlinSerial::available(void) { +typename MarlinSerial::ring_buffer_pos_t MarlinSerial::available() { const ring_buffer_pos_t h = rx_buffer.head, t = rx_buffer.tail; return (ring_buffer_pos_t)(Cfg::RX_SIZE + h - t) & (Cfg::RX_SIZE - 1); } template -void MarlinSerial::flush(void) { +void MarlinSerial::flush() { rx_buffer.tail = rx_buffer.head; if (Cfg::XONOFF) { @@ -431,7 +431,7 @@ void MarlinSerial::write(const uint8_t c) { } template -void MarlinSerial::flushTX(void) { +void MarlinSerial::flushTX() { // TX if (Cfg::TX_SIZE == 0) { @@ -520,7 +520,7 @@ void MarlinSerial::print(double n, int digits) { } template -void MarlinSerial::println(void) { +void MarlinSerial::println() { print('\r'); print('\n'); } diff --git a/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h b/Marlin/src/HAL/HAL_DUE/MarlinSerial.h similarity index 96% rename from Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h rename to Marlin/src/HAL/HAL_DUE/MarlinSerial.h index 1ba8d82df8..92806f15b4 100644 --- a/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h +++ b/Marlin/src/HAL/HAL_DUE/MarlinSerial.h @@ -108,19 +108,19 @@ protected: static ring_buffer_pos_t rx_max_enqueued; FORCE_INLINE static void store_rxd_char(); - FORCE_INLINE static void _tx_thr_empty_irq(void); - static void UART_ISR(void); + FORCE_INLINE static void _tx_thr_empty_irq(); + static void UART_ISR(); public: MarlinSerial() {}; static void begin(const long); static void end(); - static int peek(void); - static int read(void); - static void flush(void); - static ring_buffer_pos_t available(void); + static int peek(); + static int read(); + static void flush(); + static ring_buffer_pos_t available(); static void write(const uint8_t c); - static void flushTX(void); + static void flushTX(); FORCE_INLINE static uint8_t dropped() { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; } FORCE_INLINE static uint8_t buffer_overruns() { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; } @@ -149,7 +149,7 @@ public: static void println(long, int = DEC); static void println(unsigned long, int = DEC); static void println(double, int = 2); - static void println(void); + static void println(); operator bool() { return true; } private: diff --git a/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.cpp b/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.cpp similarity index 93% rename from Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.cpp rename to Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.cpp index 58cc846002..1bce07e53f 100644 --- a/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.cpp @@ -31,7 +31,7 @@ #if SERIAL_PORT == -1 -#include "MarlinSerialUSB_Due.h" +#include "MarlinSerialUSB.h" #if ENABLED(EMERGENCY_PARSER) #include "../../feature/emergency_parser.h" @@ -39,11 +39,11 @@ // Imports from Atmel USB Stack/CDC implementation extern "C" { - bool usb_task_cdc_isenabled(void); - bool usb_task_cdc_dtr_active(void); - bool udi_cdc_is_rx_ready(void); - int udi_cdc_getc(void); - bool udi_cdc_is_tx_ready(void); + bool usb_task_cdc_isenabled(); + bool usb_task_cdc_dtr_active(); + bool udi_cdc_is_rx_ready(); + int udi_cdc_getc(); + bool udi_cdc_is_tx_ready(); int udi_cdc_putc(int value); }; @@ -62,7 +62,7 @@ void MarlinSerialUSB::begin(const long baud_setting) { void MarlinSerialUSB::end() { } -int MarlinSerialUSB::peek(void) { +int MarlinSerialUSB::peek() { if (pending_char >= 0) return pending_char; @@ -83,7 +83,7 @@ int MarlinSerialUSB::peek(void) { return pending_char; } -int MarlinSerialUSB::read(void) { +int MarlinSerialUSB::read() { if (pending_char >= 0) { int ret = pending_char; pending_char = -1; @@ -107,7 +107,7 @@ int MarlinSerialUSB::read(void) { return c; } -bool MarlinSerialUSB::available(void) { +bool MarlinSerialUSB::available() { /* If Pending chars */ return pending_char >= 0 || /* or USB CDC enumerated and configured on the PC side and some @@ -115,8 +115,8 @@ bool MarlinSerialUSB::available(void) { (usb_task_cdc_isenabled() && udi_cdc_is_rx_ready()); } -void MarlinSerialUSB::flush(void) { } -void MarlinSerialUSB::flushTX(void) { } +void MarlinSerialUSB::flush() { } +void MarlinSerialUSB::flushTX() { } void MarlinSerialUSB::write(const uint8_t c) { @@ -186,7 +186,7 @@ void MarlinSerialUSB::print(double n, int digits) { printFloat(n, digits); } -void MarlinSerialUSB::println(void) { +void MarlinSerialUSB::println() { print('\r'); print('\n'); } diff --git a/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.h b/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.h similarity index 94% rename from Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.h rename to Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.h index cc63232f29..3d9d4bafaa 100644 --- a/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.h +++ b/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB.h @@ -43,11 +43,11 @@ public: MarlinSerialUSB() {}; static void begin(const long); static void end(); - static int peek(void); - static int read(void); - static void flush(void); - static void flushTX(void); - static bool available(void); + static int peek(); + static int read(); + static void flush(); + static void flushTX(); + static bool available(); static void write(const uint8_t c); #if ENABLED(SERIAL_STATS_DROPPED_RX) @@ -80,7 +80,7 @@ public: static void println(long, int = DEC); static void println(unsigned long, int = DEC); static void println(double, int = 2); - static void println(void); + static void println(); operator bool() { return true; } private: diff --git a/Marlin/src/HAL/HAL_DUE/Servo_Due.cpp b/Marlin/src/HAL/HAL_DUE/Servo.cpp similarity index 92% rename from Marlin/src/HAL/HAL_DUE/Servo_Due.cpp rename to Marlin/src/HAL/HAL_DUE/Servo.cpp index a80d0c4f0d..f48fdf5796 100644 --- a/Marlin/src/HAL/HAL_DUE/Servo_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/Servo.cpp @@ -56,19 +56,19 @@ static volatile int8_t Channel[_Nbr_16timers]; // counter for the s void Servo_Handler(timer16_Sequence_t timer, Tc *pTc, uint8_t channel); #ifdef _useTimer1 - void HANDLER_FOR_TIMER1(void) { Servo_Handler(_timer1, TC_FOR_TIMER1, CHANNEL_FOR_TIMER1); } + void HANDLER_FOR_TIMER1() { Servo_Handler(_timer1, TC_FOR_TIMER1, CHANNEL_FOR_TIMER1); } #endif #ifdef _useTimer2 - void HANDLER_FOR_TIMER2(void) { Servo_Handler(_timer2, TC_FOR_TIMER2, CHANNEL_FOR_TIMER2); } + void HANDLER_FOR_TIMER2() { Servo_Handler(_timer2, TC_FOR_TIMER2, CHANNEL_FOR_TIMER2); } #endif #ifdef _useTimer3 - void HANDLER_FOR_TIMER3(void) { Servo_Handler(_timer3, TC_FOR_TIMER3, CHANNEL_FOR_TIMER3); } + void HANDLER_FOR_TIMER3() { Servo_Handler(_timer3, TC_FOR_TIMER3, CHANNEL_FOR_TIMER3); } #endif #ifdef _useTimer4 - void HANDLER_FOR_TIMER4(void) { Servo_Handler(_timer4, TC_FOR_TIMER4, CHANNEL_FOR_TIMER4); } + void HANDLER_FOR_TIMER4() { Servo_Handler(_timer4, TC_FOR_TIMER4, CHANNEL_FOR_TIMER4); } #endif #ifdef _useTimer5 - void HANDLER_FOR_TIMER5(void) { Servo_Handler(_timer5, TC_FOR_TIMER5, CHANNEL_FOR_TIMER5); } + void HANDLER_FOR_TIMER5() { Servo_Handler(_timer5, TC_FOR_TIMER5, CHANNEL_FOR_TIMER5); } #endif void Servo_Handler(timer16_Sequence_t timer, Tc *tc, uint8_t channel) { diff --git a/Marlin/src/HAL/HAL_DUE/Tone.cpp b/Marlin/src/HAL/HAL_DUE/Tone.cpp index b3d7e21698..2af97aac61 100644 --- a/Marlin/src/HAL/HAL_DUE/Tone.cpp +++ b/Marlin/src/HAL/HAL_DUE/Tone.cpp @@ -31,7 +31,7 @@ #include "../../inc/MarlinConfig.h" #include "HAL.h" -#include "HAL_timers_Due.h" +#include "timers.h" static pin_t tone_pin; volatile static int32_t toggles; diff --git a/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp index 8f9f745723..5e5a4e5fc1 100644 --- a/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp +++ b/Marlin/src/HAL/HAL_DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp @@ -71,7 +71,7 @@ void spiSend(uint8_t b); void spiSend(const uint8_t* buf, size_t n); #include "../../shared/Marduino.h" -#include "../fastio_Due.h" +#include "../fastio.h" void u8g_SetPIOutput_DUE_hw_spi(u8g_t *u8g, uint8_t pin_index) { PIO_Configure(g_APinDescription[u8g->pin_list[pin_index]].pPort, PIO_OUTPUT_1, diff --git a/Marlin/src/HAL/HAL_DUE/endstop_interrupts.h b/Marlin/src/HAL/HAL_DUE/endstop_interrupts.h index d97b8453cc..daa2b3c15e 100644 --- a/Marlin/src/HAL/HAL_DUE/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_DUE/endstop_interrupts.h @@ -38,45 +38,46 @@ #include "../../module/endstops.h" // One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } +void endstop_ISR() { endstops.update(); } /** * Endstop interrupts for Due based targets. * On Due, all pins support external interrupt capability. */ -void setup_endstop_interrupts(void) { +void setup_endstop_interrupts() { + #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) #if HAS_X_MAX - attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); // assign it + _ATTACH(X_MAX_PIN); #endif #if HAS_X_MIN - attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(X_MIN_PIN); #endif #if HAS_Y_MAX - attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MAX_PIN); #endif #if HAS_Y_MIN - attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MIN_PIN); #endif #if HAS_Z_MAX - attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MAX_PIN); #endif #if HAS_Z_MIN - attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PIN); #endif #if HAS_Z2_MAX - attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MAX_PIN); #endif #if HAS_Z2_MIN - attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MIN_PIN); #endif #if HAS_Z3_MAX - attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MAX_PIN); #endif #if HAS_Z3_MIN - attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MIN_PIN); #endif #if HAS_Z_MIN_PROBE_PIN - attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PROBE_PIN); #endif } diff --git a/Marlin/src/HAL/HAL_DUE/fastio_Due.h b/Marlin/src/HAL/HAL_DUE/fastio.h similarity index 100% rename from Marlin/src/HAL/HAL_DUE/fastio_Due.h rename to Marlin/src/HAL/HAL_DUE/fastio.h diff --git a/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp index b465fcfa75..fc1baa22ac 100644 --- a/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp @@ -33,7 +33,7 @@ #define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp) #endif -extern void eeprom_flush(void); +extern void eeprom_flush(); bool PersistentStore::access_start() { return true; } diff --git a/Marlin/src/HAL/HAL_DUE/HAL_timers_Due.cpp b/Marlin/src/HAL/HAL_DUE/timers.cpp similarity index 99% rename from Marlin/src/HAL/HAL_DUE/HAL_timers_Due.cpp rename to Marlin/src/HAL/HAL_DUE/timers.cpp index 64ca0ac0f1..57dd9f924f 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL_timers_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/timers.cpp @@ -34,7 +34,7 @@ #include "../../inc/MarlinConfig.h" #include "HAL.h" -#include "HAL_timers_Due.h" +#include "timers.h" // ------------------------ // Local defines diff --git a/Marlin/src/HAL/HAL_DUE/HAL_timers_Due.h b/Marlin/src/HAL/HAL_DUE/timers.h similarity index 100% rename from Marlin/src/HAL/HAL_DUE/HAL_timers_Due.h rename to Marlin/src/HAL/HAL_DUE/timers.h diff --git a/Marlin/src/HAL/HAL_DUE/usb/compiler.h b/Marlin/src/HAL/HAL_DUE/usb/compiler.h index cecdd256f0..7719c129c3 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/compiler.h +++ b/Marlin/src/HAL/HAL_DUE/usb/compiler.h @@ -230,7 +230,7 @@ /* Define NO_INIT attribute */ #if 0 //ndef NO_INIT -#if defined ( __CC_ARM ) +#ifdef __CC_ARM # define NO_INIT __attribute__((zero_init)) #elif defined ( __ICCARM__ ) # define NO_INIT __no_init @@ -262,7 +262,7 @@ //! @{ typedef unsigned char Bool; //!< Boolean. #ifndef __cplusplus -#if !defined(__bool_true_false_are_defined) +#ifndef __bool_true_false_are_defined typedef unsigned char bool; //!< Boolean. #endif #endif @@ -443,7 +443,7 @@ typedef struct #define DISABLE 0 #define ENABLE 1 #ifndef __cplusplus -#if !defined(__bool_true_false_are_defined) +#ifndef __bool_true_false_are_defined #define false 0 #define true 1 #endif diff --git a/Marlin/src/HAL/HAL_DUE/usb/osc.h b/Marlin/src/HAL/HAL_DUE/usb/osc.h index fe09d6fd3e..3a9543507b 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/osc.h +++ b/Marlin/src/HAL/HAL_DUE/usb/osc.h @@ -61,27 +61,27 @@ extern "C" { * Below BOARD_XXX macros are related to the specific board, and * should be defined by the board code, otherwise default value are used. */ -#if !defined(BOARD_FREQ_SLCK_XTAL) +#ifndef BOARD_FREQ_SLCK_XTAL # warning The board slow clock xtal frequency has not been defined. # define BOARD_FREQ_SLCK_XTAL (32768UL) #endif -#if !defined(BOARD_FREQ_SLCK_BYPASS) +#ifndef BOARD_FREQ_SLCK_BYPASS # warning The board slow clock bypass frequency has not been defined. # define BOARD_FREQ_SLCK_BYPASS (32768UL) #endif -#if !defined(BOARD_FREQ_MAINCK_XTAL) +#ifndef BOARD_FREQ_MAINCK_XTAL # warning The board main clock xtal frequency has not been defined. # define BOARD_FREQ_MAINCK_XTAL (12000000UL) #endif -#if !defined(BOARD_FREQ_MAINCK_BYPASS) +#ifndef BOARD_FREQ_MAINCK_BYPASS # warning The board main clock bypass frequency has not been defined. # define BOARD_FREQ_MAINCK_BYPASS (12000000UL) #endif -#if !defined(BOARD_OSC_STARTUP_US) +#ifndef BOARD_OSC_STARTUP_US # warning The board main clock xtal startup time has not been defined. # define BOARD_OSC_STARTUP_US (15625UL) #endif diff --git a/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp b/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp index 6f777d8f9e..7699f2724f 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp +++ b/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp @@ -15,11 +15,11 @@ extern "C" { #define SD_MMC_BLOCK_SIZE 512 -void sd_mmc_spi_mem_init(void) { +void sd_mmc_spi_mem_init() { } -Ctrl_status sd_mmc_spi_test_unit_ready(void) { - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected()) +Ctrl_status sd_mmc_spi_test_unit_ready() { + if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) return CTRL_NO_PRESENT; return CTRL_GOOD; } @@ -27,7 +27,7 @@ Ctrl_status sd_mmc_spi_test_unit_ready(void) { // NOTE: This function is defined as returning the address of the last block // in the card, which is cardSize() - 1 Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) { - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected()) + if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) return CTRL_NO_PRESENT; *nb_sector = card.getSd2Card().cardSize() - 1; return CTRL_GOOD; @@ -38,12 +38,12 @@ bool sd_mmc_spi_unload(bool unload) { return true; } -bool sd_mmc_spi_wr_protect(void) { +bool sd_mmc_spi_wr_protect() { return false; } -bool sd_mmc_spi_removal(void) { - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected()) +bool sd_mmc_spi_removal() { + if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) return true; return false; } @@ -62,7 +62,7 @@ uint8_t sector_buf[SD_MMC_BLOCK_SIZE]; // #define DEBUG_MMC Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) { - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected()) + if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) return CTRL_NO_PRESENT; #ifdef DEBUG_MMC @@ -99,7 +99,7 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) { } Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) { - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected()) + if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) return CTRL_NO_PRESENT; #ifdef DEBUG_MMC diff --git a/Marlin/src/HAL/HAL_DUE/usb/spc_protocol.h b/Marlin/src/HAL/HAL_DUE/usb/spc_protocol.h index e5e7603c9a..6fadb9f36c 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/spc_protocol.h +++ b/Marlin/src/HAL/HAL_DUE/usb/spc_protocol.h @@ -43,12 +43,12 @@ * \asf_license_stop * */ + /* * Support and FAQ: visit Atmel Support */ -#ifndef _SPC_PROTOCOL_H_ -#define _SPC_PROTOCOL_H_ - +#ifndef _SPC_PROTOCOL_H_ +#define _SPC_PROTOCOL_H_ /** * \ingroup usb_msc_protocol diff --git a/Marlin/src/HAL/HAL_DUE/usb/udd.h b/Marlin/src/HAL/HAL_DUE/usb/udd.h index 10807f43d7..c87763de23 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/udd.h +++ b/Marlin/src/HAL/HAL_DUE/usb/udd.h @@ -94,11 +94,11 @@ typedef struct { uint16_t payload_size; //! Callback called after reception of ZLP from setup request - void (*callback) (void); + void (*callback)(void); //! Callback called when the buffer given (.payload) is full or empty. //! This one return false to abort data transfer, or true with a new buffer in .payload. - bool(*over_under_run) (void); + bool (*over_under_run)(void); } udd_ctrl_request_t; extern udd_ctrl_request_t udd_g_ctrlreq; @@ -123,7 +123,7 @@ extern udd_ctrl_request_t udd_g_ctrlreq; * Registered by routine udd_ep_wait_stall_clear() * Callback called when endpoint stall is cleared. */ -typedef void (*udd_callback_halt_cleared_t) (void); +typedef void (*udd_callback_halt_cleared_t)(void); /** * \brief End of transfer callback function type. diff --git a/Marlin/src/HAL/HAL_DUE/usb/udi.h b/Marlin/src/HAL/HAL_DUE/usb/udi.h index 1fc7ae5d01..709908cad9 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/udi.h +++ b/Marlin/src/HAL/HAL_DUE/usb/udi.h @@ -82,7 +82,7 @@ typedef struct { * * \return \c 1 if function was successfully done, otherwise \c 0. */ - bool(*enable) (void); + bool (*enable)(void); /** * \brief Disable the interface. @@ -95,7 +95,7 @@ typedef struct { * - the device is detached from the host (i.e. Vbus is no * longer present) */ - void (*disable) (void); + void (*disable)(void); /** * \brief Handle a control request directed at an interface. @@ -108,7 +108,7 @@ typedef struct { * * \return \c 1 if this interface supports the SETUP request, otherwise \c 0. */ - bool(*setup) (void); + bool (*setup)(void); /** * \brief Returns the current setting of the selected interface. @@ -117,12 +117,12 @@ typedef struct { * * \return alternate setting of selected interface */ - uint8_t(*getsetting) (void); + uint8_t (*getsetting)(void); /** * \brief To signal that a SOF is occurred */ - void(*sof_notify) (void); + void (*sof_notify)(void); } udi_api_t; //@} diff --git a/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h b/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h index 45c5cef5ae..526419c860 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h +++ b/Marlin/src/HAL/HAL_DUE/usb/udi_cdc.h @@ -55,7 +55,7 @@ #include "udi.h" // Check the number of port -#ifndef UDI_CDC_PORT_NB +#ifndef UDI_CDC_PORT_NB # define UDI_CDC_PORT_NB 1 #endif #if (UDI_CDC_PORT_NB < 1) || (UDI_CDC_PORT_NB > 7) diff --git a/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_conf.h b/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_conf.h index b99d611171..cbd3eb00ae 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_conf.h +++ b/Marlin/src/HAL/HAL_DUE/usb/udi_cdc_conf.h @@ -50,7 +50,7 @@ #include "usb_protocol_cdc.h" #include "conf_usb.h" -#ifndef UDI_CDC_PORT_NB +#ifndef UDI_CDC_PORT_NB # define UDI_CDC_PORT_NB 1 #endif diff --git a/Marlin/src/HAL/HAL_DUE/watchdog_Due.cpp b/Marlin/src/HAL/HAL_DUE/watchdog.cpp similarity index 97% rename from Marlin/src/HAL/HAL_DUE/watchdog_Due.cpp rename to Marlin/src/HAL/HAL_DUE/watchdog.cpp index f1df75eaa6..1f51b75c18 100644 --- a/Marlin/src/HAL/HAL_DUE/watchdog_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/watchdog.cpp @@ -24,7 +24,7 @@ #include "../../inc/MarlinConfig.h" #include "../../Marlin.h" -#include "watchdog_Due.h" +#include "watchdog.h" // Override Arduino runtime to either config or disable the watchdog // @@ -32,7 +32,7 @@ // process, because watchdog initialization at hardware reset on SAM3X8E // is unreliable, and there is risk of unintended resets if we delay // that initialization to a later time. -void watchdogSetup(void) { +void watchdogSetup() { #if ENABLED(USE_WATCHDOG) @@ -106,7 +106,7 @@ void watchdogSetup(void) { // Initialize watchdog - On SAM3X, Watchdog was already configured // and enabled or disabled at startup, so no need to reconfigure it // here. - void watchdog_init(void) { + void watchdog_init() { // Reset watchdog to start clean WDT_Restart(WDT); } diff --git a/Marlin/src/HAL/HAL_DUE/watchdog_Due.h b/Marlin/src/HAL/HAL_DUE/watchdog.h similarity index 100% rename from Marlin/src/HAL/HAL_DUE/watchdog_Due.h rename to Marlin/src/HAL/HAL_DUE/watchdog.h diff --git a/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.h b/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.h index 66bdbd7aae..9fca4fcbea 100644 --- a/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.h +++ b/Marlin/src/HAL/HAL_ESP32/FlushableHardwareSerial.h @@ -29,7 +29,7 @@ class FlushableHardwareSerial : public HardwareSerial { public: FlushableHardwareSerial(int uart_nr); - inline void flushTX(void) { /* No need to flush the hardware serial, but defined here for compatibility. */ } + inline void flushTX() { /* No need to flush the hardware serial, but defined here for compatibility. */ } }; extern FlushableHardwareSerial flushableSerial; diff --git a/Marlin/src/HAL/HAL_ESP32/HAL.cpp b/Marlin/src/HAL/HAL_ESP32/HAL.cpp index 535e3b3269..9bf41c2e84 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL.cpp +++ b/Marlin/src/HAL/HAL_ESP32/HAL.cpp @@ -23,7 +23,7 @@ #ifdef ARDUINO_ARCH_ESP32 #include "HAL.h" -#include "HAL_timers_ESP32.h" +#include "timers.h" #include #include #include @@ -78,11 +78,11 @@ volatile int numPWMUsed = 0, // Public functions // ------------------------ -void HAL_init(void) { +void HAL_init() { i2s_init(); } -void HAL_init_board(void) { +void HAL_init_board() { #if EITHER(EEPROM_SETTINGS, WEBSUPPORT) spiffs_init(); #endif @@ -99,15 +99,15 @@ void HAL_init_board(void) { #endif } -void HAL_idletask(void) { +void HAL_idletask() { #if ENABLED(OTASUPPORT) OTA_handle(); #endif } -void HAL_clear_reset_source(void) { } +void HAL_clear_reset_source() { } -uint8_t HAL_get_reset_source(void) { return rtc_get_reset_reason(1); } +uint8_t HAL_get_reset_source() { return rtc_get_reset_reason(1); } void _delay_ms(int delay_ms) { delay(delay_ms); } diff --git a/Marlin/src/HAL/HAL_ESP32/HAL.h b/Marlin/src/HAL/HAL_ESP32/HAL.h index 467e5e0de5..0736ff3c59 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL.h +++ b/Marlin/src/HAL/HAL_ESP32/HAL.h @@ -30,11 +30,11 @@ #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" -#include "fastio_ESP32.h" -#include "watchdog_ESP32.h" +#include "fastio.h" +#include "watchdog.h" #include "i2s.h" -#include "HAL_timers_ESP32.h" +#include "timers.h" #include "WebSocketSerial.h" #include "FlushableHardwareSerial.h" @@ -85,16 +85,16 @@ extern uint16_t HAL_adc_result; // ------------------------ // clear reset reason -void HAL_clear_reset_source (void); +void HAL_clear_reset_source(); // reset reason -uint8_t HAL_get_reset_source(void); +uint8_t HAL_get_reset_source(); void _delay_ms(int delay); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" -int freeMemory(void); +int freeMemory(); #pragma GCC diagnostic pop void analogWrite(pin_t pin, int value); @@ -108,7 +108,7 @@ void eeprom_update_block (const void *__src, void *__dst, size_t __n); // ADC #define HAL_ANALOG_SELECT(pin) -void HAL_adc_init(void); +void HAL_adc_init(); #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) #define HAL_READ_ADC() HAL_adc_result @@ -123,6 +123,6 @@ void HAL_adc_start_conversion(uint8_t adc_pin); // Enable hooks into idle and setup for HAL #define HAL_IDLETASK 1 #define BOARD_INIT() HAL_init_board(); -void HAL_idletask(void); -void HAL_init(void); -void HAL_init_board(void); +void HAL_idletask(); +void HAL_init(); +void HAL_init_board(); diff --git a/Marlin/src/HAL/HAL_ESP32/HAL_spi_ESP32.cpp b/Marlin/src/HAL/HAL_ESP32/HAL_SPI.cpp similarity index 99% rename from Marlin/src/HAL/HAL_ESP32/HAL_spi_ESP32.cpp rename to Marlin/src/HAL/HAL_ESP32/HAL_SPI.cpp index 85c0879712..eba880b4fd 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL_spi_ESP32.cpp +++ b/Marlin/src/HAL/HAL_ESP32/HAL_SPI.cpp @@ -27,9 +27,10 @@ #include "../shared/HAL_SPI.h" #include #include "spi_pins.h" -#include "../../core/macros.h" #include +#include "../../core/macros.h" + // ------------------------ // Public Variables // ------------------------ @@ -79,7 +80,7 @@ void spiInit(uint8_t spiRate) { SPI.begin(); } -uint8_t spiRec(void) { +uint8_t spiRec() { SPI.beginTransaction(spiConfig); uint8_t returnByte = SPI.transfer(0xFF); SPI.endTransaction(); diff --git a/Marlin/src/HAL/HAL_ESP32/HAL_Servo_ESP32.cpp b/Marlin/src/HAL/HAL_ESP32/Servo.cpp similarity index 71% rename from Marlin/src/HAL/HAL_ESP32/HAL_Servo_ESP32.cpp rename to Marlin/src/HAL/HAL_ESP32/Servo.cpp index 5f2dd40e19..3c3b8fa704 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL_Servo_ESP32.cpp +++ b/Marlin/src/HAL/HAL_ESP32/Servo.cpp @@ -25,32 +25,32 @@ #if HAS_SERVOS -#include "HAL_Servo_ESP32.h" +#include "Servo.h" // Adjacent channels (0/1, 2/3 etc.) share the same timer and therefore the same frequency and resolution settings on ESP32, // so we only allocate servo channels up high to avoid side effects with regards to analogWrite (fans, leds, laser pwm etc.) int Servo::channel_next_free = 12; Servo::Servo() { - this->channel = channel_next_free++; + channel = channel_next_free++; } -int8_t Servo::attach(const int pin) { - if (this->channel >= CHANNEL_MAX_NUM) return -1; - if (pin > 0) this->pin = pin; +int8_t Servo::attach(const int inPin) { + if (channel >= CHANNEL_MAX_NUM) return -1; + if (pin > 0) pin = inPin; - ledcSetup(this->channel, 50, 16); // channel X, 50 Hz, 16-bit depth - ledcAttachPin(this->pin, this->channel); + ledcSetup(channel, 50, 16); // channel X, 50 Hz, 16-bit depth + ledcAttachPin(pin, channel); return true; } -void Servo::detach() { ledcDetachPin(this->pin); } +void Servo::detach() { ledcDetachPin(pin); } -int Servo::read() { return this->degrees; } +int Servo::read() { return degrees; } void Servo::write(int inDegrees) { - this->degrees = constrain(inDegrees, MIN_ANGLE, MAX_ANGLE); - int us = map(this->degrees, MIN_ANGLE, MAX_ANGLE, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH); + degrees = constrain(inDegrees, MIN_ANGLE, MAX_ANGLE); + int us = map(degrees, MIN_ANGLE, MAX_ANGLE, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH); int duty = map(us, 0, TAU_USEC, 0, MAX_COMPARE); ledcWrite(channel, duty); } @@ -58,11 +58,11 @@ void Servo::write(int inDegrees) { void Servo::move(const int value) { constexpr uint16_t servo_delay[] = SERVO_DELAY; static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long."); - if (this->attach(0) >= 0) { - this->write(value); - safe_delay(servo_delay[this->channel]); + if (attach(0) >= 0) { + write(value); + safe_delay(servo_delay[channel]); #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); + detach(); #endif } } diff --git a/Marlin/src/HAL/HAL_ESP32/HAL_Servo_ESP32.h b/Marlin/src/HAL/HAL_ESP32/Servo.h similarity index 100% rename from Marlin/src/HAL/HAL_ESP32/HAL_Servo_ESP32.h rename to Marlin/src/HAL/HAL_ESP32/Servo.h diff --git a/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp b/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp index ce2692e2d2..9a38d3996a 100644 --- a/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp +++ b/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp @@ -66,15 +66,15 @@ ring_buffer_pos_t RingBuffer::write(const uint8_t *buffer, ring_buffer_pos_t siz return written; } -int RingBuffer::available(void) { +int RingBuffer::available() { return (size - read_index + write_index) & (size - 1); } -int RingBuffer::peek(void) { +int RingBuffer::peek() { return available() ? data[read_index] : -1; } -int RingBuffer::read(void) { +int RingBuffer::read() { if (available()) { const int ret = data[read_index]; read_index = NEXT_INDEX(read_index, size); @@ -94,7 +94,7 @@ ring_buffer_pos_t RingBuffer::read(uint8_t *buffer) { return len; } -void RingBuffer::flush(void) { read_index = write_index; } +void RingBuffer::flush() { read_index = write_index; } // WebSocketSerial impl WebSocketSerial::WebSocketSerial() @@ -120,10 +120,10 @@ void WebSocketSerial::begin(const long baud_setting) { } void WebSocketSerial::end() { } -int WebSocketSerial::peek(void) { return rx_buffer.peek(); } -int WebSocketSerial::read(void) { return rx_buffer.read(); } -int WebSocketSerial::available(void) { return rx_buffer.available(); } -void WebSocketSerial::flush(void) { rx_buffer.flush(); } +int WebSocketSerial::peek() { return rx_buffer.peek(); } +int WebSocketSerial::read() { return rx_buffer.read(); } +int WebSocketSerial::available() { return rx_buffer.available(); } +void WebSocketSerial::flush() { rx_buffer.flush(); } size_t WebSocketSerial::write(const uint8_t c) { size_t ret = tx_buffer.write(c); @@ -145,7 +145,7 @@ size_t WebSocketSerial::write(const uint8_t* buffer, size_t size) { return written; } -void WebSocketSerial::flushTX(void) { +void WebSocketSerial::flushTX() { // No need to do anything as there's no benefit to sending partial lines over the websocket connection. } diff --git a/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h b/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h index 6470f941d1..9590271b01 100644 --- a/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h +++ b/Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h @@ -45,11 +45,11 @@ public: RingBuffer(ring_buffer_pos_t size); ~RingBuffer(); - int available(void); - int peek(void); - int read(void); + int available(); + int peek(); + int read(); ring_buffer_pos_t read(uint8_t *buffer); - void flush(void); + void flush(); ring_buffer_pos_t write(const uint8_t c); ring_buffer_pos_t write(const uint8_t* buffer, ring_buffer_pos_t size); }; @@ -62,11 +62,11 @@ public: WebSocketSerial(); void begin(const long); void end(); - int available(void); - int peek(void); - int read(void); - void flush(void); - void flushTX(void); + int available(); + int peek(); + int read(); + void flush(); + void flushTX(); size_t write(const uint8_t c); size_t write(const uint8_t* buffer, size_t size); diff --git a/Marlin/src/HAL/HAL_ESP32/endstop_interrupts.h b/Marlin/src/HAL/HAL_ESP32/endstop_interrupts.h index 9e5fc8a665..31a3e4d667 100644 --- a/Marlin/src/HAL/HAL_ESP32/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_ESP32/endstop_interrupts.h @@ -38,40 +38,41 @@ #include "../../module/endstops.h" // One ISR for all EXT-Interrupts -void ICACHE_RAM_ATTR endstop_ISR(void) { endstops.update(); } +void ICACHE_RAM_ATTR endstop_ISR() { endstops.update(); } -void setup_endstop_interrupts(void) { +void setup_endstop_interrupts() { + #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) #if HAS_X_MAX - attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(X_MAX_PIN); #endif #if HAS_X_MIN - attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(X_MIN_PIN); #endif #if HAS_Y_MAX - attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MAX_PIN); #endif #if HAS_Y_MIN - attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MIN_PIN); #endif #if HAS_Z_MAX - attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MAX_PIN); #endif #if HAS_Z_MIN - attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PIN); #endif #if HAS_Z2_MAX - attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MAX_PIN); #endif #if HAS_Z2_MIN - attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MIN_PIN); #endif #if HAS_Z3_MAX - attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MAX_PIN); #endif #if HAS_Z3_MIN - attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MIN_PIN); #endif #if HAS_Z_MIN_PROBE_PIN - attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PROBE_PIN); #endif } diff --git a/Marlin/src/HAL/HAL_ESP32/fastio_ESP32.h b/Marlin/src/HAL/HAL_ESP32/fastio.h similarity index 100% rename from Marlin/src/HAL/HAL_ESP32/fastio_ESP32.h rename to Marlin/src/HAL/HAL_ESP32/fastio.h diff --git a/Marlin/src/HAL/HAL_ESP32/HAL_timers_ESP32.cpp b/Marlin/src/HAL/HAL_ESP32/timers.cpp similarity index 99% rename from Marlin/src/HAL/HAL_ESP32/HAL_timers_ESP32.cpp rename to Marlin/src/HAL/HAL_ESP32/timers.cpp index fc90af4b8f..79a79e37cd 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL_timers_ESP32.cpp +++ b/Marlin/src/HAL/HAL_ESP32/timers.cpp @@ -30,7 +30,7 @@ #include "HAL.h" -#include "HAL_timers_ESP32.h" +#include "timers.h" // ------------------------ // Local defines diff --git a/Marlin/src/HAL/HAL_ESP32/HAL_timers_ESP32.h b/Marlin/src/HAL/HAL_ESP32/timers.h similarity index 92% rename from Marlin/src/HAL/HAL_ESP32/HAL_timers_ESP32.h rename to Marlin/src/HAL/HAL_ESP32/timers.h index 0806fd2c77..4b01f4ba7c 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL_timers_ESP32.h +++ b/Marlin/src/HAL/HAL_ESP32/timers.h @@ -79,13 +79,13 @@ typedef uint64_t hal_timer_t; #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) -#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler(void) -#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler(void) -#define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler(void) +#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler() +#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler() +#define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler() -extern "C" void tempTC_Handler(void); -extern "C" void stepTC_Handler(void); -extern "C" void pwmTC_Handler(void); +extern "C" void tempTC_Handler(); +extern "C" void stepTC_Handler(); +extern "C" void pwmTC_Handler(); // ------------------------ // Types @@ -95,7 +95,7 @@ typedef struct { timer_group_t group; timer_idx_t idx; uint32_t divider; - void (*fn)(void); + void (*fn)(); } tTimerConfig; // ------------------------ diff --git a/Marlin/src/HAL/HAL_ESP32/watchdog_ESP32.cpp b/Marlin/src/HAL/HAL_ESP32/watchdog.cpp similarity index 92% rename from Marlin/src/HAL/HAL_ESP32/watchdog_ESP32.cpp rename to Marlin/src/HAL/HAL_ESP32/watchdog.cpp index cbd5d989cd..d05e67c856 100644 --- a/Marlin/src/HAL/HAL_ESP32/watchdog_ESP32.cpp +++ b/Marlin/src/HAL/HAL_ESP32/watchdog.cpp @@ -26,13 +26,13 @@ #if ENABLED(USE_WATCHDOG) -#include "watchdog_ESP32.h" +#include "watchdog.h" -void watchdogSetup(void) { +void watchdogSetup() { // do whatever. don't remove this function. } -void watchdog_init(void) { +void watchdog_init() { // TODO } diff --git a/Marlin/src/HAL/HAL_ESP32/watchdog_ESP32.h b/Marlin/src/HAL/HAL_ESP32/watchdog.h similarity index 100% rename from Marlin/src/HAL/HAL_ESP32/watchdog_ESP32.h rename to Marlin/src/HAL/HAL_ESP32/watchdog.h diff --git a/Marlin/src/HAL/HAL_ESP32/web.cpp b/Marlin/src/HAL/HAL_ESP32/web.cpp index b2bb03d714..c593fc0242 100644 --- a/Marlin/src/HAL/HAL_ESP32/web.cpp +++ b/Marlin/src/HAL/HAL_ESP32/web.cpp @@ -22,16 +22,18 @@ #ifdef ARDUINO_ARCH_ESP32 +#include +#undef DISABLED // esp32-hal-gpio.h + #include "../../inc/MarlinConfigPre.h" #if ENABLED(WEBSUPPORT) -#include #include "wifi.h" AsyncEventSource events("/events"); // event source (Server-Sent events) -void onNotFound(AsyncWebServerRequest *request){ +void onNotFound(AsyncWebServerRequest *request) { request->send(404); } diff --git a/Marlin/src/HAL/HAL_LINUX/HAL.cpp b/Marlin/src/HAL/HAL_LINUX/HAL.cpp index 0251e2e4e6..316f6b452a 100644 --- a/Marlin/src/HAL/HAL_LINUX/HAL.cpp +++ b/Marlin/src/HAL/HAL_LINUX/HAL.cpp @@ -31,10 +31,10 @@ HalSerial usb_serial; extern "C" void u8g_xMicroDelay(uint16_t val) { DELAY_US(val); } -extern "C" void u8g_MicroDelay(void) { +extern "C" void u8g_MicroDelay() { u8g_xMicroDelay(1); } -extern "C" void u8g_10MicroDelay(void) { +extern "C" void u8g_10MicroDelay() { u8g_xMicroDelay(10); } extern "C" void u8g_Delay(uint16_t val) { @@ -51,7 +51,7 @@ int freeMemory() { // ADC // ------------------------ -void HAL_adc_init(void) { +void HAL_adc_init() { } @@ -64,18 +64,18 @@ void HAL_adc_start_conversion(const uint8_t ch) { active_ch = ch; } -bool HAL_adc_finished(void) { +bool HAL_adc_finished() { return true; } -uint16_t HAL_adc_get_result(void) { +uint16_t HAL_adc_get_result() { pin_t pin = analogInputToDigitalPin(active_ch); if (!VALID_PIN(pin)) return 0; uint16_t data = ((Gpio::get(pin) >> 2) & 0x3FF); return data; // return 10bit value as Marlin expects } -void HAL_pwm_init(void) { +void HAL_pwm_init() { } diff --git a/Marlin/src/HAL/HAL_LINUX/HAL.h b/Marlin/src/HAL/HAL_LINUX/HAL.h index db771f06c0..39d68a7a10 100644 --- a/Marlin/src/HAL/HAL_LINUX/HAL.h +++ b/Marlin/src/HAL/HAL_LINUX/HAL.h @@ -56,7 +56,7 @@ uint8_t _getc(); #include "../shared/HAL_SPI.h" #include "fastio.h" #include "watchdog.h" -#include "HAL_timers.h" +#include "timers.h" #include "serial.h" #define SHARED_SERVOS HAS_SERVOS @@ -78,32 +78,24 @@ extern HalSerial usb_serial; #define ENABLE_ISRS() #define DISABLE_ISRS() -inline void HAL_init(void) { } +inline void HAL_init() { } // Utility functions #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" -int freeMemory(void); +int freeMemory(); #pragma GCC diagnostic pop -// SPI: Extended functions which take a channel number (hardware SPI only) -/** Write single byte to specified SPI channel */ -void spiSend(uint32_t chan, byte b); -/** Write buffer to specified SPI channel */ -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); -/** Read single byte from specified SPI channel */ -uint8_t spiRec(uint32_t chan); - // ADC #define HAL_ANALOG_SELECT(pin) HAL_adc_enable_channel(pin) #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) #define HAL_READ_ADC() HAL_adc_get_result() #define HAL_ADC_READY() true -void HAL_adc_init(void); +void HAL_adc_init(); void HAL_adc_enable_channel(int pin); void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(void); +uint16_t HAL_adc_get_result(); /* ---------------- Delay in cycles */ FORCE_INLINE static void DELAY_CYCLES(uint64_t x) { diff --git a/Marlin/src/HAL/HAL_LINUX/arduino.cpp b/Marlin/src/HAL/HAL_LINUX/arduino.cpp index a7e451ebcc..7915d685ea 100644 --- a/Marlin/src/HAL/HAL_LINUX/arduino.cpp +++ b/Marlin/src/HAL/HAL_LINUX/arduino.cpp @@ -28,8 +28,8 @@ #include "../shared/Delay.h" // Interrupts -void cli(void) { } // Disable -void sei(void) { } // Enable +void cli() { } // Disable +void sei() { } // Enable // Time functions void _delay_ms(const int delay_ms) { @@ -90,7 +90,7 @@ void eeprom_read_block(void *__dst, const void *__src, size_t __n) { } void eeprom_update_block(const void *__src, void *__dst, size_t __n) { } -char *dtostrf (double __val, signed char __width, unsigned char __prec, char *__s) { +char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s) { char format_string[20]; snprintf(format_string, 20, "%%%d.%df", __width, __prec); sprintf(__s, format_string, __val); diff --git a/Marlin/src/HAL/HAL_LINUX/include/Arduino.h b/Marlin/src/HAL/HAL_LINUX/include/Arduino.h index 0d29df466e..13a8206e1b 100644 --- a/Marlin/src/HAL/HAL_LINUX/include/Arduino.h +++ b/Marlin/src/HAL/HAL_LINUX/include/Arduino.h @@ -49,8 +49,6 @@ typedef uint8_t byte; #define PGM_P const char * // Used for libraries, preprocessor, and constants -#define min(a,b) ((a)<(b)?(a):(b)) -#define max(a,b) ((a)>(b)?(a):(b)) #define abs(x) ((x)>0?(x):-(x)) #ifndef isnan @@ -65,9 +63,9 @@ typedef uint8_t byte; #define constrain(value, arg_min, arg_max) ((value) < (arg_min) ? (arg_min) :((value) > (arg_max) ? (arg_max) : (value))) //Interrupts -void cli(void); // Disable -void sei(void); // Enable -void attachInterrupt(uint32_t pin, void (*callback)(void), uint32_t mode); +void cli(); // Disable +void sei(); // Enable +void attachInterrupt(uint32_t pin, void (*callback)(), uint32_t mode); void detachInterrupt(uint32_t pin); extern "C" void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode); extern "C" void GpioDisableInt(uint32_t port, uint32_t pin); @@ -111,13 +109,13 @@ uint16_t analogRead(pin_t); // EEPROM void eeprom_write_byte(unsigned char *pos, unsigned char value); unsigned char eeprom_read_byte(unsigned char *pos); -void eeprom_read_block (void *__dst, const void *__src, size_t __n); -void eeprom_update_block (const void *__src, void *__dst, size_t __n); +void eeprom_read_block(void *__dst, const void *__src, size_t __n); +void eeprom_update_block(const void *__src, void *__dst, size_t __n); int32_t random(int32_t); int32_t random(int32_t, int32_t); void randomSeed(uint32_t); -char *dtostrf (double __val, signed char __width, unsigned char __prec, char *__s); +char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s); int map(uint16_t x, uint16_t in_min, uint16_t in_max, uint16_t out_min, uint16_t out_max); diff --git a/Marlin/src/HAL/HAL_LINUX/include/serial.h b/Marlin/src/HAL/HAL_LINUX/include/serial.h index a844936c1b..268bdeeeca 100644 --- a/Marlin/src/HAL/HAL_LINUX/include/serial.h +++ b/Marlin/src/HAL/HAL_LINUX/include/serial.h @@ -108,11 +108,11 @@ public: void flush() { receive_buffer.clear(); } - uint8_t availableForWrite(void){ + uint8_t availableForWrite() { return transmit_buffer.free() > 255 ? 255 : (uint8_t)transmit_buffer.free(); } - void flushTX(void){ + void flushTX() { if (host_connected) while (transmit_buffer.available()) { /* nada */ } } @@ -200,7 +200,7 @@ public: void println(unsigned long value, int nbase = 0) { print(value, nbase); println(); } void println(float value, int round = 6) { printf("%f\n" , value); } void println(double value, int round = 6) { printf("%f\n" , value); } - void println(void) { print('\n'); } + void println() { print('\n'); } volatile RingBuffer receive_buffer; volatile RingBuffer transmit_buffer; diff --git a/Marlin/src/HAL/HAL_LINUX/main.cpp b/Marlin/src/HAL/HAL_LINUX/main.cpp index 01b0eee34d..4231affba7 100644 --- a/Marlin/src/HAL/HAL_LINUX/main.cpp +++ b/Marlin/src/HAL/HAL_LINUX/main.cpp @@ -104,7 +104,7 @@ void simulation_loop() { } } -int main(void) { +int main() { std::thread write_serial (write_serial_thread); std::thread read_serial (read_serial_thread); diff --git a/Marlin/src/HAL/HAL_LINUX/HAL_timers.cpp b/Marlin/src/HAL/HAL_LINUX/timers.cpp similarity index 97% rename from Marlin/src/HAL/HAL_LINUX/HAL_timers.cpp rename to Marlin/src/HAL/HAL_LINUX/timers.cpp index 48c033d87e..f293d7f408 100644 --- a/Marlin/src/HAL/HAL_LINUX/HAL_timers.cpp +++ b/Marlin/src/HAL/HAL_LINUX/timers.cpp @@ -25,7 +25,7 @@ #include "hardware/Timer.h" #include "../../inc/MarlinConfig.h" -#include "HAL_timers.h" +#include "timers.h" /** * Use POSIX signals to attempt to emulate Interrupts @@ -37,7 +37,7 @@ HAL_TEMP_TIMER_ISR(); Timer timers[2]; -void HAL_timer_init(void) { +void HAL_timer_init() { timers[0].init(0, STEPPER_TIMER_RATE, TIMER0_IRQHandler); timers[1].init(1, TEMP_TIMER_RATE, TIMER1_IRQHandler); } diff --git a/Marlin/src/HAL/HAL_LINUX/HAL_timers.h b/Marlin/src/HAL/HAL_LINUX/timers.h similarity index 98% rename from Marlin/src/HAL/HAL_LINUX/HAL_timers.h rename to Marlin/src/HAL/HAL_LINUX/timers.h index e883cb0150..8022aabd26 100644 --- a/Marlin/src/HAL/HAL_LINUX/HAL_timers.h +++ b/Marlin/src/HAL/HAL_LINUX/timers.h @@ -59,16 +59,16 @@ typedef uint32_t hal_timer_t; #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) -#define HAL_STEP_TIMER_ISR() extern "C" void TIMER0_IRQHandler(void) -#define HAL_TEMP_TIMER_ISR() extern "C" void TIMER1_IRQHandler(void) +#define HAL_STEP_TIMER_ISR() extern "C" void TIMER0_IRQHandler() +#define HAL_TEMP_TIMER_ISR() extern "C" void TIMER1_IRQHandler() // PWM timer #define HAL_PWM_TIMER -#define HAL_PWM_TIMER_ISR() extern "C" void TIMER3_IRQHandler(void) +#define HAL_PWM_TIMER_ISR() extern "C" void TIMER3_IRQHandler() #define HAL_PWM_TIMER_IRQn -void HAL_timer_init(void); +void HAL_timer_init(); void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare); diff --git a/Marlin/src/HAL/HAL_LINUX/watchdog.cpp b/Marlin/src/HAL/HAL_LINUX/watchdog.cpp index f96a05e5b8..a1ecac1cb5 100644 --- a/Marlin/src/HAL/HAL_LINUX/watchdog.cpp +++ b/Marlin/src/HAL/HAL_LINUX/watchdog.cpp @@ -28,19 +28,19 @@ #include "watchdog.h" -void watchdog_init(void) {} +void watchdog_init() {} -void HAL_clear_reset_source(void) {} +void HAL_clear_reset_source() {} -uint8_t HAL_get_reset_source(void) { +uint8_t HAL_get_reset_source() { return RST_POWER_ON; } void watchdog_reset() {} #else - void HAL_clear_reset_source(void) {} - uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; } + void HAL_clear_reset_source() {} + uint8_t HAL_get_reset_source() { return RST_POWER_ON; } #endif // USE_WATCHDOG #endif // __PLAT_LINUX__ diff --git a/Marlin/src/HAL/HAL_LINUX/watchdog.h b/Marlin/src/HAL/HAL_LINUX/watchdog.h index 04ce17fe9d..5bc06f04f1 100644 --- a/Marlin/src/HAL/HAL_LINUX/watchdog.h +++ b/Marlin/src/HAL/HAL_LINUX/watchdog.h @@ -23,7 +23,7 @@ #define WDT_TIMEOUT 4000000 // 4 second timeout -void watchdog_init(void); -void watchdog_reset(void); -void HAL_clear_reset_source(void); -uint8_t HAL_get_reset_source(void); +void watchdog_init(); +void watchdog_reset(); +void HAL_clear_reset_source(); +uint8_t HAL_get_reset_source(); diff --git a/Marlin/src/HAL/HAL_LPC1768/DebugMonitor_LPC1768.cpp b/Marlin/src/HAL/HAL_LPC1768/DebugMonitor.cpp similarity index 94% rename from Marlin/src/HAL/HAL_LPC1768/DebugMonitor_LPC1768.cpp rename to Marlin/src/HAL/HAL_LPC1768/DebugMonitor.cpp index 0196253df2..fefee386e5 100644 --- a/Marlin/src/HAL/HAL_LPC1768/DebugMonitor_LPC1768.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/DebugMonitor.cpp @@ -44,7 +44,7 @@ #define sw_barrier() __asm__ volatile("": : :"memory"); // (re)initialize UART0 as a monitor output to 250000,n,8,1 -static void TXBegin(void) { +static void TXBegin() { } // Send character through UART with no interrupts @@ -210,7 +210,7 @@ void HardFault_HandlerC(unsigned long *sp, unsigned long lr, unsigned long cause } extern "C" { -__attribute__((naked)) void NMI_Handler(void) { +__attribute__((naked)) void NMI_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -223,7 +223,7 @@ __attribute__((naked)) void NMI_Handler(void) { ); } -__attribute__((naked)) void HardFault_Handler(void) { +__attribute__((naked)) void HardFault_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -236,7 +236,7 @@ __attribute__((naked)) void HardFault_Handler(void) { ); } -__attribute__((naked)) void MemManage_Handler(void) { +__attribute__((naked)) void MemManage_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -249,7 +249,7 @@ __attribute__((naked)) void MemManage_Handler(void) { ); } -__attribute__((naked)) void BusFault_Handler(void) { +__attribute__((naked)) void BusFault_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -262,7 +262,7 @@ __attribute__((naked)) void BusFault_Handler(void) { ); } -__attribute__((naked)) void UsageFault_Handler(void) { +__attribute__((naked)) void UsageFault_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -275,7 +275,7 @@ __attribute__((naked)) void UsageFault_Handler(void) { ); } -__attribute__((naked)) void DebugMon_Handler(void) { +__attribute__((naked)) void DebugMon_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -289,7 +289,7 @@ __attribute__((naked)) void DebugMon_Handler(void) { } /* This is NOT an exception, it is an interrupt handler - Nevertheless, the framing is the same */ -__attribute__((naked)) void WDT_IRQHandler(void) { +__attribute__((naked)) void WDT_IRQHandler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") @@ -302,7 +302,7 @@ __attribute__((naked)) void WDT_IRQHandler(void) { ); } -__attribute__((naked)) void RSTC_Handler(void) { +__attribute__((naked)) void RSTC_Handler() { __asm__ __volatile__ ( ".syntax unified" "\n\t" A("tst lr, #4") diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL.cpp b/Marlin/src/HAL/HAL_LPC1768/HAL.cpp index aed7a7855c..b684145e99 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/HAL.cpp @@ -30,10 +30,10 @@ extern "C" void u8g_xMicroDelay(uint16_t val) { DELAY_US(val); } -extern "C" void u8g_MicroDelay(void) { +extern "C" void u8g_MicroDelay() { u8g_xMicroDelay(1); } -extern "C" void u8g_10MicroDelay(void) { +extern "C" void u8g_10MicroDelay() { u8g_xMicroDelay(10); } extern "C" void u8g_Delay(uint16_t val) { diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL.h b/Marlin/src/HAL/HAL_LPC1768/HAL.h index 45be77f41c..cf2576de25 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL.h +++ b/Marlin/src/HAL/HAL_LPC1768/HAL.h @@ -28,7 +28,7 @@ #define CPU_32_BIT -void HAL_init(void); +void HAL_init(); #include #include @@ -41,7 +41,7 @@ extern "C" volatile uint32_t _millis; #include "../shared/HAL_SPI.h" #include "fastio.h" #include "watchdog.h" -#include "HAL_timers.h" +#include "timers.h" #include "MarlinSerial.h" #include @@ -113,20 +113,9 @@ extern "C" volatile uint32_t _millis; // #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" -int freeMemory(void); +int freeMemory(); #pragma GCC diagnostic pop -// -// SPI: Extended functions taking a channel number (Hardware SPI only) -// - -// Write single byte to specified SPI channel -void spiSend(uint32_t chan, byte b); -// Write buffer to specified SPI channel -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); -// Read single byte from specified SPI channel -uint8_t spiRec(uint32_t chan); - // // ADC API // @@ -155,7 +144,7 @@ int16_t PARSED_PIN_INDEX(const char code, const int16_t dval); #define HAL_SENSITIVE_PINS P0_06, P0_07, P0_08, P0_09 #define HAL_IDLETASK 1 -void HAL_idletask(void); +void HAL_idletask(); #define PLATFORM_M997_SUPPORT void flashFirmware(int16_t value); diff --git a/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp b/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp index 2379300512..a8778f7446 100644 --- a/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp @@ -27,28 +27,28 @@ #if (defined(SERIAL_PORT) && SERIAL_PORT == 0) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 0) MarlinSerial MSerial(LPC_UART0); - extern "C" void UART0_IRQHandler(void) { + extern "C" void UART0_IRQHandler() { MSerial.IRQHandler(); } #endif #if (defined(SERIAL_PORT) && SERIAL_PORT == 1) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 1) MarlinSerial MSerial1((LPC_UART_TypeDef *) LPC_UART1); - extern "C" void UART1_IRQHandler(void) { + extern "C" void UART1_IRQHandler() { MSerial1.IRQHandler(); } #endif #if (defined(SERIAL_PORT) && SERIAL_PORT == 2) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 2) MarlinSerial MSerial2(LPC_UART2); - extern "C" void UART2_IRQHandler(void) { + extern "C" void UART2_IRQHandler() { MSerial2.IRQHandler(); } #endif #if (defined(SERIAL_PORT) && SERIAL_PORT == 3) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 3) MarlinSerial MSerial3(LPC_UART3); - extern "C" void UART3_IRQHandler(void) { + extern "C" void UART3_IRQHandler() { MSerial3.IRQHandler(); } #endif diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL_Servo_LPC1768.h b/Marlin/src/HAL/HAL_LPC1768/Servo.h similarity index 91% rename from Marlin/src/HAL/HAL_LPC1768/HAL_Servo_LPC1768.h rename to Marlin/src/HAL/HAL_LPC1768/Servo.h index 8b511032cb..1bbf84c73e 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL_Servo_LPC1768.h +++ b/Marlin/src/HAL/HAL_LPC1768/Servo.h @@ -57,11 +57,11 @@ class libServo: public Servo { constexpr uint16_t servo_delay[] = SERVO_DELAY; static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long."); - if (this->attach(servo_info[this->servoIndex].Pin.nbr) >= 0) { // try to reattach - this->write(value); - safe_delay(servo_delay[this->servoIndex]); // delay to allow servo to reach position + if (attach(servo_info[servoIndex].Pin.nbr) >= 0) { // try to reattach + write(value); + safe_delay(servo_delay[servoIndex]); // delay to allow servo to reach position #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); + detach(); #endif } diff --git a/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h b/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h index a1d9aba167..53e4b15809 100644 --- a/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_LPC1768/endstop_interrupts.h @@ -38,73 +38,74 @@ #include "../../module/endstops.h" // One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } +void endstop_ISR() { endstops.update(); } -void setup_endstop_interrupts(void) { +void setup_endstop_interrupts() { + #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) #if HAS_X_MAX #if !LPC1768_PIN_INTERRUPT_M(X_MAX_PIN) - #error "X_MAX_PIN is not an INTERRUPT capable pin." + #error "X_MAX_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(X_MAX_PIN); #endif #if HAS_X_MIN #if !LPC1768_PIN_INTERRUPT_M(X_MIN_PIN) - #error "X_MIN_PIN is not an INTERRUPT capable pin." + #error "X_MIN_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(X_MIN_PIN); #endif #if HAS_Y_MAX #if !LPC1768_PIN_INTERRUPT_M(Y_MAX_PIN) - #error "Y_MAX_PIN is not an INTERRUPT capable pin." + #error "Y_MAX_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MAX_PIN); #endif #if HAS_Y_MIN #if !LPC1768_PIN_INTERRUPT_M(Y_MIN_PIN) - #error "Y_MIN_PIN is not an INTERRUPT capable pin." + #error "Y_MIN_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MIN_PIN); #endif #if HAS_Z_MAX #if !LPC1768_PIN_INTERRUPT_M(Z_MAX_PIN) - #error "Z_MAX_PIN is not an INTERRUPT capable pin." + #error "Z_MAX_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MAX_PIN); #endif #if HAS_Z_MIN #if !LPC1768_PIN_INTERRUPT_M(Z_MIN_PIN) - #error "Z_MIN_PIN is not an INTERRUPT capable pin." + #error "Z_MIN_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PIN); #endif #if HAS_Z2_MAX #if !LPC1768_PIN_INTERRUPT_M(Z2_MAX_PIN) - #error "Z2_MAX_PIN is not an INTERRUPT capable pin." + #error "Z2_MAX_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MAX_PIN); #endif #if HAS_Z2_MIN #if !LPC1768_PIN_INTERRUPT_M(Z2_MIN_PIN) - #error "Z2_MIN_PIN is not an INTERRUPT capable pin." + #error "Z2_MIN_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MIN_PIN); #endif #if HAS_Z3_MAX #if !LPC1768_PIN_INTERRUPT_M(Z3_MIN_PIN) - #error "Z3_MIN_PIN is not an INTERRUPT capable pin." + #error "Z3_MIN_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MAX_PIN); #endif #if HAS_Z3_MIN #if !LPC1768_PIN_INTERRUPT_M(Z3_MIN_PIN) - #error "Z3_MIN_PIN is not an INTERRUPT capable pin." + #error "Z3_MIN_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MIN_PIN); #endif #if HAS_Z_MIN_PROBE_PIN #if !LPC1768_PIN_INTERRUPT_M(Z_MIN_PROBE_PIN) - #error "Z_MIN_PROBE_PIN is not an INTERRUPT capable pin." + #error "Z_MIN_PROBE_PIN is not INTERRUPT-capable." #endif - attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PROBE_PIN); #endif } diff --git a/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c b/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c index 28c1e01792..3ad1aff017 100644 --- a/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c +++ b/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c @@ -89,7 +89,7 @@ uint8_t digipot_mcp4451_start(uint8_t sla) { // send slave address and write bi return 1; } -void digipot_mcp4451_init(void) { +void digipot_mcp4451_init() { /** * Init I2C pin connect */ diff --git a/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h b/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h index 13712e2ae0..d7e4b0dc7a 100644 --- a/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h +++ b/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h @@ -45,7 +45,7 @@ #include uint8_t digipot_mcp4451_start(uint8_t sla); -void digipot_mcp4451_init(void); +void digipot_mcp4451_init(); uint8_t digipot_mcp4451_send_byte(uint8_t data); #ifdef __cplusplus diff --git a/Marlin/src/HAL/HAL_LPC1768/main.cpp b/Marlin/src/HAL/HAL_LPC1768/main.cpp index fa3d27dbb6..ab5b184b47 100644 --- a/Marlin/src/HAL/HAL_LPC1768/main.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/main.cpp @@ -38,15 +38,15 @@ extern "C" { #include "../../sd/cardreader.h" #include "../../inc/MarlinConfig.h" #include "HAL.h" -#include "HAL_timers.h" +#include "timers.h" extern uint32_t MSC_SD_Init(uint8_t pdrv); extern "C" int isLPC1769(); -extern "C" void disk_timerproc(void); +extern "C" void disk_timerproc(); void SysTick_Callback() { disk_timerproc(); } -void HAL_init(void) { +void HAL_init() { // Init LEDs #if PIN_EXISTS(LED) @@ -149,7 +149,7 @@ void HAL_init(void) { } // HAL idle task -void HAL_idletask(void) { +void HAL_idletask() { #if ENABLED(SHARED_SD_CARD) // If Marlin is using the SD card we need to lock it to prevent access from // a PC via USB. @@ -158,7 +158,7 @@ void HAL_idletask(void) { // the disk if Marlin has it mounted. Unfortuately there is currently no way // to unmount the disk from the LCD menu. // if (IS_SD_PRINTING() || IS_SD_FILE_OPEN()) - if (card.isDetected()) + if (card.isMounted()) MSC_Aquire_Lock(); else MSC_Release_Lock(); diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL_timers.cpp b/Marlin/src/HAL/HAL_LPC1768/timers.cpp similarity index 97% rename from Marlin/src/HAL/HAL_LPC1768/HAL_timers.cpp rename to Marlin/src/HAL/HAL_LPC1768/timers.cpp index 2274630ca8..7bf7ff3880 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL_timers.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/timers.cpp @@ -29,9 +29,9 @@ #ifdef TARGET_LPC1768 #include "../../inc/MarlinConfig.h" -#include "HAL_timers.h" +#include "timers.h" -void HAL_timer_init(void) { +void HAL_timer_init() { SBI(LPC_SC->PCONP, SBIT_TIMER0); // Power ON Timer 0 LPC_TIM0->PR = (HAL_TIMER_RATE) / (STEPPER_TIMER_RATE) - 1; // Use prescaler to set frequency if needed diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL_timers.h b/Marlin/src/HAL/HAL_LPC1768/timers.h similarity index 99% rename from Marlin/src/HAL/HAL_LPC1768/HAL_timers.h rename to Marlin/src/HAL/HAL_LPC1768/timers.h index 29cb8c437e..73ea728af1 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL_timers.h +++ b/Marlin/src/HAL/HAL_LPC1768/timers.h @@ -53,7 +53,7 @@ #define _HAL_TIMER(T) _CAT(LPC_TIM, T) #define _HAL_TIMER_IRQ(T) TIMER##T##_IRQn -#define __HAL_TIMER_ISR(T) extern "C" void TIMER##T##_IRQHandler(void) +#define __HAL_TIMER_ISR(T) extern "C" void TIMER##T##_IRQHandler() #define _HAL_TIMER_ISR(T) __HAL_TIMER_ISR(T) typedef uint32_t hal_timer_t; @@ -94,7 +94,7 @@ typedef uint32_t hal_timer_t; // ------------------------ // Public functions // ------------------------ -void HAL_timer_init(void); +void HAL_timer_init(); void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) { diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.c similarity index 99% rename from Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c rename to Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.c index 41a19d430f..dc81396b09 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.c @@ -163,7 +163,7 @@ uint8_t u8g_i2c_send_byte(uint8_t data) { return 1; } -void u8g_i2c_stop(void) { +void u8g_i2c_stop() { } diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.h b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.h similarity index 97% rename from Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.h rename to Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.h index 11e05ba0d0..9dd594cd9e 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.h +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_I2C_routines.h @@ -25,4 +25,4 @@ void u8g_i2c_init(uint8_t options); uint8_t u8g_i2c_wait(uint8_t mask, uint8_t pos); uint8_t u8g_i2c_start(uint8_t sla); uint8_t u8g_i2c_send_byte(uint8_t data); -void u8g_i2c_stop(void); +void u8g_i2c_stop(); diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_defines.h b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_defines.h similarity index 100% rename from Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_defines.h rename to Marlin/src/HAL/HAL_LPC1768/u8g/LCD_defines.h diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_delay.h b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h similarity index 95% rename from Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_delay.h rename to Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h index f37773d21c..8806e87477 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_delay.h +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h @@ -35,8 +35,8 @@ #endif void U8g_delay(int msec); -void u8g_MicroDelay(void); -void u8g_10MicroDelay(void); +void u8g_MicroDelay(); +void u8g_10MicroDelay(); #ifdef __cplusplus } diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_pin_routines.c b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.c similarity index 100% rename from Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_pin_routines.c rename to Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.c diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_pin_routines.h b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.h similarity index 100% rename from Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_pin_routines.h rename to Marlin/src/HAL/HAL_LPC1768/u8g/LCD_pin_routines.h diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction index e93ff8b08d..0222c62280 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction @@ -138,7 +138,7 @@ uint8_t u8g_i2c_start_sw(uint8_t sla) { // assert start condition and then send } -void u8g_i2c_stop_sw(void) { } +void u8g_i2c_stop_sw() { } void u8g_i2c_init_sw(uint8_t clock_option) { u8g_i2c_start(0); } // send slave address and write bit diff --git a/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp b/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp index e6729ff58f..55e3628603 100644 --- a/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp @@ -29,7 +29,7 @@ #include "lpc17xx_wdt.h" #include "watchdog.h" -void watchdog_init(void) { +void watchdog_init() { #if ENABLED(WATCHDOG_RESET_MANUAL) // We enable the watchdog timer, but only for the interrupt. @@ -56,11 +56,11 @@ void watchdog_init(void) { WDT_Start(WDT_TIMEOUT); } -void HAL_clear_reset_source(void) { +void HAL_clear_reset_source() { WDT_ClrTimeOutFlag(); } -uint8_t HAL_get_reset_source(void) { +uint8_t HAL_get_reset_source() { if (TEST(WDT_ReadTimeOutFlag(), 0)) return RST_WATCHDOG; return RST_POWER_ON; } @@ -74,10 +74,10 @@ void watchdog_reset() { #else -void watchdog_init(void) {} -void watchdog_reset(void) {} -void HAL_clear_reset_source(void) {} -uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; } +void watchdog_init() {} +void watchdog_reset() {} +void HAL_clear_reset_source() {} +uint8_t HAL_get_reset_source() { return RST_POWER_ON; } #endif // USE_WATCHDOG diff --git a/Marlin/src/HAL/HAL_LPC1768/watchdog.h b/Marlin/src/HAL/HAL_LPC1768/watchdog.h index 04ce17fe9d..5bc06f04f1 100644 --- a/Marlin/src/HAL/HAL_LPC1768/watchdog.h +++ b/Marlin/src/HAL/HAL_LPC1768/watchdog.h @@ -23,7 +23,7 @@ #define WDT_TIMEOUT 4000000 // 4 second timeout -void watchdog_init(void); -void watchdog_reset(void); -void HAL_clear_reset_source(void); -uint8_t HAL_get_reset_source(void); +void watchdog_init(); +void watchdog_reset(); +void HAL_clear_reset_source(); +uint8_t HAL_get_reset_source(); diff --git a/Marlin/src/HAL/HAL_SAMD51/HAL.cpp b/Marlin/src/HAL/HAL_SAMD51/HAL.cpp index dac6037b20..d80dd17aab 100644 --- a/Marlin/src/HAL/HAL_SAMD51/HAL.cpp +++ b/Marlin/src/HAL/HAL_SAMD51/HAL.cpp @@ -368,12 +368,13 @@ uint16_t HAL_adc_result; // ------------------------ // HAL initialization task -void HAL_init(void) { +void HAL_init() { #if DMA_IS_REQUIRED dma_init(); #endif #if ENABLED(SDSUPPORT) - #if SD_CONNECTION_IS(ONBOARD) && PIN_EXISTS(SD_DETECT) // SD_DETECT_PIN may be remove when NO_SD_HOST_DRIVE is not defined in configuration_adv + // SD_DETECT_PIN may be removed if NO_SD_HOST_DRIVE is not defined in Configuration_adv.h + #if SD_CONNECTION_IS(ONBOARD) && PIN_EXISTS(SD_DETECT) SET_INPUT_PULLUP(SD_DETECT_PIN); #endif OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up @@ -382,15 +383,15 @@ void HAL_init(void) { // HAL idle task /* -void HAL_idletask(void) { +void HAL_idletask() { } */ -void HAL_clear_reset_source(void) { } +void HAL_clear_reset_source() { } #pragma push_macro("WDT") #undef WDT // Required to be able to use '.bit.WDT'. Compiler wrongly replace struct field with WDT define -uint8_t HAL_get_reset_source(void) { +uint8_t HAL_get_reset_source() { RSTC_RCAUSE_Type resetCause; resetCause.reg = REG_RSTC_RCAUSE; @@ -420,7 +421,7 @@ int freeMemory() { // ADC // ------------------------ -void HAL_adc_init(void) { +void HAL_adc_init() { #if ADC_IS_REQUIRED memset(HAL_adc_results, 0xFF, sizeof(HAL_adc_results)); // Fill result with invalid values @@ -468,7 +469,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = 0xFFFF; } -uint16_t HAL_adc_get_result(void) { +uint16_t HAL_adc_get_result() { return HAL_adc_result; } diff --git a/Marlin/src/HAL/HAL_SAMD51/HAL.h b/Marlin/src/HAL/HAL_SAMD51/HAL.h index 81095f8a15..3489a4d285 100644 --- a/Marlin/src/HAL/HAL_SAMD51/HAL.h +++ b/Marlin/src/HAL/HAL_SAMD51/HAL.h @@ -25,9 +25,9 @@ #include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" -#include "fastio_SAMD51.h" -#include "watchdog_SAMD51.h" -#include "HAL_timers_SAMD51.h" +#include "fastio.h" +#include "watchdog.h" +#include "timers.h" #ifdef ADAFRUIT_GRAND_CENTRAL_M4 #include "MarlinSerial_AGCM4.h" @@ -91,8 +91,8 @@ typedef int8_t pin_t; #define cli() __disable_irq() // Disable interrupts #define sei() __enable_irq() // Enable interrupts -void HAL_clear_reset_source(void); // clear reset reason -uint8_t HAL_get_reset_source(void); // get reset reason +void HAL_clear_reset_source(); // clear reset reason +uint8_t HAL_get_reset_source(); // get reset reason // // EEPROM @@ -107,14 +107,14 @@ extern uint16_t HAL_adc_result; // result of last ADC conversion #define HAL_ANALOG_SELECT(pin) -void HAL_adc_init(void); +void HAL_adc_init(); #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) #define HAL_READ_ADC() HAL_adc_result #define HAL_ADC_READY() true void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(void); +uint16_t HAL_adc_get_result(); // // Pin Map @@ -131,10 +131,10 @@ void tone(const pin_t _pin, const unsigned int frequency, const unsigned long du void noTone(const pin_t _pin); // Enable hooks into idle and setup for HAL -void HAL_init(void); +void HAL_init(); /* #define HAL_IDLETASK 1 -void HAL_idletask(void); +void HAL_idletask(); */ // @@ -144,5 +144,13 @@ FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" -int freeMemory(void); +int freeMemory(); #pragma GCC diagnostic pop + +#ifdef __cplusplus + extern "C" { +#endif +char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s); +#ifdef __cplusplus + } +#endif diff --git a/Marlin/src/HAL/HAL_SAMD51/HAL_spi_SAMD51.cpp b/Marlin/src/HAL/HAL_SAMD51/HAL_SPI.cpp similarity index 98% rename from Marlin/src/HAL/HAL_SAMD51/HAL_spi_SAMD51.cpp rename to Marlin/src/HAL/HAL_SAMD51/HAL_SPI.cpp index 5235d56cf9..bbd12912a2 100644 --- a/Marlin/src/HAL/HAL_SAMD51/HAL_spi_SAMD51.cpp +++ b/Marlin/src/HAL/HAL_SAMD51/HAL_SPI.cpp @@ -64,7 +64,7 @@ // ------------------------ // Hardware SPI // ------------------------ - void spiBegin(void) { + void spiBegin() { spiInit(SPI_HALF_SPEED); } @@ -92,7 +92,7 @@ * * @details */ - uint8_t spiRec(void) { + uint8_t spiRec() { sdSPI.beginTransaction(spiConfig); uint8_t returnByte = sdSPI.transfer(0xFF); sdSPI.endTransaction(); diff --git a/Marlin/src/HAL/HAL_SAMD51/Servo_SAMD51.cpp b/Marlin/src/HAL/HAL_SAMD51/Servo.cpp similarity index 98% rename from Marlin/src/HAL/HAL_SAMD51/Servo_SAMD51.cpp rename to Marlin/src/HAL/HAL_SAMD51/Servo.cpp index c4fd2d57bc..dbae750425 100644 --- a/Marlin/src/HAL/HAL_SAMD51/Servo_SAMD51.cpp +++ b/Marlin/src/HAL/HAL_SAMD51/Servo.cpp @@ -1,7 +1,7 @@ /** * Marlin 3D Printer Firmware * - * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) * * This program is free software: you can redistribute it and/or modify @@ -33,7 +33,7 @@ #include "../shared/servo.h" #include "../shared/servo_private.h" #include "SAMD51.h" -#include "HAL_timers_SAMD51.h" +#include "timers.h" #define __TC_GCLK_ID(t) TC##t##_GCLK_ID #define _TC_GCLK_ID(t) __TC_GCLK_ID(t) diff --git a/Marlin/src/HAL/HAL_SAMD51/ServoTimers.h b/Marlin/src/HAL/HAL_SAMD51/ServoTimers.h index b1e18729c6..8b77d5b503 100644 --- a/Marlin/src/HAL/HAL_SAMD51/ServoTimers.h +++ b/Marlin/src/HAL/HAL_SAMD51/ServoTimers.h @@ -1,7 +1,7 @@ /** * Marlin 3D Printer Firmware * - * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) * * This program is free software: you can redistribute it and/or modify diff --git a/Marlin/src/HAL/HAL_SAMD51/endstop_interrupts.h b/Marlin/src/HAL/HAL_SAMD51/endstop_interrupts.h index 26c11b6e8b..1f66e02e31 100644 --- a/Marlin/src/HAL/HAL_SAMD51/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_SAMD51/endstop_interrupts.h @@ -112,9 +112,9 @@ && !MATCH_Z_MIN_PROBE_EILINE(P)) // One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } +void endstop_ISR() { endstops.update(); } -void setup_endstop_interrupts(void) { +void setup_endstop_interrupts() { #if HAS_X_MAX #if !AVAILABLE_EILINE(X_MAX_PIN) static_assert(false, "X_MAX_PIN has no EXTINT line available."); diff --git a/Marlin/src/HAL/HAL_SAMD51/fastio_SAMD51.h b/Marlin/src/HAL/HAL_SAMD51/fastio.h similarity index 100% rename from Marlin/src/HAL/HAL_SAMD51/fastio_SAMD51.h rename to Marlin/src/HAL/HAL_SAMD51/fastio.h diff --git a/Marlin/src/HAL/HAL_SAMD51/HAL_timers_SAMD51.cpp b/Marlin/src/HAL/HAL_SAMD51/timers.cpp similarity index 99% rename from Marlin/src/HAL/HAL_SAMD51/HAL_timers_SAMD51.cpp rename to Marlin/src/HAL/HAL_SAMD51/timers.cpp index ea02e839fe..63902c3c5e 100644 --- a/Marlin/src/HAL/HAL_SAMD51/HAL_timers_SAMD51.cpp +++ b/Marlin/src/HAL/HAL_SAMD51/timers.cpp @@ -25,7 +25,7 @@ // Includes // -------------------------------------------------------------------------- #include "../../inc/MarlinConfig.h" -#include "HAL_timers_SAMD51.h" +#include "timers.h" // -------------------------------------------------------------------------- // Local defines diff --git a/Marlin/src/HAL/HAL_SAMD51/HAL_timers_SAMD51.h b/Marlin/src/HAL/HAL_SAMD51/timers.h similarity index 100% rename from Marlin/src/HAL/HAL_SAMD51/HAL_timers_SAMD51.h rename to Marlin/src/HAL/HAL_SAMD51/timers.h diff --git a/Marlin/src/HAL/HAL_SAMD51/watchdog_SAMD51.cpp b/Marlin/src/HAL/HAL_SAMD51/watchdog.cpp similarity index 96% rename from Marlin/src/HAL/HAL_SAMD51/watchdog_SAMD51.cpp rename to Marlin/src/HAL/HAL_SAMD51/watchdog.cpp index fad3410cff..a60bcedd8a 100644 --- a/Marlin/src/HAL/HAL_SAMD51/watchdog_SAMD51.cpp +++ b/Marlin/src/HAL/HAL_SAMD51/watchdog.cpp @@ -25,9 +25,9 @@ #if ENABLED(USE_WATCHDOG) - #include "watchdog_SAMD51.h" + #include "watchdog.h" - void watchdog_init(void) { + void watchdog_init() { // The low-power oscillator used by the WDT runs at 32,768 Hz with // a 1:32 prescale, thus 1024 Hz, though probably not super precise. diff --git a/Marlin/src/HAL/HAL_SAMD51/watchdog_SAMD51.h b/Marlin/src/HAL/HAL_SAMD51/watchdog.h similarity index 100% rename from Marlin/src/HAL/HAL_SAMD51/watchdog_SAMD51.h rename to Marlin/src/HAL/HAL_SAMD51/watchdog.h diff --git a/Marlin/src/HAL/HAL_STM32/HAL.cpp b/Marlin/src/HAL/HAL_STM32/HAL.cpp index dc21069dba..6ecde3ef35 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL.cpp +++ b/Marlin/src/HAL/HAL_STM32/HAL.cpp @@ -60,7 +60,7 @@ uint16_t HAL_adc_result; #endif // HAL initialization task -void HAL_init(void) { +void HAL_init() { FastIO_init(); #if ENABLED(SDSUPPORT) @@ -84,9 +84,9 @@ void HAL_init(void) { #endif // EEPROM_EMULATED_SRAM } -void HAL_clear_reset_source(void) { __HAL_RCC_CLEAR_RESET_FLAGS(); } +void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); } -uint8_t HAL_get_reset_source(void) { +uint8_t HAL_get_reset_source() { if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET) return RST_WATCHDOG; if (__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST) != RESET) return RST_SOFTWARE; if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST) != RESET) return RST_EXTERNAL; @@ -108,8 +108,13 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRead(adc_pin); } -uint16_t HAL_adc_get_result(void) { +uint16_t HAL_adc_get_result() { return HAL_adc_result; } +void flashFirmware(int16_t value) { + UNUSED(value); + NVIC_SystemReset(); +} + #endif // ARDUINO_ARCH_STM32 && !STM32GENERIC diff --git a/Marlin/src/HAL/HAL_STM32/HAL.h b/Marlin/src/HAL/HAL_STM32/HAL.h index ccbe8a7c5d..dae75d42f2 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL.h +++ b/Marlin/src/HAL/HAL_STM32/HAL.h @@ -28,8 +28,8 @@ #include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" -#include "fastio_STM32.h" -#include "watchdog_STM32.h" +#include "fastio.h" +#include "watchdog.h" #include "../../inc/MarlinConfigPre.h" @@ -96,7 +96,7 @@ #define NUM_SERIAL 1 #endif -#include "HAL_timers_STM32.h" +#include "timers.h" /** * TODO: review this to return 1 for pins that are not analog input @@ -147,13 +147,13 @@ extern uint16_t HAL_adc_result; #define __bss_end __bss_end__ // Enable hooks into setup for HAL -void HAL_init(void); +void HAL_init(); // Clear reset reason -void HAL_clear_reset_source (void); +void HAL_clear_reset_source(); // Reset reason -uint8_t HAL_get_reset_source(void); +uint8_t HAL_get_reset_source(); void _delay_ms(const int delay); @@ -169,17 +169,6 @@ static inline int freeMemory() { #pragma GCC diagnostic pop -// -// SPI: Extended functions which take a channel number (hardware SPI only) -// - -// Write single byte to specified SPI channel -void spiSend(uint32_t chan, byte b); -// Write buffer to specified SPI channel -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); -// Read single byte from specified SPI channel -uint8_t spiRec(uint32_t chan); - // // EEPROM // @@ -196,7 +185,7 @@ void eeprom_update_block(const void *__src, void *__dst, size_t __n); #define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT) -inline void HAL_adc_init(void) {} +inline void HAL_adc_init() {} #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) #define HAL_READ_ADC() HAL_adc_result @@ -204,8 +193,11 @@ inline void HAL_adc_init(void) {} void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(void); +uint16_t HAL_adc_get_result(); #define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_INDEX(pin) pin #define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) + +#define PLATFORM_M997_SUPPORT +void flashFirmware(int16_t value); diff --git a/Marlin/src/HAL/HAL_STM32/HAL_spi_STM32.cpp b/Marlin/src/HAL/HAL_STM32/HAL_SPI.cpp similarity index 94% rename from Marlin/src/HAL/HAL_STM32/HAL_spi_STM32.cpp rename to Marlin/src/HAL/HAL_STM32/HAL_SPI.cpp index b2e1ebc175..45bd26d720 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL_spi_STM32.cpp +++ b/Marlin/src/HAL/HAL_STM32/HAL_SPI.cpp @@ -59,7 +59,7 @@ static SPISettings spiConfig; * * @details Only configures SS pin since stm32duino creates and initialize the SPI object */ -void spiBegin(void) { +void spiBegin() { #if !PIN_EXISTS(SS) #error "SS_PIN not defined!" #endif @@ -82,12 +82,7 @@ void spiInit(uint8_t spiRate) { clock = 4000000; // Default from the SPI library } spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0); - #if defined(MISO_PIN) && defined(SDSS) && defined(MOSI_PIN) && defined(SCK_PIN) - SPI.setMISO(MISO_PIN); - SPI.setSSEL(SDSS); - SPI.setMOSI(MOSI_PIN); - SPI.setSCLK(SCK_PIN); - #endif + SPI.begin(); } @@ -98,7 +93,7 @@ void spiInit(uint8_t spiRate) { * * @details */ -uint8_t spiRec(void) { +uint8_t spiRec() { SPI.beginTransaction(spiConfig); uint8_t returnByte = SPI.transfer(0xFF); SPI.endTransaction(); diff --git a/Marlin/src/HAL/HAL_STM32/HAL_Servo_STM32.cpp b/Marlin/src/HAL/HAL_STM32/Servo.cpp similarity index 78% rename from Marlin/src/HAL/HAL_STM32/HAL_Servo_STM32.cpp rename to Marlin/src/HAL/HAL_STM32/Servo.cpp index fa68c48342..2882f071ac 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL_Servo_STM32.cpp +++ b/Marlin/src/HAL/HAL_STM32/Servo.cpp @@ -26,29 +26,29 @@ #if HAS_SERVOS -#include "HAL_Servo_STM32.h" +#include "Servo.h" uint8_t servoPin[MAX_SERVOS] = { 0 }; int8_t libServo::attach(const int pin) { - if (this->servoIndex >= MAX_SERVOS) return -1; - if (pin > 0) servoPin[this->servoIndex] = pin; - return Servo::attach(servoPin[this->servoIndex]); + if (servoIndex >= MAX_SERVOS) return -1; + if (pin > 0) servoPin[servoIndex] = pin; + return super::attach(servoPin[servoIndex]); } int8_t libServo::attach(const int pin, const int min, const int max) { - if (pin > 0) servoPin[this->servoIndex] = pin; - return Servo::attach(servoPin[this->servoIndex], min, max); + if (pin > 0) servoPin[servoIndex] = pin; + return super::attach(servoPin[servoIndex], min, max); } void libServo::move(const int value) { constexpr uint16_t servo_delay[] = SERVO_DELAY; static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long."); - if (this->attach(0) >= 0) { - this->write(value); - safe_delay(servo_delay[this->servoIndex]); + if (attach(0) >= 0) { + write(value); + safe_delay(servo_delay[servoIndex]); #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); + detach(); #endif } } diff --git a/Marlin/src/HAL/HAL_STM32/HAL_Servo_STM32.h b/Marlin/src/HAL/HAL_STM32/Servo.h similarity index 98% rename from Marlin/src/HAL/HAL_STM32/HAL_Servo_STM32.h rename to Marlin/src/HAL/HAL_STM32/Servo.h index a782c130e4..592f3a0662 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL_Servo_STM32.h +++ b/Marlin/src/HAL/HAL_STM32/Servo.h @@ -31,6 +31,7 @@ class libServo : public Servo { int8_t attach(const int pin, const int min, const int max); void move(const int value); private: + typedef Servo super; uint16_t min_ticks, max_ticks; uint8_t servoIndex; // index into the channel data for this servo }; diff --git a/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h b/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h index 86f6d68c59..d0aa731e89 100644 --- a/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h @@ -25,9 +25,9 @@ #include "../../module/endstops.h" // One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } +void endstop_ISR() { endstops.update(); } -void setup_endstop_interrupts(void) { +void setup_endstop_interrupts() { #if HAS_X_MAX attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); #endif diff --git a/Marlin/src/HAL/HAL_STM32/fastio_STM32.cpp b/Marlin/src/HAL/HAL_STM32/fastio.cpp similarity index 100% rename from Marlin/src/HAL/HAL_STM32/fastio_STM32.cpp rename to Marlin/src/HAL/HAL_STM32/fastio.cpp diff --git a/Marlin/src/HAL/HAL_STM32/fastio_STM32.h b/Marlin/src/HAL/HAL_STM32/fastio.h similarity index 100% rename from Marlin/src/HAL/HAL_STM32/fastio_STM32.h rename to Marlin/src/HAL/HAL_STM32/fastio.h diff --git a/Marlin/src/HAL/HAL_STM32/persistent_store_sdcard.cpp b/Marlin/src/HAL/HAL_STM32/persistent_store_sdcard.cpp index 33bff7a7a8..6ce63073c4 100644 --- a/Marlin/src/HAL/HAL_STM32/persistent_store_sdcard.cpp +++ b/Marlin/src/HAL/HAL_STM32/persistent_store_sdcard.cpp @@ -47,7 +47,7 @@ static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE]; #define EEPROM_FILENAME "eeprom.dat" bool PersistentStore::access_start() { - if (!card.isDetected()) return false; + if (!card.isMounted()) return false; SdFile file, root = card.getroot(); if (!file.open(&root, EEPROM_FILENAME, O_RDONLY)) @@ -62,7 +62,7 @@ static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE]; } bool PersistentStore::access_finish() { - if (!card.isDetected()) return false; + if (!card.isMounted()) return false; SdFile file, root = card.getroot(); int bytes_written = 0; diff --git a/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32GENERIC.h b/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32GENERIC.h index 3e66fda657..b1c2562185 100644 --- a/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32GENERIC.h +++ b/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32GENERIC.h @@ -29,9 +29,11 @@ #ifdef BOARD_NR_GPIO_PINS // Only in STM32GENERIC (Maple) #ifdef __STM32F1__ - #include "../HAL_STM32F1/fastio_STM32F1.h" + #include "../HAL_STM32F1/fastio.h" #elif defined(STM32F4) || defined(STM32F7) - #include "../HAL_STM32_F4_F7/fastio_STM32_F4_F7.h" + #include "../HAL_STM32_F4_F7/fastio.h" +#else + #include "fastio.h" #endif extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS]; diff --git a/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32duino.h b/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32duino.h index 138633b502..9d9796eabe 100644 --- a/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32duino.h +++ b/Marlin/src/HAL/HAL_STM32/pinsDebug_STM32duino.h @@ -145,19 +145,19 @@ uint8_t get_pin_mode(const pin_t Ard_num) { case 'D' : mode_all = GPIOD->MODER; break; #ifdef PE_0 case 'E' : mode_all = GPIOE->MODER; break; - #elif defined (PF_0) + #elif defined(PF_0) case 'F' : mode_all = GPIOF->MODER; break; - #elif defined (PG_0) + #elif defined(PG_0) case 'G' : mode_all = GPIOG->MODER; break; - #elif defined (PH_0) + #elif defined(PH_0) case 'H' : mode_all = GPIOH->MODER; break; - #elif defined (PI_0) + #elif defined(PI_0) case 'I' : mode_all = GPIOI->MODER; break; - #elif defined (PJ_0) + #elif defined(PJ_0) case 'J' : mode_all = GPIOJ->MODER; break; - #elif defined (PK_0) + #elif defined(PK_0) case 'K' : mode_all = GPIOK->MODER; break; - #elif defined (PL_0) + #elif defined(PL_0) case 'L' : mode_all = GPIOL->MODER; break; #endif } diff --git a/Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.cpp b/Marlin/src/HAL/HAL_STM32/timers.cpp similarity index 99% rename from Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.cpp rename to Marlin/src/HAL/HAL_STM32/timers.cpp index beefdb3083..51f84e657f 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.cpp +++ b/Marlin/src/HAL/HAL_STM32/timers.cpp @@ -24,7 +24,7 @@ #include "HAL.h" -#include "HAL_timers_STM32.h" +#include "timers.h" // ------------------------ // Local defines diff --git a/Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.h b/Marlin/src/HAL/HAL_STM32/timers.h similarity index 100% rename from Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.h rename to Marlin/src/HAL/HAL_STM32/timers.h diff --git a/Marlin/src/HAL/HAL_STM32/watchdog_STM32.cpp b/Marlin/src/HAL/HAL_STM32/watchdog.cpp similarity index 97% rename from Marlin/src/HAL/HAL_STM32/watchdog_STM32.cpp rename to Marlin/src/HAL/HAL_STM32/watchdog.cpp index ae9f1e3583..8963d55cfc 100644 --- a/Marlin/src/HAL/HAL_STM32/watchdog_STM32.cpp +++ b/Marlin/src/HAL/HAL_STM32/watchdog.cpp @@ -28,7 +28,7 @@ #include "../../inc/MarlinConfig.h" - #include "watchdog_STM32.h" + #include "watchdog.h" #include void watchdog_init() { IWatchdog.begin(4000000); } // 4 sec timeout diff --git a/Marlin/src/HAL/HAL_STM32/watchdog_STM32.h b/Marlin/src/HAL/HAL_STM32/watchdog.h similarity index 100% rename from Marlin/src/HAL/HAL_STM32/watchdog_STM32.h rename to Marlin/src/HAL/HAL_STM32/watchdog.h diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL.cpp b/Marlin/src/HAL/HAL_STM32F1/HAL.cpp index 1af050e203..e1f2e21ffd 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/HAL.cpp @@ -82,7 +82,7 @@ // Public Variables // ------------------------ -#ifdef SERIAL_USB +#if (defined(SERIAL_USB) && !defined(USE_USB_COMPOSITE)) USBSerial SerialUSB; #endif @@ -121,6 +121,15 @@ const uint8_t adc_pins[] = { #if ENABLED(FILAMENT_WIDTH_SENSOR) FILWIDTH_PIN, #endif + #if HAS_JOY_ADC_X + JOY_X_PIN, + #endif + #if HAS_JOY_ADC_Y + JOY_Y_PIN, + #endif + #if HAS_JOY_ADC_Z + JOY_Z_PIN, + #endif }; enum TEMP_PINS : char { @@ -151,15 +160,20 @@ enum TEMP_PINS : char { #if ENABLED(FILAMENT_WIDTH_SENSOR) FILWIDTH, #endif + #if HAS_JOY_ADC_X + JOY_X, + #endif + #if HAS_JOY_ADC_Y + JOY_Y, + #endif + #if HAS_JOY_ADC_Z + JOY_Z, + #endif ADC_PIN_COUNT }; uint16_t HAL_adc_results[ADC_PIN_COUNT]; -// ------------------------ -// Function prototypes -// ------------------------ - // ------------------------ // Private functions // ------------------------ @@ -187,20 +201,23 @@ static void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) { #if SERIAL_PORT > 0 #if SERIAL_PORT2 #if SERIAL_PORT2 > 0 - void board_setup_usb(void) {} + void board_setup_usb() {} #endif #else - void board_setup_usb(void) {} + void board_setup_usb() {} #endif #endif } } #endif -void HAL_init(void) { +void HAL_init() { NVIC_SetPriorityGrouping(0x3); #if PIN_EXISTS(LED) OUT_WRITE(LED_PIN, LOW); #endif + #ifdef USE_USB_COMPOSITE + MSC_SD_init(); + #endif #if PIN_EXISTS(USB_CONNECT) OUT_WRITE(USB_CONNECT_PIN, !USB_CONNECT_INVERTING); // USB clear connection delay(1000); // Give OS time to notice @@ -208,21 +225,39 @@ void HAL_init(void) { #endif } +// HAL idle task +void HAL_idletask() { + #ifdef USE_USB_COMPOSITE + #if ENABLED(SHARED_SD_CARD) + // If Marlin is using the SD card we need to lock it to prevent access from + // a PC via USB. + // Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but + // this will not reliably detect delete operations. To be safe we will lock + // the disk if Marlin has it mounted. Unfortuately there is currently no way + // to unmount the disk from the LCD menu. + // if (IS_SD_PRINTING() || IS_SD_FILE_OPEN()) + /* copy from lpc1768 framework, should be fixed later for process SHARED_SD_CARD*/ + #endif + // process USB mass storage device class loop + MarlinMSC.loop(); + #endif +} + /* VGPV Done with defines // disable interrupts -void cli(void) { noInterrupts(); } +void cli() { noInterrupts(); } // enable interrupts -void sei(void) { interrupts(); } +void sei() { interrupts(); } */ -void HAL_clear_reset_source(void) { } +void HAL_clear_reset_source() { } /** * TODO: Check this and change or remove. * currently returns 1 that's equal to poweron reset. */ -uint8_t HAL_get_reset_source(void) { return 1; } +uint8_t HAL_get_reset_source() { return 1; } void _delay_ms(const int delay_ms) { delay(delay_ms); } @@ -262,7 +297,7 @@ extern "C" { // ADC // ------------------------ // Init the AD in continuous capture mode -void HAL_adc_init(void) { +void HAL_adc_init() { // configure the ADC adc.calibrate(); #if F_CPU > 72000000 @@ -305,6 +340,15 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { #if HAS_TEMP_ADC_5 case TEMP_5_PIN: pin_index = TEMP_5; break; #endif + #if HAS_JOY_ADC_X + case JOY_X_PIN: pin_index = JOY_X; break; + #endif + #if HAS_JOY_ADC_Y + case JOY_Y_PIN: pin_index = JOY_Y; break; + #endif + #if HAS_JOY_ADC_Z + case JOY_Z_PIN: pin_index = JOY_Z; break; + #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) case FILWIDTH_PIN: pin_index = FILWIDTH; break; #endif @@ -312,7 +356,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = (HAL_adc_results[(int)pin_index] >> 2) & 0x3FF; // shift to get 10 bits only. } -uint16_t HAL_adc_get_result(void) { return HAL_adc_result; } +uint16_t HAL_adc_get_result() { return HAL_adc_result; } uint16_t analogRead(pin_t pin) { const bool is_analog = _GET_MODE(pin) == GPIO_INPUT_ANALOG; @@ -325,4 +369,6 @@ void analogWrite(pin_t pin, int pwm_val8) { analogWrite(uint8_t(pin), pwm_val8); } +void flashFirmware(int16_t value) { nvic_sys_reset(); } + #endif // __STM32F1__ diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL.h b/Marlin/src/HAL/HAL_STM32F1/HAL.h index 227b495ed8..f1017c82df 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL.h +++ b/Marlin/src/HAL/HAL_STM32F1/HAL.h @@ -33,30 +33,36 @@ #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" -#include "fastio_STM32F1.h" -#include "watchdog_STM32F1.h" +#include "fastio.h" +#include "watchdog.h" -#include "HAL_timers_STM32F1.h" +#include "timers.h" #include #include #include "../../inc/MarlinConfigPre.h" +#ifdef USE_USB_COMPOSITE + #include "msc_sd.h" +#endif + // ------------------------ // Defines // ------------------------ #ifdef SERIAL_USB - #define UsbSerial Serial + #ifndef USE_USB_COMPOSITE + #define UsbSerial Serial + #else + #define UsbSerial MarlinCompositeSerial + #endif #define MSerial1 Serial1 #define MSerial2 Serial2 #define MSerial3 Serial3 #define MSerial4 Serial4 #define MSerial5 Serial5 #else - extern USBSerial SerialUSB; - #define UsbSerial SerialUSB #define MSerial1 Serial #define MSerial2 Serial1 #define MSerial3 Serial2 @@ -110,7 +116,9 @@ #endif // Set interrupt grouping for this MCU -void HAL_init(void); +void HAL_init(); +#define HAL_IDLETASK 1 +void HAL_idletask(); /** * TODO: review this to return 1 for pins that are not analog input @@ -175,10 +183,10 @@ extern uint16_t HAL_adc_result; #define __bss_end __bss_end__ // Clear reset reason -void HAL_clear_reset_source(void); +void HAL_clear_reset_source(); // Reset reason -uint8_t HAL_get_reset_source(void); +uint8_t HAL_get_reset_source(); void _delay_ms(const int delay); @@ -187,7 +195,7 @@ void _delay_ms(const int delay); /* extern "C" { - int freeMemory(void); + int freeMemory(); } */ @@ -208,17 +216,6 @@ static int freeMemory() { #pragma GCC diagnostic pop -// -// SPI: Extended functions which take a channel number (hardware SPI only) -// - -// Write single byte to specified SPI channel -void spiSend(uint32_t chan, byte b); -// Write buffer to specified SPI channel -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); -// Read single byte from specified SPI channel -uint8_t spiRec(uint32_t chan); - // // EEPROM // @@ -238,14 +235,14 @@ void eeprom_update_block(const void *__src, void *__dst, size_t __n); #define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT_ANALOG); -void HAL_adc_init(void); +void HAL_adc_init(); #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) #define HAL_READ_ADC() HAL_adc_result #define HAL_ADC_READY() true void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(void); +uint16_t HAL_adc_get_result(); uint16_t analogRead(pin_t pin); // need HAL_ANALOG_SELECT() first void analogWrite(pin_t pin, int pwm_val8); // PWM only! mul by 257 in maple!? @@ -256,3 +253,6 @@ void analogWrite(pin_t pin, int pwm_val8); // PWM only! mul by 257 in maple!? #define JTAG_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_SW_ONLY) #define JTAGSWD_DISABLE() afio_cfg_debug_ports(AFIO_DEBUG_NONE) + +#define PLATFORM_M997_SUPPORT +void flashFirmware(int16_t value); diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL_spi_Stm32f1.cpp b/Marlin/src/HAL/HAL_STM32F1/HAL_SPI.cpp similarity index 99% rename from Marlin/src/HAL/HAL_STM32F1/HAL_spi_Stm32f1.cpp rename to Marlin/src/HAL/HAL_STM32F1/HAL_SPI.cpp index 4b8177addb..9f3f34239d 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL_spi_Stm32f1.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/HAL_SPI.cpp @@ -33,7 +33,7 @@ #ifdef __STM32F1__ #include "../../inc/MarlinConfig.h" -#include "SPI.h" +#include // ------------------------ // Public functions @@ -112,7 +112,7 @@ void spiInit(uint8_t spiRate) { * * @details */ -uint8_t spiRec(void) { +uint8_t spiRec() { uint8_t returnByte = SPI.transfer(ff); return returnByte; } diff --git a/Marlin/src/HAL/HAL_STM32F1/SPI.cpp b/Marlin/src/HAL/HAL_STM32F1/SPI.cpp index 3b9d4aeb0c..101b42a53a 100644 --- a/Marlin/src/HAL/HAL_STM32F1/SPI.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/SPI.cpp @@ -31,7 +31,7 @@ #ifdef __STM32F1__ -#include "SPI.h" +#include #include #include @@ -47,12 +47,7 @@ #warning "Unexpected clock speed; SPI frequency calculation will be incorrect" #endif -struct spi_pins { - uint8_t nss; - uint8_t sck; - uint8_t miso; - uint8_t mosi; -}; +struct spi_pins { uint8_t nss, sck, miso, mosi; }; static const spi_pins* dev_to_spi_pins(spi_dev *dev); static void configure_gpios(spi_dev *dev, bool as_master); @@ -64,40 +59,40 @@ static spi_baud_rate determine_baud_rate(spi_dev *dev, uint32_t freq); static const spi_pins board_spi_pins[] __FLASH__ = { #if BOARD_NR_SPI >= 1 - { BOARD_SPI1_NSS_PIN, - BOARD_SPI1_SCK_PIN, - BOARD_SPI1_MISO_PIN, - BOARD_SPI1_MOSI_PIN }, + { BOARD_SPI1_NSS_PIN, + BOARD_SPI1_SCK_PIN, + BOARD_SPI1_MISO_PIN, + BOARD_SPI1_MOSI_PIN }, #endif #if BOARD_NR_SPI >= 2 - { BOARD_SPI2_NSS_PIN, - BOARD_SPI2_SCK_PIN, - BOARD_SPI2_MISO_PIN, - BOARD_SPI2_MOSI_PIN }, + { BOARD_SPI2_NSS_PIN, + BOARD_SPI2_SCK_PIN, + BOARD_SPI2_MISO_PIN, + BOARD_SPI2_MOSI_PIN }, #endif #if BOARD_NR_SPI >= 3 - { BOARD_SPI3_NSS_PIN, - BOARD_SPI3_SCK_PIN, - BOARD_SPI3_MISO_PIN, - BOARD_SPI3_MOSI_PIN }, + { BOARD_SPI3_NSS_PIN, + BOARD_SPI3_SCK_PIN, + BOARD_SPI3_MISO_PIN, + BOARD_SPI3_MOSI_PIN }, #endif }; #if BOARD_NR_SPI >= 1 - static void (*_spi1_this); + static void *_spi1_this; #endif #if BOARD_NR_SPI >= 2 - static void (*_spi2_this); + static void *_spi2_this; #endif #if BOARD_NR_SPI >= 3 - static void (*_spi3_this); + static void *_spi3_this; #endif /** * Constructor */ SPIClass::SPIClass(uint32_t spi_num) { - _currentSetting=&_settings[spi_num-1];// SPI channels are called 1 2 and 3 but the array is zero indexed + _currentSetting = &_settings[spi_num - 1]; // SPI channels are called 1 2 and 3 but the array is zero indexed switch (spi_num) { #if BOARD_NR_SPI >= 1 @@ -149,7 +144,7 @@ SPIClass::SPIClass(uint32_t spi_num) { _currentSetting->state = SPI_STATE_IDLE; } -/* +/** * Set up/tear down */ void SPIClass::updateSettings() { @@ -175,8 +170,7 @@ void SPIClass::beginSlave() { } void SPIClass::end() { - if (!spi_is_enabled(_currentSetting->spi_d)) - return; + if (!spi_is_enabled(_currentSetting->spi_d)) return; // Follows RM0008's sequence for disabling a SPI in master/slave // full duplex mode. @@ -184,8 +178,7 @@ void SPIClass::end() { // FIXME [0.1.0] remove this once you have an interrupt based driver volatile uint16_t rx __attribute__((unused)) = spi_rx_reg(_currentSetting->spi_d); } - while (!spi_is_tx_empty(_currentSetting->spi_d)) {}; - while (spi_is_busy(_currentSetting->spi_d)) {}; + waitSpiTxEnd(_currentSetting->spi_d); spi_peripheral_disable(_currentSetting->spi_d); // added for DMA callbacks. @@ -207,10 +200,10 @@ void SPIClass::setBitOrder(BitOrder bitOrder) { _currentSetting->spi_d->regs->CR1 = cr1; } -/* Victor Perez. Added to test changing datasize from 8 to 16 bit modes on the fly. -* Input parameter should be SPI_CR1_DFF set to 0 or 1 on a 32bit word. -* -*/ +/** + * Victor Perez. Added to test changing datasize from 8 to 16 bit modes on the fly. + * Input parameter should be SPI_CR1_DFF set to 0 or 1 on a 32bit word. + */ void SPIClass::setDataSize(uint32_t datasize) { _currentSetting->dataSize = datasize; uint32_t cr1 = _currentSetting->spi_d->regs->CR1 & ~(SPI_CR1_DFF); @@ -220,29 +213,31 @@ void SPIClass::setDataSize(uint32_t datasize) { } void SPIClass::setDataMode(uint8_t dataMode) { - /* Notes: - As far as I can tell, the AVR numbers for dataMode appear to match the numbers required by the STM32 - From the AVR doc http://www.atmel.com/images/doc2585.pdf section 2.4 - SPI Mode CPOL CPHA Shift SCK-edge Capture SCK-edge - 0 0 0 Falling Rising - 1 0 1 Rising Falling - 2 1 0 Rising Falling - 3 1 1 Falling Rising - - On the STM32 it appears to be - - bit 1 - CPOL : Clock polarity - (This bit should not be changed when communication is ongoing) - 0 : CLK to 0 when idle - 1 : CLK to 1 when idle - - bit 0 - CPHA : Clock phase - (This bit should not be changed when communication is ongoing) - 0 : The first clock transition is the first data capture edge - 1 : The second clock transition is the first data capture edge - - If someone finds this is not the case or sees a logic error with this let me know ;-) - */ + /** + * Notes: + * As far as we know the AVR numbers for dataMode match the numbers required by the STM32. + * From the AVR doc http://www.atmel.com/images/doc2585.pdf section 2.4 + * + * SPI Mode CPOL CPHA Shift SCK-edge Capture SCK-edge + * 0 0 0 Falling Rising + * 1 0 1 Rising Falling + * 2 1 0 Rising Falling + * 3 1 1 Falling Rising + * + * On the STM32 it appears to be + * + * bit 1 - CPOL : Clock polarity + * (This bit should not be changed when communication is ongoing) + * 0 : CLK to 0 when idle + * 1 : CLK to 1 when idle + * + * bit 0 - CPHA : Clock phase + * (This bit should not be changed when communication is ongoing) + * 0 : The first clock transition is the first data capture edge + * 1 : The second clock transition is the first data capture edge + * + * If someone finds this is not the case or sees a logic error with this let me know ;-) + */ _currentSetting->dataMode = dataMode; uint32_t cr1 = _currentSetting->spi_d->regs->CR1 & ~(SPI_CR1_CPOL|SPI_CR1_CPHA); _currentSetting->spi_d->regs->CR1 = cr1 | (dataMode & (SPI_CR1_CPOL|SPI_CR1_CPHA)); @@ -265,13 +260,12 @@ void SPIClass::beginTransactionSlave(SPISettings settings) { void SPIClass::endTransaction() { } - -/* +/** * I/O */ uint16_t SPIClass::read() { - while ( spi_is_rx_nonempty(_currentSetting->spi_d)==0 ) ; + while (!spi_is_rx_nonempty(_currentSetting->spi_d)) { /* nada */ } return (uint16)spi_rx_reg(_currentSetting->spi_d); } @@ -282,16 +276,16 @@ void SPIClass::read(uint8_t *buf, uint32_t len) { // start sequence: write byte 0 regs->DR = 0x00FF; // write the first byte // main loop - while ( (--len) ) { - while( !(regs->SR & SPI_SR_TXE) ); // wait for TXE flag + while (--len) { + while(!(regs->SR & SPI_SR_TXE)) { /* nada */ } // wait for TXE flag noInterrupts(); // go atomic level - avoid interrupts to surely get the previously received data regs->DR = 0x00FF; // write the next data item to be transmitted into the SPI_DR register. This clears the TXE flag. - while ( !(regs->SR & SPI_SR_RXNE) ); // wait till data is available in the DR register + while (!(regs->SR & SPI_SR_RXNE)) { /* nada */ } // wait till data is available in the DR register *buf++ = (uint8)(regs->DR); // read and store the received byte. This clears the RXNE flag. interrupts(); // let systick do its job } // read remaining last byte - while ( !(regs->SR & SPI_SR_RXNE) ) {} // wait till data is available in the Rx register + while (!(regs->SR & SPI_SR_RXNE)) { /* nada */ } // wait till data is available in the Rx register *buf++ = (uint8)(regs->DR); // read and store the received byte } @@ -302,42 +296,38 @@ void SPIClass::write(uint16_t data) { * This almost doubles the speed of this function. */ spi_tx_reg(_currentSetting->spi_d, data); // write the data to be transmitted into the SPI_DR register (this clears the TXE flag) - while (spi_is_tx_empty(_currentSetting->spi_d) == 0); // "5. Wait until TXE=1 ..." - while (spi_is_busy(_currentSetting->spi_d) != 0); // "... and then wait until BSY=0 before disabling the SPI." + waitSpiTxEnd(_currentSetting->spi_d); } void SPIClass::write16(uint16_t data) { // Added by stevestrong: write two consecutive bytes in 8 bit mode (DFF=0) spi_tx_reg(_currentSetting->spi_d, data>>8); // write high byte - while (spi_is_tx_empty(_currentSetting->spi_d) == 0); // Wait until TXE=1 + while (!spi_is_tx_empty(_currentSetting->spi_d)) { /* nada */ } // Wait until TXE=1 spi_tx_reg(_currentSetting->spi_d, data); // write low byte - while (spi_is_tx_empty(_currentSetting->spi_d) == 0); // Wait until TXE=1 - while (spi_is_busy(_currentSetting->spi_d) != 0); // wait until BSY=0 + waitSpiTxEnd(_currentSetting->spi_d); } void SPIClass::write(uint16_t data, uint32_t n) { // Added by stevstrong: Repeatedly send same data by the specified number of times spi_reg_map * regs = _currentSetting->spi_d->regs; - while ( (n--)>0 ) { + while (n--) { regs->DR = data; // write the data to be transmitted into the SPI_DR register (this clears the TXE flag) - while ( (regs->SR & SPI_SR_TXE)==0 ) ; // wait till Tx empty + while (!(regs->SR & SPI_SR_TXE)) { /* nada */ } // wait till Tx empty } - while ( (regs->SR & SPI_SR_BSY) != 0); // wait until BSY=0 before returning + while (regs->SR & SPI_SR_BSY) { /* nada */ } // wait until BSY=0 before returning } void SPIClass::write(const void *data, uint32_t length) { spi_dev * spi_d = _currentSetting->spi_d; spi_tx(spi_d, data, length); // data can be array of bytes or words - while (spi_is_tx_empty(spi_d) == 0); // "5. Wait until TXE=1 ..." - while (spi_is_busy(spi_d) != 0); // "... and then wait until BSY=0 before disabling the SPI." + waitSpiTxEnd(spi_d); } uint8_t SPIClass::transfer(uint8_t byte) const { spi_dev * spi_d = _currentSetting->spi_d; spi_rx_reg(spi_d); // read any previous data spi_tx_reg(spi_d, byte); // Write the data item to be transmitted into the SPI_DR register - while (spi_is_tx_empty(spi_d) == 0); // "5. Wait until TXE=1 ..." - while (spi_is_busy(spi_d) != 0); // "... and then wait until BSY=0 before disabling the SPI." + waitSpiTxEnd(spi_d); return (uint8)spi_rx_reg(spi_d); // "... and read the last received data." } @@ -345,24 +335,23 @@ uint16_t SPIClass::transfer16(uint16_t data) const { // Modified by stevestrong: write & read two consecutive bytes in 8 bit mode (DFF=0) // This is more effective than two distinct byte transfers spi_dev * spi_d = _currentSetting->spi_d; - spi_rx_reg(spi_d); // read any previous data - spi_tx_reg(spi_d, data>>8); // write high byte - while (spi_is_tx_empty(spi_d) == 0); // wait until TXE=1 - while (spi_is_busy(spi_d) != 0); // wait until BSY=0 - uint16_t ret = spi_rx_reg(spi_d)<<8; // read and shift high byte - spi_tx_reg(spi_d, data); // write low byte - while (spi_is_tx_empty(spi_d) == 0); // wait until TXE=1 - while (spi_is_busy(spi_d) != 0); // wait until BSY=0 - ret += spi_rx_reg(spi_d); // read low byte + spi_rx_reg(spi_d); // read any previous data + spi_tx_reg(spi_d, data>>8); // write high byte + waitSpiTxEnd(spi_d); // wait until TXE=1 and then wait until BSY=0 + uint16_t ret = spi_rx_reg(spi_d)<<8; // read and shift high byte + spi_tx_reg(spi_d, data); // write low byte + waitSpiTxEnd(spi_d); // wait until TXE=1 and then wait until BSY=0 + ret += spi_rx_reg(spi_d); // read low byte return ret; } -/* Roger Clark and Victor Perez, 2015 -* Performs a DMA SPI transfer with at least a receive buffer. -* If a TX buffer is not provided, FF is sent over and over for the lenght of the transfer. -* On exit TX buffer is not modified, and RX buffer cotains the received data. -* Still in progress. -*/ +/** + * Roger Clark and Victor Perez, 2015 + * Performs a DMA SPI transfer with at least a receive buffer. + * If a TX buffer is not provided, FF is sent over and over for the lenght of the transfer. + * On exit TX buffer is not modified, and RX buffer cotains the received data. + * Still in progress. + */ void SPIClass::dmaTransferSet(const void *transmitBuf, void *receiveBuf) { dma_init(_currentSetting->spiDmaDev); //spi_rx_dma_enable(_currentSetting->spi_d); @@ -399,13 +388,12 @@ uint8_t SPIClass::dmaTransferRepeat(uint16_t length) { //uint32_t m = millis(); uint8_t b = 0; uint32_t m = millis(); - while ((dma_get_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel) & DMA_ISR_TCIF1) == 0) { - //Avoid interrupts and just loop waiting for the flag to be set. + while (!(dma_get_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel) & DMA_ISR_TCIF1)) { + // Avoid interrupts and just loop waiting for the flag to be set. if ((millis() - m) > DMA_TIMEOUT) { b = 2; break; } } - while (spi_is_tx_empty(_currentSetting->spi_d) == 0); // "5. Wait until TXE=1 ..." - while (spi_is_busy(_currentSetting->spi_d) != 0); // "... and then wait until BSY=0 before disabling the SPI." + waitSpiTxEnd(_currentSetting->spi_d); // until TXE=1 and BSY=0 spi_tx_dma_disable(_currentSetting->spi_d); spi_rx_dma_disable(_currentSetting->spi_d); dma_disable(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); @@ -416,7 +404,8 @@ uint8_t SPIClass::dmaTransferRepeat(uint16_t length) { return b; } -/* Roger Clark and Victor Perez, 2015 +/** + * Roger Clark and Victor Perez, 2015 * Performs a DMA SPI transfer with at least a receive buffer. * If a TX buffer is not provided, FF is sent over and over for the length of the transfer. * On exit TX buffer is not modified, and RX buffer contains the received data. @@ -427,7 +416,8 @@ uint8_t SPIClass::dmaTransfer(const void *transmitBuf, void *receiveBuf, uint16_ return dmaTransferRepeat(length); } -/* Roger Clark and Victor Perez, 2015 +/** + * Roger Clark and Victor Perez, 2015 * Performs a DMA SPI send using a TX buffer. * On exit TX buffer is not modified. * Still in progress. @@ -448,19 +438,17 @@ uint8_t SPIClass::dmaSendRepeat(uint16_t length) { dma_clear_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); dma_set_num_transfers(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel, length); _currentSetting->state = SPI_STATE_TRANSMIT; - dma_enable(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel);// enable transmit + dma_enable(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); // enable transmit spi_tx_dma_enable(_currentSetting->spi_d); - if (_currentSetting->transmitCallback) - return 0; + if (_currentSetting->transmitCallback) return 0; uint32_t m = millis(); uint8_t b = 0; - while ((dma_get_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel) & DMA_ISR_TCIF1)==0) { - //Avoid interrupts and just loop waiting for the flag to be set. + while (!(dma_get_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel) & DMA_ISR_TCIF1)) { + // Avoid interrupts and just loop waiting for the flag to be set. if ((millis() - m) > DMA_TIMEOUT) { b = 2; break; } } - while (spi_is_tx_empty(_currentSetting->spi_d) == 0); // "5. Wait until TXE=1 ..." - while (spi_is_busy(_currentSetting->spi_d) != 0); // "... and then wait until BSY=0 before disabling the SPI." + waitSpiTxEnd(_currentSetting->spi_d); // until TXE=1 and BSY=0 spi_tx_dma_disable(_currentSetting->spi_d); dma_disable(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); dma_clear_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); @@ -478,14 +466,12 @@ uint8_t SPIClass::dmaSendAsync(const void * transmitBuf, uint16_t length, bool m if (_currentSetting->state != SPI_STATE_READY) { uint32_t m = millis(); - while ((dma_get_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel) & DMA_ISR_TCIF1)==0) { + while (!(dma_get_isr_bits(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel) & DMA_ISR_TCIF1)) { //Avoid interrupts and just loop waiting for the flag to be set. //delayMicroseconds(10); if ((millis() - m) > DMA_TIMEOUT) { b = 2; break; } } - - while (spi_is_tx_empty(_currentSetting->spi_d) == 0); // "5. Wait until TXE=1 ..." - while (spi_is_busy(_currentSetting->spi_d) != 0); // "... and then wait until BSY=0 before disabling the SPI." + waitSpiTxEnd(_currentSetting->spi_d); // until TXE=1 and BSY=0 spi_tx_dma_disable(_currentSetting->spi_d); dma_disable(_currentSetting->spiDmaDev, _currentSetting->spiTxDmaChannel); _currentSetting->state = SPI_STATE_READY; @@ -513,7 +499,7 @@ uint8_t SPIClass::dmaSendAsync(const void * transmitBuf, uint16_t length, bool m * New functions added to manage callbacks. * Victor Perez 2017 */ -void SPIClass::onReceive(void(*callback)(void)) { +void SPIClass::onReceive(void(*callback)()) { _currentSetting->receiveCallback = callback; if (callback) { switch (_currentSetting->spi_d->clk_id) { @@ -541,7 +527,7 @@ void SPIClass::onReceive(void(*callback)(void)) { } } -void SPIClass::onTransmit(void(*callback)(void)) { +void SPIClass::onTransmit(void(*callback)()) { _currentSetting->transmitCallback = callback; if (callback) { switch (_currentSetting->spi_d->clk_id) { @@ -575,11 +561,10 @@ void SPIClass::onTransmit(void(*callback)(void)) { * during the initial setup and only set the callback to EventCallback if they are set. */ void SPIClass::EventCallback() { - while (spi_is_tx_empty(_currentSetting->spi_d) == 0); // "5. Wait until TXE=1 ..." - while (spi_is_busy(_currentSetting->spi_d) != 0); // "... and then wait until BSY=0" + waitSpiTxEnd(_currentSetting->spi_d); switch (_currentSetting->state) { case SPI_STATE_TRANSFER: - while (spi_is_rx_nonempty(_currentSetting->spi_d)); + while (spi_is_rx_nonempty(_currentSetting->spi_d)) { /* nada */ } _currentSetting->state = SPI_STATE_READY; spi_tx_dma_disable(_currentSetting->spi_d); spi_rx_dma_disable(_currentSetting->spi_d); @@ -608,7 +593,7 @@ void SPIClass::detachInterrupt() { // Should be disableInterrupt() } -/* +/** * Pin accessors */ @@ -628,25 +613,14 @@ uint8_t SPIClass::nssPin() { return dev_to_spi_pins(_currentSetting->spi_d)->nss; } -/* +/** * Deprecated functions */ +uint8_t SPIClass::send(uint8_t data) { write(data); return 1; } +uint8_t SPIClass::send(uint8_t *buf, uint32_t len) { write(buf, len); return len; } +uint8_t SPIClass::recv() { return read(); } -uint8_t SPIClass::send(uint8_t data) { - this->write(data); - return 1; -} - -uint8_t SPIClass::send(uint8_t *buf, uint32_t len) { - this->write(buf, len); - return len; -} - -uint8_t SPIClass::recv() { - return this->read(); -} - -/* +/** * DMA call back functions, one per port. */ #if BOARD_NR_SPI >= 1 @@ -665,7 +639,7 @@ uint8_t SPIClass::recv() { } #endif -/* +/** * Auxiliary functions */ static const spi_pins* dev_to_spi_pins(spi_dev *dev) { @@ -718,10 +692,10 @@ static const spi_baud_rate baud_rates[8] __FLASH__ = { SPI_BAUD_PCLK_DIV_256, }; -/* -* Note: This assumes you're on a LeafLabs-style board -* (CYCLES_PER_MICROSECOND == 72, APB2 at 72MHz, APB1 at 36MHz). -*/ +/** + * Note: This assumes you're on a LeafLabs-style board + * (CYCLES_PER_MICROSECOND == 72, APB2 at 72MHz, APB1 at 36MHz). + */ static spi_baud_rate determine_baud_rate(spi_dev *dev, uint32_t freq) { uint32_t clock = 0; switch (rcc_dev_clk(dev->clk_id)) { diff --git a/Marlin/src/HAL/HAL_STM32F1/SPI.h b/Marlin/src/HAL/HAL_STM32F1/SPI.h index 1e77bf1066..0162ac13bb 100644 --- a/Marlin/src/HAL/HAL_STM32F1/SPI.h +++ b/Marlin/src/HAL/HAL_STM32F1/SPI.h @@ -58,7 +58,7 @@ #define SPI_2XCLOCK_MASK 0x01 // SPI2X = bit 0 on SPSR // define SPI_AVR_EIMSK for AVR boards with external interrupt pins -#if defined(EIMSK) +#ifdef EIMSK #define SPI_AVR_EIMSK EIMSK #elif defined(GICR) #define SPI_AVR_EIMSK GICR @@ -96,36 +96,36 @@ typedef enum { class SPISettings { public: - SPISettings(uint32_t clock, BitOrder bitOrder, uint8_t dataMode) { - if (__builtin_constant_p(clock)) - init_AlwaysInline(clock, bitOrder, dataMode, DATA_SIZE_8BIT); + SPISettings(uint32_t inClock, BitOrder inBitOrder, uint8_t inDataMode) { + if (__builtin_constant_p(inClock)) + init_AlwaysInline(inClock, inBitOrder, inDataMode, DATA_SIZE_8BIT); else - init_MightInline(clock, bitOrder, dataMode, DATA_SIZE_8BIT); + init_MightInline(inClock, inBitOrder, inDataMode, DATA_SIZE_8BIT); } - SPISettings(uint32_t clock, BitOrder bitOrder, uint8_t dataMode, uint32_t dataSize) { - if (__builtin_constant_p(clock)) - init_AlwaysInline(clock, bitOrder, dataMode, dataSize); + SPISettings(uint32_t inClock, BitOrder inBitOrder, uint8_t inDataMode, uint32_t inDataSize) { + if (__builtin_constant_p(inClock)) + init_AlwaysInline(inClock, inBitOrder, inDataMode, inDataSize); else - init_MightInline(clock, bitOrder, dataMode, dataSize); + init_MightInline(inClock, inBitOrder, inDataMode, inDataSize); } - SPISettings(uint32_t clock) { - if (__builtin_constant_p(clock)) - init_AlwaysInline(clock, MSBFIRST, SPI_MODE0, DATA_SIZE_8BIT); + SPISettings(uint32_t inClock) { + if (__builtin_constant_p(inClock)) + init_AlwaysInline(inClock, MSBFIRST, SPI_MODE0, DATA_SIZE_8BIT); else - init_MightInline(clock, MSBFIRST, SPI_MODE0, DATA_SIZE_8BIT); + init_MightInline(inClock, MSBFIRST, SPI_MODE0, DATA_SIZE_8BIT); } SPISettings() { init_AlwaysInline(4000000, MSBFIRST, SPI_MODE0, DATA_SIZE_8BIT); } private: - void init_MightInline(uint32_t clock, BitOrder bitOrder, uint8_t dataMode, uint32_t dataSize) { - init_AlwaysInline(clock, bitOrder, dataMode, dataSize); + void init_MightInline(uint32_t inClock, BitOrder inBitOrder, uint8_t inDataMode, uint32_t inDataSize) { + init_AlwaysInline(inClock, inBitOrder, inDataMode, inDataSize); } - void init_AlwaysInline(uint32_t clock, BitOrder bitOrder, uint8_t dataMode, uint32_t dataSize) __attribute__((__always_inline__)) { - this->clock = clock; - this->bitOrder = bitOrder; - this->dataMode = dataMode; - this->dataSize = dataSize; + void init_AlwaysInline(uint32_t inClock, BitOrder inBitOrder, uint8_t inDataMode, uint32_t inDataSize) __attribute__((__always_inline__)) { + clock = inClock; + bitOrder = inBitOrder; + dataMode = inDataMode; + dataSize = inDataSize; } uint32_t clock; uint32_t dataSize; @@ -137,8 +137,8 @@ private: spi_dev *spi_d; dma_channel spiRxDmaChannel, spiTxDmaChannel; dma_dev* spiDmaDev; - void (*receiveCallback)(void) = NULL; - void (*transmitCallback)(void) = NULL; + void (*receiveCallback)() = NULL; + void (*transmitCallback)() = NULL; friend class SPIClass; }; @@ -213,8 +213,8 @@ public: * onTransmit used to set the callback in case of dmaSend (tx only). That function * will NOT be called in case of TX/RX */ - void onReceive(void(*)(void)); - void onTransmit(void(*)(void)); + void onReceive(void(*)()); + void onTransmit(void(*)()); /* * I/O @@ -327,7 +327,7 @@ public: * @brief Get a pointer to the underlying libmaple spi_dev for * this HardwareSPI instance. */ - spi_dev* c_dev(void) { return _currentSetting->spi_d; } + spi_dev* c_dev() { return _currentSetting->spi_d; } spi_dev* dev() { return _currentSetting->spi_d; } @@ -339,7 +339,7 @@ public: * or 1-3 in high density devices. */ void setModule(int spi_num) { - _currentSetting=&_settings[spi_num-1];// SPI channels are called 1 2 and 3 but the array is zero indexed + _currentSetting = &_settings[spi_num - 1];// SPI channels are called 1 2 and 3 but the array is zero indexed } /* -- The following methods are deprecated --------------------------- */ @@ -406,4 +406,12 @@ private: */ }; +/** + * @brief Wait until TXE (tx empty) flag is set and BSY (busy) flag unset. + */ +static inline void waitSpiTxEnd(spi_dev *spi_d) { + while (spi_is_tx_empty(spi_d) == 0) { /* nada */ } // wait until TXE=1 + while (spi_is_busy(spi_d) != 0) { /* nada */ } // wait until BSY=0 +} + extern SPIClass SPI; diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL_Servo_Stm32f1.cpp b/Marlin/src/HAL/HAL_STM32F1/Servo.cpp similarity index 68% rename from Marlin/src/HAL/HAL_STM32F1/HAL_Servo_Stm32f1.cpp rename to Marlin/src/HAL/HAL_STM32F1/Servo.cpp index 7fbc0f61d0..5dc2169154 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL_Servo_Stm32f1.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/Servo.cpp @@ -29,8 +29,8 @@ uint8_t ServoCount = 0; -#include "HAL_Servo_STM32F1.h" -#include "HAL_timers_STM32F1.h" +#include "Servo.h" +#include "timers.h" //#include "Servo.h" @@ -56,52 +56,50 @@ uint8_t ServoCount = 0; #define SERVO_OVERFLOW ((uint16_t)round((double)TAU_CYC / SERVO_PRESCALER)) // Unit conversions -#define US_TO_COMPARE(us) ((uint16_t)map((us), 0, TAU_USEC, 0, SERVO_OVERFLOW)) -#define COMPARE_TO_US(c) ((uint32_t)map((c), 0, SERVO_OVERFLOW, 0, TAU_USEC)) -#define ANGLE_TO_US(a) ((uint16_t)(map((a), this->minAngle, this->maxAngle, \ - SERVO_DEFAULT_MIN_PW, SERVO_DEFAULT_MAX_PW))) -#define US_TO_ANGLE(us) ((int16_t)(map((us), SERVO_DEFAULT_MIN_PW, SERVO_DEFAULT_MAX_PW, \ - this->minAngle, this->maxAngle))) +#define US_TO_COMPARE(us) uint16_t(map((us), 0, TAU_USEC, 0, SERVO_OVERFLOW)) +#define COMPARE_TO_US(c) uint32_t(map((c), 0, SERVO_OVERFLOW, 0, TAU_USEC)) +#define ANGLE_TO_US(a) uint16_t(map((a), minAngle, maxAngle, SERVO_DEFAULT_MIN_PW, SERVO_DEFAULT_MAX_PW)) +#define US_TO_ANGLE(us) int16_t(map((us), SERVO_DEFAULT_MIN_PW, SERVO_DEFAULT_MAX_PW, minAngle, maxAngle)) -void libServo::servoWrite(uint8_t pin, uint16_t duty_cycle) { +void libServo::servoWrite(uint8_t inPin, uint16_t duty_cycle) { #ifdef SERVO0_TIMER_NUM - if (this->servoIndex == 0) { - this->pwmSetDuty(duty_cycle); + if (servoIndex == 0) { + pwmSetDuty(duty_cycle); return; } #endif - timer_dev *tdev = PIN_MAP[pin].timer_device; - uint8_t tchan = PIN_MAP[pin].timer_channel; + timer_dev *tdev = PIN_MAP[inPin].timer_device; + uint8_t tchan = PIN_MAP[inPin].timer_channel; if (tdev) timer_set_compare(tdev, tchan, duty_cycle); } libServo::libServo() { - this->servoIndex = ServoCount < MAX_SERVOS ? ServoCount++ : INVALID_SERVO; + servoIndex = ServoCount < MAX_SERVOS ? ServoCount++ : INVALID_SERVO; } -bool libServo::attach(const int32_t pin, const int32_t minAngle, const int32_t maxAngle) { - if (this->servoIndex >= MAX_SERVOS) return false; - if (pin >= BOARD_NR_GPIO_PINS) return false; +bool libServo::attach(const int32_t inPin, const int32_t inMinAngle, const int32_t inMaxAngle) { + if (servoIndex >= MAX_SERVOS) return false; + if (inPin >= BOARD_NR_GPIO_PINS) return false; - this->minAngle = minAngle; - this->maxAngle = maxAngle; - this->angle = -1; + minAngle = inMinAngle; + maxAngle = inMaxAngle; + angle = -1; #ifdef SERVO0_TIMER_NUM - if (this->servoIndex == 0 && this->setupSoftPWM(pin)) { - this->pin = pin; // set attached() + if (servoIndex == 0 && setupSoftPWM(inPin)) { + pin = inPin; // set attached() return true; } #endif - if (!PWM_PIN(pin)) return false; + if (!PWM_PIN(inPin)) return false; - timer_dev *tdev = PIN_MAP[pin].timer_device; - //uint8_t tchan = PIN_MAP[pin].timer_channel; + timer_dev *tdev = PIN_MAP[inPin].timer_device; + //uint8_t tchan = PIN_MAP[inPin].timer_channel; - SET_PWM(pin); - servoWrite(pin, 0); + SET_PWM(inPin); + servoWrite(inPin, 0); timer_pause(tdev); timer_set_prescaler(tdev, SERVO_PRESCALER - 1); // prescaler is 1-based @@ -109,25 +107,24 @@ bool libServo::attach(const int32_t pin, const int32_t minAngle, const int32_t m timer_generate_update(tdev); timer_resume(tdev); - this->pin = pin; // set attached() - + pin = inPin; // set attached() return true; } bool libServo::detach() { - if (!this->attached()) return false; - this->angle = -1; - servoWrite(this->pin, 0); + if (!attached()) return false; + angle = -1; + servoWrite(pin, 0); return true; } int32_t libServo::read() const { - if (this->attached()) { + if (attached()) { #ifdef SERVO0_TIMER_NUM - if (this->servoIndex == 0) return this->angle; + if (servoIndex == 0) return angle; #endif - timer_dev *tdev = PIN_MAP[this->pin].timer_device; - uint8_t tchan = PIN_MAP[this->pin].timer_channel; + timer_dev *tdev = PIN_MAP[pin].timer_device; + uint8_t tchan = PIN_MAP[pin].timer_channel; return US_TO_ANGLE(COMPARE_TO_US(timer_get_compare(tdev, tchan))); } return 0; @@ -137,18 +134,18 @@ void libServo::move(const int32_t value) { constexpr uint16_t servo_delay[] = SERVO_DELAY; static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long."); - if (this->attached()) { - this->angle = constrain(value, this->minAngle, this->maxAngle); - servoWrite(this->pin, US_TO_COMPARE(ANGLE_TO_US(this->angle))); - safe_delay(servo_delay[this->servoIndex]); + if (attached()) { + angle = constrain(value, minAngle, maxAngle); + servoWrite(pin, US_TO_COMPARE(ANGLE_TO_US(angle))); + safe_delay(servo_delay[servoIndex]); #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); + detach(); #endif } } #ifdef SERVO0_TIMER_NUM - extern "C" void Servo_IRQHandler(void) { + extern "C" void Servo_IRQHandler() { static timer_dev *tdev = get_timer_dev(SERVO0_TIMER_NUM); uint16_t SR = timer_get_status(tdev); if (SR & TIMER_SR_CC1IF) { // channel 1 off @@ -169,13 +166,13 @@ void libServo::move(const int32_t value) { } } - bool libServo::setupSoftPWM(const int32_t pin) { + bool libServo::setupSoftPWM(const int32_t inPin) { timer_dev *tdev = get_timer_dev(SERVO0_TIMER_NUM); if (!tdev) return false; #ifdef SERVO0_PWM_OD - OUT_WRITE_OD(pin, 1); + OUT_WRITE_OD(inPin, 1); #else - OUT_WRITE(pin, 0); + OUT_WRITE(inPin, 0); #endif timer_pause(tdev); @@ -206,9 +203,9 @@ void libServo::move(const int32_t value) { timer_disable_irq(tdev, 1); timer_disable_irq(tdev, 2); #ifdef SERVO0_PWM_OD - OUT_WRITE_OD(this->pin, 1); // off + OUT_WRITE_OD(pin, 1); // off #else - OUT_WRITE(this->pin, 0); + OUT_WRITE(pin, 0); #endif } } @@ -221,7 +218,7 @@ void libServo::move(const int32_t value) { #else - bool libServo::setupSoftPWM(const int32_t pin) { return false; } + bool libServo::setupSoftPWM(const int32_t inPin) { return false; } void libServo::pwmSetDuty(const uint16_t duty_cycle) {} void libServo::pauseSoftPWM() {} diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL_Servo_Stm32f1.h b/Marlin/src/HAL/HAL_STM32F1/Servo.h similarity index 96% rename from Marlin/src/HAL/HAL_STM32F1/HAL_Servo_Stm32f1.h rename to Marlin/src/HAL/HAL_STM32F1/Servo.h index f97ca7486b..92f4dd678d 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL_Servo_Stm32f1.h +++ b/Marlin/src/HAL/HAL_STM32F1/Servo.h @@ -41,7 +41,7 @@ class libServo { public: libServo(); bool attach(const int32_t pin, const int32_t minAngle=SERVO_DEFAULT_MIN_ANGLE, const int32_t maxAngle=SERVO_DEFAULT_MAX_ANGLE); - bool attached() const { return this->pin != NOT_ATTACHED; } + bool attached() const { return pin != NOT_ATTACHED; } bool detach(); void move(const int32_t value); int32_t read() const; diff --git a/Marlin/src/HAL/HAL_STM32F1/stm32f1_flag_script.py b/Marlin/src/HAL/HAL_STM32F1/build_flags.py similarity index 100% rename from Marlin/src/HAL/HAL_STM32F1/stm32f1_flag_script.py rename to Marlin/src/HAL/HAL_STM32F1/build_flags.py diff --git a/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp b/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp index 35b10a2a5d..9d569772fa 100644 --- a/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/dogm/u8g_com_stm32duino_fsmc.cpp @@ -113,7 +113,7 @@ uint8_t u8g_com_stm32duino_fsmc_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, voi #define __ASM __asm #define __STATIC_INLINE static inline -__attribute__((always_inline)) __STATIC_INLINE void __DSB(void) { +__attribute__((always_inline)) __STATIC_INLINE void __DSB() { __ASM volatile ("dsb 0xF":::"memory"); } diff --git a/Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h b/Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h index 830f0075c0..d043b3b8db 100644 --- a/Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h @@ -50,9 +50,9 @@ #include "../../module/endstops.h" // One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } +void endstop_ISR() { endstops.update(); } -void setup_endstop_interrupts(void) { +void setup_endstop_interrupts() { #if HAS_X_MAX attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); // assign it #endif diff --git a/Marlin/src/HAL/HAL_STM32F1/fastio_Stm32f1.h b/Marlin/src/HAL/HAL_STM32F1/fastio.h similarity index 100% rename from Marlin/src/HAL/HAL_STM32F1/fastio_Stm32f1.h rename to Marlin/src/HAL/HAL_STM32F1/fastio.h diff --git a/Marlin/src/HAL/HAL_STM32F1/maple_win_usb_driver/maple_serial.inf b/Marlin/src/HAL/HAL_STM32F1/maple_win_usb_driver/maple_serial.inf new file mode 100644 index 0000000000..c39f4ce0ed --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/maple_win_usb_driver/maple_serial.inf @@ -0,0 +1,56 @@ +; +; STMicroelectronics Communication Device Class driver installation file +; (C)2006 Copyright STMicroelectronics +; + +[Version] +Signature="$Windows NT$" +Class=Ports +ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} +Provider=%STM% +LayoutFile=layout.inf + +[Manufacturer] +%MFGNAME%=VirComDevice,NT,NTamd64 + +[DestinationDirs] +DefaultDestDir = 12 + +[VirComDevice.NT] +%DESCRIPTION%=DriverInstall,USB\VID_1EAF&PID_0029&MI_01 +%DESCRIPTION%=DriverInstall,USB\VID_1EAF&PID_0029&MI_01 + +[VirComDevice.NTamd64] +%DESCRIPTION%=DriverInstall,USB\VID_1EAF&PID_0029&MI_01 +%DESCRIPTION%=DriverInstall,USB\VID_1EAF&PID_0029&MI_01 + +[DriverInstall.NT] +Include=mdmcpq.inf +CopyFiles=FakeModemCopyFileSection +AddReg=DriverInstall.NT.AddReg + +[DriverInstall.NT.AddReg] +HKR,,DevLoader,,*ntkern +HKR,,NTMPDriver,,usbser.sys +HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" + +[DriverInstall.NT.Services] +AddService=usbser, 0x00000002, DriverServiceInst + +[DriverServiceInst] +DisplayName=%SERVICE% +ServiceType=1 +StartType=3 +ErrorControl=1 +ServiceBinary=%12%\usbser.sys + +;------------------------------------------------------------------------------ +; String Definitions +;------------------------------------------------------------------------------ + + +[Strings] +STM = "LeafLabs" +MFGNAME = "LeafLabs" +DESCRIPTION = "Maple R3" +SERVICE = "USB Virtual COM port" diff --git a/Marlin/src/HAL/HAL_STM32F1/msc_sd.cpp b/Marlin/src/HAL/HAL_STM32F1/msc_sd.cpp new file mode 100644 index 0000000000..81e430fa2a --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/msc_sd.cpp @@ -0,0 +1,64 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech] + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#ifdef USE_USB_COMPOSITE + +#include "msc_sd.h" +#include "SPI.h" + +#define PRODUCT_ID 0x29 + +USBMassStorage MarlinMSC; +USBCompositeSerial MarlinCompositeSerial; + +#include "../../inc/MarlinConfig.h" + +#ifdef HAS_ONBOARD_SD + + #include "onboard_sd.h" + + static bool MSC_Write(const uint8_t *writebuff, uint32_t startSector, uint16_t numSectors) { + return (disk_write(0, writebuff, startSector, numSectors) == RES_OK); + } + static bool MSC_Read(uint8_t *readbuff, uint32_t startSector, uint16_t numSectors) { + return (disk_read(0, readbuff, startSector, numSectors) == RES_OK); + } + +#endif + +void MSC_SD_init() { + USBComposite.setProductId(PRODUCT_ID); + // Just set MarlinCompositeSerial enabled to true + // because when MarlinCompositeSerial.begin() is used in setup() + // it clears all USBComposite devices. + MarlinCompositeSerial.begin(); + USBComposite.end(); + USBComposite.clear(); + // Set api and register mass storage + #ifdef HAS_ONBOARD_SD + uint32_t cardSize; + if (disk_initialize(0) == RES_OK) { + if (disk_ioctl(0, GET_SECTOR_COUNT, (void *)(&cardSize)) == RES_OK) { + MarlinMSC.setDriveData(0, cardSize, MSC_Read, MSC_Write); + MarlinMSC.registerComponent(); + } + } + #endif + // Register composite Serial + MarlinCompositeSerial.registerComponent(); + USBComposite.begin(); +} + +#endif // USE_USB_COMPOSITE diff --git a/Marlin/src/HAL/HAL_STM32F1/msc_sd.h b/Marlin/src/HAL/HAL_STM32F1/msc_sd.h new file mode 100644 index 0000000000..9f06ca5fdb --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/msc_sd.h @@ -0,0 +1,23 @@ +/** + * Marlin 3D Printer Firmware + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech] + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include + +extern USBMassStorage MarlinMSC; +extern USBCompositeSerial MarlinCompositeSerial; + +void MSC_SD_init(); diff --git a/Marlin/src/HAL/HAL_STM32F1/onboard_sd.cpp b/Marlin/src/HAL/HAL_STM32F1/onboard_sd.cpp new file mode 100644 index 0000000000..6e9432896d --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/onboard_sd.cpp @@ -0,0 +1,556 @@ +/** + * STM32F1: MMCv3/SDv1/SDv2 (SPI mode) control module + * + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech] + * Copyright (C) 2015, ChaN, all right reserved. + * + * This software is a free software and there is NO WARRANTY. + * No restriction on use. You can use, modify and redistribute it for + * personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY. + * Redistributions of source code must retain the above copyright notice. + * + */ + +#include "../../inc/MarlinConfig.h" + +#ifdef HAS_ONBOARD_SD + +#include "onboard_sd.h" +#include "SPI.h" +#include "fastio.h" + +#ifdef SHARED_SD_CARD + #ifndef ON_BOARD_SPI_DEVICE + #define ON_BOARD_SPI_DEVICE SPI_DEVICE + #endif + #define ONBOARD_SD_SPI SPI +#else + SPIClass OnBoardSPI(ON_BOARD_SPI_DEVICE); + #define ONBOARD_SD_SPI OnBoardSPI +#endif + +#if ON_BOARD_SPI_DEVICE == 1 + #define SPI_CLOCK_MAX SPI_BAUD_PCLK_DIV_4 +#else + #define SPI_CLOCK_MAX SPI_BAUD_PCLK_DIV_2 +#endif + +#define CS_LOW() {WRITE(ONBOARD_SD_CS_PIN, LOW);} /* Set OnBoardSPI cs low */ +#define CS_HIGH() {WRITE(ONBOARD_SD_CS_PIN, HIGH);} /* Set OnBoardSPI cs high */ + +#define FCLK_FAST() ONBOARD_SD_SPI.setClockDivider(SPI_CLOCK_MAX) +#define FCLK_SLOW() ONBOARD_SD_SPI.setClockDivider(SPI_BAUD_PCLK_DIV_256) + +/*-------------------------------------------------------------------------- + Module Private Functions +---------------------------------------------------------------------------*/ + +/* MMC/SD command */ +#define CMD0 (0) /* GO_IDLE_STATE */ +#define CMD1 (1) /* SEND_OP_COND (MMC) */ +#define ACMD41 (0x80+41) /* SEND_OP_COND (SDC) */ +#define CMD8 (8) /* SEND_IF_COND */ +#define CMD9 (9) /* SEND_CSD */ +#define CMD10 (10) /* SEND_CID */ +#define CMD12 (12) /* STOP_TRANSMISSION */ +#define ACMD13 (0x80+13) /* SD_STATUS (SDC) */ +#define CMD16 (16) /* SET_BLOCKLEN */ +#define CMD17 (17) /* READ_SINGLE_BLOCK */ +#define CMD18 (18) /* READ_MULTIPLE_BLOCK */ +#define CMD23 (23) /* SET_BLOCK_COUNT (MMC) */ +#define ACMD23 (0x80+23) /* SET_WR_BLK_ERASE_COUNT (SDC) */ +#define CMD24 (24) /* WRITE_BLOCK */ +#define CMD25 (25) /* WRITE_MULTIPLE_BLOCK */ +#define CMD32 (32) /* ERASE_ER_BLK_START */ +#define CMD33 (33) /* ERASE_ER_BLK_END */ +#define CMD38 (38) /* ERASE */ +#define CMD48 (48) /* READ_EXTR_SINGLE */ +#define CMD49 (49) /* WRITE_EXTR_SINGLE */ +#define CMD55 (55) /* APP_CMD */ +#define CMD58 (58) /* READ_OCR */ + +static volatile DSTATUS Stat = STA_NOINIT; /* Physical drive status */ +static volatile UINT timeout; +static BYTE CardType; /* Card type flags */ + +/*-----------------------------------------------------------------------*/ +/* Send/Receive data to the MMC (Platform dependent) */ +/*-----------------------------------------------------------------------*/ + +/* Exchange a byte */ +static BYTE xchg_spi ( + BYTE dat /* Data to send */ +) { + BYTE returnByte = ONBOARD_SD_SPI.transfer(dat); + return returnByte; +} + +/* Receive multiple byte */ +static void rcvr_spi_multi ( + BYTE *buff, /* Pointer to data buffer */ + UINT btr /* Number of bytes to receive (16, 64 or 512) */ +) { + ONBOARD_SD_SPI.dmaTransfer(0, const_cast(buff), btr); +} + +#if _DISKIO_WRITE + + /* Send multiple bytes */ + static void xmit_spi_multi ( + const BYTE *buff, /* Pointer to the data */ + UINT btx /* Number of bytes to send (multiple of 16) */ + ) { + ONBOARD_SD_SPI.dmaSend(const_cast(buff), btx); + } + +#endif // _DISKIO_WRITE + +/*-----------------------------------------------------------------------*/ +/* Wait for card ready */ +/*-----------------------------------------------------------------------*/ + +static int wait_ready ( /* 1:Ready, 0:Timeout */ + UINT wt /* Timeout [ms] */ +) { + BYTE d; + + timeout = millis() + wt; + do { + d = xchg_spi(0xFF); + /* This loop takes a while. Insert rot_rdq() here for multitask environment. */ + } while (d != 0xFF && (timeout > millis())); /* Wait for card goes ready or timeout */ + + return (d == 0xFF) ? 1 : 0; +} + +/*-----------------------------------------------------------------------*/ +/* Deselect card and release SPI */ +/*-----------------------------------------------------------------------*/ + +static void deselect() { + CS_HIGH(); /* CS = H */ + xchg_spi(0xFF); /* Dummy clock (force DO hi-z for multiple slave SPI) */ +} + +/*-----------------------------------------------------------------------*/ +/* Select card and wait for ready */ +/*-----------------------------------------------------------------------*/ + +static int select() { /* 1:OK, 0:Timeout */ + CS_LOW(); /* CS = L */ + xchg_spi(0xFF); /* Dummy clock (force DO enabled) */ + + if (wait_ready(500)) return 1; /* Leading busy check: Wait for card ready */ + + deselect(); /* Timeout */ + return 0; +} + +/*-----------------------------------------------------------------------*/ +/* Control SPI module (Platform dependent) */ +/*-----------------------------------------------------------------------*/ + +static void power_on() { /* Enable SSP module and attach it to I/O pads */ + ONBOARD_SD_SPI.setModule(ON_BOARD_SPI_DEVICE); + ONBOARD_SD_SPI.begin(); + ONBOARD_SD_SPI.setBitOrder(MSBFIRST); + ONBOARD_SD_SPI.setDataMode(SPI_MODE0); + OUT_WRITE(ONBOARD_SD_CS_PIN, HIGH); /* Set CS# high */ +} + +static void power_off() { /* Disable SPI function */ + select(); /* Wait for card ready */ + deselect(); +} + +/*-----------------------------------------------------------------------*/ +/* Receive a data packet from the MMC */ +/*-----------------------------------------------------------------------*/ + +static int rcvr_datablock ( /* 1:OK, 0:Error */ + BYTE *buff, /* Data buffer */ + UINT btr /* Data block length (byte) */ +) { + BYTE token; + + timeout = millis() + 200; + do { /* Wait for DataStart token in timeout of 200ms */ + token = xchg_spi(0xFF); + /* This loop will take a while. Insert rot_rdq() here for multitask environment. */ + } while ((token == 0xFF) && (timeout > millis())); + if (token != 0xFE) return 0; /* Function fails if invalid DataStart token or timeout */ + + rcvr_spi_multi(buff, btr); /* Store trailing data to the buffer */ + xchg_spi(0xFF); xchg_spi(0xFF); /* Discard CRC */ + + return 1; /* Function succeeded */ +} + +/*-----------------------------------------------------------------------*/ +/* Send a data packet to the MMC */ +/*-----------------------------------------------------------------------*/ + +#if _DISKIO_WRITE + + static int xmit_datablock ( /* 1:OK, 0:Failed */ + const BYTE *buff, /* Ponter to 512 byte data to be sent */ + BYTE token /* Token */ + ) { + BYTE resp; + + if (!wait_ready(500)) return 0; /* Leading busy check: Wait for card ready to accept data block */ + + xchg_spi(token); /* Send token */ + if (token == 0xFD) return 1; /* Do not send data if token is StopTran */ + + xmit_spi_multi(buff, 512); /* Data */ + xchg_spi(0xFF); xchg_spi(0xFF); /* Dummy CRC */ + + resp = xchg_spi(0xFF); /* Receive data resp */ + + return (resp & 0x1F) == 0x05 ? 1 : 0; /* Data was accepted or not */ + + /* Busy check is done at next transmission */ + } + +#endif // _DISKIO_WRITE + +/*-----------------------------------------------------------------------*/ +/* Send a command packet to the MMC */ +/*-----------------------------------------------------------------------*/ + +static BYTE send_cmd ( /* Return value: R1 resp (bit7==1:Failed to send) */ + BYTE cmd, /* Command index */ + DWORD arg /* Argument */ +) { + BYTE n, res; + + if (cmd & 0x80) { /* Send a CMD55 prior to ACMD */ + cmd &= 0x7F; + res = send_cmd(CMD55, 0); + if (res > 1) return res; + } + + /* Select the card and wait for ready except to stop multiple block read */ + if (cmd != CMD12) { + deselect(); + if (!select()) return 0xFF; + } + + /* Send command packet */ + xchg_spi(0x40 | cmd); /* Start + command index */ + xchg_spi((BYTE)(arg >> 24)); /* Argument[31..24] */ + xchg_spi((BYTE)(arg >> 16)); /* Argument[23..16] */ + xchg_spi((BYTE)(arg >> 8)); /* Argument[15..8] */ + xchg_spi((BYTE)arg); /* Argument[7..0] */ + n = 0x01; /* Dummy CRC + Stop */ + if (cmd == CMD0) n = 0x95; /* Valid CRC for CMD0(0) */ + if (cmd == CMD8) n = 0x87; /* Valid CRC for CMD8(0x1AA) */ + xchg_spi(n); + + /* Receive command resp */ + if (cmd == CMD12) xchg_spi(0xFF); /* Diacard following one byte when CMD12 */ + n = 10; /* Wait for response (10 bytes max) */ + do + res = xchg_spi(0xFF); + while ((res & 0x80) && --n); + + return res; /* Return received response */ +} + +/*-------------------------------------------------------------------------- + Public Functions +---------------------------------------------------------------------------*/ + +/*-----------------------------------------------------------------------*/ +/* Initialize disk drive */ +/*-----------------------------------------------------------------------*/ + +DSTATUS disk_initialize ( + BYTE drv /* Physical drive number (0) */ +) { + BYTE n, cmd, ty, ocr[4]; + + if (drv) return STA_NOINIT; /* Supports only drive 0 */ + power_on(); /* Initialize SPI */ + + if (Stat & STA_NODISK) return Stat; /* Is a card existing in the soket? */ + + FCLK_SLOW(); + for (n = 10; n; n--) xchg_spi(0xFF); /* Send 80 dummy clocks */ + + ty = 0; + if (send_cmd(CMD0, 0) == 1) { /* Put the card SPI state */ + timeout = millis() + 1000; /* Initialization timeout = 1 sec */ + if (send_cmd(CMD8, 0x1AA) == 1) { /* Is the catd SDv2? */ + for (n = 0; n < 4; n++) ocr[n] = xchg_spi(0xFF); /* Get 32 bit return value of R7 resp */ + if (ocr[2] == 0x01 && ocr[3] == 0xAA) { /* Does the card support 2.7-3.6V? */ + while ((timeout > millis()) && send_cmd(ACMD41, 1UL << 30)) ; /* Wait for end of initialization with ACMD41(HCS) */ + if ((timeout > millis()) && send_cmd(CMD58, 0) == 0) { /* Check CCS bit in the OCR */ + for (n = 0; n < 4; n++) ocr[n] = xchg_spi(0xFF); + ty = (ocr[0] & 0x40) ? CT_SD2 | CT_BLOCK : CT_SD2; /* Check if the card is SDv2 */ + } + } + } else { /* Not an SDv2 card */ + if (send_cmd(ACMD41, 0) <= 1) { /* SDv1 or MMCv3? */ + ty = CT_SD1; cmd = ACMD41; /* SDv1 (ACMD41(0)) */ + } else { + ty = CT_MMC; cmd = CMD1; /* MMCv3 (CMD1(0)) */ + } + while ((timeout > millis()) && send_cmd(cmd, 0)) ; /* Wait for the card leaves idle state */ + if (!(timeout > millis()) || send_cmd(CMD16, 512) != 0) /* Set block length: 512 */ + ty = 0; + } + } + CardType = ty; /* Card type */ + deselect(); + + if (ty) { /* OK */ + FCLK_FAST(); /* Set fast clock */ + Stat &= ~STA_NOINIT; /* Clear STA_NOINIT flag */ + } else { /* Failed */ + power_off(); + Stat = STA_NOINIT; + } + + return Stat; +} + +/*-----------------------------------------------------------------------*/ +/* Get disk status */ +/*-----------------------------------------------------------------------*/ + +DSTATUS disk_status ( + BYTE drv /* Physical drive number (0) */ +) { + if (drv) return STA_NOINIT; /* Supports only drive 0 */ + return Stat; /* Return disk status */ +} + +/*-----------------------------------------------------------------------*/ +/* Read sector(s) */ +/*-----------------------------------------------------------------------*/ + +DRESULT disk_read ( + BYTE drv, /* Physical drive number (0) */ + BYTE *buff, /* Pointer to the data buffer to store read data */ + DWORD sector, /* Start sector number (LBA) */ + UINT count /* Number of sectors to read (1..128) */ +) { + BYTE cmd; + + if (drv || !count) return RES_PARERR; /* Check parameter */ + if (Stat & STA_NOINIT) return RES_NOTRDY; /* Check if drive is ready */ + if (!(CardType & CT_BLOCK)) sector *= 512; /* LBA ot BA conversion (byte addressing cards) */ + FCLK_FAST(); + cmd = count > 1 ? CMD18 : CMD17; /* READ_MULTIPLE_BLOCK : READ_SINGLE_BLOCK */ + if (send_cmd(cmd, sector) == 0) { + do { + if (!rcvr_datablock(buff, 512)) break; + buff += 512; + } while (--count); + if (cmd == CMD18) send_cmd(CMD12, 0); /* STOP_TRANSMISSION */ + } + deselect(); + + return count ? RES_ERROR : RES_OK; /* Return result */ +} + +/*-----------------------------------------------------------------------*/ +/* Write sector(s) */ +/*-----------------------------------------------------------------------*/ + +#if _DISKIO_WRITE + + DRESULT disk_write( + BYTE drv, /* Physical drive number (0) */ + const BYTE *buff, /* Ponter to the data to write */ + DWORD sector, /* Start sector number (LBA) */ + UINT count /* Number of sectors to write (1..128) */ + ) { + if (drv || !count) return RES_PARERR; /* Check parameter */ + if (Stat & STA_NOINIT) return RES_NOTRDY; /* Check drive status */ + if (Stat & STA_PROTECT) return RES_WRPRT; /* Check write protect */ + FCLK_FAST(); + if (!(CardType & CT_BLOCK)) sector *= 512; /* LBA ==> BA conversion (byte addressing cards) */ + + if (count == 1) { /* Single sector write */ + if ((send_cmd(CMD24, sector) == 0) /* WRITE_BLOCK */ + && xmit_datablock(buff, 0xFE)) { + count = 0; + } + } + else { /* Multiple sector write */ + if (CardType & CT_SDC) send_cmd(ACMD23, count); /* Predefine number of sectors */ + if (send_cmd(CMD25, sector) == 0) { /* WRITE_MULTIPLE_BLOCK */ + do { + if (!xmit_datablock(buff, 0xFC)) break; + buff += 512; + } while (--count); + if (!xmit_datablock(0, 0xFD)) count = 1; /* STOP_TRAN token */ + } + } + deselect(); + + return count ? RES_ERROR : RES_OK; /* Return result */ + } + +#endif // _DISKIO_WRITE + +/*-----------------------------------------------------------------------*/ +/* Miscellaneous drive controls other than data read/write */ +/*-----------------------------------------------------------------------*/ + +#if _DISKIO_IOCTL + + DRESULT disk_ioctl ( + BYTE drv, /* Physical drive number (0) */ + BYTE cmd, /* Control command code */ + void *buff /* Pointer to the conrtol data */ + ) { + DRESULT res; + BYTE n, csd[16], *ptr = (BYTE *)buff; + DWORD *dp, st, ed, csize; + #if _DISKIO_ISDIO + SDIO_CMD *sdio = buff; + BYTE rc, *buf; + UINT dc; + #endif + + if (drv) return RES_PARERR; /* Check parameter */ + if (Stat & STA_NOINIT) return RES_NOTRDY; /* Check if drive is ready */ + + res = RES_ERROR; + FCLK_FAST(); + switch (cmd) { + case CTRL_SYNC: /* Wait for end of internal write process of the drive */ + if (select()) res = RES_OK; + break; + + case GET_SECTOR_COUNT: /* Get drive capacity in unit of sector (DWORD) */ + if ((send_cmd(CMD9, 0) == 0) && rcvr_datablock(csd, 16)) { + if ((csd[0] >> 6) == 1) { /* SDC ver 2.00 */ + csize = csd[9] + ((WORD)csd[8] << 8) + ((DWORD)(csd[7] & 63) << 16) + 1; + *(DWORD*)buff = csize << 10; + } else { /* SDC ver 1.XX or MMC ver 3 */ + n = (csd[5] & 15) + ((csd[10] & 128) >> 7) + ((csd[9] & 3) << 1) + 2; + csize = (csd[8] >> 6) + ((WORD)csd[7] << 2) + ((WORD)(csd[6] & 3) << 10) + 1; + *(DWORD*)buff = csize << (n - 9); + } + res = RES_OK; + } + break; + + case GET_BLOCK_SIZE: /* Get erase block size in unit of sector (DWORD) */ + if (CardType & CT_SD2) { /* SDC ver 2.00 */ + if (send_cmd(ACMD13, 0) == 0) { /* Read SD status */ + xchg_spi(0xFF); + if (rcvr_datablock(csd, 16)) { /* Read partial block */ + for (n = 64 - 16; n; n--) xchg_spi(0xFF); /* Purge trailing data */ + *(DWORD*)buff = 16UL << (csd[10] >> 4); + res = RES_OK; + } + } + } else { /* SDC ver 1.XX or MMC */ + if ((send_cmd(CMD9, 0) == 0) && rcvr_datablock(csd, 16)) { /* Read CSD */ + if (CardType & CT_SD1) { /* SDC ver 1.XX */ + *(DWORD*)buff = (((csd[10] & 63) << 1) + ((WORD)(csd[11] & 128) >> 7) + 1) << ((csd[13] >> 6) - 1); + } else { /* MMC */ + *(DWORD*)buff = ((WORD)((csd[10] & 124) >> 2) + 1) * (((csd[11] & 3) << 3) + ((csd[11] & 224) >> 5) + 1); + } + res = RES_OK; + } + } + break; + + case CTRL_TRIM: /* Erase a block of sectors (used when _USE_TRIM in ffconf.h is 1) */ + if (!(CardType & CT_SDC)) break; /* Check if the card is SDC */ + if (disk_ioctl(drv, MMC_GET_CSD, csd)) break; /* Get CSD */ + if (!(csd[0] >> 6) && !(csd[10] & 0x40)) break; /* Check if sector erase can be applied to the card */ + dp = (DWORD *)buff; st = dp[0]; ed = dp[1]; /* Load sector block */ + if (!(CardType & CT_BLOCK)) { + st *= 512; ed *= 512; + } + if (send_cmd(CMD32, st) == 0 && send_cmd(CMD33, ed) == 0 && send_cmd(CMD38, 0) == 0 && wait_ready(30000)) { /* Erase sector block */ + res = RES_OK; /* FatFs does not check result of this command */ + } + break; + + /* Following commands are never used by FatFs module */ + + case MMC_GET_TYPE: /* Get MMC/SDC type (BYTE) */ + *ptr = CardType; + res = RES_OK; + break; + + case MMC_GET_CSD: /* Read CSD (16 bytes) */ + if (send_cmd(CMD9, 0) == 0 && rcvr_datablock(ptr, 16)) { /* READ_CSD */ + res = RES_OK; + } + break; + + case MMC_GET_CID: /* Read CID (16 bytes) */ + if (send_cmd(CMD10, 0) == 0 && rcvr_datablock(ptr, 16)) { /* READ_CID */ + res = RES_OK; + } + break; + + case MMC_GET_OCR: /* Read OCR (4 bytes) */ + if (send_cmd(CMD58, 0) == 0) { /* READ_OCR */ + for (n = 4; n; n--) *ptr++ = xchg_spi(0xFF); + res = RES_OK; + } + break; + + case MMC_GET_SDSTAT: /* Read SD status (64 bytes) */ + if (send_cmd(ACMD13, 0) == 0) { /* SD_STATUS */ + xchg_spi(0xFF); + if (rcvr_datablock(ptr, 64)) res = RES_OK; + } + break; + + #if _DISKIO_ISDIO + + case ISDIO_READ: + sdio = buff; + if (send_cmd(CMD48, 0x80000000 | sdio->func << 28 | sdio->addr << 9 | ((sdio->ndata - 1) & 0x1FF)) == 0) { + for (Timer1 = 1000; (rc = xchg_spi(0xFF)) == 0xFF && Timer1; ) ; + if (rc == 0xFE) { + for (buf = sdio->data, dc = sdio->ndata; dc; dc--) *buf++ = xchg_spi(0xFF); + for (dc = 514 - sdio->ndata; dc; dc--) xchg_spi(0xFF); + res = RES_OK; + } + } + break; + case ISDIO_WRITE: + sdio = buff; + if (send_cmd(CMD49, 0x80000000 | sdio->func << 28 | sdio->addr << 9 | ((sdio->ndata - 1) & 0x1FF)) == 0) { + xchg_spi(0xFF); xchg_spi(0xFE); + for (buf = sdio->data, dc = sdio->ndata; dc; dc--) xchg_spi(*buf++); + for (dc = 514 - sdio->ndata; dc; dc--) xchg_spi(0xFF); + if ((xchg_spi(0xFF) & 0x1F) == 0x05) res = RES_OK; + } + break; + case ISDIO_MRITE: + sdio = buff; + if (send_cmd(CMD49, 0x84000000 | sdio->func << 28 | sdio->addr << 9 | sdio->ndata >> 8) == 0) { + xchg_spi(0xFF); xchg_spi(0xFE); + xchg_spi(sdio->ndata); + for (dc = 513; dc; dc--) xchg_spi(0xFF); + if ((xchg_spi(0xFF) & 0x1F) == 0x05) res = RES_OK; + } + break; + + #endif // _DISKIO_ISDIO + + default: res = RES_PARERR; + } + + deselect(); + return res; + } + +#endif // _DISKIO_IOCTL + +#endif // HAS_ONBOARD_SD diff --git a/Marlin/src/HAL/HAL_STM32F1/onboard_sd.h b/Marlin/src/HAL/HAL_STM32F1/onboard_sd.h new file mode 100644 index 0000000000..ec73162ba1 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32F1/onboard_sd.h @@ -0,0 +1,96 @@ +/*----------------------------------------------------------------------- +/ * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] +/ * Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech] +/ * Low level disk interface module include file (C)ChaN, 2015 +/-----------------------------------------------------------------------*/ + +#pragma once + +#define _DISKIO_WRITE 1 /* 1: Enable disk_write function */ +#define _DISKIO_IOCTL 1 /* 1: Enable disk_ioctl fucntion */ +#define _DISKIO_ISDIO 0 /* 1: Enable iSDIO control fucntion */ + +typedef unsigned char BYTE; +typedef unsigned short WORD; +typedef unsigned long DWORD; +typedef unsigned int UINT; + +/* Status of Disk Functions */ +typedef BYTE DSTATUS; + +/* Results of Disk Functions */ +typedef enum { + RES_OK = 0, /* 0: Successful */ + RES_ERROR, /* 1: R/W Error */ + RES_WRPRT, /* 2: Write Protected */ + RES_NOTRDY, /* 3: Not Ready */ + RES_PARERR /* 4: Invalid Parameter */ +} DRESULT; + + +#if _DISKIO_ISDIO +/* Command structure for iSDIO ioctl command */ +typedef struct { + BYTE func; /* Function number: 0..7 */ + WORD ndata; /* Number of bytes to transfer: 1..512, or mask + data */ + DWORD addr; /* Register address: 0..0x1FFFF */ + void* data; /* Pointer to the data (to be written | read buffer) */ +} SDIO_CMD; +#endif + +/*---------------------------------------*/ +/* Prototypes for disk control functions */ + +DSTATUS disk_initialize(BYTE pdrv); +DSTATUS disk_status(BYTE pdrv); +DRESULT disk_read(BYTE pdrv, BYTE* buff, DWORD sector, UINT count); +#if _DISKIO_WRITE + DRESULT disk_write(BYTE pdrv, const BYTE* buff, DWORD sector, UINT count); +#endif +#if _DISKIO_IOCTL + DRESULT disk_ioctl(BYTE pdrv, BYTE cmd, void* buff); +#endif + +/* Disk Status Bits (DSTATUS) */ +#define STA_NOINIT 0x01 /* Drive not initialized */ +#define STA_NODISK 0x02 /* No medium in the drive */ +#define STA_PROTECT 0x04 /* Write protected */ + +/* Command code for disk_ioctrl fucntion */ + +/* Generic command (Used by FatFs) */ +#define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */ +#define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */ +#define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */ +#define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */ +#define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */ + +/* Generic command (Not used by FatFs) */ +#define CTRL_FORMAT 5 /* Create physical format on the media */ +#define CTRL_POWER_IDLE 6 /* Put the device idle state */ +#define CTRL_POWER_OFF 7 /* Put the device off state */ +#define CTRL_LOCK 8 /* Lock media removal */ +#define CTRL_UNLOCK 9 /* Unlock media removal */ +#define CTRL_EJECT 10 /* Eject media */ + +/* MMC/SDC specific ioctl command (Not used by FatFs) */ +#define MMC_GET_TYPE 50 /* Get card type */ +#define MMC_GET_CSD 51 /* Get CSD */ +#define MMC_GET_CID 52 /* Get CID */ +#define MMC_GET_OCR 53 /* Get OCR */ +#define MMC_GET_SDSTAT 54 /* Get SD status */ +#define ISDIO_READ 55 /* Read data form SD iSDIO register */ +#define ISDIO_WRITE 56 /* Write data to SD iSDIO register */ +#define ISDIO_MRITE 57 /* Masked write data to SD iSDIO register */ + +/* ATA/CF specific ioctl command (Not used by FatFs) */ +#define ATA_GET_REV 60 /* Get F/W revision */ +#define ATA_GET_MODEL 61 /* Get model name */ +#define ATA_GET_SN 62 /* Get serial number */ + +/* MMC card type flags (MMC_GET_TYPE) */ +#define CT_MMC 0x01 /* MMC ver 3 */ +#define CT_SD1 0x02 /* SD ver 1 */ +#define CT_SD2 0x04 /* SD ver 2 */ +#define CT_SDC (CT_SD1|CT_SD2) /* SD */ +#define CT_BLOCK 0x08 /* Block addressing */ diff --git a/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp b/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp index ea7b46f4dd..38d5803f58 100644 --- a/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp @@ -48,7 +48,7 @@ static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE]; #define EEPROM_FILENAME "eeprom.dat" bool PersistentStore::access_start() { - if (!card.isDetected()) return false; + if (!card.isMounted()) return false; SdFile file, root = card.getroot(); if (!file.open(&root, EEPROM_FILENAME, O_RDONLY)) @@ -63,7 +63,7 @@ static char _ALIGN(4) HAL_eeprom_data[HAL_EEPROM_SIZE]; } bool PersistentStore::access_finish() { - if (!card.isDetected()) return false; + if (!card.isMounted()) return false; SdFile file, root = card.getroot(); int bytes_written = 0; diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.cpp b/Marlin/src/HAL/HAL_STM32F1/sdio.cpp similarity index 92% rename from Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.cpp rename to Marlin/src/HAL/HAL_STM32F1/sdio.cpp index d2d59811a8..c1cab57a9e 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/sdio.cpp @@ -29,11 +29,11 @@ #if defined(STM32_HIGH_DENSITY) || defined(STM32_XL_DENSITY) -#include "HAL_sdio_STM32F1.h" +#include "sdio.h" SDIO_CardInfoTypeDef SdCard; -bool SDIO_Init(void) { +bool SDIO_Init() { uint32_t count = 0U; SdCard.CardType = SdCard.CardVersion = SdCard.Class = SdCard.RelCardAdd = SdCard.BlockNbr = SdCard.BlockSize = SdCard.LogBlockNbr = SdCard.LogBlockSize = 0; @@ -107,7 +107,7 @@ bool SDIO_ReadBlock_DMA(uint32_t blockAddress, uint8_t *data) { dma_disable(SDIO_DMA_DEV, SDIO_DMA_CHANNEL); if (SDIO->STA & SDIO_STA_RXDAVL) { - while (SDIO->STA & SDIO_STA_RXDAVL) (void) SDIO->FIFO; + while (SDIO->STA & SDIO_STA_RXDAVL) (void)SDIO->FIFO; SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS | SDIO_ICR_DATA_FLAGS); return false; } @@ -167,21 +167,21 @@ bool SDIO_WriteBlock(uint32_t blockAddress, const uint8_t *data) { return false; } -inline uint32_t SDIO_GetCardState(void) { return SDIO_CmdSendStatus(SdCard.RelCardAdd << 16U) ? (SDIO_GetResponse(SDIO_RESP1) >> 9U) & 0x0FU : SDIO_CARD_ERROR; } +inline uint32_t SDIO_GetCardState() { return SDIO_CmdSendStatus(SdCard.RelCardAdd << 16U) ? (SDIO_GetResponse(SDIO_RESP1) >> 9U) & 0x0FU : SDIO_CARD_ERROR; } // ------------------------ // SD Commands and Responses // ------------------------ void SDIO_SendCommand(uint16_t command, uint32_t argument) { SDIO->ARG = argument; SDIO->CMD = (uint32_t)(SDIO_CMD_CPSMEN | command); } -uint8_t SDIO_GetCommandResponse(void) { return (uint8_t)(SDIO->RESPCMD); } +uint8_t SDIO_GetCommandResponse() { return (uint8_t)(SDIO->RESPCMD); } uint32_t SDIO_GetResponse(uint32_t response) { return SDIO->RESP[response]; } -bool SDIO_CmdGoIdleState(void) { SDIO_SendCommand(CMD0_GO_IDLE_STATE, 0); return SDIO_GetCmdError(); } -bool SDIO_CmdSendCID(void) { SDIO_SendCommand(CMD2_ALL_SEND_CID, 0); return SDIO_GetCmdResp2(); } +bool SDIO_CmdGoIdleState() { SDIO_SendCommand(CMD0_GO_IDLE_STATE, 0); return SDIO_GetCmdError(); } +bool SDIO_CmdSendCID() { SDIO_SendCommand(CMD2_ALL_SEND_CID, 0); return SDIO_GetCmdResp2(); } bool SDIO_CmdSetRelAdd(uint32_t *rca) { SDIO_SendCommand(CMD3_SET_REL_ADDR, 0); return SDIO_GetCmdResp6(SDMMC_CMD_SET_REL_ADDR, rca); } bool SDIO_CmdSelDesel(uint32_t address) { SDIO_SendCommand(CMD7_SEL_DESEL_CARD, address); return SDIO_GetCmdResp1(SDMMC_CMD_SEL_DESEL_CARD); } -bool SDIO_CmdOperCond(void) { SDIO_SendCommand(CMD8_HS_SEND_EXT_CSD, SDMMC_CHECK_PATTERN); return SDIO_GetCmdResp7(); } +bool SDIO_CmdOperCond() { SDIO_SendCommand(CMD8_HS_SEND_EXT_CSD, SDMMC_CHECK_PATTERN); return SDIO_GetCmdResp7(); } bool SDIO_CmdSendCSD(uint32_t argument) { SDIO_SendCommand(CMD9_SEND_CSD, argument); return SDIO_GetCmdResp2(); } bool SDIO_CmdSendStatus(uint32_t argument) { SDIO_SendCommand(CMD13_SEND_STATUS, argument); return SDIO_GetCmdResp1(SDMMC_CMD_SEND_STATUS); } bool SDIO_CmdReadSingleBlock(uint32_t address) { SDIO_SendCommand(CMD17_READ_SINGLE_BLOCK, address); return SDIO_GetCmdResp1(SDMMC_CMD_READ_SINGLE_BLOCK); } @@ -212,7 +212,7 @@ bool SDIO_CmdAppSetClearCardDetect(uint32_t rsa) { do { if (!--count) return false; } while (!SDIO_GET_FLAG(FLAGS)); \ }while(0) -bool SDIO_GetCmdError(void) { +bool SDIO_GetCmdError() { SDIO_WAIT(SDIO_STA_CMDSENT); SDIO_CLEAR_FLAG(SDIO_ICR_CMD_FLAGS); @@ -232,7 +232,7 @@ bool SDIO_GetCmdResp1(uint8_t command) { return (SDIO_GetResponse(SDIO_RESP1) & SDMMC_OCR_ERRORBITS) == SDMMC_ALLZERO; } -bool SDIO_GetCmdResp2(void) { +bool SDIO_GetCmdResp2() { SDIO_WAIT(SDIO_STA_CCRCFAIL | SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT); if (SDIO_GET_FLAG(SDIO_STA_CCRCFAIL | SDIO_STA_CTIMEOUT)) { @@ -244,7 +244,7 @@ bool SDIO_GetCmdResp2(void) { return true; } -bool SDIO_GetCmdResp3(void) { +bool SDIO_GetCmdResp3() { SDIO_WAIT(SDIO_STA_CCRCFAIL | SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT); if (SDIO_GET_FLAG(SDIO_STA_CTIMEOUT)) { @@ -272,7 +272,7 @@ bool SDIO_GetCmdResp6(uint8_t command, uint32_t *rca) { return true; } -bool SDIO_GetCmdResp7(void) { +bool SDIO_GetCmdResp7() { SDIO_WAIT(SDIO_STA_CCRCFAIL | SDIO_STA_CMDREND | SDIO_STA_CTIMEOUT); if (SDIO_GET_FLAG(SDIO_STA_CTIMEOUT)) { diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.h b/Marlin/src/HAL/HAL_STM32F1/sdio.h similarity index 96% rename from Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.h rename to Marlin/src/HAL/HAL_STM32F1/sdio.h index 2ff195d48f..ca0aced695 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL_sdio_STM32F1.h +++ b/Marlin/src/HAL/HAL_STM32F1/sdio.h @@ -121,13 +121,13 @@ typedef struct { // Public functions // ------------------------ -inline uint32_t SDIO_GetCardState(void); +inline uint32_t SDIO_GetCardState(); -bool SDIO_CmdGoIdleState(void); -bool SDIO_CmdSendCID(void); +bool SDIO_CmdGoIdleState(); +bool SDIO_CmdSendCID(); bool SDIO_CmdSetRelAdd(uint32_t *rca); bool SDIO_CmdSelDesel(uint32_t address); -bool SDIO_CmdOperCond(void); +bool SDIO_CmdOperCond(); bool SDIO_CmdSendCSD(uint32_t argument); bool SDIO_CmdSendStatus(uint32_t argument); bool SDIO_CmdReadSingleBlock(uint32_t address); @@ -139,11 +139,11 @@ bool SDIO_CmdAppOperCommand(uint32_t sdType); bool SDIO_CmdAppSetClearCardDetect(uint32_t rsa); void SDIO_SendCommand(uint16_t command, uint32_t argument); -uint8_t SDIO_GetCommandResponse(void); +uint8_t SDIO_GetCommandResponse(); uint32_t SDIO_GetResponse(uint32_t response); -bool SDIO_GetCmdError(void); +bool SDIO_GetCmdError(); bool SDIO_GetCmdResp1(uint8_t command); -bool SDIO_GetCmdResp2(void); -bool SDIO_GetCmdResp3(void); +bool SDIO_GetCmdResp2(); +bool SDIO_GetCmdResp3(); bool SDIO_GetCmdResp6(uint8_t command, uint32_t *rca); -bool SDIO_GetCmdResp7(void); +bool SDIO_GetCmdResp7(); diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL_timers_Stm32f1.cpp b/Marlin/src/HAL/HAL_STM32F1/timers.cpp similarity index 99% rename from Marlin/src/HAL/HAL_STM32F1/HAL_timers_Stm32f1.cpp rename to Marlin/src/HAL/HAL_STM32F1/timers.cpp index faff842eb0..a21dc12c12 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL_timers_Stm32f1.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/timers.cpp @@ -28,7 +28,7 @@ #include "HAL.h" -#include "HAL_timers_STM32F1.h" +#include "timers.h" // ------------------------ // Local defines diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL_timers_Stm32f1.h b/Marlin/src/HAL/HAL_STM32F1/timers.h similarity index 96% rename from Marlin/src/HAL/HAL_STM32F1/HAL_timers_Stm32f1.h rename to Marlin/src/HAL/HAL_STM32F1/timers.h index c114fe5ed4..69793f4302 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL_timers_Stm32f1.h +++ b/Marlin/src/HAL/HAL_STM32F1/timers.h @@ -86,11 +86,11 @@ timer_dev* get_timer_dev(int number); // TODO change this -#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler(void) -#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler(void) +#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler() +#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler() -extern "C" void tempTC_Handler(void); -extern "C" void stepTC_Handler(void); +extern "C" void tempTC_Handler(); +extern "C" void stepTC_Handler(); // ------------------------ // Public Variables diff --git a/Marlin/src/HAL/HAL_STM32F1/watchdog_Stm32f1.cpp b/Marlin/src/HAL/HAL_STM32F1/watchdog.cpp similarity index 94% rename from Marlin/src/HAL/HAL_STM32F1/watchdog_Stm32f1.cpp rename to Marlin/src/HAL/HAL_STM32F1/watchdog.cpp index 62e4d077eb..5696939f30 100644 --- a/Marlin/src/HAL/HAL_STM32F1/watchdog_Stm32f1.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/watchdog.cpp @@ -31,7 +31,7 @@ #if ENABLED(USE_WATCHDOG) #include -#include "watchdog_STM32F1.h" +#include "watchdog.h" void watchdog_reset() { #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED) @@ -40,7 +40,7 @@ void watchdog_reset() { iwdg_feed(); } -void watchdogSetup(void) { +void watchdogSetup() { // do whatever. don't remove this function. } @@ -51,7 +51,7 @@ void watchdogSetup(void) { * * @details The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and 625 reload value (counts down to 0) */ -void watchdog_init(void) { +void watchdog_init() { //iwdg_init(IWDG_PRE_256, STM32F1_WD_RELOAD); } diff --git a/Marlin/src/HAL/HAL_STM32F1/watchdog_Stm32f1.h b/Marlin/src/HAL/HAL_STM32F1/watchdog.h similarity index 100% rename from Marlin/src/HAL/HAL_STM32F1/watchdog_Stm32f1.h rename to Marlin/src/HAL/HAL_STM32F1/watchdog.h diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.cpp index 3602c0d86b..7ed6e2c10f 100644 --- a/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.cpp +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.cpp @@ -39,15 +39,15 @@ uint16_t HAL_adc_result; /* VGPV Done with defines // disable interrupts -void cli(void) { noInterrupts(); } +void cli() { noInterrupts(); } // enable interrupts -void sei(void) { interrupts(); } +void sei() { interrupts(); } */ -void HAL_clear_reset_source(void) { __HAL_RCC_CLEAR_RESET_FLAGS(); } +void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); } -uint8_t HAL_get_reset_source(void) { +uint8_t HAL_get_reset_source() { if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET) return RST_WATCHDOG; if (__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST) != RESET) return RST_SOFTWARE; if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST) != RESET) return RST_EXTERNAL; @@ -91,6 +91,6 @@ extern "C" { void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRead(adc_pin); } -uint16_t HAL_adc_get_result(void) { return HAL_adc_result; } +uint16_t HAL_adc_get_result() { return HAL_adc_result; } #endif // STM32GENERIC && (STM32F4 || STM32F7) diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h b/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h index 61807f026d..1effe2d752 100644 --- a/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h @@ -28,10 +28,10 @@ #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" -#include "fastio_STM32_F4_F7.h" -#include "watchdog_STM32_F4_F7.h" +#include "fastio.h" +#include "watchdog.h" -#include "HAL_timers_STM32_F4_F7.h" +#include "timers.h" #include "../../inc/MarlinConfigPre.h" @@ -150,53 +150,42 @@ extern uint16_t HAL_adc_result; // Memory related #define __bss_end __bss_end__ -inline void HAL_init(void) { } +inline void HAL_init() { } // Clear reset reason -void HAL_clear_reset_source (void); +void HAL_clear_reset_source(); // Reset reason -uint8_t HAL_get_reset_source(void); +uint8_t HAL_get_reset_source(); void _delay_ms(const int delay); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" - /* extern "C" { - int freeMemory(void); + int freeMemory(); } */ extern "C" char* _sbrk(int incr); /* -static int freeMemory() { +int freeMemory() { volatile int top; top = (int)((char*)&top - reinterpret_cast(_sbrk(0))); return top; } */ -static int freeMemory() { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" + +static inline int freeMemory() { volatile char top; return &top - reinterpret_cast(_sbrk(0)); } #pragma GCC diagnostic pop -// -// SPI: Extended functions which take a channel number (hardware SPI only) -// - -// Write single byte to specified SPI channel -void spiSend(uint32_t chan, byte b); -// Write buffer to specified SPI channel -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); -// Read single byte from specified SPI channel -uint8_t spiRec(uint32_t chan); - // // EEPROM // @@ -216,14 +205,14 @@ void eeprom_update_block (const void *__src, void *__dst, size_t __n); #define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT) -inline void HAL_adc_init(void) {} +inline void HAL_adc_init() {} #define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) #define HAL_READ_ADC() HAL_adc_result #define HAL_ADC_READY() true void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(void); +uint16_t HAL_adc_get_result(); #define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_INDEX(pin) pin diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_spi_STM32_F4_F7.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_SPI.cpp similarity index 97% rename from Marlin/src/HAL/HAL_STM32_F4_F7/HAL_spi_STM32_F4_F7.cpp rename to Marlin/src/HAL/HAL_STM32_F4_F7/HAL_SPI.cpp index ca7cc5b543..2f85182e20 100644 --- a/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_spi_STM32_F4_F7.cpp +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_SPI.cpp @@ -32,12 +32,12 @@ #if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7)) -#include "HAL.h" -#include "../shared/HAL_SPI.h" -#include -#include "spi_pins.h" -#include "../../core/macros.h" +#include "../../inc/MarlinConfig.h" + #include +#include +#include "../shared/HAL_SPI.h" +#include "spi_pins.h" // ------------------------ // Public Variables @@ -71,8 +71,8 @@ static SPISettings spiConfig; * * @details Only configures SS pin since libmaple creates and initialize the SPI object */ -void spiBegin(void) { - #if !PIN_EXISTS(SS) +void spiBegin() { + #if !defined(SS_PIN) || SS_PIN < 0 #error SS_PIN not defined! #endif @@ -103,7 +103,7 @@ void spiInit(uint8_t spiRate) { * * @details */ -uint8_t spiRec(void) { +uint8_t spiRec() { SPI.beginTransaction(spiConfig); uint8_t returnByte = SPI.transfer(0xFF); SPI.endTransaction(); diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/HAL_timers_STM32F4.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.cpp similarity index 97% rename from Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/HAL_timers_STM32F4.cpp rename to Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.cpp index 26ea90e6d4..32219962ee 100644 --- a/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/HAL_timers_STM32F4.cpp +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.cpp @@ -23,7 +23,7 @@ #if defined(STM32GENERIC) && defined(STM32F4) #include "../HAL.h" -#include "HAL_timers_STM32F4.h" +#include "timers.h" // ------------------------ // Local defines @@ -82,10 +82,10 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { } extern "C" void TIM5_IRQHandler() { - ((void(*)(void))TimerHandle[0].callback)(); + ((void(*)())TimerHandle[0].callback)(); } extern "C" void TIM7_IRQHandler() { - ((void(*)(void))TimerHandle[1].callback)(); + ((void(*)())TimerHandle[1].callback)(); } void HAL_timer_enable_interrupt(const uint8_t timer_num) { diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/HAL_timers_STM32F4.h b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.h similarity index 100% rename from Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/HAL_timers_STM32F4.h rename to Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.h diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.cpp index 698681e7f0..3117321ac7 100644 --- a/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.cpp +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.cpp @@ -37,7 +37,7 @@ #include "../../../inc/MarlinConfig.h" #include "../../../Marlin.h" -#include "../../../module/stepper_indirection.h" +#include "../../../module/stepper/indirection.h" #include "../../../module/printcounter.h" #include "../../../libs/duration_t.h" #include "../../../libs/hex_print_routines.h" @@ -226,7 +226,7 @@ void TMC26XStepper::setSpeed(uint16_t whatSpeed) { this->next_step_time = this->last_step_time + this->step_delay; } -uint16_t TMC26XStepper::getSpeed(void) { return this->speed; } +uint16_t TMC26XStepper::getSpeed() { return this->speed; } /** * Moves the motor steps_to_move steps. @@ -246,7 +246,7 @@ char TMC26XStepper::step(int16_t steps_to_move) { return -1; } -char TMC26XStepper::move(void) { +char TMC26XStepper::move() { // decrement the number of steps, moving one step each time: if (this->steps_left > 0) { uint32_t time = micros(); @@ -277,11 +277,11 @@ char TMC26XStepper::move(void) { return 0; } -char TMC26XStepper::isMoving(void) { return this->steps_left > 0; } +char TMC26XStepper::isMoving() { return this->steps_left > 0; } -uint16_t TMC26XStepper::getStepsLeft(void) { return this->steps_left; } +uint16_t TMC26XStepper::getStepsLeft() { return this->steps_left; } -char TMC26XStepper::stop(void) { +char TMC26XStepper::stop() { //note to self if the motor is currently moving char state = isMoving(); //stop the motor @@ -313,10 +313,12 @@ void TMC26XStepper::setCurrent(uint16_t current) { current_scaling = (byte)((resistor_value * mASetting * 32.0 / (0.165 * sq(1000.0))) - 0.5); //theoretically - 1.0 for better rounding it is 0.5 #ifdef TMC_DEBUG0 // crashes SERIAL_ECHOPAIR("\nCS (Vsense=1): ",current_scaling); - } else { - SERIAL_ECHOPAIR("\nCS: ", current_scaling); #endif } + #ifdef TMC_DEBUG0 // crashes + else + SERIAL_ECHOPAIR("\nCS: ", current_scaling); + #endif // do some sanity checks NOMORE(current_scaling, 31); @@ -332,7 +334,7 @@ void TMC26XStepper::setCurrent(uint16_t current) { } } -uint16_t TMC26XStepper::getCurrent(void) { +uint16_t TMC26XStepper::getCurrent() { // Calculate the current according to the datasheet to be on the safe side. // This is not the fastest but the most accurate and illustrative way. float result = (float)(stallguard2_current_register_value & CURRENT_SCALING_PATTERN), @@ -359,7 +361,7 @@ void TMC26XStepper::setStallGuardThreshold(char stallguard_threshold, char stall if (started) send262(stallguard2_current_register_value); } -char TMC26XStepper::getStallGuardThreshold(void) { +char TMC26XStepper::getStallGuardThreshold() { uint32_t stallguard_threshold = stallguard2_current_register_value & STALL_GUARD_VALUE_PATTERN; //shift it down to bit 0 stallguard_threshold >>= 8; @@ -372,7 +374,7 @@ char TMC26XStepper::getStallGuardThreshold(void) { return result; } -char TMC26XStepper::getStallGuardFilter(void) { +char TMC26XStepper::getStallGuardFilter() { if (stallguard2_current_register_value & STALL_GUARD_FILTER_ENABLED) return -1; return 0; @@ -419,7 +421,7 @@ void TMC26XStepper::setMicrosteps(const int16_t in_steps) { /** * returns the effective number of microsteps at the moment */ -int16_t TMC26XStepper::getMicrosteps(void) { return microsteps; } +int16_t TMC26XStepper::getMicrosteps() { return microsteps; } /** * constant_off_time: The off time setting controls the minimum chopper frequency. @@ -621,7 +623,7 @@ void TMC26XStepper::setCoolStepEnabled(boolean enabled) { if (started) send262(cool_step_register_value); } -boolean TMC26XStepper::isCoolStepEnabled(void) { return this->cool_step_enabled; } +boolean TMC26XStepper::isCoolStepEnabled() { return this->cool_step_enabled; } uint16_t TMC26XStepper::getCoolStepLowerSgThreshold() { // We return our internally stored value - in order to provide the correct setting even if cool step is not enabled @@ -682,7 +684,7 @@ void TMC26XStepper::readStatus(char read_value) { send262(driver_configuration_register_value); } -int16_t TMC26XStepper::getMotorPosition(void) { +int16_t TMC26XStepper::getMotorPosition() { //we read it out even if we are not started yet - perhaps it is useful information for somebody readStatus(TMC26X_READOUT_POSITION); return getReadoutValue(); @@ -690,7 +692,7 @@ int16_t TMC26XStepper::getMotorPosition(void) { //reads the StallGuard setting from last status //returns -1 if StallGuard information is not present -int16_t TMC26XStepper::getCurrentStallGuardReading(void) { +int16_t TMC26XStepper::getCurrentStallGuardReading() { //if we don't yet started there cannot be a StallGuard value if (!started) return -1; //not time optimal, but solution optiomal: @@ -699,7 +701,7 @@ int16_t TMC26XStepper::getCurrentStallGuardReading(void) { return getReadoutValue(); } -uint8_t TMC26XStepper::getCurrentCSReading(void) { +uint8_t TMC26XStepper::getCurrentCSReading() { //if we don't yet started there cannot be a StallGuard value if (!started) return 0; //not time optimal, but solution optiomal: @@ -708,7 +710,7 @@ uint8_t TMC26XStepper::getCurrentCSReading(void) { return (getReadoutValue() & 0x1F); } -uint16_t TMC26XStepper::getCurrentCurrent(void) { +uint16_t TMC26XStepper::getCurrentCurrent() { float result = (float)getCurrentCSReading(), resistor_value = (float)this->resistor, voltage = (driver_configuration_register_value & VSENSE)? 0.165 : 0.31; @@ -719,7 +721,7 @@ uint16_t TMC26XStepper::getCurrentCurrent(void) { /** * Return true if the StallGuard threshold has been reached */ -boolean TMC26XStepper::isStallGuardOverThreshold(void) { +boolean TMC26XStepper::isStallGuardOverThreshold() { if (!this->started) return false; return (driver_status_result & STATUS_STALL_GUARD_STATUS); } @@ -730,7 +732,7 @@ boolean TMC26XStepper::isStallGuardOverThreshold(void) { * OVER_TEMPERATURE_SHUTDOWN if the temperature is so hot that the driver is shut down * Any of those levels are not too good. */ -char TMC26XStepper::getOverTemperature(void) { +char TMC26XStepper::getOverTemperature() { if (!this->started) return 0; if (driver_status_result & STATUS_OVER_TEMPERATURE_SHUTDOWN) @@ -743,44 +745,44 @@ char TMC26XStepper::getOverTemperature(void) { } // Is motor channel A shorted to ground -boolean TMC26XStepper::isShortToGroundA(void) { +boolean TMC26XStepper::isShortToGroundA() { if (!this->started) return false; return (driver_status_result & STATUS_SHORT_TO_GROUND_A); } // Is motor channel B shorted to ground -boolean TMC26XStepper::isShortToGroundB(void) { +boolean TMC26XStepper::isShortToGroundB() { if (!this->started) return false; return (driver_status_result & STATUS_SHORT_TO_GROUND_B); } // Is motor channel A connected -boolean TMC26XStepper::isOpenLoadA(void) { +boolean TMC26XStepper::isOpenLoadA() { if (!this->started) return false; return (driver_status_result & STATUS_OPEN_LOAD_A); } // Is motor channel B connected -boolean TMC26XStepper::isOpenLoadB(void) { +boolean TMC26XStepper::isOpenLoadB() { if (!this->started) return false; return (driver_status_result & STATUS_OPEN_LOAD_B); } // Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s -boolean TMC26XStepper::isStandStill(void) { +boolean TMC26XStepper::isStandStill() { if (!this->started) return false; return (driver_status_result & STATUS_STAND_STILL); } //is chopper inactive since 2^20 clock cycles - defaults to ~0,08s -boolean TMC26XStepper::isStallGuardReached(void) { +boolean TMC26XStepper::isStallGuardReached() { if (!this->started) return false; return (driver_status_result & STATUS_STALL_GUARD_STATUS); } //reads the StallGuard setting from last status //returns -1 if StallGuard information is not present -int16_t TMC26XStepper::getReadoutValue(void) { +int16_t TMC26XStepper::getReadoutValue() { return (int)(driver_status_result >> 10); } @@ -792,7 +794,7 @@ boolean TMC26XStepper::isCurrentScalingHalfed() { /** * version() returns the version of the library: */ -int16_t TMC26XStepper::version(void) { return 1; } +int16_t TMC26XStepper::version() { return 1; } void TMC26XStepper::debugLastStatus() { #ifdef TMC_DEBUG1 @@ -829,9 +831,8 @@ void TMC26XStepper::debugLastStatus() { SERIAL_ECHOPAIR("\n Stall Guard value:", value); } else if (readout_config == READ_STALL_GUARD_AND_COOL_STEP) { - int16_t stallGuard = value & 0xF, current = value & 0x1F0; - SERIAL_ECHOPAIR("\n Approx Stall Guard: ", stallGuard); - SERIAL_ECHOPAIR("\n Current level", current); + SERIAL_ECHOPAIR("\n Approx Stall Guard: ", value & 0xF); + SERIAL_ECHOPAIR("\n Current level", value & 0x1F0); } } #endif diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.h b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.h index 9753aa3407..f1d0133a3b 100644 --- a/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.h +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.h @@ -150,7 +150,7 @@ class TMC26XStepper { * \brief Report the currently selected speed in RPM. * \sa setSpeed() */ - uint16_t getSpeed(void); + uint16_t getSpeed(); /*! * \brief Set the number of microsteps in 2^i values (rounded) up to 256 @@ -170,7 +170,7 @@ class TMC26XStepper { * * \sa setMicrosteps() */ - int16_t getMicrosteps(void); + int16_t getMicrosteps(); /*! * \brief Initiate a movement with the given number of steps. Positive values move in one direction, negative in the other. @@ -204,7 +204,7 @@ class TMC26XStepper { * It is recommended to call this using a hardware timer to ensure regular invocation. * \sa step() */ - char move(void); + char move(); /*! * \brief Check whether the last movement command is done. @@ -213,13 +213,13 @@ class TMC26XStepper { * Used to determine if the motor is ready for new movements. *\sa step(), move() */ - char isMoving(void); + char isMoving(); /*! * \brief Get the number of steps left in the current movement. * \return The number of steps left in the movement. Always positive. */ - uint16_t getStepsLeft(void); + uint16_t getStepsLeft(); /*! * \brief Stop the motor immediately. @@ -227,7 +227,7 @@ class TMC26XStepper { * * This method directly and abruptly stops the motor and may be used as an emergency stop. */ - char stop(void); + char stop(); /*! * \brief Set and configure the classical Constant Off Timer Chopper @@ -309,7 +309,7 @@ class TMC26XStepper { * \return the maximum motor current in milli amps * \sa getCurrentCurrent() */ - uint16_t getCurrent(void); + uint16_t getCurrent(); /*! * \brief set the StallGuard threshold in order to get sensible StallGuard readings. @@ -332,13 +332,13 @@ class TMC26XStepper { * \brief reads out the StallGuard threshold * \return a number between -64 and 63. */ - char getStallGuardThreshold(void); + char getStallGuardThreshold(); /*! * \brief returns the current setting of the StallGuard filter * \return 0 if not set, -1 if set */ - char getStallGuardFilter(void); + char getStallGuardFilter(); /*! * \brief This method configures the CoolStep smart energy operation. You must have a proper StallGuard configuration for the motor situation (current, voltage, speed) in rder to use this feature. @@ -411,7 +411,7 @@ class TMC26XStepper { * * Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time. */ - int16_t getMotorPosition(void); + int16_t getMotorPosition(); /*! * \brief Reads the current StallGuard value. @@ -419,14 +419,14 @@ class TMC26XStepper { * Keep in mind that this routine reads and writes a value via SPI - so this may take a bit time. * \sa setStallGuardThreshold() for tuning the readout to sensible ranges. */ - int16_t getCurrentStallGuardReading(void); + int16_t getCurrentStallGuardReading(); /*! * \brief Reads the current current setting value as fraction of the maximum current * Returns values between 0 and 31, representing 1/32 to 32/32 (=1) * \sa setCoolStepConfiguration() */ - uint8_t getCurrentCSReading(void); + uint8_t getCurrentCSReading(); /*! @@ -442,7 +442,7 @@ class TMC26XStepper { * may not be the fastest. * \sa getCurrentCSReading(), getResistor(), isCurrentScalingHalfed(), getCurrent() */ - uint16_t getCurrentCurrent(void); + uint16_t getCurrentCurrent(); /*! * \brief checks if there is a StallGuard warning in the last status @@ -452,7 +452,7 @@ class TMC26XStepper { * * \sa setStallGuardThreshold() for tuning the readout to sensible ranges. */ - boolean isStallGuardOverThreshold(void); + boolean isStallGuardOverThreshold(); /*! * \brief Return over temperature status of the last status readout @@ -460,7 +460,7 @@ class TMC26XStepper { * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. */ - char getOverTemperature(void); + char getOverTemperature(); /*! * \brief Is motor channel A shorted to ground detected in the last status readout. @@ -469,7 +469,7 @@ class TMC26XStepper { * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. */ - boolean isShortToGroundA(void); + boolean isShortToGroundA(); /*! * \brief Is motor channel B shorted to ground detected in the last status readout. @@ -477,14 +477,14 @@ class TMC26XStepper { * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. */ - boolean isShortToGroundB(void); + boolean isShortToGroundB(); /*! * \brief iIs motor channel A connected according to the last statu readout. * \return true is yes, false if not. * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. */ - boolean isOpenLoadA(void); + boolean isOpenLoadA(); /*! * \brief iIs motor channel A connected according to the last statu readout. @@ -492,7 +492,7 @@ class TMC26XStepper { * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. */ - boolean isOpenLoadB(void); + boolean isOpenLoadB(); /*! * \brief Is chopper inactive since 2^20 clock cycles - defaults to ~0,08s @@ -500,7 +500,7 @@ class TMC26XStepper { * Keep in mind that this method does not enforce a readout but uses the value of the last status readout. * You may want to use getMotorPosition() or getCurrentStallGuardReading() to enforce an updated status readout. */ - boolean isStandStill(void); + boolean isStandStill(); /*! * \brief checks if there is a StallGuard warning in the last status @@ -513,7 +513,7 @@ class TMC26XStepper { * * \sa setStallGuardThreshold() for tuning the readout to sensible ranges. */ - boolean isStallGuardReached(void); + boolean isStallGuardReached(); /*! *\brief enables or disables the motor driver bridges. If disabled the motor can run freely. If enabled not. @@ -549,13 +549,13 @@ class TMC26XStepper { * \brief Prints out all the information that can be found in the last status read out - it does not force a status readout. * The result is printed via Serial */ - void debugLastStatus(void); + void debugLastStatus(); /*! * \brief library version * \return the version number as int. */ - int16_t version(void); + int16_t version(); private: uint16_t steps_left; // The steps the motor has to do to complete the movement diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/HAL_timers_STM32F7.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.cpp similarity index 97% rename from Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/HAL_timers_STM32F7.cpp rename to Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.cpp index 32697d7ccd..5a3b32ef5b 100644 --- a/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/HAL_timers_STM32F7.cpp +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.cpp @@ -23,7 +23,7 @@ #if defined(STM32GENERIC) && defined(STM32F7) #include "../HAL.h" -#include "HAL_timers_STM32F7.h" +#include "timers.h" // ------------------------ // Local defines @@ -86,10 +86,10 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { //forward the interrupt extern "C" void TIM5_IRQHandler() { - ((void(*)(void))timerConfig[0].callback)(); + ((void(*)())timerConfig[0].callback)(); } extern "C" void TIM7_IRQHandler() { - ((void(*)(void))timerConfig[1].callback)(); + ((void(*)())timerConfig[1].callback)(); } void HAL_timer_set_compare(const uint8_t timer_num, const uint32_t compare) { diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/HAL_timers_STM32F7.h b/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.h similarity index 100% rename from Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/HAL_timers_STM32F7.h rename to Marlin/src/HAL/HAL_STM32_F4_F7/STM32F7/timers.h diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_Servo_STM32_F4_F7.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.cpp similarity index 84% rename from Marlin/src/HAL/HAL_STM32_F4_F7/HAL_Servo_STM32_F4_F7.cpp rename to Marlin/src/HAL/HAL_STM32_F4_F7/Servo.cpp index 5c585e663d..b3aac77615 100644 --- a/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_Servo_STM32_F4_F7.cpp +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.cpp @@ -27,25 +27,25 @@ #if HAS_SERVOS -#include "HAL_Servo_STM32_F4_F7.h" +#include "Servo.h" int8_t libServo::attach(const int pin) { - if (this->servoIndex >= MAX_SERVOS) return -1; - return Servo::attach(pin); + if (servoIndex >= MAX_SERVOS) return -1; + return super::attach(pin); } int8_t libServo::attach(const int pin, const int min, const int max) { - return Servo::attach(pin, min, max); + return super::attach(pin, min, max); } void libServo::move(const int value) { constexpr uint16_t servo_delay[] = SERVO_DELAY; static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long."); - if (this->attach(0) >= 0) { - this->write(value); - safe_delay(servo_delay[this->servoIndex]); + if (attach(0) >= 0) { + write(value); + safe_delay(servo_delay[servoIndex]); #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); + detach(); #endif } } diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_Servo_STM32_F4_F7.h b/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.h similarity index 98% rename from Marlin/src/HAL/HAL_STM32_F4_F7/HAL_Servo_STM32_F4_F7.h rename to Marlin/src/HAL/HAL_STM32_F4_F7/Servo.h index c839c6a145..64fa05025c 100644 --- a/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_Servo_STM32_F4_F7.h +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/Servo.h @@ -35,6 +35,7 @@ class libServo : public Servo { int8_t attach(const int pin, const int min, const int max); void move(const int value); private: + typedef Servo super; uint16_t min_ticks, max_ticks; uint8_t servoIndex; // index into the channel data for this servo }; diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.cpp index 1c9de1e212..3358fa3df7 100644 --- a/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.cpp +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.cpp @@ -62,7 +62,7 @@ uint16_t VirtAddVarTab[NB_OF_VAR]; /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ -static HAL_StatusTypeDef EE_Format(void); +static HAL_StatusTypeDef EE_Format(); static uint16_t EE_FindValidPage(uint8_t Operation); static uint16_t EE_VerifyPageFullWriteVariable(uint16_t VirtAddress, uint16_t Data); static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data); @@ -75,7 +75,7 @@ static uint16_t EE_VerifyPageFullyErased(uint32_t Address); * @retval - Flash error code: on write Flash error * - FLASH_COMPLETE: on success */ -uint16_t EE_Initialize(void) { +uint16_t EE_Initialize() { /* Get Page0 and Page1 status */ uint16_t PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS), PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); @@ -331,7 +331,7 @@ uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data) { * @retval Status of the last operation (Flash write or erase) done during * EEPROM formating */ -static HAL_StatusTypeDef EE_Format(void) { +static HAL_StatusTypeDef EE_Format() { FLASH_EraseInitTypeDef pEraseInit; pEraseInit.TypeErase = FLASH_TYPEERASE_SECTORS; pEraseInit.Sector = PAGE0_ID; diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.h b/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.h index 90aeeee5a3..e4094f8e13 100644 --- a/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.h +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/eeprom_emul.h @@ -108,7 +108,7 @@ #define NB_OF_VAR uint16_t(4096) /* Exported functions ------------------------------------------------------- */ -uint16_t EE_Initialize(void); +uint16_t EE_Initialize(); uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data); uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data); diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/endstop_interrupts.h b/Marlin/src/HAL/HAL_STM32_F4_F7/endstop_interrupts.h index 86f6d68c59..d0aa731e89 100644 --- a/Marlin/src/HAL/HAL_STM32_F4_F7/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/endstop_interrupts.h @@ -25,9 +25,9 @@ #include "../../module/endstops.h" // One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } +void endstop_ISR() { endstops.update(); } -void setup_endstop_interrupts(void) { +void setup_endstop_interrupts() { #if HAS_X_MAX attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); #endif diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/fastio.h b/Marlin/src/HAL/HAL_STM32_F4_F7/fastio.h new file mode 100644 index 0000000000..1e5ef2ef30 --- /dev/null +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/fastio.h @@ -0,0 +1,310 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * Copyright (c) 2017 Victor Perez + * + * 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 . + * + */ +#pragma once + +/** + * Fast I/O interfaces for STM32F4/7 + * These use GPIO functions instead of Direct Port Manipulation, as on AVR. + */ + +#ifndef PWM + #define PWM OUTPUT +#endif + +#define READ(IO) digitalRead(IO) +#define WRITE(IO,V) digitalWrite(IO,V) + +#define _GET_MODE(IO) +#define _SET_MODE(IO,M) pinMode(IO, M) +#define _SET_OUTPUT(IO) pinMode(IO, OUTPUT) /*!< Output Push Pull Mode & GPIO_NOPULL */ + +#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0) + +#define SET_INPUT(IO) _SET_MODE(IO, INPUT) /*!< Input Floating Mode */ +#define SET_INPUT_PULLUP(IO) _SET_MODE(IO, INPUT_PULLUP) /*!< Input with Pull-up activation */ +#define SET_INPUT_PULLDOWN(IO) _SET_MODE(IO, INPUT_PULLDOWN) /*!< Input with Pull-down activation */ +#define SET_OUTPUT(IO) OUT_WRITE(IO, LOW) +#define SET_PWM(IO) _SET_MODE(IO, PWM) + +#define TOGGLE(IO) OUT_WRITE(IO, !READ(IO)) + +#define IS_INPUT(IO) +#define IS_OUTPUT(IO) + +#define PWM_PIN(P) true + +// digitalRead/Write wrappers +#define extDigitalRead(IO) digitalRead(IO) +#define extDigitalWrite(IO,V) digitalWrite(IO,V) + +// +// Pins Definitions +// +#define PORTA 0 +#define PORTB 1 +#define PORTC 2 +#define PORTD 3 +#define PORTE 4 +#define PORTF 5 +#define PORTG 6 + +#define _STM32_PIN(P,PN) ((PORT##P * 16) + PN) + +#undef PA0 +#define PA0 _STM32_PIN(A, 0) +#undef PA1 +#define PA1 _STM32_PIN(A, 1) +#undef PA2 +#define PA2 _STM32_PIN(A, 2) +#undef PA3 +#define PA3 _STM32_PIN(A, 3) +#undef PA4 +#define PA4 _STM32_PIN(A, 4) +#undef PA5 +#define PA5 _STM32_PIN(A, 5) +#undef PA6 +#define PA6 _STM32_PIN(A, 6) +#undef PA7 +#define PA7 _STM32_PIN(A, 7) +#undef PA8 +#define PA8 _STM32_PIN(A, 8) +#undef PA9 +#define PA9 _STM32_PIN(A, 9) +#undef PA10 +#define PA10 _STM32_PIN(A, 10) +#undef PA11 +#define PA11 _STM32_PIN(A, 11) +#undef PA12 +#define PA12 _STM32_PIN(A, 12) +#undef PA13 +#define PA13 _STM32_PIN(A, 13) +#undef PA14 +#define PA14 _STM32_PIN(A, 14) +#undef PA15 +#define PA15 _STM32_PIN(A, 15) + +#undef PB0 +#define PB0 _STM32_PIN(B, 0) +#undef PB1 +#define PB1 _STM32_PIN(B, 1) +#undef PB2 +#define PB2 _STM32_PIN(B, 2) +#undef PB3 +#define PB3 _STM32_PIN(B, 3) +#undef PB4 +#define PB4 _STM32_PIN(B, 4) +#undef PB5 +#define PB5 _STM32_PIN(B, 5) +#undef PB6 +#define PB6 _STM32_PIN(B, 6) +#undef PB7 +#define PB7 _STM32_PIN(B, 7) +#undef PB8 +#define PB8 _STM32_PIN(B, 8) +#undef PB9 +#define PB9 _STM32_PIN(B, 9) +#undef PB10 +#define PB10 _STM32_PIN(B, 10) +#undef PB11 +#define PB11 _STM32_PIN(B, 11) +#undef PB12 +#define PB12 _STM32_PIN(B, 12) +#undef PB13 +#define PB13 _STM32_PIN(B, 13) +#undef PB14 +#define PB14 _STM32_PIN(B, 14) +#undef PB15 +#define PB15 _STM32_PIN(B, 15) + +#undef PC0 +#define PC0 _STM32_PIN(C, 0) +#undef PC1 +#define PC1 _STM32_PIN(C, 1) +#undef PC2 +#define PC2 _STM32_PIN(C, 2) +#undef PC3 +#define PC3 _STM32_PIN(C, 3) +#undef PC4 +#define PC4 _STM32_PIN(C, 4) +#undef PC5 +#define PC5 _STM32_PIN(C, 5) +#undef PC6 +#define PC6 _STM32_PIN(C, 6) +#undef PC7 +#define PC7 _STM32_PIN(C, 7) +#undef PC8 +#define PC8 _STM32_PIN(C, 8) +#undef PC9 +#define PC9 _STM32_PIN(C, 9) +#undef PC10 +#define PC10 _STM32_PIN(C, 10) +#undef PC11 +#define PC11 _STM32_PIN(C, 11) +#undef PC12 +#define PC12 _STM32_PIN(C, 12) +#undef PC13 +#define PC13 _STM32_PIN(C, 13) +#undef PC14 +#define PC14 _STM32_PIN(C, 14) +#undef PC15 +#define PC15 _STM32_PIN(C, 15) + +#undef PD0 +#define PD0 _STM32_PIN(D, 0) +#undef PD1 +#define PD1 _STM32_PIN(D, 1) +#undef PD2 +#define PD2 _STM32_PIN(D, 2) +#undef PD3 +#define PD3 _STM32_PIN(D, 3) +#undef PD4 +#define PD4 _STM32_PIN(D, 4) +#undef PD5 +#define PD5 _STM32_PIN(D, 5) +#undef PD6 +#define PD6 _STM32_PIN(D, 6) +#undef PD7 +#define PD7 _STM32_PIN(D, 7) +#undef PD8 +#define PD8 _STM32_PIN(D, 8) +#undef PD9 +#define PD9 _STM32_PIN(D, 9) +#undef PD10 +#define PD10 _STM32_PIN(D, 10) +#undef PD11 +#define PD11 _STM32_PIN(D, 11) +#undef PD12 +#define PD12 _STM32_PIN(D, 12) +#undef PD13 +#define PD13 _STM32_PIN(D, 13) +#undef PD14 +#define PD14 _STM32_PIN(D, 14) +#undef PD15 +#define PD15 _STM32_PIN(D, 15) + +#undef PE0 +#define PE0 _STM32_PIN(E, 0) +#undef PE1 +#define PE1 _STM32_PIN(E, 1) +#undef PE2 +#define PE2 _STM32_PIN(E, 2) +#undef PE3 +#define PE3 _STM32_PIN(E, 3) +#undef PE4 +#define PE4 _STM32_PIN(E, 4) +#undef PE5 +#define PE5 _STM32_PIN(E, 5) +#undef PE6 +#define PE6 _STM32_PIN(E, 6) +#undef PE7 +#define PE7 _STM32_PIN(E, 7) +#undef PE8 +#define PE8 _STM32_PIN(E, 8) +#undef PE9 +#define PE9 _STM32_PIN(E, 9) +#undef PE10 +#define PE10 _STM32_PIN(E, 10) +#undef PE11 +#define PE11 _STM32_PIN(E, 11) +#undef PE12 +#define PE12 _STM32_PIN(E, 12) +#undef PE13 +#define PE13 _STM32_PIN(E, 13) +#undef PE14 +#define PE14 _STM32_PIN(E, 14) +#undef PE15 +#define PE15 _STM32_PIN(E, 15) + +#ifdef STM32F7 + + #undef PORTF + #define PORTF 5 + #undef PF0 + #define PF0 _STM32_PIN(F, 0) + #undef PF1 + #define PF1 _STM32_PIN(F, 1) + #undef PF2 + #define PF2 _STM32_PIN(F, 2) + #undef PF3 + #define PF3 _STM32_PIN(F, 3) + #undef PF4 + #define PF4 _STM32_PIN(F, 4) + #undef PF5 + #define PF5 _STM32_PIN(F, 5) + #undef PF6 + #define PF6 _STM32_PIN(F, 6) + #undef PF7 + #define PF7 _STM32_PIN(F, 7) + #undef PF8 + #define PF8 _STM32_PIN(F, 8) + #undef PF9 + #define PF9 _STM32_PIN(F, 9) + #undef PF10 + #define PF10 _STM32_PIN(F, 10) + #undef PF11 + #define PF11 _STM32_PIN(F, 11) + #undef PF12 + #define PF12 _STM32_PIN(F, 12) + #undef PF13 + #define PF13 _STM32_PIN(F, 13) + #undef PF14 + #define PF14 _STM32_PIN(F, 14) + #undef PF15 + #define PF15 _STM32_PIN(F, 15) + + #undef PORTG + #define PORTG 6 + #undef PG0 + #define PG0 _STM32_PIN(G, 0) + #undef PG1 + #define PG1 _STM32_PIN(G, 1) + #undef PG2 + #define PG2 _STM32_PIN(G, 2) + #undef PG3 + #define PG3 _STM32_PIN(G, 3) + #undef PG4 + #define PG4 _STM32_PIN(G, 4) + #undef PG5 + #define PG5 _STM32_PIN(G, 5) + #undef PG6 + #define PG6 _STM32_PIN(G, 6) + #undef PG7 + #define PG7 _STM32_PIN(G, 7) + #undef PG8 + #define PG8 _STM32_PIN(G, 8) + #undef PG9 + #define PG9 _STM32_PIN(G, 9) + #undef PG10 + #define PG10 _STM32_PIN(G, 10) + #undef PG11 + #define PG11 _STM32_PIN(G, 11) + #undef PG12 + #define PG12 _STM32_PIN(G, 12) + #undef PG13 + #define PG13 _STM32_PIN(G, 13) + #undef PG14 + #define PG14 _STM32_PIN(G, 14) + #undef PG15 + #define PG15 _STM32_PIN(G, 15) + +#endif // STM32GENERIC && STM32F7 diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/fastio_STM32_F4_F7.h b/Marlin/src/HAL/HAL_STM32_F4_F7/fastio_STM32_F4_F7.h deleted file mode 100644 index d65900540d..0000000000 --- a/Marlin/src/HAL/HAL_STM32_F4_F7/fastio_STM32_F4_F7.h +++ /dev/null @@ -1,204 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * Copyright (c) 2017 Victor Perez - * - * 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 . - * - */ -#pragma once - -/** - * Fast I/O interfaces for STM32F4/7 - * These use GPIO functions instead of Direct Port Manipulation, as on AVR. - */ - -#define READ(IO) digitalRead(IO) -#define WRITE(IO,V) digitalWrite(IO,V) - -#define _GET_MODE(IO) -#define _SET_MODE(IO,M) pinMode(IO, M) -#define _SET_OUTPUT(IO) pinMode(IO, OUTPUT) /*!< Output Push Pull Mode & GPIO_NOPULL */ - -#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0) - -#define SET_INPUT(IO) _SET_MODE(IO, INPUT) /*!< Input Floating Mode */ -#define SET_INPUT_PULLUP(IO) _SET_MODE(IO, INPUT_PULLUP) /*!< Input with Pull-up activation */ -#define SET_INPUT_PULLDOWN(IO) _SET_MODE(IO, INPUT_PULLDOWN) /*!< Input with Pull-down activation */ -#define SET_OUTPUT(IO) OUT_WRITE(IO, LOW) -#define SET_PWM(IO) _SET_MODE(IO, PWM) - -#define TOGGLE(IO) OUT_WRITE(IO, !READ(IO)) - -#define IS_INPUT(IO) -#define IS_OUTPUT(IO) - -#define PWM_PIN(P) true - -// digitalRead/Write wrappers -#define extDigitalRead(IO) digitalRead(IO) -#define extDigitalWrite(IO,V) digitalWrite(IO,V) - -// -// Pins Definitions -// -#define PORTA 0 -#define PORTB 1 -#define PORTC 2 -#define PORTD 3 -#define PORTE 4 - -#define _STM32_PIN(P,PN) ((PORT##P * 16) + PN) - -#ifndef PA0 - #define PA0 _STM32_PIN(A, 0) - #define PA1 _STM32_PIN(A, 1) - #define PA2 _STM32_PIN(A, 2) - #define PA3 _STM32_PIN(A, 3) - #define PA4 _STM32_PIN(A, 4) - #define PA5 _STM32_PIN(A, 5) - #define PA6 _STM32_PIN(A, 6) - #define PA7 _STM32_PIN(A, 7) - #define PA8 _STM32_PIN(A, 8) - #define PA9 _STM32_PIN(A, 9) - #define PA10 _STM32_PIN(A, 10) - #define PA11 _STM32_PIN(A, 11) - #define PA12 _STM32_PIN(A, 12) - #define PA13 _STM32_PIN(A, 13) - #define PA14 _STM32_PIN(A, 14) - #define PA15 _STM32_PIN(A, 15) -#endif - -#ifndef PB0 - #define PB0 _STM32_PIN(B, 0) - #define PB1 _STM32_PIN(B, 1) - #define PB2 _STM32_PIN(B, 2) - #define PB3 _STM32_PIN(B, 3) - #define PB4 _STM32_PIN(B, 4) - #define PB5 _STM32_PIN(B, 5) - #define PB6 _STM32_PIN(B, 6) - #define PB7 _STM32_PIN(B, 7) - #define PB8 _STM32_PIN(B, 8) - #define PB9 _STM32_PIN(B, 9) - #define PB10 _STM32_PIN(B, 10) - #define PB11 _STM32_PIN(B, 11) - #define PB12 _STM32_PIN(B, 12) - #define PB13 _STM32_PIN(B, 13) - #define PB14 _STM32_PIN(B, 14) - #define PB15 _STM32_PIN(B, 15) -#endif - -#ifndef PC0 - #define PC0 _STM32_PIN(C, 0) - #define PC1 _STM32_PIN(C, 1) - #define PC2 _STM32_PIN(C, 2) - #define PC3 _STM32_PIN(C, 3) - #define PC4 _STM32_PIN(C, 4) - #define PC5 _STM32_PIN(C, 5) - #define PC6 _STM32_PIN(C, 6) - #define PC7 _STM32_PIN(C, 7) - #define PC8 _STM32_PIN(C, 8) - #define PC9 _STM32_PIN(C, 9) - #define PC10 _STM32_PIN(C, 10) - #define PC11 _STM32_PIN(C, 11) - #define PC12 _STM32_PIN(C, 12) - #define PC13 _STM32_PIN(C, 13) - #define PC14 _STM32_PIN(C, 14) - #define PC15 _STM32_PIN(C, 15) -#endif - -#ifndef PD0 - #define PD0 _STM32_PIN(D, 0) - #define PD1 _STM32_PIN(D, 1) - #define PD2 _STM32_PIN(D, 2) - #define PD3 _STM32_PIN(D, 3) - #define PD4 _STM32_PIN(D, 4) - #define PD5 _STM32_PIN(D, 5) - #define PD6 _STM32_PIN(D, 6) - #define PD7 _STM32_PIN(D, 7) - #define PD8 _STM32_PIN(D, 8) - #define PD9 _STM32_PIN(D, 9) - #define PD10 _STM32_PIN(D, 10) - #define PD11 _STM32_PIN(D, 11) - #define PD12 _STM32_PIN(D, 12) - #define PD13 _STM32_PIN(D, 13) - #define PD14 _STM32_PIN(D, 14) - #define PD15 _STM32_PIN(D, 15) -#endif - -#ifndef PE0 - #define PE0 _STM32_PIN(E, 0) - #define PE1 _STM32_PIN(E, 1) - #define PE2 _STM32_PIN(E, 2) - #define PE3 _STM32_PIN(E, 3) - #define PE4 _STM32_PIN(E, 4) - #define PE5 _STM32_PIN(E, 5) - #define PE6 _STM32_PIN(E, 6) - #define PE7 _STM32_PIN(E, 7) - #define PE8 _STM32_PIN(E, 8) - #define PE9 _STM32_PIN(E, 9) - #define PE10 _STM32_PIN(E, 10) - #define PE11 _STM32_PIN(E, 11) - #define PE12 _STM32_PIN(E, 12) - #define PE13 _STM32_PIN(E, 13) - #define PE14 _STM32_PIN(E, 14) - #define PE15 _STM32_PIN(E, 15) -#endif - -#ifdef STM32F7 - - #ifndef PF0 - #define PORTF 5 - #define PF0 _STM32_PIN(F, 0) - #define PF1 _STM32_PIN(F, 1) - #define PF2 _STM32_PIN(F, 2) - #define PF3 _STM32_PIN(F, 3) - #define PF4 _STM32_PIN(F, 4) - #define PF5 _STM32_PIN(F, 5) - #define PF6 _STM32_PIN(F, 6) - #define PF7 _STM32_PIN(F, 7) - #define PF8 _STM32_PIN(F, 8) - #define PF9 _STM32_PIN(F, 9) - #define PF10 _STM32_PIN(F, 10) - #define PF11 _STM32_PIN(F, 11) - #define PF12 _STM32_PIN(F, 12) - #define PF13 _STM32_PIN(F, 13) - #define PF14 _STM32_PIN(F, 14) - #define PF15 _STM32_PIN(F, 15) - #endif - - #ifndef PG0 - #define PORTG 6 - #define PG0 _STM32_PIN(G, 0) - #define PG1 _STM32_PIN(G, 1) - #define PG2 _STM32_PIN(G, 2) - #define PG3 _STM32_PIN(G, 3) - #define PG4 _STM32_PIN(G, 4) - #define PG5 _STM32_PIN(G, 5) - #define PG6 _STM32_PIN(G, 6) - #define PG7 _STM32_PIN(G, 7) - #define PG8 _STM32_PIN(G, 8) - #define PG9 _STM32_PIN(G, 9) - #define PG10 _STM32_PIN(G, 10) - #define PG11 _STM32_PIN(G, 11) - #define PG12 _STM32_PIN(G, 12) - #define PG13 _STM32_PIN(G, 13) - #define PG14 _STM32_PIN(G, 14) - #define PG15 _STM32_PIN(G, 15) - #endif - -#endif // STM32GENERIC && STM32F7 diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_timers_STM32_F4_F7.h b/Marlin/src/HAL/HAL_STM32_F4_F7/timers.h similarity index 91% rename from Marlin/src/HAL/HAL_STM32_F4_F7/HAL_timers_STM32_F4_F7.h rename to Marlin/src/HAL/HAL_STM32_F4_F7/timers.h index e7fcd6c7c6..cf33205bdd 100644 --- a/Marlin/src/HAL/HAL_STM32_F4_F7/HAL_timers_STM32_F4_F7.h +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/timers.h @@ -22,7 +22,7 @@ #pragma once #ifdef STM32F4 - #include "STM32F4/HAL_timers_STM32F4.h" + #include "STM32F4/timers.h" #else - #include "STM32F7/HAL_timers_STM32F7.h" + #include "STM32F7/timers.h" #endif diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog_STM32_F4_F7.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.cpp similarity index 97% rename from Marlin/src/HAL/HAL_STM32_F4_F7/watchdog_STM32_F4_F7.cpp rename to Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.cpp index efb72a8ba7..e078d7a104 100644 --- a/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog_STM32_F4_F7.cpp +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.cpp @@ -26,7 +26,7 @@ #if ENABLED(USE_WATCHDOG) - #include "watchdog_STM32_F4_F7.h" + #include "watchdog.h" IWDG_HandleTypeDef hiwdg; diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog_STM32_F4_F7.h b/Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.h similarity index 100% rename from Marlin/src/HAL/HAL_STM32_F4_F7/watchdog_STM32_F4_F7.h rename to Marlin/src/HAL/HAL_STM32_F4_F7/watchdog.h diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/HAL.cpp b/Marlin/src/HAL/HAL_TEENSY31_32/HAL.cpp index 56b6097858..2e15324e3b 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/HAL.cpp +++ b/Marlin/src/HAL/HAL_TEENSY31_32/HAL.cpp @@ -44,10 +44,10 @@ static const uint8_t pin2sc1a[] = { /* // disable interrupts - void cli(void) { noInterrupts(); } + void cli() { noInterrupts(); } // enable interrupts - void sei(void) { interrupts(); } + void sei() { interrupts(); } */ void HAL_adc_init() { @@ -56,9 +56,9 @@ void HAL_adc_init() { NVIC_ENABLE_IRQ(IRQ_FTM1); } -void HAL_clear_reset_source(void) { } +void HAL_clear_reset_source() { } -uint8_t HAL_get_reset_source(void) { +uint8_t HAL_get_reset_source() { switch (RCM_SRS0) { case 128: return RST_POWER_ON; break; case 64: return RST_EXTERNAL; break; @@ -87,6 +87,6 @@ extern "C" { void HAL_adc_start_conversion(const uint8_t adc_pin) { ADC0_SC1A = pin2sc1a[adc_pin]; } -uint16_t HAL_adc_get_result(void) { return ADC0_RA; } +uint16_t HAL_adc_get_result() { return ADC0_RA; } #endif // __MK20DX256__ diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h b/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h index 8911f9cf3b..4813d60d69 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h +++ b/Marlin/src/HAL/HAL_TEENSY31_32/HAL.h @@ -31,10 +31,10 @@ #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" -#include "fastio_Teensy.h" -#include "watchdog_Teensy.h" +#include "fastio.h" +#include "watchdog.h" -#include "HAL_timers_Teensy.h" +#include "timers.h" #include @@ -87,34 +87,23 @@ typedef int8_t pin_t; #undef pgm_read_word #define pgm_read_word(addr) (*((uint16_t*)(addr))) -inline void HAL_init(void) { } +inline void HAL_init() { } // Clear the reset reason -void HAL_clear_reset_source(void); +void HAL_clear_reset_source(); // Get the reason for the reset -uint8_t HAL_get_reset_source(void); +uint8_t HAL_get_reset_source(); FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" extern "C" { - int freeMemory(void); + int freeMemory(); } #pragma GCC diagnostic pop -// SPI: Extended functions which take a channel number (hardware SPI only) - -// Write single byte to specified SPI channel -void spiSend(uint32_t chan, byte b); - -// Write buffer to specified SPI channel -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); - -// Read single byte from specified SPI channel -uint8_t spiRec(uint32_t chan); - // ADC void HAL_adc_init(); @@ -126,7 +115,7 @@ void HAL_adc_init(); #define HAL_ANALOG_SELECT(pin) void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(void); +uint16_t HAL_adc_get_result(); #define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_INDEX(pin) pin diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_spi_Teensy.cpp b/Marlin/src/HAL/HAL_TEENSY31_32/HAL_SPI.cpp similarity index 98% rename from Marlin/src/HAL/HAL_TEENSY31_32/HAL_spi_Teensy.cpp rename to Marlin/src/HAL/HAL_TEENSY31_32/HAL_SPI.cpp index f53658ec55..4236f02b0f 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_spi_Teensy.cpp +++ b/Marlin/src/HAL/HAL_TEENSY31_32/HAL_SPI.cpp @@ -34,7 +34,7 @@ static SPISettings spiConfig; */ // Initialize SPI bus -void spiBegin(void) { +void spiBegin() { #if !PIN_EXISTS(SS) #error "SS_PIN not defined!" #endif @@ -71,7 +71,7 @@ void spiInit(uint8_t spiRate) { } // SPI receive a byte -uint8_t spiRec(void) { +uint8_t spiRec() { SPI.beginTransaction(spiConfig); const uint8_t returnByte = SPI.transfer(0xFF); SPI.endTransaction(); diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_Servo_Teensy.cpp b/Marlin/src/HAL/HAL_TEENSY31_32/Servo.cpp similarity index 70% rename from Marlin/src/HAL/HAL_TEENSY31_32/HAL_Servo_Teensy.cpp rename to Marlin/src/HAL/HAL_TEENSY31_32/Servo.cpp index 2ffd96e3e1..6451f6b172 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_Servo_Teensy.cpp +++ b/Marlin/src/HAL/HAL_TEENSY31_32/Servo.cpp @@ -25,29 +25,29 @@ #if HAS_SERVOS -#include "HAL_Servo_Teensy.h" +#include "Servo.h" uint8_t servoPin[MAX_SERVOS] = { 0 }; -int8_t libServo::attach(const int pin) { - if (this->servoIndex >= MAX_SERVOS) return -1; - if (pin > 0) servoPin[this->servoIndex] = pin; - return Servo::attach(servoPin[this->servoIndex]); +int8_t libServo::attach(const int inPin) { + if (servoIndex >= MAX_SERVOS) return -1; + if (inPin > 0) servoPin[servoIndex] = inPin; + return super::attach(servoPin[servoIndex]); } -int8_t libServo::attach(const int pin, const int min, const int max) { - if (pin > 0) servoPin[this->servoIndex] = pin; - return Servo::attach(servoPin[this->servoIndex], min, max); +int8_t libServo::attach(const int inPin, const int inMin, const int inMax) { + if (inPin > 0) servoPin[servoIndex] = inPin; + return super::attach(servoPin[servoIndex], inMin, inMax); } void libServo::move(const int value) { constexpr uint16_t servo_delay[] = SERVO_DELAY; static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long."); - if (this->attach(0) >= 0) { - this->write(value); - safe_delay(servo_delay[this->servoIndex]); + if (attach(0) >= 0) { + write(value); + safe_delay(servo_delay[servoIndex]); #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); + detach(); #endif } } diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_Servo_Teensy.h b/Marlin/src/HAL/HAL_TEENSY31_32/Servo.h similarity index 87% rename from Marlin/src/HAL/HAL_TEENSY31_32/HAL_Servo_Teensy.h rename to Marlin/src/HAL/HAL_TEENSY31_32/Servo.h index e096dc60c8..3eb7d39b22 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_Servo_Teensy.h +++ b/Marlin/src/HAL/HAL_TEENSY31_32/Servo.h @@ -30,7 +30,8 @@ class libServo : public Servo { int8_t attach(const int pin, const int min, const int max); void move(const int value); private: - uint16_t min_ticks; - uint16_t max_ticks; - uint8_t servoIndex; // index into the channel data for this servo + typedef Servo super; + uint16_t min_ticks; + uint16_t max_ticks; + uint8_t servoIndex; // index into the channel data for this servo }; diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/endstop_interrupts.h b/Marlin/src/HAL/HAL_TEENSY31_32/endstop_interrupts.h index 743f917816..221b721b35 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_TEENSY31_32/endstop_interrupts.h @@ -38,48 +38,40 @@ #include "../../module/endstops.h" // One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } +void endstop_ISR() { endstops.update(); } /** * Endstop interrupts for Due based targets. * On Due, all pins support external interrupt capability. */ -void setup_endstop_interrupts( void ) { - +void setup_endstop_interrupts() { + #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) #if HAS_X_MAX - attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); // assign it + _ATTACH(X_MAX_PIN); #endif - #if HAS_X_MIN - attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(X_MIN_PIN); #endif - #if HAS_Y_MAX - attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MAX_PIN); #endif - #if HAS_Y_MIN - attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MIN_PIN); #endif - #if HAS_Z_MAX - attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MAX_PIN); #endif - #if HAS_Z_MIN - attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PIN); #endif - #if HAS_Z2_MAX - attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MAX_PIN); #endif - #if HAS_Z2_MIN - attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MIN_PIN); #endif - #if HAS_Z_MIN_PROBE_PIN - attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PROBE_PIN); #endif } diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/fastio_Teensy.h b/Marlin/src/HAL/HAL_TEENSY31_32/fastio.h similarity index 100% rename from Marlin/src/HAL/HAL_TEENSY31_32/fastio_Teensy.h rename to Marlin/src/HAL/HAL_TEENSY31_32/fastio.h diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_timers_Teensy.cpp b/Marlin/src/HAL/HAL_TEENSY31_32/timers.cpp similarity index 97% rename from Marlin/src/HAL/HAL_TEENSY31_32/HAL_timers_Teensy.cpp rename to Marlin/src/HAL/HAL_TEENSY31_32/timers.cpp index ac04325649..1ae4bcf4f0 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_timers_Teensy.cpp +++ b/Marlin/src/HAL/HAL_TEENSY31_32/timers.cpp @@ -27,14 +27,14 @@ #ifdef __MK20DX256__ #include "HAL.h" -#include "HAL_timers_Teensy.h" +#include "timers.h" /** \brief Instruction Synchronization Barrier Instruction Synchronization Barrier flushes the pipeline in the processor, so that all instructions following the ISB are fetched from cache or memory, after the instruction has been completed. */ -FORCE_INLINE static void __ISB(void) { +FORCE_INLINE static void __ISB() { __asm__ __volatile__("isb 0xF":::"memory"); } @@ -42,7 +42,7 @@ FORCE_INLINE static void __ISB(void) { This function acts as a special kind of Data Memory Barrier. It completes when all explicit memory accesses before this instruction complete. */ -FORCE_INLINE static void __DSB(void) { +FORCE_INLINE static void __DSB() { __asm__ __volatile__("dsb 0xF":::"memory"); } diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_timers_Teensy.h b/Marlin/src/HAL/HAL_TEENSY31_32/timers.h similarity index 95% rename from Marlin/src/HAL/HAL_TEENSY31_32/HAL_timers_Teensy.h rename to Marlin/src/HAL/HAL_TEENSY31_32/timers.h index 52d4965e35..6dff7701be 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/HAL_timers_Teensy.h +++ b/Marlin/src/HAL/HAL_TEENSY31_32/timers.h @@ -68,8 +68,8 @@ typedef uint32_t hal_timer_t; #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) -#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr(void) //void TC3_Handler() -#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr(void) //void TC4_Handler() +#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler() +#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler() void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/watchdog_Teensy.cpp b/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.cpp similarity index 97% rename from Marlin/src/HAL/HAL_TEENSY31_32/watchdog_Teensy.cpp rename to Marlin/src/HAL/HAL_TEENSY31_32/watchdog.cpp index bf812d9a51..d1313e1f5d 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/watchdog_Teensy.cpp +++ b/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.cpp @@ -26,7 +26,7 @@ #if ENABLED(USE_WATCHDOG) -#include "watchdog_Teensy.h" +#include "watchdog.h" void watchdog_init() { WDOG_TOVALH = 0; diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/watchdog_Teensy.h b/Marlin/src/HAL/HAL_TEENSY31_32/watchdog.h similarity index 100% rename from Marlin/src/HAL/HAL_TEENSY31_32/watchdog_Teensy.h rename to Marlin/src/HAL/HAL_TEENSY31_32/watchdog.h diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp index 33541c03bf..5848944792 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp +++ b/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp @@ -51,10 +51,10 @@ static const uint8_t pin2sc1a[] = { /* // disable interrupts - void cli(void) { noInterrupts(); } + void cli() { noInterrupts(); } // enable interrupts - void sei(void) { interrupts(); } + void sei() { interrupts(); } */ void HAL_adc_init() { @@ -64,9 +64,9 @@ void HAL_adc_init() { NVIC_ENABLE_IRQ(IRQ_FTM1); } -void HAL_clear_reset_source(void) { } +void HAL_clear_reset_source() { } -uint8_t HAL_get_reset_source(void) { +uint8_t HAL_get_reset_source() { switch (RCM_SRS0) { case 128: return RST_POWER_ON; break; case 64: return RST_EXTERNAL; break; @@ -109,7 +109,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { } } -uint16_t HAL_adc_get_result(void) { +uint16_t HAL_adc_get_result() { switch (HAL_adc_select) { case 0: return ADC0_RA; case 1: return ADC1_RA; diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h b/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h index fb152ee30a..e218174ad3 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h +++ b/Marlin/src/HAL/HAL_TEENSY35_36/HAL.h @@ -31,10 +31,10 @@ #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" -#include "fastio_Teensy.h" -#include "watchdog_Teensy.h" +#include "fastio.h" +#include "watchdog.h" -#include "HAL_timers_Teensy.h" +#include "timers.h" #include #include @@ -93,31 +93,23 @@ typedef int8_t pin_t; #undef pgm_read_word #define pgm_read_word(addr) (*((uint16_t*)(addr))) -inline void HAL_init(void) { } +inline void HAL_init() { } // Clear reset reason -void HAL_clear_reset_source(void); +void HAL_clear_reset_source(); // Reset reason -uint8_t HAL_get_reset_source(void); +uint8_t HAL_get_reset_source(); FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" extern "C" { - int freeMemory(void); + int freeMemory(); } #pragma GCC diagnostic pop -// SPI: Extended functions which take a channel number (hardware SPI only) -// Write single byte to specified SPI channel -void spiSend(uint32_t chan, byte b); -// Write buffer to specified SPI channel -void spiSend(uint32_t chan, const uint8_t* buf, size_t n); -// Read single byte from specified SPI channel -uint8_t spiRec(uint32_t chan); - // ADC void HAL_adc_init(); @@ -129,7 +121,7 @@ void HAL_adc_init(); #define HAL_ANALOG_SELECT(pin) void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(void); +uint16_t HAL_adc_get_result(); #define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_INDEX(pin) pin diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_spi_Teensy.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/HAL_SPI.cpp similarity index 98% rename from Marlin/src/HAL/HAL_TEENSY35_36/HAL_spi_Teensy.cpp rename to Marlin/src/HAL/HAL_TEENSY35_36/HAL_SPI.cpp index 35424625d5..44ab74cc9b 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_spi_Teensy.cpp +++ b/Marlin/src/HAL/HAL_TEENSY35_36/HAL_SPI.cpp @@ -29,7 +29,7 @@ static SPISettings spiConfig; -void spiBegin(void) { +void spiBegin() { #if !PIN_EXISTS(SS) #error SS_PIN not defined! #endif @@ -65,7 +65,7 @@ void spiInit(uint8_t spiRate) { SPI.begin(); } -uint8_t spiRec(void) { +uint8_t spiRec() { SPI.beginTransaction(spiConfig); uint8_t returnByte = SPI.transfer(0xFF); SPI.endTransaction(); diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_Servo_Teensy.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/HAL_Servo_Teensy.cpp deleted file mode 100644 index ff56036ccd..0000000000 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_Servo_Teensy.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#if defined(__MK64FX512__) || defined(__MK66FX1M0__) - -#include "../../inc/MarlinConfig.h" - -#if HAS_SERVOS - -#include "HAL_Servo_Teensy.h" - -uint8_t servoPin[MAX_SERVOS] = { 0 }; - -int8_t libServo::attach(const int pin) { - if (this->servoIndex >= MAX_SERVOS) return -1; - if (pin > 0) servoPin[this->servoIndex] = pin; - return Servo::attach(servoPin[this->servoIndex]); -} - -int8_t libServo::attach(const int pin, const int min, const int max) { - if (pin > 0) servoPin[this->servoIndex] = pin; - return Servo::attach(servoPin[this->servoIndex], min, max); -} - -void libServo::move(const int value) { - constexpr uint16_t servo_delay[] = SERVO_DELAY; - static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long."); - if (this->attach(0) >= 0) { - this->write(value); - safe_delay(servo_delay[this->servoIndex]); - #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); - #endif - } -} - -#endif // HAS_SERVOS - -#endif // __MK64FX512__ || __MK66FX1M0__ diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/Servo.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/Servo.cpp new file mode 100644 index 0000000000..d376b80a7d --- /dev/null +++ b/Marlin/src/HAL/HAL_TEENSY35_36/Servo.cpp @@ -0,0 +1,57 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#if defined(__MK64FX512__) || defined(__MK66FX1M0__) + +#include "../../inc/MarlinConfig.h" + +#if HAS_SERVOS + +#include "Servo.h" + +uint8_t servoPin[MAX_SERVOS] = { 0 }; + +int8_t libServo::attach(const int inPin) { + if (servoIndex >= MAX_SERVOS) return -1; + if (inPin > 0) servoPin[servoIndex] = inPin; + return super::attach(servoPin[servoIndex]); +} + +int8_t libServo::attach(const int inPin, const int inMin, const int inMax) { + if (inPin > 0) servoPin[servoIndex] = inPin; + return super::attach(servoPin[servoIndex], inMin, inMax); +} + +void libServo::move(const int value) { + constexpr uint16_t servo_delay[] = SERVO_DELAY; + static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long."); + if (attach(0) >= 0) { + write(value); + safe_delay(servo_delay[servoIndex]); + #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) + detach(); + #endif + } +} + +#endif // HAS_SERVOS + +#endif // __MK64FX512__ || __MK66FX1M0__ diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_Servo_Teensy.h b/Marlin/src/HAL/HAL_TEENSY35_36/Servo.h similarity index 88% rename from Marlin/src/HAL/HAL_TEENSY35_36/HAL_Servo_Teensy.h rename to Marlin/src/HAL/HAL_TEENSY35_36/Servo.h index 4b97dbffbb..cafd323a38 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_Servo_Teensy.h +++ b/Marlin/src/HAL/HAL_TEENSY35_36/Servo.h @@ -30,7 +30,8 @@ class libServo : public Servo { int8_t attach(const int pin, const int min, const int max); void move(const int value); private: - uint16_t min_ticks; - uint16_t max_ticks; - uint8_t servoIndex; // Index into the channel data for this servo + typedef Servo super; + uint16_t min_ticks; + uint16_t max_ticks; + uint8_t servoIndex; // Index into the channel data for this servo }; diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/endstop_interrupts.h b/Marlin/src/HAL/HAL_TEENSY35_36/endstop_interrupts.h index 137cb472ef..3862f2b5b8 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_TEENSY35_36/endstop_interrupts.h @@ -38,44 +38,45 @@ #include "../../module/endstops.h" // One ISR for all EXT-Interrupts -void endstop_ISR(void) { endstops.update(); } +void endstop_ISR() { endstops.update(); } /** * Endstop interrupts for Due based targets. * On Due, all pins support external interrupt capability. */ -void setup_endstop_interrupts( void ) { +void setup_endstop_interrupts() { + #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) #if HAS_X_MAX - attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); // assign it + _ATTACH(X_MAX_PIN); #endif #if HAS_X_MIN - attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(X_MIN_PIN); #endif #if HAS_Y_MAX - attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MAX_PIN); #endif #if HAS_Y_MIN - attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Y_MIN_PIN); #endif #if HAS_Z_MAX - attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MAX_PIN); #endif #if HAS_Z_MIN - attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PIN); #endif #if HAS_Z2_MAX - attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MAX_PIN); #endif #if HAS_Z2_MIN - attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z2_MIN_PIN); #endif #if HAS_Z3_MAX - attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MAX_PIN); #endif #if HAS_Z3_MIN - attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE); + _ATTACH(Z3_MIN_PIN); #endif #if HAS_Z_MIN_PROBE_PIN - attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE); + _ATTACH(Z_MIN_PROBE_PIN); #endif } diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/fastio_Teensy.h b/Marlin/src/HAL/HAL_TEENSY35_36/fastio.h similarity index 100% rename from Marlin/src/HAL/HAL_TEENSY35_36/fastio_Teensy.h rename to Marlin/src/HAL/HAL_TEENSY35_36/fastio.h diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/timers.cpp similarity index 97% rename from Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.cpp rename to Marlin/src/HAL/HAL_TEENSY35_36/timers.cpp index 8c01120cc7..6ee6118208 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.cpp +++ b/Marlin/src/HAL/HAL_TEENSY35_36/timers.cpp @@ -28,14 +28,14 @@ #if defined(__MK64FX512__) || defined(__MK66FX1M0__) #include "HAL.h" -#include "HAL_timers_Teensy.h" +#include "timers.h" /** \brief Instruction Synchronization Barrier Instruction Synchronization Barrier flushes the pipeline in the processor, so that all instructions following the ISB are fetched from cache or memory, after the instruction has been completed. */ -FORCE_INLINE static void __ISB(void) { +FORCE_INLINE static void __ISB() { __asm__ __volatile__("isb 0xF":::"memory"); } @@ -43,7 +43,7 @@ FORCE_INLINE static void __ISB(void) { This function acts as a special kind of Data Memory Barrier. It completes when all explicit memory accesses before this instruction complete. */ -FORCE_INLINE static void __DSB(void) { +FORCE_INLINE static void __DSB() { __asm__ __volatile__("dsb 0xF":::"memory"); } diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.h b/Marlin/src/HAL/HAL_TEENSY35_36/timers.h similarity index 95% rename from Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.h rename to Marlin/src/HAL/HAL_TEENSY35_36/timers.h index 741f27c0ba..8ae51107c7 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL_timers_Teensy.h +++ b/Marlin/src/HAL/HAL_TEENSY35_36/timers.h @@ -67,8 +67,8 @@ typedef uint32_t hal_timer_t; #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) -#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr(void) //void TC3_Handler() -#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr(void) //void TC4_Handler() +#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler() +#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler() void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/watchdog_Teensy.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.cpp similarity index 97% rename from Marlin/src/HAL/HAL_TEENSY35_36/watchdog_Teensy.cpp rename to Marlin/src/HAL/HAL_TEENSY35_36/watchdog.cpp index 7924c03730..f58217c750 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/watchdog_Teensy.cpp +++ b/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.cpp @@ -26,7 +26,7 @@ #if ENABLED(USE_WATCHDOG) -#include "watchdog_Teensy.h" +#include "watchdog.h" void watchdog_init() { WDOG_TOVALH = 0; diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/watchdog_Teensy.h b/Marlin/src/HAL/HAL_TEENSY35_36/watchdog.h similarity index 100% rename from Marlin/src/HAL/HAL_TEENSY35_36/watchdog_Teensy.h rename to Marlin/src/HAL/HAL_TEENSY35_36/watchdog.h diff --git a/Marlin/src/HAL/shared/Delay.h b/Marlin/src/HAL/shared/Delay.h index 1bcfb9e8a6..1c2ee47c29 100644 --- a/Marlin/src/HAL/shared/Delay.h +++ b/Marlin/src/HAL/shared/Delay.h @@ -29,8 +29,8 @@ * DELAY_US(count): Delay execution in microseconds */ -#include "../../core/macros.h" #include "../../core/millis_t.h" +#include "../../core/macros.h" #if defined(__arm__) || defined(__thumb__) diff --git a/Marlin/src/HAL/shared/HAL_SPI.h b/Marlin/src/HAL/shared/HAL_SPI.h index 16a58f673a..d805207047 100644 --- a/Marlin/src/HAL/shared/HAL_SPI.h +++ b/Marlin/src/HAL/shared/HAL_SPI.h @@ -22,10 +22,11 @@ #pragma once /** - * HAL/HAL_SPI.h + * HAL/shared/HAL_SPI.h * Core Marlin definitions for SPI, implemented in the HALs */ +#include "Marduino.h" #include /** @@ -53,18 +54,40 @@ #define SPI_SPEED_5 5 // Set SCK rate to 1/32 of max rate #define SPI_SPEED_6 6 // Set SCK rate to 1/64 of max rate +// // Standard SPI functions -/** Initialize SPI bus */ -void spiBegin(void); -/** Configure SPI for specified SPI speed */ +// + +// Initialize SPI bus +void spiBegin(); + +// Configure SPI for specified SPI speed void spiInit(uint8_t spiRate); -/** Write single byte to SPI */ + +// Write single byte to SPI void spiSend(uint8_t b); -/** Read single byte from SPI */ -uint8_t spiRec(void); -/** Read from SPI into buffer */ + +// Read single byte from SPI +uint8_t spiRec(); + +// Read from SPI into buffer void spiRead(uint8_t* buf, uint16_t nbyte); -/** Write token and then write from 512 byte buffer to SPI (for SD card) */ + +// Write token and then write from 512 byte buffer to SPI (for SD card) void spiSendBlock(uint8_t token, const uint8_t* buf); -/** Begin SPI transaction, set clock, bit order, data mode */ + +// Begin SPI transaction, set clock, bit order, data mode void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode); + +// +// Extended SPI functions taking a channel number (Hardware SPI only) +// + +// Write single byte to specified SPI channel +void spiSend(uint32_t chan, byte b); + +// Write buffer to specified SPI channel +void spiSend(uint32_t chan, const uint8_t* buf, size_t n); + +// Read single byte from specified SPI channel +uint8_t spiRec(uint32_t chan); diff --git a/Marlin/src/HAL/shared/Marduino.h b/Marlin/src/HAL/shared/Marduino.h index 891646daab..a2de03a2b6 100644 --- a/Marlin/src/HAL/shared/Marduino.h +++ b/Marlin/src/HAL/shared/Marduino.h @@ -31,6 +31,7 @@ #undef sq // Redefined by teensy3/wiring.h #undef SBI // Redefined by arduino/const_functions.h #undef CBI // Redefined by arduino/const_functions.h +#undef UNUSED // Redefined by stm32f4xx_hal_def.h #include // NOTE: If included earlier then this line is a NOOP @@ -57,6 +58,9 @@ //#define strchr_P(s,c) strchr(s,c) #endif + #ifndef snprintf_P + #define snprintf_P snprintf + #endif #ifndef vsnprintf_P #define vsnprintf_P vsnprintf #endif @@ -74,3 +78,8 @@ #ifndef M_PI #define M_PI 3.14159265358979323846f #endif + +// Remove compiler warning on an unused variable +#ifndef UNUSED + #define UNUSED(x) ((void)(x)) +#endif diff --git a/Marlin/src/HAL/shared/backtrace/backtrace.cpp b/Marlin/src/HAL/shared/backtrace/backtrace.cpp index fc8abfa0e6..fc265615d0 100644 --- a/Marlin/src/HAL/shared/backtrace/backtrace.cpp +++ b/Marlin/src/HAL/shared/backtrace/backtrace.cpp @@ -65,7 +65,7 @@ static const UnwindCallbacks UnwCallbacks = { #endif }; -void backtrace(void) { +void backtrace() { UnwindFrame btf; uint32_t sp = 0, lr = 0, pc = 0; @@ -95,6 +95,6 @@ void backtrace(void) { #else // !__arm__ && !__thumb__ -void backtrace(void) {} +void backtrace() {} #endif diff --git a/Marlin/src/HAL/shared/backtrace/backtrace.h b/Marlin/src/HAL/shared/backtrace/backtrace.h index a3d7cc7e3d..a2b8eae594 100644 --- a/Marlin/src/HAL/shared/backtrace/backtrace.h +++ b/Marlin/src/HAL/shared/backtrace/backtrace.h @@ -22,4 +22,4 @@ #pragma once // Perform a backtrace to the serial port -void backtrace(void); +void backtrace(); diff --git a/Marlin/src/HAL/shared/backtrace/unwarm.cpp b/Marlin/src/HAL/shared/backtrace/unwarm.cpp index fb4263a272..cdc9c06c61 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarm.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarm.cpp @@ -78,7 +78,7 @@ void UnwInitState(UnwState * const state, /**< Pointer to structure to fill. } // Detect if function names are available -static int __attribute__ ((noinline)) has_function_names(void) { +static int __attribute__ ((noinline)) has_function_names() { uint32_t flag_word = ((uint32_t*)(((uint32_t)(&has_function_names)) & (-4))) [-1]; return ((flag_word & 0xFF000000) == 0xFF000000) ? 1 : 0; } diff --git a/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp b/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp index ebd53cc1d9..207cd56aa8 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp @@ -23,9 +23,9 @@ extern "C" const UnwTabEntry __exidx_start[]; extern "C" const UnwTabEntry __exidx_end[]; /* This prevents the linking of libgcc unwinder code */ -void __aeabi_unwind_cpp_pr0(void) {}; -void __aeabi_unwind_cpp_pr1(void) {}; -void __aeabi_unwind_cpp_pr2(void) {}; +void __aeabi_unwind_cpp_pr0() {}; +void __aeabi_unwind_cpp_pr1() {}; +void __aeabi_unwind_cpp_pr2() {}; static inline __attribute__((always_inline)) uint32_t prel31_to_addr(const uint32_t *prel31) { uint32_t offset = (((uint32_t)(*prel31)) << 1) >> 1; @@ -285,7 +285,7 @@ static UnwResult UnwTabExecuteInstructions(const UnwindCallbacks *cb, UnwTabStat return UNWIND_SUCCESS; } -static inline __attribute__((always_inline)) uint32_t read_psp(void) { +static inline __attribute__((always_inline)) uint32_t read_psp() { /* Read the current PSP and return its value as a pointer */ uint32_t psp; diff --git a/Marlin/src/HAL/shared/backtrace/unwinder.cpp b/Marlin/src/HAL/shared/backtrace/unwinder.cpp index bde5899435..e63af1ed25 100644 --- a/Marlin/src/HAL/shared/backtrace/unwinder.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwinder.cpp @@ -27,7 +27,7 @@ extern "C" const UnwTabEntry __exidx_start[]; extern "C" const UnwTabEntry __exidx_end[]; // Detect if unwind information is present or not -static int HasUnwindTableInfo(void) { +static int HasUnwindTableInfo() { // > 16 because there are default entries we can't supress return ((char*)(&__exidx_end) - (char*)(&__exidx_start)) > 16 ? 1 : 0; } diff --git a/Marlin/src/HAL/shared/eeprom_i2c.cpp b/Marlin/src/HAL/shared/eeprom_i2c.cpp index f5e470541d..2752b7d4cc 100644 --- a/Marlin/src/HAL/shared/eeprom_i2c.cpp +++ b/Marlin/src/HAL/shared/eeprom_i2c.cpp @@ -42,12 +42,8 @@ static uint8_t eeprom_device_address = 0x50; // Public functions // ------------------------ -static void eeprom_init(void) { - static bool eeprom_initialized = false; - if (!eeprom_initialized) { - Wire.begin(); - eeprom_initialized = true; - } +static void eeprom_init() { + Wire.begin(); } void eeprom_write_byte(uint8_t *pos, unsigned char value) { diff --git a/Marlin/src/HAL/shared/servo.cpp b/Marlin/src/HAL/shared/servo.cpp index 22cf6bc88f..b5975e58e7 100644 --- a/Marlin/src/HAL/shared/servo.cpp +++ b/Marlin/src/HAL/shared/servo.cpp @@ -58,11 +58,11 @@ #include "servo.h" #include "servo_private.h" -ServoInfo_t servo_info[MAX_SERVOS]; // static array of servo info structures -uint8_t ServoCount = 0; // the total number of attached servos +ServoInfo_t servo_info[MAX_SERVOS]; // static array of servo info structures +uint8_t ServoCount = 0; // the total number of attached servos -#define SERVO_MIN() (MIN_PULSE_WIDTH - this->min * 4) // minimum value in uS for this servo -#define SERVO_MAX() (MAX_PULSE_WIDTH - this->max * 4) // maximum value in uS for this servo +#define SERVO_MIN(v) (MIN_PULSE_WIDTH - (v) * 4) // minimum value in uS for this servo +#define SERVO_MAX(v) (MAX_PULSE_WIDTH - (v) * 4) // maximum value in uS for this servo /************ static functions common to all instances ***********************/ @@ -79,54 +79,54 @@ static boolean isTimerActive(timer16_Sequence_t timer) { Servo::Servo() { if (ServoCount < MAX_SERVOS) { - this->servoIndex = ServoCount++; // assign a servo index to this instance - servo_info[this->servoIndex].ticks = usToTicks(DEFAULT_PULSE_WIDTH); // store default values - 12 Aug 2009 + servoIndex = ServoCount++; // assign a servo index to this instance + servo_info[servoIndex].ticks = usToTicks(DEFAULT_PULSE_WIDTH); // store default values - 12 Aug 2009 } else - this->servoIndex = INVALID_SERVO; // too many servos + servoIndex = INVALID_SERVO; // too many servos } -int8_t Servo::attach(const int pin) { - return this->attach(pin, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH); +int8_t Servo::attach(const int inPin) { + return attach(inPin, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH); } -int8_t Servo::attach(const int pin, const int min, const int max) { +int8_t Servo::attach(const int inPin, const int inMin, const int inMax) { - if (this->servoIndex >= MAX_SERVOS) return -1; + if (servoIndex >= MAX_SERVOS) return -1; - if (pin > 0) servo_info[this->servoIndex].Pin.nbr = pin; - pinMode(servo_info[this->servoIndex].Pin.nbr, OUTPUT); // set servo pin to output + if (inPin > 0) servo_info[servoIndex].Pin.nbr = inPin; + pinMode(servo_info[servoIndex].Pin.nbr, OUTPUT); // set servo pin to output - // todo min/max check: ABS(min - MIN_PULSE_WIDTH) /4 < 128 - this->min = (MIN_PULSE_WIDTH - min) / 4; //resolution of min/max is 4 uS - this->max = (MAX_PULSE_WIDTH - max) / 4; + // TODO: min/max check: ABS(min - MIN_PULSE_WIDTH) / 4 < 128 + min = (MIN_PULSE_WIDTH - inMin) / 4; //resolution of min/max is 4 uS + max = (MAX_PULSE_WIDTH - inMax) / 4; // initialize the timer if it has not already been initialized timer16_Sequence_t timer = SERVO_INDEX_TO_TIMER(servoIndex); if (!isTimerActive(timer)) initISR(timer); - servo_info[this->servoIndex].Pin.isActive = true; // this must be set after the check for isTimerActive + servo_info[servoIndex].Pin.isActive = true; // this must be set after the check for isTimerActive - return this->servoIndex; + return servoIndex; } void Servo::detach() { - servo_info[this->servoIndex].Pin.isActive = false; + servo_info[servoIndex].Pin.isActive = false; timer16_Sequence_t timer = SERVO_INDEX_TO_TIMER(servoIndex); if (!isTimerActive(timer)) finISR(timer); } void Servo::write(int value) { if (value < MIN_PULSE_WIDTH) // treat values less than 544 as angles in degrees (valid values in microseconds are handled as microseconds) - value = map(constrain(value, 0, 180), 0, 180, SERVO_MIN(), SERVO_MAX()); - this->writeMicroseconds(value); + value = map(constrain(value, 0, 180), 0, 180, SERVO_MIN(min), SERVO_MAX(max)); + writeMicroseconds(value); } void Servo::writeMicroseconds(int value) { // calculate and store the values for the given channel - byte channel = this->servoIndex; + byte channel = servoIndex; if (channel < MAX_SERVOS) { // ensure channel is valid // ensure pulse width is valid - value = constrain(value, SERVO_MIN(), SERVO_MAX()) - (TRIM_DURATION); + value = constrain(value, SERVO_MIN(min), SERVO_MAX(max)) - (TRIM_DURATION); value = usToTicks(value); // convert to ticks after compensating for interrupt overhead - 12 Aug 2009 CRITICAL_SECTION_START; @@ -136,22 +136,22 @@ void Servo::writeMicroseconds(int value) { } // return the value as degrees -int Servo::read() { return map(this->readMicroseconds() + 1, SERVO_MIN(), SERVO_MAX(), 0, 180); } +int Servo::read() { return map(readMicroseconds() + 1, SERVO_MIN(min), SERVO_MAX(max), 0, 180); } int Servo::readMicroseconds() { - return (this->servoIndex == INVALID_SERVO) ? 0 : ticksToUs(servo_info[this->servoIndex].ticks) + (TRIM_DURATION); + return (servoIndex == INVALID_SERVO) ? 0 : ticksToUs(servo_info[servoIndex].ticks) + (TRIM_DURATION); } -bool Servo::attached() { return servo_info[this->servoIndex].Pin.isActive; } +bool Servo::attached() { return servo_info[servoIndex].Pin.isActive; } void Servo::move(const int value) { constexpr uint16_t servo_delay[] = SERVO_DELAY; static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long."); - if (this->attach(0) >= 0) { - this->write(value); - safe_delay(servo_delay[this->servoIndex]); + if (attach(0) >= 0) { + write(value); + safe_delay(servo_delay[servoIndex]); #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); + detach(); #endif } } diff --git a/Marlin/src/HAL/shared/servo.h b/Marlin/src/HAL/shared/servo.h index d1a83bf169..e4905b7295 100644 --- a/Marlin/src/HAL/shared/servo.h +++ b/Marlin/src/HAL/shared/servo.h @@ -68,23 +68,23 @@ */ #if IS_TEENSY32 - #include "../HAL_TEENSY31_32/HAL_Servo_Teensy.h" + #include "../HAL_TEENSY31_32/Servo.h" #elif IS_TEENSY35 || IS_TEENSY36 - #include "../HAL_TEENSY35_36/HAL_Servo_Teensy.h" + #include "../HAL_TEENSY35_36/Servo.h" #elif defined(TARGET_LPC1768) - #include "../HAL_LPC1768/HAL_Servo_LPC1768.h" + #include "../HAL_LPC1768/Servo.h" #elif defined(__STM32F1__) || defined(TARGET_STM32F1) - #include "../HAL_STM32F1/HAL_Servo_STM32F1.h" + #include "../HAL_STM32F1/Servo.h" #elif defined(STM32GENERIC) && defined(STM32F4) - #include "../HAL_STM32F4/HAL_Servo_STM32F4.h" + #include "../HAL_STM32_F4_F7/Servo.h" #elif defined(ARDUINO_ARCH_STM32) - #include "../HAL_STM32/HAL_Servo_STM32.h" + #include "../HAL_STM32/Servo.h" #elif defined(ARDUINO_ARCH_ESP32) - #include "../HAL_ESP32/HAL_Servo_ESP32.h" + #include "../HAL_ESP32/Servo.h" #else #include - #if defined(__AVR__) || defined(ARDUINO_ARCH_SAM) || defined (__SAMD51__) + #if defined(__AVR__) || defined(ARDUINO_ARCH_SAM) || defined(__SAMD51__) // we're good to go #else #error "This library only supports boards with an AVR, SAM3X or SAMD51 processor." diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index a548fc43a2..89501e9bfa 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -45,7 +45,7 @@ #include "HAL/shared/Delay.h" -#include "module/stepper_indirection.h" +#include "module/stepper/indirection.h" #ifdef ARDUINO #include @@ -89,6 +89,10 @@ #include "feature/bltouch.h" #endif +#if ENABLED(POLL_JOG) + #include "feature/joystick.h" +#endif + #if HAS_SERVOS #include "module/servo.h" #endif @@ -410,7 +414,7 @@ void disable_all_steppers() { void event_probe_recover() { #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_INFO, PSTR("G29 Retrying")); + host_prompt_do(PROMPT_INFO, PSTR("G29 Retrying"), PSTR("Dismiss")); #endif #ifdef ACTION_ON_G29_RECOVER host_action(PSTR(ACTION_ON_G29_RECOVER)); @@ -668,6 +672,9 @@ void idle( bool no_stepper_sleep/*=false*/ #endif ) { + #if ENABLED(POWER_LOSS_RECOVERY) && PIN_EXISTS(POWER_LOSS) + recovery.outage(); + #endif #if ENABLED(SPI_ENDSTOPS) if (endstops.tmc_spi_homing.any @@ -739,13 +746,17 @@ void idle( #if ENABLED(PRUSA_MMU2) mmu2.mmu_loop(); #endif + + #if ENABLED(POLL_JOG) + joystick.inject_jog_moves(); + #endif } /** * Kill all activity and lock the machine. * After this the machine will need to be reset. */ -void kill(PGM_P const lcd_msg/*=nullptr*/) { +void kill(PGM_P const lcd_msg/*=nullptr*/, const bool steppers_off/*=false*/) { thermalManager.disable_all_heaters(); SERIAL_ERROR_MSG(MSG_ERR_KILLED); @@ -760,10 +771,10 @@ void kill(PGM_P const lcd_msg/*=nullptr*/) { host_action_kill(); #endif - minkill(); + minkill(steppers_off); } -void minkill() { +void minkill(const bool steppers_off/*=false*/) { // Wait a short time (allows messages to get out before shutting down. for (int i = 1000; i--;) DELAY_US(600); @@ -773,7 +784,11 @@ void minkill() { // Wait to ensure all interrupts stopped for (int i = 1000; i--;) DELAY_US(250); - thermalManager.disable_all_heaters(); // turn off heaters again + // Reiterate heaters off + thermalManager.disable_all_heaters(); + + // Power off all steppers (for M112) or just the E steppers + steppers_off ? disable_all_steppers() : disable_e_steppers(); #if HAS_POWER_SWITCH PSU_OFF(); @@ -799,8 +814,8 @@ void minkill() { #endif } - void(*resetFunc)(void) = 0; // Declare resetFunc() at address 0 - resetFunc(); // Jump to address 0 + void (*resetFunc)() = 0; // Declare resetFunc() at address 0 + resetFunc(); // Jump to address 0 #else // !HAS_KILL @@ -947,10 +962,11 @@ void setup() { SERIAL_EOL(); #if defined(STRING_DISTRIBUTION_DATE) && defined(STRING_CONFIG_H_AUTHOR) - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_CONFIGURATION_VER); - SERIAL_ECHOPGM(STRING_DISTRIBUTION_DATE); - SERIAL_ECHOLNPGM(MSG_AUTHOR STRING_CONFIG_H_AUTHOR); + SERIAL_ECHO_MSG( + MSG_CONFIGURATION_VER + STRING_DISTRIBUTION_DATE + MSG_AUTHOR STRING_CONFIG_H_AUTHOR + ); SERIAL_ECHO_MSG("Compiled: " __DATE__); #endif @@ -959,6 +975,12 @@ void setup() { // UI must be initialized before EEPROM // (because EEPROM code calls the UI). + + // Set up LEDs early + #if HAS_COLOR_LEDS + leds.setup(); + #endif + ui.init(); ui.reset_status(); @@ -966,9 +988,8 @@ void setup() { ui.show_bootscreen(); #endif - #if ENABLED(SDIO_SUPPORT) && !PIN_EXISTS(SD_DETECT) - // Auto-mount the SD for EEPROM.dat emulation - if (!card.isDetected()) card.initsd(); + #if ENABLED(SDSUPPORT) + card.mount(); // Mount the SD card before settings.first_load #endif // Load data from EEPROM if available (or use defaults) @@ -1054,10 +1075,6 @@ void setup() { OUT_WRITE(STAT_LED_BLUE_PIN, LOW); // OFF #endif - #if HAS_COLOR_LEDS - leds.setup(); - #endif - #if HAS_CASE_LIGHT #if DISABLED(CASE_LIGHT_USE_NEOPIXEL) if (PWM_PIN(CASE_LIGHT_PIN)) SET_PWM(CASE_LIGHT_PIN); else SET_OUTPUT(CASE_LIGHT_PIN); @@ -1138,6 +1155,10 @@ void setup() { card.beginautostart(); #endif + #if ENABLED(HOST_PROMPT_SUPPORT) + host_action_prompt_end(); + #endif + #if HAS_TRINAMIC && DISABLED(PS_DEFAULT_OFF) test_tmc_connection(true, true, true, true); #endif @@ -1189,7 +1210,6 @@ void loop() { #endif // SDSUPPORT - if (queue.length < BUFSIZE) queue.get_available_commands(); queue.advance(); endstops.event_handler(); } diff --git a/Marlin/src/Marlin.h b/Marlin/src/Marlin.h index db24382bc8..1a9acc0075 100644 --- a/Marlin/src/Marlin.h +++ b/Marlin/src/Marlin.h @@ -322,8 +322,8 @@ void disable_e_stepper(const uint8_t e); void disable_e_steppers(); void disable_all_steppers(); -void kill(PGM_P const lcd_msg=nullptr); -void minkill(); +void kill(PGM_P const lcd_msg=nullptr, const bool steppers_off=false); +void minkill(const bool steppers_off=false); void quickstop_stepper(); diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 1d432f681a..89f1f0d20d 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -95,8 +95,8 @@ #define BOARD_Z_BOLT_X_SERIES 1141 // Z-Bolt X Series #define BOARD_TT_OSCAR 1142 // TT OSCAR #define BOARD_OVERLORD 1143 // Overlord/Overlord Pro -#define BOARD_HJC2560C_REV1 1144 // ADIMLab Granty v1 -#define BOARD_HJC2560C_REV2 1145 // ADIMLab Granty v2 +#define BOARD_HJC2560C_REV1 1144 // ADIMLab Gantry v1 +#define BOARD_HJC2560C_REV2 1145 // ADIMLab Gantry v2 // // RAMBo and derivatives @@ -255,9 +255,9 @@ // STM32 ARM Cortex-M3 // -#define BOARD_STM32F1R 4000 // STM32R Libmaple-based STM32F1 controller -#define BOARD_MALYAN_M200 4001 // STM32C8T6 Libmaple-based STM32F1 controller -#define BOARD_STM3R_MINI 4002 // STM32 Libmaple-based STM32F1 controller +#define BOARD_STM32F103R 4000 // STM32F103R Libmaple-based STM32F1 controller +#define BOARD_MALYAN_M200 4001 // STM32C8T6 Libmaple-based STM32F1 controller +#define BOARD_STM3R_MINI 4002 // STM32F103R Libmaple-based STM32F1 controller #define BOARD_GTM32_PRO_VB 4003 // STM32F103VET6 controller #define BOARD_MORPHEUS 4004 // STM32F103C8 / STM32F103CB Libmaple-based STM32F1 controller #define BOARD_CHITU3D 4005 // Chitu3D (STM32F103RET6) @@ -294,6 +294,8 @@ #define BOARD_STEVAL 4206 // STEVAL-3DP001V1 3D PRINTER BOARD #define BOARD_BIGTREE_SKR_PRO_V1_1 4207 // BigTreeTech SKR Pro v1.1 (STM32F407ZG) #define BOARD_BIGTREE_BTT002_V1_0 4208 // BigTreeTech BTT002 v1.0 (STM32F407VE) +#define BOARD_LERDGE_K 4209 // Lerdge K (STM32F407ZG) +#define BOARD_LERDGE_X 4210 // Lerdge X (STM32F407VE) // // ARM Cortex M7 @@ -307,11 +309,6 @@ // #define BOARD_ESP32 6000 -// -// SAMD51 ARM Cortex M4 -// -#define BOARD_AGCM4_RURAMPS4D_13 6100 - // // Simulations // diff --git a/Marlin/src/core/enum.h b/Marlin/src/core/enum.h index a6a3f57888..15118f7b28 100644 --- a/Marlin/src/core/enum.h +++ b/Marlin/src/core/enum.h @@ -49,10 +49,6 @@ enum AxisEnum : unsigned char { NO_AXIS = 0xFF }; -#if HAS_DRIVER(L6470) - enum L6470_driver_enum : unsigned char { X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5 }; -#endif - #define LOOP_S_LE_N(VAR, S, N) for (uint8_t VAR=(S); VAR<=(N); VAR++) #define LOOP_S_L_N(VAR, S, N) for (uint8_t VAR=(S); VAR<(N); VAR++) #define LOOP_LE_N(VAR, N) LOOP_S_LE_N(VAR, 0, N) @@ -65,14 +61,3 @@ enum AxisEnum : unsigned char { #define LOOP_ABC(VAR) LOOP_S_LE_N(VAR, A_AXIS, C_AXIS) #define LOOP_ABCE(VAR) LOOP_S_LE_N(VAR, A_AXIS, E_AXIS) #define LOOP_ABCE_N(VAR) LOOP_S_L_N(VAR, A_AXIS, XYZE_N) - -typedef enum { - LINEARUNIT_MM, - LINEARUNIT_INCH -} LinearUnit; - -typedef enum { - TEMPUNIT_C, - TEMPUNIT_K, - TEMPUNIT_F -} TempUnit; diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 42e5bdf263..ee4e23fa76 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -46,6 +46,7 @@ // bg Bulgarian // ca Catalan // cz Czech +// da Danish // de German // el Greek // el-gr Greek (Greece) @@ -90,10 +91,11 @@ #define MACHINE_UUID DEFAULT_MACHINE_UUID #endif -#ifdef BOARD_WEBSITE_URL - #undef WEBSITE_URL - #define WEBSITE_URL BOARD_WEBSITE_URL -#endif +#define MARLIN_WEBSITE_URL "http://marlinfw.org" + +//#if !defined(STRING_SPLASH_LINE3) && defined(WEBSITE_URL) +// #define STRING_SPLASH_LINE3 WEBSITE_URL +//#endif #if HAS_GRAPHICAL_LCD // @@ -196,7 +198,7 @@ #define MSG_Z3_MAX "z3_max" #define MSG_Z_PROBE "z_probe" #define MSG_FILAMENT_RUNOUT_SENSOR "filament" -#define MSG_PROBE_Z_OFFSET "Probe Z Offset" +#define MSG_PROBE_OFFSET "Probe Offset" #define MSG_SKEW_MIN "min_skew_factor: " #define MSG_SKEW_MAX "max_skew_factor: " #define MSG_ERR_MATERIAL_INDEX "M145 S out of range (0-1)" diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index eb2b41d65b..73a8ec5823 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -45,6 +45,14 @@ #define _O2 __attribute__((optimize("O2"))) #define _O3 __attribute__((optimize("O3"))) +#ifndef UNUSED + #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) + #define UNUSED(X) (void)X + #else + #define UNUSED(x) ((void)(x)) + #endif +#endif + // Clock speed factors #if !defined(CYCLES_PER_MICROSECOND) && !defined(__STM32F1__) #define CYCLES_PER_MICROSECOND (F_CPU / 1000000UL) // 16 or 20 on AVR @@ -53,13 +61,11 @@ // Nanoseconds per cycle #define NANOSECONDS_PER_CYCLE (1000000000.0 / F_CPU) -// Remove compiler warning on an unused variable -#ifndef UNUSED - #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) - #define UNUSED(X) (void)X - #else - #define UNUSED(x) ((void)(x)) - #endif +// Macros to make sprintf_P read from PROGMEM (AVR extension) +#ifdef __AVR__ + #define S_FMT "%S" +#else + #define S_FMT "%s" #endif // Macros to make a string from a macro @@ -72,7 +78,7 @@ // Macros for bit masks #undef _BV #define _BV(n) (1<<(n)) -#define TEST(n,b) !!((n)&_BV(b)) +#define TEST(n,b) (!!((n)&_BV(b))) #define SET_BIT_TO(N,B,TF) do{ if (TF) SBI(N,B); else CBI(N,B); }while(0) #ifndef SBI @@ -88,6 +94,7 @@ #define SBI32(n,b) (n |= _BV32(b)) #define CBI32(n,b) (n &= ~_BV32(b)) +#define cu(x) ((x)*(x)*(x)) #define RADIANS(d) ((d)*float(M_PI)/180.0f) #define DEGREES(r) ((r)*180.0f/float(M_PI)) #define HYPOT2(x,y) (sq(x)+sq(y)) @@ -103,14 +110,14 @@ // C++11 solution that is standards compliant. template static inline constexpr void NOLESS(V& v, const N n) { - if (v < n) v = n; + if (n > v) v = n; } template static inline constexpr void NOMORE(V& v, const N n) { - if (v > n) v = n; + if (n < v) v = n; } template static inline constexpr void LIMIT(V& v, const N1 n1, const N2 n2) { - if (v < n1) v = n1; - else if (v > n2) v = n2; + if (n1 > v) v = n1; + else if (n2 < v) v = n2; } #else @@ -120,21 +127,21 @@ #define NOLESS(v, n) \ do{ \ __typeof__(n) _n = (n); \ - if (v < _n) v = _n; \ + if (_n > v) v = _n; \ }while(0) #define NOMORE(v, n) \ do{ \ __typeof__(n) _n = (n); \ - if (v > _n) v = _n; \ + if (_n < v) v = _n; \ }while(0) #define LIMIT(v, n1, n2) \ do{ \ __typeof__(n1) _n1 = (n1); \ __typeof__(n2) _n2 = (n2); \ - if (v < _n1) v = _n1; \ - else if (v > _n2) v = _n2; \ + if (_n1 > v) v = _n1; \ + else if (_n2 < v) v = _n2; \ }while(0) #endif @@ -198,12 +205,22 @@ }while(0) // Macros for initializing arrays -#define ARRAY_6(v1, v2, v3, v4, v5, v6, ...) { v1, v2, v3, v4, v5, v6 } -#define ARRAY_5(v1, v2, v3, v4, v5, ...) { v1, v2, v3, v4, v5 } -#define ARRAY_4(v1, v2, v3, v4, ...) { v1, v2, v3, v4 } -#define ARRAY_3(v1, v2, v3, ...) { v1, v2, v3 } -#define ARRAY_2(v1, v2, ...) { v1, v2 } -#define ARRAY_1(v1, ...) { v1 } +#define ARRAY_16(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,...) { A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P } +#define ARRAY_15(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,...) { A,B,C,D,E,F,G,H,I,J,K,L,M,N,O } +#define ARRAY_14(A,B,C,D,E,F,G,H,I,J,K,L,M,N,...) { A,B,C,D,E,F,G,H,I,J,K,L,M,N } +#define ARRAY_13(A,B,C,D,E,F,G,H,I,J,K,L,M,...) { A,B,C,D,E,F,G,H,I,J,K,L,M } +#define ARRAY_12(A,B,C,D,E,F,G,H,I,J,K,L,...) { A,B,C,D,E,F,G,H,I,J,K,L } +#define ARRAY_11(A,B,C,D,E,F,G,H,I,J,K,...) { A,B,C,D,E,F,G,H,I,J,K } +#define ARRAY_10(A,B,C,D,E,F,G,H,I,J,...) { A,B,C,D,E,F,G,H,I,J } +#define ARRAY_9( A,B,C,D,E,F,G,H,I,...) { A,B,C,D,E,F,G,H,I } +#define ARRAY_8( A,B,C,D,E,F,G,H,...) { A,B,C,D,E,F,G,H } +#define ARRAY_7( A,B,C,D,E,F,G,...) { A,B,C,D,E,F,G } +#define ARRAY_6( A,B,C,D,E,F,...) { A,B,C,D,E,F } +#define ARRAY_5( A,B,C,D,E,...) { A,B,C,D,E } +#define ARRAY_4( A,B,C,D,...) { A,B,C,D } +#define ARRAY_3( A,B,C,...) { A,B,C } +#define ARRAY_2( A,B,...) { A,B } +#define ARRAY_1( A,...) { A } #define _ARRAY_N(N,V...) ARRAY_##N(V) #define ARRAY_N(N,V...) _ARRAY_N(N,V) @@ -234,8 +251,11 @@ #define DECREMENT_(n) DEC_##n #define DECREMENT(n) DECREMENT_(n) +// Feedrate +typedef float feedRate_t; #define MMM_TO_MMS(MM_M) ((MM_M)/60.0f) #define MMS_TO_MMM(MM_S) ((MM_S)*60.0f) +#define MMS_SCALED(V) ((V) * 0.01f * feedrate_percentage) #define NOOP (void(0)) @@ -275,8 +295,8 @@ #endif // Use NUM_ARGS(__VA_ARGS__) to get the number of variadic arguments -#define _NUM_ARGS(_0,_24_,_23,_22,_21,_20,_19,_18,_17,_16,_15,_14,_13,_12,_11,_10,_9,_8,_7,_6,_5,_4,_3,_2,_1,N,...) N -#define NUM_ARGS(V...) _NUM_ARGS(0,V,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0) +#define _NUM_ARGS(_,Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A,OUT,...) OUT +#define NUM_ARGS(V...) _NUM_ARGS(0,V,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0) #ifdef __cplusplus @@ -302,29 +322,29 @@ #else #define MIN_2(a,b) ((a)<(b)?(a):(b)) - #define MIN_3(a,...) MIN_2(a,MIN_2(__VA_ARGS__)) - #define MIN_4(a,...) MIN_2(a,MIN_3(__VA_ARGS__)) - #define MIN_5(a,...) MIN_2(a,MIN_4(__VA_ARGS__)) - #define MIN_6(a,...) MIN_2(a,MIN_5(__VA_ARGS__)) - #define MIN_7(a,...) MIN_2(a,MIN_6(__VA_ARGS__)) - #define MIN_8(a,...) MIN_2(a,MIN_7(__VA_ARGS__)) - #define MIN_9(a,...) MIN_2(a,MIN_8(__VA_ARGS__)) - #define MIN_10(a,...) MIN_2(a,MIN_9(__VA_ARGS__)) - #define __MIN_N(N, ...) MIN_##N(__VA_ARGS__) - #define _MIN_N(N, ...) __MIN_N(N,__VA_ARGS__) - #define _MIN(...) _MIN_N(NUM_ARGS(__VA_ARGS__), __VA_ARGS__) + #define MIN_3(a,V...) MIN_2(a,MIN_2(V)) + #define MIN_4(a,V...) MIN_2(a,MIN_3(V)) + #define MIN_5(a,V...) MIN_2(a,MIN_4(V)) + #define MIN_6(a,V...) MIN_2(a,MIN_5(V)) + #define MIN_7(a,V...) MIN_2(a,MIN_6(V)) + #define MIN_8(a,V...) MIN_2(a,MIN_7(V)) + #define MIN_9(a,V...) MIN_2(a,MIN_8(V)) + #define MIN_10(a,V...) MIN_2(a,MIN_9(V)) + #define __MIN_N(N,V...) MIN_##N(V) + #define _MIN_N(N,V...) __MIN_N(N,V) + #define _MIN(V...) _MIN_N(NUM_ARGS(V), V) #define MAX_2(a,b) ((a)>(b)?(a):(b)) - #define MAX_3(a,...) MAX_2(a,MAX_2(__VA_ARGS__)) - #define MAX_4(a,...) MAX_2(a,MAX_3(__VA_ARGS__)) - #define MAX_5(a,...) MAX_2(a,MAX_4(__VA_ARGS__)) - #define MAX_6(a,...) MAX_2(a,MAX_5(__VA_ARGS__)) - #define MAX_7(a,...) MAX_2(a,MAX_6(__VA_ARGS__)) - #define MAX_8(a,...) MAX_2(a,MAX_7(__VA_ARGS__)) - #define MAX_9(a,...) MAX_2(a,MAX_8(__VA_ARGS__)) - #define MAX_10(a,...) MAX_2(a,MAX_9(__VA_ARGS__)) - #define __MAX_N(N, ...) MAX_##N(__VA_ARGS__) - #define _MAX_N(N, ...) __MAX_N(N,__VA_ARGS__) - #define _MAX(...) _MAX_N(NUM_ARGS(__VA_ARGS__), __VA_ARGS__) + #define MAX_3(a,V...) MAX_2(a,MAX_2(V)) + #define MAX_4(a,V...) MAX_2(a,MAX_3(V)) + #define MAX_5(a,V...) MAX_2(a,MAX_4(V)) + #define MAX_6(a,V...) MAX_2(a,MAX_5(V)) + #define MAX_7(a,V...) MAX_2(a,MAX_6(V)) + #define MAX_8(a,V...) MAX_2(a,MAX_7(V)) + #define MAX_9(a,V...) MAX_2(a,MAX_8(V)) + #define MAX_10(a,V...) MAX_2(a,MAX_9(V)) + #define __MAX_N(N,V...) MAX_##N(V) + #define _MAX_N(N,V...) __MAX_N(N,V) + #define _MAX(V...) _MAX_N(NUM_ARGS(V), V) #endif diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index 84b64b8b62..a468802ecc 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -68,12 +68,9 @@ void print_bin(const uint16_t val) { } } -void print_xyz(PGM_P const prefix, PGM_P const suffix, const float x, const float y, const float z) { +void print_xyz(PGM_P const prefix, PGM_P const suffix, const float &x, const float &y, const float &z) { serialprintPGM(prefix); - SERIAL_CHAR('('); - SERIAL_ECHO(x); - SERIAL_ECHOPAIR(", ", y, ", ", z); - SERIAL_CHAR(')'); + SERIAL_ECHOPAIR(" " MSG_X, x, " " MSG_Y, y, " " MSG_Z, z); if (suffix) serialprintPGM(suffix); else SERIAL_EOL(); } diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index 463b9b6f53..23f6240e1e 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -75,7 +75,9 @@ extern uint8_t marlin_debug_flags; #define SERIAL_PRINTF(V...) SERIAL_OUT(printf, V) #define SERIAL_FLUSH() SERIAL_OUT(flush) -#if TX_BUFFER_SIZE > 0 +#ifdef __STM32F1__ + #define SERIAL_FLUSHTX() SERIAL_OUT(flush) +#elif TX_BUFFER_SIZE > 0 #define SERIAL_FLUSHTX() SERIAL_OUT(flushTX) #else #define SERIAL_FLUSHTX() @@ -144,8 +146,8 @@ extern uint8_t marlin_debug_flags; #define SERIAL_ECHOPGM(S) (serialprintPGM(PSTR(S))) #define SERIAL_ECHOLNPGM(S) (serialprintPGM(PSTR(S "\n"))) -#define SERIAL_ECHOPAIR_F(pre, V...) do{ SERIAL_ECHO(pre); SERIAL_ECHO_F(V); }while(0) -#define SERIAL_ECHOLNPAIR_F(V...) do{ SERIAL_ECHOPAIR_F(V); SERIAL_EOL(); }while(0) +#define SERIAL_ECHOPAIR_F(S, V...) do{ SERIAL_ECHOPGM(S); SERIAL_ECHO_F(V); }while(0) +#define SERIAL_ECHOLNPAIR_F(V...) do{ SERIAL_ECHOPAIR_F(V); SERIAL_EOL(); }while(0) #define SERIAL_ECHO_START() serial_echo_start() #define SERIAL_ERROR_START() serial_error_start() @@ -156,6 +158,8 @@ extern uint8_t marlin_debug_flags; #define SERIAL_ECHO_SP(C) serial_spaces(C) +#define SERIAL_ECHO_TERNARY(TF, PRE, ON, OFF, POST) serial_ternary(TF, PSTR(PRE), PSTR(ON), PSTR(OFF), PSTR(POST)) + // // Functions for serial printing from PROGMEM. (Saves loads of SRAM.) // @@ -182,7 +186,7 @@ void serial_spaces(uint8_t count); void print_bin(const uint16_t val); -void print_xyz(PGM_P const prefix, PGM_P const suffix, const float x, const float y, const float z); void print_xyz(PGM_P const prefix, PGM_P const suffix, const float xyz[]); +void print_xyz(PGM_P const prefix, PGM_P const suffix, const float &x, const float &y, const float &z); #define SERIAL_POS(SUFFIX,VAR) do { print_xyz(PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); }while(0) #define SERIAL_XYZ(PREFIX,V...) do { print_xyz(PSTR(PREFIX), nullptr, V); }while(0) diff --git a/Marlin/src/core/utility.cpp b/Marlin/src/core/utility.cpp index 089cf528d6..5ebd84afd1 100644 --- a/Marlin/src/core/utility.cpp +++ b/Marlin/src/core/utility.cpp @@ -40,7 +40,6 @@ void safe_delay(millis_t ms) { #include "../module/probe.h" #include "../module/motion.h" #include "../module/stepper.h" - #include "../module/stepper.h" #include "../libs/numtostr.h" #include "../feature/bedlevel/bedlevel.h" @@ -80,40 +79,36 @@ void safe_delay(millis_t ms) { ); #if HAS_BED_PROBE - SERIAL_ECHOPAIR( - "Probe Offset X:" STRINGIFY(X_PROBE_OFFSET_FROM_EXTRUDER) - " Y:" STRINGIFY(Y_PROBE_OFFSET_FROM_EXTRUDER) - " Z:", zprobe_zoffset - ); - if ((X_PROBE_OFFSET_FROM_EXTRUDER) > 0) + SERIAL_ECHOPAIR("Probe Offset X:", probe_offset[X_AXIS], " Y:", probe_offset[Y_AXIS], " Z:", probe_offset[Z_AXIS]); + if (probe_offset[X_AXIS] > 0) SERIAL_ECHOPGM(" (Right"); - else if ((X_PROBE_OFFSET_FROM_EXTRUDER) < 0) + else if (probe_offset[X_AXIS] < 0) SERIAL_ECHOPGM(" (Left"); - else if ((Y_PROBE_OFFSET_FROM_EXTRUDER) != 0) + else if (probe_offset[Y_AXIS] != 0) SERIAL_ECHOPGM(" (Middle"); else SERIAL_ECHOPGM(" (Aligned With"); - if ((Y_PROBE_OFFSET_FROM_EXTRUDER) > 0) { + if (probe_offset[Y_AXIS] > 0) { #if IS_SCARA SERIAL_ECHOPGM("-Distal"); #else SERIAL_ECHOPGM("-Back"); #endif } - else if ((Y_PROBE_OFFSET_FROM_EXTRUDER) < 0) { + else if (probe_offset[Y_AXIS] < 0) { #if IS_SCARA SERIAL_ECHOPGM("-Proximal"); #else SERIAL_ECHOPGM("-Front"); #endif } - else if ((X_PROBE_OFFSET_FROM_EXTRUDER) != 0) + else if (probe_offset[X_AXIS] != 0) SERIAL_ECHOPGM("-Center"); - if (zprobe_zoffset < 0) + if (probe_offset[Z_AXIS] < 0) SERIAL_ECHOPGM(" & Below"); - else if (zprobe_zoffset > 0) + else if (probe_offset[Z_AXIS] > 0) SERIAL_ECHOPGM(" & Above"); else SERIAL_ECHOPGM(" & Same Z as"); diff --git a/Marlin/src/core/utility.h b/Marlin/src/core/utility.h index 63597fd413..4ae6a96713 100644 --- a/Marlin/src/core/utility.h +++ b/Marlin/src/core/utility.h @@ -59,7 +59,7 @@ public: inline void restore() { ref_ = val_; } }; -#define REMEMBER(N,X, ...) restorer restorer_##N(X, ##__VA_ARGS__) +#define REMEMBER(N,X,V...) const restorer restorer_##N(X, ##V) #define RESTORE(N) restorer_##N.restore() // Converts from an uint8_t in the range of 0-255 to an uint8_t diff --git a/Marlin/src/feature/I2CPositionEncoder.cpp b/Marlin/src/feature/I2CPositionEncoder.cpp index 7d225b8e08..1f73f1417b 100644 --- a/Marlin/src/feature/I2CPositionEncoder.cpp +++ b/Marlin/src/feature/I2CPositionEncoder.cpp @@ -168,7 +168,7 @@ void I2CPositionEncoder::update() { if (errPrstIdx >= I2CPE_ERR_PRST_ARRAY_SIZE) { float sumP = 0; LOOP_L_N(i, I2CPE_ERR_PRST_ARRAY_SIZE) sumP += errPrst[i]; - const int32_t errorP = int32_t(sumP * (1.0f / (I2CPE_ERR_PRST_ARRAY_SIZE))); + const int32_t errorP = int32_t(sumP * RECIPROCAL(I2CPE_ERR_PRST_ARRAY_SIZE)); SERIAL_ECHO(axis_codes[encoderAxis]); SERIAL_ECHOLNPAIR(" - err detected: ", errorP * planner.steps_to_mm[encoderAxis], "mm; correcting!"); babystep.add_steps(encoderAxis, -LROUND(errorP)); @@ -233,7 +233,7 @@ bool I2CPositionEncoder::passes_test(const bool report) { switch (H) { case I2CPE_MAG_SIG_GOOD: case I2CPE_MAG_SIG_MID: - serial_ternary(H == I2CPE_MAG_SIG_GOOD, PSTR("passes test; field strength "), PSTR("good"), PSTR("fair"), PSTR(".\n")); + SERIAL_ECHO_TERNARY(H == I2CPE_MAG_SIG_GOOD, "passes test; field strength ", "good", "fair", ".\n"); break; default: SERIAL_ECHOLNPGM("not detected!"); @@ -329,23 +329,22 @@ bool I2CPositionEncoder::test_axis() { float startCoord[NUM_AXIS] = { 0 }, endCoord[NUM_AXIS] = { 0 }; const float startPosition = soft_endstop[encoderAxis].min + 10, - endPosition = soft_endstop[encoderAxis].max - 10, - feedrate = FLOOR(MMM_TO_MMS((encoderAxis == Z_AXIS) ? HOMING_FEEDRATE_Z : HOMING_FEEDRATE_XY)); + endPosition = soft_endstop[encoderAxis].max - 10; + const feedRate_t fr_mm_s = FLOOR(MMM_TO_MMS((encoderAxis == Z_AXIS) ? HOMING_FEEDRATE_Z : HOMING_FEEDRATE_XY)); ec = false; - LOOP_NA(i) { + LOOP_XYZ(i) { startCoord[i] = planner.get_axis_position_mm((AxisEnum)i); endCoord[i] = planner.get_axis_position_mm((AxisEnum)i); } - startCoord[encoderAxis] = startPosition; endCoord[encoderAxis] = endPosition; planner.synchronize(); planner.buffer_line(startCoord[X_AXIS], startCoord[Y_AXIS], startCoord[Z_AXIS], - planner.get_axis_position_mm(E_AXIS), feedrate, 0); + planner.get_axis_position_mm(E_AXIS), fr_mm_s, 0); planner.synchronize(); // if the module isn't currently trusted, wait until it is (or until it should be if things are working) @@ -357,7 +356,7 @@ bool I2CPositionEncoder::test_axis() { if (trusted) { // if trusted, commence test planner.buffer_line(endCoord[X_AXIS], endCoord[Y_AXIS], endCoord[Z_AXIS], - planner.get_axis_position_mm(E_AXIS), feedrate, 0); + planner.get_axis_position_mm(E_AXIS), fr_mm_s, 0); planner.synchronize(); } @@ -380,11 +379,9 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) { travelDistance, travelledDistance, total = 0, startCoord[NUM_AXIS] = { 0 }, endCoord[NUM_AXIS] = { 0 }; - float feedrate; - int32_t startCount, stopCount; - feedrate = MMM_TO_MMS((encoderAxis == Z_AXIS) ? HOMING_FEEDRATE_Z : HOMING_FEEDRATE_XY); + const feedRate_t fr_mm_s = MMM_TO_MMS((encoderAxis == Z_AXIS) ? HOMING_FEEDRATE_Z : HOMING_FEEDRATE_XY); bool oldec = ec; ec = false; @@ -393,9 +390,9 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) { endDistance = soft_endstop[encoderAxis].max - 20; travelDistance = endDistance - startDistance; - LOOP_NA(i) { - startCoord[i] = planner.get_axis_position_mm((AxisEnum)i); - endCoord[i] = planner.get_axis_position_mm((AxisEnum)i); + LOOP_XYZ(a) { + startCoord[a] = planner.get_axis_position_mm((AxisEnum)a); + endCoord[a] = planner.get_axis_position_mm((AxisEnum)a); } startCoord[encoderAxis] = startDistance; @@ -405,7 +402,7 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) { LOOP_L_N(i, iter) { planner.buffer_line(startCoord[X_AXIS], startCoord[Y_AXIS], startCoord[Z_AXIS], - planner.get_axis_position_mm(E_AXIS), feedrate, 0); + planner.get_axis_position_mm(E_AXIS), fr_mm_s, 0); planner.synchronize(); delay(250); @@ -414,7 +411,7 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) { //do_blocking_move_to(endCoord[X_AXIS],endCoord[Y_AXIS],endCoord[Z_AXIS]); planner.buffer_line(endCoord[X_AXIS], endCoord[Y_AXIS], endCoord[Z_AXIS], - planner.get_axis_position_mm(E_AXIS), feedrate, 0); + planner.get_axis_position_mm(E_AXIS), fr_mm_s, 0); planner.synchronize(); //Read encoder distance @@ -440,7 +437,7 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) { total += new_steps_mm; // swap start and end points so next loop runs from current position - float tempCoord = startCoord[encoderAxis]; + const float tempCoord = startCoord[encoderAxis]; startCoord[encoderAxis] = endCoord[encoderAxis]; endCoord[encoderAxis] = tempCoord; } diff --git a/Marlin/src/feature/I2CPositionEncoder.h b/Marlin/src/feature/I2CPositionEncoder.h index 84e4a29519..ad3e30a513 100644 --- a/Marlin/src/feature/I2CPositionEncoder.h +++ b/Marlin/src/feature/I2CPositionEncoder.h @@ -168,15 +168,15 @@ class I2CPositionEncoder { bool passes_test(const bool report); - bool test_axis(void); + bool test_axis(); - FORCE_INLINE int get_error_count(void) { return errorCount; } + FORCE_INLINE int get_error_count() { return errorCount; } FORCE_INLINE void set_error_count(const int newCount) { errorCount = newCount; } FORCE_INLINE uint8_t get_address() { return i2cAddress; } FORCE_INLINE void set_address(const uint8_t addr) { i2cAddress = addr; } - FORCE_INLINE bool get_active(void) { return active; } + FORCE_INLINE bool get_active() { return active; } FORCE_INLINE void set_active(const bool a) { active = a; } FORCE_INLINE void set_inverted(const bool i) { invert = i; } @@ -219,10 +219,10 @@ class I2CPositionEncodersMgr { public: - static void init(void); + static void init(); // consider only updating one endoder per call / tick if encoders become too time intensive - static void update(void) { LOOP_PE(i) encoders[i].update(); } + static void update() { LOOP_PE(i) encoders[i].update(); } static void homed(const AxisEnum axis) { LOOP_PE(i) @@ -276,7 +276,7 @@ class I2CPositionEncodersMgr { CHECK_IDX(); encoders[idx].set_ec_enabled(enabled); SERIAL_ECHOPAIR("Error correction on ", axis_codes[axis]); - serial_ternary(encoders[idx].get_ec_enabled(), PSTR(" axis is "), PSTR("en"), PSTR("dis"), PSTR("abled.\n")); + SERIAL_ECHO_TERNARY(encoders[idx].get_ec_enabled(), " axis is ", "en", "dis", "abled.\n"); } static void set_ec_threshold(const int8_t idx, const float newThreshold, const AxisEnum axis) { diff --git a/Marlin/src/feature/babystep.cpp b/Marlin/src/feature/babystep.cpp index 41d7e80075..e16912d69e 100644 --- a/Marlin/src/feature/babystep.cpp +++ b/Marlin/src/feature/babystep.cpp @@ -35,7 +35,7 @@ Babystep babystep; -volatile int16_t Babystep::todo[BS_TODO_AXIS(Z_AXIS) + 1]; +volatile int16_t Babystep::steps[BS_TODO_AXIS(Z_AXIS) + 1]; #if HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI) int16_t Babystep::accum; @@ -45,10 +45,10 @@ volatile int16_t Babystep::todo[BS_TODO_AXIS(Z_AXIS) + 1]; #endif void Babystep::step_axis(const AxisEnum axis) { - const int16_t curTodo = todo[BS_TODO_AXIS(axis)]; // get rid of volatile for performance + const int16_t curTodo = steps[BS_TODO_AXIS(axis)]; // get rid of volatile for performance if (curTodo) { stepper.babystep((AxisEnum)axis, curTodo > 0); - if (curTodo > 0) todo[BS_TODO_AXIS(axis)]--; else todo[BS_TODO_AXIS(axis)]++; + if (curTodo > 0) steps[BS_TODO_AXIS(axis)]--; else steps[BS_TODO_AXIS(axis)]++; } } @@ -94,30 +94,30 @@ void Babystep::add_steps(const AxisEnum axis, const int16_t distance) { case CORE_AXIS_1: // X on CoreXY and CoreXZ, Y on CoreYZ BSA_ENABLE(CORE_AXIS_1); BSA_ENABLE(CORE_AXIS_2); - todo[CORE_AXIS_1] += distance * 2; - todo[CORE_AXIS_2] += distance * 2; + steps[CORE_AXIS_1] += distance * 2; + steps[CORE_AXIS_2] += distance * 2; break; case CORE_AXIS_2: // Y on CoreXY, Z on CoreXZ and CoreYZ BSA_ENABLE(CORE_AXIS_1); BSA_ENABLE(CORE_AXIS_2); - todo[CORE_AXIS_1] += CORESIGN(distance * 2); - todo[CORE_AXIS_2] -= CORESIGN(distance * 2); + steps[CORE_AXIS_1] += CORESIGN(distance * 2); + steps[CORE_AXIS_2] -= CORESIGN(distance * 2); break; case NORMAL_AXIS: // Z on CoreXY, Y on CoreXZ, X on CoreYZ default: BSA_ENABLE(NORMAL_AXIS); - todo[NORMAL_AXIS] += distance; + steps[NORMAL_AXIS] += distance; break; } #elif CORE_IS_XZ || CORE_IS_YZ // Only Z stepping needs to be handled here BSA_ENABLE(CORE_AXIS_1); BSA_ENABLE(CORE_AXIS_2); - todo[CORE_AXIS_1] += CORESIGN(distance * 2); - todo[CORE_AXIS_2] -= CORESIGN(distance * 2); + steps[CORE_AXIS_1] += CORESIGN(distance * 2); + steps[CORE_AXIS_2] -= CORESIGN(distance * 2); #else BSA_ENABLE(Z_AXIS); - todo[Z_AXIS] += distance; + steps[Z_AXIS] += distance; #endif #else #if ENABLED(BABYSTEP_XY) @@ -125,7 +125,7 @@ void Babystep::add_steps(const AxisEnum axis, const int16_t distance) { #else BSA_ENABLE(Z_AXIS); #endif - todo[BS_TODO_AXIS(axis)] += distance; + steps[BS_TODO_AXIS(axis)] += distance; #endif #if ENABLED(BABYSTEP_ALWAYS_AVAILABLE) gcode.reset_stepper_timeout(); diff --git a/Marlin/src/feature/babystep.h b/Marlin/src/feature/babystep.h index ff3709e5ff..617108316f 100644 --- a/Marlin/src/feature/babystep.h +++ b/Marlin/src/feature/babystep.h @@ -22,7 +22,6 @@ #pragma once #include "../inc/MarlinConfigPre.h" -#include "../core/enum.h" #if IS_CORE || EITHER(BABYSTEP_XY, I2C_POSITION_ENCODERS) #define BS_TODO_AXIS(A) A @@ -40,19 +39,25 @@ class Babystep { public: - static volatile int16_t todo[BS_TODO_AXIS(Z_AXIS) + 1]; + static volatile int16_t steps[BS_TODO_AXIS(Z_AXIS) + 1]; + #if HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI) + static int16_t accum; // Total babysteps in current edit + #if ENABLED(BABYSTEP_DISPLAY_TOTAL) static int16_t axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]; // Total babysteps since G28 static inline void reset_total(const AxisEnum axis) { - #if ENABLED(BABYSTEP_XY) - if (axis == Z_AXIS) - #endif - axis_total[BS_TOTAL_AXIS(axis)] = 0; + if (true + #if ENABLED(BABYSTEP_XY) + && axis == Z_AXIS + #endif + ) axis_total[BS_TOTAL_AXIS(axis)] = 0; } #endif + #endif + static void add_steps(const AxisEnum axis, const int16_t distance); static void add_mm(const AxisEnum axis, const float &mm); static void task(); diff --git a/Marlin/src/feature/backlash.h b/Marlin/src/feature/backlash.h index e86955b95b..19d6534917 100644 --- a/Marlin/src/feature/backlash.h +++ b/Marlin/src/feature/backlash.h @@ -28,28 +28,21 @@ constexpr uint8_t all_on = 0xFF, all_off = 0x00; class Backlash { public: - #ifdef BACKLASH_DISTANCE_MM - #if ENABLED(BACKLASH_GCODE) - static float distance_mm[XYZ]; - #else - static const float distance_mm[XYZ]; - //static constexpr float distance_mm[XYZ] = BACKLASH_DISTANCE_MM; // compiler barks at this - #endif - #endif #if ENABLED(BACKLASH_GCODE) + static float distance_mm[XYZ]; static uint8_t correction; #ifdef BACKLASH_SMOOTHING_MM static float smoothing_mm; #endif + static inline void set_correction(const float &v) { correction = _MAX(0, _MIN(1.0, v)) * all_on; } static inline float get_correction() { return float(ui8_to_percent(correction)) / 100.0f; } #else static constexpr uint8_t correction = (BACKLASH_CORRECTION) * 0xFF; + static const float distance_mm[XYZ]; #ifdef BACKLASH_SMOOTHING_MM static constexpr float smoothing_mm = BACKLASH_SMOOTHING_MM; #endif - static inline void set_correction(float) { } - static inline float get_correction() { return float(ui8_to_percent(correction)) / 100.0f; } #endif #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) @@ -60,27 +53,27 @@ public: static void measure_with_probe(); #endif - static inline float get_measurement(const uint8_t e) { + static inline float get_measurement(const AxisEnum a) { // Return the measurement averaged over all readings return ( #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - measured_count[e] > 0 ? measured_mm[e] / measured_count[e] : + measured_count[a] > 0 ? measured_mm[a] / measured_count[a] : #endif 0 ); #if DISABLED(MEASURE_BACKLASH_WHEN_PROBING) - UNUSED(e); + UNUSED(a); #endif } - static inline bool has_measurement(const uint8_t e) { + static inline bool has_measurement(const AxisEnum a) { return (false #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - || (measured_count[e] > 0) + || (measured_count[a] > 0) #endif ); #if DISABLED(MEASURE_BACKLASH_WHEN_PROBING) - UNUSED(e); + UNUSED(a); #endif } diff --git a/Marlin/src/feature/bedlevel/abl/abl.cpp b/Marlin/src/feature/bedlevel/abl/abl.cpp index c70cf62203..d1857af112 100644 --- a/Marlin/src/feature/bedlevel/abl/abl.cpp +++ b/Marlin/src/feature/bedlevel/abl/abl.cpp @@ -24,7 +24,6 @@ #if ENABLED(AUTO_BED_LEVELING_BILINEAR) -#include "abl.h" #include "../bedlevel.h" #include "../../../module/motion.h" @@ -282,11 +281,9 @@ float bilinear_z_offset(const float raw[XYZ]) { ry = raw[Y_AXIS] - bilinear_start[Y_AXIS]; #if ENABLED(EXTRAPOLATE_BEYOND_GRID) - // Keep using the last grid box - #define FAR_EDGE_OR_BOX 2 + #define FAR_EDGE_OR_BOX 2 // Keep using the last grid box #else - // Just use the grid far edge - #define FAR_EDGE_OR_BOX 1 + #define FAR_EDGE_OR_BOX 1 // Just use the grid far edge #endif if (last_x != rx) { @@ -363,7 +360,7 @@ float bilinear_z_offset(const float raw[XYZ]) { * Prepare a bilinear-leveled linear move on Cartesian, * splitting the move where it crosses grid borders. */ - void bilinear_line_to_destination(const float fr_mm_s, uint16_t x_splits, uint16_t y_splits) { + void bilinear_line_to_destination(const feedRate_t scaled_fr_mm_s, uint16_t x_splits, uint16_t y_splits) { // Get current and destination cells for this line int cx1 = CELL_INDEX(X, current_position[X_AXIS]), cy1 = CELL_INDEX(Y, current_position[Y_AXIS]), @@ -376,8 +373,8 @@ float bilinear_z_offset(const float raw[XYZ]) { // Start and end in the same cell? No split needed. if (cx1 == cx2 && cy1 == cy2) { - buffer_line_to_destination(fr_mm_s); set_current_from_destination(); + line_to_current_position(scaled_fr_mm_s); return; } @@ -408,8 +405,8 @@ float bilinear_z_offset(const float raw[XYZ]) { else { // Must already have been split on these border(s) // This should be a rare case. - buffer_line_to_destination(fr_mm_s); set_current_from_destination(); + line_to_current_position(scaled_fr_mm_s); return; } @@ -417,11 +414,11 @@ float bilinear_z_offset(const float raw[XYZ]) { destination[E_AXIS] = LINE_SEGMENT_END(E); // Do the split and look for more borders - bilinear_line_to_destination(fr_mm_s, x_splits, y_splits); + bilinear_line_to_destination(scaled_fr_mm_s, x_splits, y_splits); // Restore destination from stack COPY(destination, end); - bilinear_line_to_destination(fr_mm_s, x_splits, y_splits); + bilinear_line_to_destination(scaled_fr_mm_s, x_splits, y_splits); } #endif // IS_CARTESIAN && !SEGMENT_LEVELED_MOVES diff --git a/Marlin/src/feature/bedlevel/abl/abl.h b/Marlin/src/feature/bedlevel/abl/abl.h index 2ba834480f..71c7d83632 100644 --- a/Marlin/src/feature/bedlevel/abl/abl.h +++ b/Marlin/src/feature/bedlevel/abl/abl.h @@ -37,7 +37,7 @@ void refresh_bed_level(); #endif #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES) - void bilinear_line_to_destination(const float fr_mm_s, uint16_t x_splits=0xFFFF, uint16_t y_splits=0xFFFF); + void bilinear_line_to_destination(const feedRate_t &scaled_fr_mm_s, uint16_t x_splits=0xFFFF, uint16_t y_splits=0xFFFF); #endif #define _GET_MESH_X(I) (bilinear_start[X_AXIS] + (I) * bilinear_grid_spacing[X_AXIS]) diff --git a/Marlin/src/feature/bedlevel/bedlevel.cpp b/Marlin/src/feature/bedlevel/bedlevel.cpp index e6bc47a62b..f4a17b0035 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.cpp +++ b/Marlin/src/feature/bedlevel/bedlevel.cpp @@ -130,23 +130,25 @@ TemporaryBedLevelingState::TemporaryBedLevelingState(const bool enable) : saved( */ void reset_bed_level() { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("reset_bed_level"); - set_bed_leveling_enabled(false); - #if ENABLED(MESH_BED_LEVELING) - mbl.reset(); - #elif ENABLED(AUTO_BED_LEVELING_UBL) + #if ENABLED(AUTO_BED_LEVELING_UBL) ubl.reset(); - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - bilinear_start[X_AXIS] = bilinear_start[Y_AXIS] = - bilinear_grid_spacing[X_AXIS] = bilinear_grid_spacing[Y_AXIS] = 0; - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { - z_values[x][y] = NAN; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, 0); - #endif - } - #elif ABL_PLANAR - planner.bed_level_matrix.set_to_identity(); + #else + set_bed_leveling_enabled(false); + #if ENABLED(MESH_BED_LEVELING) + mbl.reset(); + #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) + bilinear_start[X_AXIS] = bilinear_start[Y_AXIS] = + bilinear_grid_spacing[X_AXIS] = bilinear_grid_spacing[Y_AXIS] = 0; + for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) + for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { + z_values[x][y] = NAN; + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onMeshUpdate(x, y, 0); + #endif + } + #elif ABL_PLANAR + planner.bed_level_matrix.set_to_identity(); + #endif #endif } diff --git a/Marlin/src/feature/bedlevel/bedlevel.h b/Marlin/src/feature/bedlevel/bedlevel.h index e5f0db47f7..d01751407a 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.h +++ b/Marlin/src/feature/bedlevel/bedlevel.h @@ -23,11 +23,6 @@ #include "../../inc/MarlinConfigPre.h" -typedef struct { - int8_t x_index, y_index; - float distance; // When populated, the distance from the search location -} mesh_index_pair; - #if ENABLED(PROBE_MANUALLY) extern bool g29_in_progress; #else @@ -56,11 +51,16 @@ class TemporaryBedLevelingState { TemporaryBedLevelingState(const bool enable); ~TemporaryBedLevelingState() { set_bed_leveling_enabled(saved); } }; -#define TEMPORARY_BED_LEVELING_STATE(enable) TemporaryBedLevelingState tbls(enable) +#define TEMPORARY_BED_LEVELING_STATE(enable) const TemporaryBedLevelingState tbls(enable) #if HAS_MESH - typedef float (&bed_mesh_t)[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; + typedef float bed_mesh_t[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; + + typedef struct { + int8_t x_index, y_index; + float distance; // When populated, the distance from the search location + } mesh_index_pair; #if ENABLED(AUTO_BED_LEVELING_BILINEAR) #include "abl/abl.h" diff --git a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp index 6a9deaed9b..b3a1a13529 100644 --- a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp +++ b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp @@ -64,7 +64,7 @@ * Prepare a mesh-leveled linear move in a Cartesian setup, * splitting the move where it crosses mesh borders. */ - void mesh_bed_leveling::line_to_destination(const float fr_mm_s, uint8_t x_splits, uint8_t y_splits) { + void mesh_bed_leveling::line_to_destination(const feedRate_t &scaled_fr_mm_s, uint8_t x_splits, uint8_t y_splits) { // Get current and destination cells for this line int cx1 = cell_index_x(current_position[X_AXIS]), cy1 = cell_index_y(current_position[Y_AXIS]), @@ -77,7 +77,7 @@ // Start and end in the same cell? No split needed. if (cx1 == cx2 && cy1 == cy2) { - line_to_destination(fr_mm_s); + line_to_destination(scaled_fr_mm_s); set_current_from_destination(); return; } @@ -109,7 +109,7 @@ else { // Must already have been split on these border(s) // This should be a rare case. - line_to_destination(fr_mm_s); + line_to_destination(scaled_fr_mm_s); set_current_from_destination(); return; } @@ -118,11 +118,11 @@ destination[E_AXIS] = MBL_SEGMENT_END(E); // Do the split and look for more borders - line_to_destination(fr_mm_s, x_splits, y_splits); + line_to_destination(scaled_fr_mm_s, x_splits, y_splits); // Restore destination from stack COPY(destination, end); - line_to_destination(fr_mm_s, x_splits, y_splits); + line_to_destination(scaled_fr_mm_s, x_splits, y_splits); } #endif // IS_CARTESIAN && !SEGMENT_LEVELED_MOVES diff --git a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h index e39bd0e789..def380399e 100644 --- a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h +++ b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h @@ -32,8 +32,8 @@ enum MeshLevelingState : char { MeshReset // G29 S5 }; -#define MESH_X_DIST ((MESH_MAX_X - (MESH_MIN_X)) / (GRID_MAX_POINTS_X - 1)) -#define MESH_Y_DIST ((MESH_MAX_Y - (MESH_MIN_Y)) / (GRID_MAX_POINTS_Y - 1)) +#define MESH_X_DIST (float(MESH_MAX_X - (MESH_MIN_X)) / float(GRID_MAX_POINTS_X - 1)) +#define MESH_Y_DIST (float(MESH_MAX_Y - (MESH_MIN_Y)) / float(GRID_MAX_POINTS_Y - 1)) #define _GET_MESH_X(I) mbl.index_to_xpos[I] #define _GET_MESH_Y(J) mbl.index_to_ypos[J] #define Z_VALUES_ARR mbl.z_values @@ -73,22 +73,22 @@ public: } static int8_t cell_index_x(const float &x) { - int8_t cx = (x - (MESH_MIN_X)) * (1.0f / (MESH_X_DIST)); + int8_t cx = (x - (MESH_MIN_X)) * RECIPROCAL(MESH_X_DIST); return constrain(cx, 0, (GRID_MAX_POINTS_X) - 2); } static int8_t cell_index_y(const float &y) { - int8_t cy = (y - (MESH_MIN_Y)) * (1.0f / (MESH_Y_DIST)); + int8_t cy = (y - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST); return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 2); } static int8_t probe_index_x(const float &x) { - int8_t px = (x - (MESH_MIN_X) + 0.5f * (MESH_X_DIST)) * (1.0f / (MESH_X_DIST)); + int8_t px = (x - (MESH_MIN_X) + 0.5f * (MESH_X_DIST)) * RECIPROCAL(MESH_X_DIST); return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1; } static int8_t probe_index_y(const float &y) { - int8_t py = (y - (MESH_MIN_Y) + 0.5f * (MESH_Y_DIST)) * (1.0f / (MESH_Y_DIST)); + int8_t py = (y - (MESH_MIN_Y) + 0.5f * (MESH_Y_DIST)) * RECIPROCAL(MESH_Y_DIST); return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; } @@ -116,7 +116,7 @@ public: } #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES) - static void line_to_destination(const float fr_mm_s, uint8_t x_splits=0xFF, uint8_t y_splits=0xFF); + static void line_to_destination(const feedRate_t &scaled_fr_mm_s, uint8_t x_splits=0xFF, uint8_t y_splits=0xFF); #endif }; diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.cpp b/Marlin/src/feature/bedlevel/ubl/ubl.cpp index ee8fb48c9d..4cdc4721b5 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl.cpp @@ -24,13 +24,14 @@ #if ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" + #include "../bedlevel.h" + unified_bed_leveling ubl; #include "../../../module/configuration_store.h" #include "../../../module/planner.h" #include "../../../module/motion.h" - #include "../../bedlevel/bedlevel.h" + #include "../../../module/probe.h" #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extensible_ui/ui_api.h" @@ -49,16 +50,15 @@ for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) if (!isnan(z_values[x][y])) { SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(" M421 I", x, " J", y); - SERIAL_ECHOPAIR_F(" Z", z_values[x][y], 4); - SERIAL_EOL(); + SERIAL_ECHOPAIR(" M421 I", int(x), " J", int(y)); + SERIAL_ECHOLNPAIR_F(" Z", z_values[x][y], 4); serial_delay(75); // Prevent Printrun from exploding } } void unified_bed_leveling::report_state() { echo_name(); - serial_ternary(planner.leveling_active, PSTR(" System v" UBL_VERSION " "), PSTR(""), PSTR("in"), PSTR("active\n")); + SERIAL_ECHO_TERNARY(planner.leveling_active, " System v" UBL_VERSION " ", "", "in", "active\n"); serial_delay(50); } @@ -66,10 +66,21 @@ float unified_bed_leveling::z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - // 15 is the maximum nubmer of grid points supported + 1 safety margin for now, - // until determinism prevails - constexpr float unified_bed_leveling::_mesh_index_to_xpos[16], - unified_bed_leveling::_mesh_index_to_ypos[16]; + #define _GRIDPOS(A,N) (MESH_MIN_##A + N * (MESH_##A##_DIST)) + + const float + unified_bed_leveling::_mesh_index_to_xpos[GRID_MAX_POINTS_X] PROGMEM = ARRAY_N(GRID_MAX_POINTS_X, + _GRIDPOS(X, 0), _GRIDPOS(X, 1), _GRIDPOS(X, 2), _GRIDPOS(X, 3), + _GRIDPOS(X, 4), _GRIDPOS(X, 5), _GRIDPOS(X, 6), _GRIDPOS(X, 7), + _GRIDPOS(X, 8), _GRIDPOS(X, 9), _GRIDPOS(X, 10), _GRIDPOS(X, 11), + _GRIDPOS(X, 12), _GRIDPOS(X, 13), _GRIDPOS(X, 14), _GRIDPOS(X, 15) + ), + unified_bed_leveling::_mesh_index_to_ypos[GRID_MAX_POINTS_Y] PROGMEM = ARRAY_N(GRID_MAX_POINTS_Y, + _GRIDPOS(Y, 0), _GRIDPOS(Y, 1), _GRIDPOS(Y, 2), _GRIDPOS(Y, 3), + _GRIDPOS(Y, 4), _GRIDPOS(Y, 5), _GRIDPOS(Y, 6), _GRIDPOS(Y, 7), + _GRIDPOS(Y, 8), _GRIDPOS(Y, 9), _GRIDPOS(Y, 10), _GRIDPOS(Y, 11), + _GRIDPOS(Y, 12), _GRIDPOS(Y, 13), _GRIDPOS(Y, 14), _GRIDPOS(Y, 15) + ); #if HAS_LCD_MENU bool unified_bed_leveling::lcd_map_control = false; @@ -85,9 +96,6 @@ const bool was_enabled = planner.leveling_active; set_bed_leveling_enabled(false); storage_slot = -1; - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - planner.set_z_fade_height(10.0); - #endif ZERO(z_values); #if ENABLED(EXTENSIBLE_UI) for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) @@ -165,11 +173,11 @@ serialprintPGM(csv ? PSTR("CSV:\n") : PSTR("LCD:\n")); } - // Add XY_PROBE_OFFSET_FROM_EXTRUDER because probe_pt() subtracts these when - // moving to the xy position to be measured. This ensures better agreement between + // Add XY probe offset from extruder because probe_at_point() subtracts them when + // moving to the XY position to be measured. This ensures better agreement between // the current Z position after G28 and the mesh values. - const float current_xi = find_closest_x_index(current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER), - current_yi = find_closest_y_index(current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER); + const float current_xi = find_closest_x_index(current_position[X_AXIS] + probe_offset[X_AXIS]), + current_yi = find_closest_y_index(current_position[Y_AXIS] + probe_offset[Y_AXIS]); if (!lcd) SERIAL_EOL(); for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) { diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index 20ff9b0779..6897217c38 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -23,11 +23,7 @@ //#define UBL_DEVEL_DEBUGGING -#include "../bedlevel.h" -#include "../../../module/planner.h" #include "../../../module/motion.h" -#include "../../../lcd/ultralcd.h" -#include "../../../Marlin.h" #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../../core/debug_out.h" @@ -108,31 +104,9 @@ class unified_bed_leveling { static int8_t storage_slot; - static float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - - // 15 is the maximum nubmer of grid points supported + 1 safety margin for now, - // until determinism prevails - static constexpr float _mesh_index_to_xpos[16] PROGMEM = { - MESH_MIN_X + 0 * (MESH_X_DIST), MESH_MIN_X + 1 * (MESH_X_DIST), - MESH_MIN_X + 2 * (MESH_X_DIST), MESH_MIN_X + 3 * (MESH_X_DIST), - MESH_MIN_X + 4 * (MESH_X_DIST), MESH_MIN_X + 5 * (MESH_X_DIST), - MESH_MIN_X + 6 * (MESH_X_DIST), MESH_MIN_X + 7 * (MESH_X_DIST), - MESH_MIN_X + 8 * (MESH_X_DIST), MESH_MIN_X + 9 * (MESH_X_DIST), - MESH_MIN_X + 10 * (MESH_X_DIST), MESH_MIN_X + 11 * (MESH_X_DIST), - MESH_MIN_X + 12 * (MESH_X_DIST), MESH_MIN_X + 13 * (MESH_X_DIST), - MESH_MIN_X + 14 * (MESH_X_DIST), MESH_MIN_X + 15 * (MESH_X_DIST) - }; - - static constexpr float _mesh_index_to_ypos[16] PROGMEM = { - MESH_MIN_Y + 0 * (MESH_Y_DIST), MESH_MIN_Y + 1 * (MESH_Y_DIST), - MESH_MIN_Y + 2 * (MESH_Y_DIST), MESH_MIN_Y + 3 * (MESH_Y_DIST), - MESH_MIN_Y + 4 * (MESH_Y_DIST), MESH_MIN_Y + 5 * (MESH_Y_DIST), - MESH_MIN_Y + 6 * (MESH_Y_DIST), MESH_MIN_Y + 7 * (MESH_Y_DIST), - MESH_MIN_Y + 8 * (MESH_Y_DIST), MESH_MIN_Y + 9 * (MESH_Y_DIST), - MESH_MIN_Y + 10 * (MESH_Y_DIST), MESH_MIN_Y + 11 * (MESH_Y_DIST), - MESH_MIN_Y + 12 * (MESH_Y_DIST), MESH_MIN_Y + 13 * (MESH_Y_DIST), - MESH_MIN_Y + 14 * (MESH_Y_DIST), MESH_MIN_Y + 15 * (MESH_Y_DIST) - }; + static bed_mesh_t z_values; + static const float _mesh_index_to_xpos[GRID_MAX_POINTS_X], + _mesh_index_to_ypos[GRID_MAX_POINTS_Y]; #if HAS_LCD_MENU static bool lcd_map_control; @@ -145,14 +119,14 @@ class unified_bed_leveling { FORCE_INLINE static void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; } static int8_t get_cell_index_x(const float &x) { - const int8_t cx = (x - (MESH_MIN_X)) * (1.0f / (MESH_X_DIST)); + const int8_t cx = (x - (MESH_MIN_X)) * RECIPROCAL(MESH_X_DIST); return constrain(cx, 0, (GRID_MAX_POINTS_X) - 1); // -1 is appropriate if we want all movement to the X_MAX } // position. But with this defined this way, it is possible // to extrapolate off of this point even further out. Probably // that is OK because something else should be keeping that from // happening and should not be worried about at this level. static int8_t get_cell_index_y(const float &y) { - const int8_t cy = (y - (MESH_MIN_Y)) * (1.0f / (MESH_Y_DIST)); + const int8_t cy = (y - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST); return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 1); // -1 is appropriate if we want all movement to the Y_MAX } // position. But with this defined this way, it is possible // to extrapolate off of this point even further out. Probably @@ -160,12 +134,12 @@ class unified_bed_leveling { // happening and should not be worried about at this level. static int8_t find_closest_x_index(const float &x) { - const int8_t px = (x - (MESH_MIN_X) + (MESH_X_DIST) * 0.5) * (1.0f / (MESH_X_DIST)); + const int8_t px = (x - (MESH_MIN_X) + (MESH_X_DIST) * 0.5) * RECIPROCAL(MESH_X_DIST); return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1; } static int8_t find_closest_y_index(const float &y) { - const int8_t py = (y - (MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * (1.0f / (MESH_Y_DIST)); + const int8_t py = (y - (MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * RECIPROCAL(MESH_Y_DIST); return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1; } @@ -210,7 +184,7 @@ class unified_bed_leveling { ); } - const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * (1.0f / (MESH_X_DIST)), + const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * RECIPROCAL(MESH_X_DIST), z1 = z_values[x1_i][yi]; return z1 + xratio * (z_values[_MIN(x1_i, GRID_MAX_POINTS_X - 2) + 1][yi] - z1); // Don't allow x1_i+1 to be past the end of the array @@ -239,7 +213,7 @@ class unified_bed_leveling { ); } - const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * (1.0f / (MESH_Y_DIST)), + const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * RECIPROCAL(MESH_Y_DIST), z1 = z_values[xi][y1_i]; return z1 + yratio * (z_values[xi][_MIN(y1_i, GRID_MAX_POINTS_Y - 2) + 1] - z1); // Don't allow y1_i+1 to be past the end of the array @@ -311,9 +285,9 @@ class unified_bed_leveling { } #if UBL_SEGMENTED - static bool prepare_segmented_line_to(const float (&rtarget)[XYZE], const float &feedrate); + static bool line_to_destination_segmented(const feedRate_t &scaled_fr_mm_s); #else - static void line_to_destination_cartesian(const float &fr, const uint8_t e); + static void line_to_destination_cartesian(const feedRate_t &scaled_fr_mm_s, const uint8_t e); #endif static inline bool mesh_is_valid() { diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 6b6233f826..54c7666bac 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -24,7 +24,7 @@ #if ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl.h" + #include "../bedlevel.h" #include "../../../Marlin.h" #include "../../../HAL/shared/persistent_store_api.h" @@ -33,11 +33,9 @@ #include "../../../lcd/ultralcd.h" #include "../../../module/stepper.h" #include "../../../module/planner.h" + #include "../../../module/motion.h" #include "../../../module/probe.h" #include "../../../gcode/gcode.h" - #include "../../../core/serial.h" - #include "../../../gcode/parser.h" - #include "../../../feature/bedlevel/bedlevel.h" #include "../../../libs/least_squares_fit.h" #if ENABLED(DUAL_X_CARRIAGE) @@ -292,7 +290,7 @@ * especially better for Delta printers, since it populates the center of the mesh first, allowing for * a quicker test print to verify settings. You don't need to populate the entire mesh to use it. * After all, you don't want to spend a lot of time generating a mesh only to realize the resolution - * or zprobe_zoffset are incorrect. Mesh-generation gathers points starting closest to the nozzle unless + * or probe offsets are incorrect. Mesh-generation gathers points starting closest to the nozzle unless * an (X,Y) coordinate pair is given. * * Unified Bed Leveling uses a lot of EEPROM storage to hold its data, and it takes some effort to get @@ -315,7 +313,7 @@ // Check for commands that require the printer to be homed if (may_move) { planner.synchronize(); - if (axis_unhomed_error()) gcode.home_all_axes(); + if (axes_need_homing()) gcode.home_all_axes(); #if ENABLED(DUAL_X_CARRIAGE) if (active_extruder != 0) tool_change(0); #endif @@ -441,7 +439,7 @@ #if HAS_BED_PROBE - case 1: + case 1: { // // Invalidate Entire Mesh and Automatically Probe Mesh in areas that can be reached by the probe // @@ -455,12 +453,12 @@ SERIAL_ECHO(g29_y_pos); SERIAL_ECHOLNPGM(").\n"); } - probe_entire_mesh(g29_x_pos + X_PROBE_OFFSET_FROM_EXTRUDER, g29_y_pos + Y_PROBE_OFFSET_FROM_EXTRUDER, + probe_entire_mesh(g29_x_pos + probe_offset[X_AXIS], g29_y_pos + probe_offset[Y_AXIS], parser.seen('T'), parser.seen('E'), parser.seen('U')); report_current_position(); probe_deployed = true; - break; + } break; #endif // HAS_BED_PROBE @@ -484,8 +482,8 @@ g29_x_pos = X_HOME_POS; g29_y_pos = Y_HOME_POS; #else // cartesian - g29_x_pos = X_PROBE_OFFSET_FROM_EXTRUDER > 0 ? X_BED_SIZE : 0; - g29_y_pos = Y_PROBE_OFFSET_FROM_EXTRUDER < 0 ? Y_BED_SIZE : 0; + g29_x_pos = probe_offset[X_AXIS] > 0 ? X_BED_SIZE : 0; + g29_y_pos = probe_offset[Y_AXIS] < 0 ? Y_BED_SIZE : 0; #endif } @@ -757,10 +755,10 @@ do { if (do_ubl_mesh_map) display_map(g29_map_type); - const int current = (GRID_MAX_POINTS) - count + 1; - SERIAL_ECHOLNPAIR("\nProbing mesh point ", current, "/", int(GRID_MAX_POINTS), ".\n"); + const int point_num = (GRID_MAX_POINTS) - count + 1; + SERIAL_ECHOLNPAIR("\nProbing mesh point ", point_num, "/", int(GRID_MAX_POINTS), ".\n"); #if HAS_DISPLAY - ui.status_printf_P(0, PSTR(MSG_PROBING_MESH " %i/%i"), current, int(GRID_MAX_POINTS)); + ui.status_printf_P(0, PSTR(MSG_PROBING_MESH " %i/%i"), point_num, int(GRID_MAX_POINTS)); #endif #if HAS_LCD_MENU @@ -783,7 +781,7 @@ if (location.x_index >= 0) { // mesh point found and is reachable by probe const float rawx = mesh_index_to_xpos(location.x_index), rawy = mesh_index_to_ypos(location.y_index), - measured_z = probe_pt(rawx, rawy, stow_probe ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level); // TODO: Needs error handling + measured_z = probe_at_point(rawx, rawy, stow_probe ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level); // TODO: Needs error handling z_values[location.x_index][location.y_index] = measured_z; #if ENABLED(EXTENSIBLE_UI) ExtUI::onMeshUpdate(location.x_index, location.y_index, measured_z); @@ -802,8 +800,8 @@ restore_ubl_active_state_and_leave(); do_blocking_move_to_xy( - constrain(rx - (X_PROBE_OFFSET_FROM_EXTRUDER), MESH_MIN_X, MESH_MAX_X), - constrain(ry - (Y_PROBE_OFFSET_FROM_EXTRUDER), MESH_MIN_Y, MESH_MAX_Y) + constrain(rx - probe_offset[X_AXIS], MESH_MIN_X, MESH_MAX_X), + constrain(ry - probe_offset[Y_AXIS], MESH_MIN_Y, MESH_MAX_Y) ); } @@ -1091,7 +1089,7 @@ g29_verbose_level = parser.seen('V') ? parser.value_int() : 0; if (!WITHIN(g29_verbose_level, 0, 4)) { - SERIAL_ECHOLNPGM("?(V)erbose level is implausible (0-4).\n"); + SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4).\n"); err_flag = true; } @@ -1283,8 +1281,8 @@ out_mesh.distance = -99999.9f; // Get our reference position. Either the nozzle or probe location. - const float px = rx + (probe_as_reference == USE_PROBE_AS_REFERENCE ? X_PROBE_OFFSET_FROM_EXTRUDER : 0), - py = ry + (probe_as_reference == USE_PROBE_AS_REFERENCE ? Y_PROBE_OFFSET_FROM_EXTRUDER : 0); + const float px = rx + (probe_as_reference == USE_PROBE_AS_REFERENCE ? probe_offset[X_AXIS] : 0), + py = ry + (probe_as_reference == USE_PROBE_AS_REFERENCE ? probe_offset[Y_AXIS] : 0); float best_so_far = 99999.99f; @@ -1383,25 +1381,36 @@ #if HAS_BED_PROBE + //#define VALIDATE_MESH_TILT + #include "../../../libs/vector_3.h" void unified_bed_leveling::tilt_mesh_based_on_probed_grid(const bool do_3_pt_leveling) { - constexpr int16_t x_min = _MAX(MIN_PROBE_X, MESH_MIN_X), - x_max = _MIN(MAX_PROBE_X, MESH_MAX_X), - y_min = _MAX(MIN_PROBE_Y, MESH_MIN_Y), - y_max = _MIN(MAX_PROBE_Y, MESH_MAX_Y); + const float x_min = probe_min_x(), x_max = probe_max_x(), + y_min = probe_min_y(), y_max = probe_max_y(), + dx = (x_max - x_min) / (g29_grid_size - 1), + dy = (y_max - y_min) / (g29_grid_size - 1); - bool abort_flag = false; + vector_3 points[3] = { + #if ENABLED(HAS_FIXED_3POINT) + vector_3(PROBE_PT_1_X, PROBE_PT_1_Y, 0), + vector_3(PROBE_PT_2_X, PROBE_PT_2_Y, 0), + vector_3(PROBE_PT_3_X, PROBE_PT_3_Y, 0) + #else + vector_3(x_min, y_min, 0), + vector_3(x_max, y_min, 0), + vector_3((x_max - x_min) / 2, y_max, 0) + #endif + }; float measured_z; + bool abort_flag = false; - const float dx = float(x_max - x_min) / (g29_grid_size - 1), - dy = float(y_max - y_min) / (g29_grid_size - 1); + #ifdef VALIDATE_MESH_TILT + float z1, z2, z3; // Needed for algorithm validation below + #endif struct linear_fit_data lsf_results; - - //float z1, z2, z3; // Needed for algorithm validation down below. - incremental_LSF_reset(&lsf_results); if (do_3_pt_leveling) { @@ -1410,17 +1419,19 @@ ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 1/3")); #endif - measured_z = probe_pt(PROBE_PT_1_X, PROBE_PT_1_Y, PROBE_PT_RAISE, g29_verbose_level); + measured_z = probe_at_point(points[0].x, points[0].y, PROBE_PT_RAISE, g29_verbose_level); if (isnan(measured_z)) abort_flag = true; else { - measured_z -= get_z_correction(PROBE_PT_1_X, PROBE_PT_1_Y); - //z1 = measured_z; + measured_z -= get_z_correction(points[0].x, points[0].y); + #ifdef VALIDATE_MESH_TILT + z1 = measured_z; + #endif if (g29_verbose_level > 3) { serial_spaces(16); SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z); } - incremental_LSF(&lsf_results, PROBE_PT_1_X, PROBE_PT_1_Y, measured_z); + incremental_LSF(&lsf_results, points[0].x, points[0].y, measured_z); } if (!abort_flag) { @@ -1429,17 +1440,19 @@ ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 2/3")); #endif - measured_z = probe_pt(PROBE_PT_2_X, PROBE_PT_2_Y, PROBE_PT_RAISE, g29_verbose_level); - //z2 = measured_z; + measured_z = probe_at_point(points[1].x, points[1].y, PROBE_PT_RAISE, g29_verbose_level); + #ifdef VALIDATE_MESH_TILT + z2 = measured_z; + #endif if (isnan(measured_z)) abort_flag = true; else { - measured_z -= get_z_correction(PROBE_PT_2_X, PROBE_PT_2_Y); + measured_z -= get_z_correction(points[1].x, points[1].y); if (g29_verbose_level > 3) { serial_spaces(16); SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z); } - incremental_LSF(&lsf_results, PROBE_PT_2_X, PROBE_PT_2_Y, measured_z); + incremental_LSF(&lsf_results, points[1].x, points[1].y, measured_z); } } @@ -1449,17 +1462,19 @@ ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " 3/3")); #endif - measured_z = probe_pt(PROBE_PT_3_X, PROBE_PT_3_Y, PROBE_PT_STOW, g29_verbose_level); - //z3 = measured_z; + measured_z = probe_at_point(points[2].x, points[2].y, PROBE_PT_STOW, g29_verbose_level); + #ifdef VALIDATE_MESH_TILT + z3 = measured_z; + #endif if (isnan(measured_z)) abort_flag = true; else { - measured_z -= get_z_correction(PROBE_PT_3_X, PROBE_PT_3_Y); + measured_z -= get_z_correction(points[2].x, points[2].y); if (g29_verbose_level > 3) { serial_spaces(16); SERIAL_ECHOLNPAIR("Corrected_Z=", measured_z); } - incremental_LSF(&lsf_results, PROBE_PT_3_X, PROBE_PT_3_Y, measured_z); + incremental_LSF(&lsf_results, points[2].x, points[2].y, measured_z); } } @@ -1477,20 +1492,20 @@ bool zig_zag = false; - uint16_t total_points = g29_grid_size * g29_grid_size, current = 1; + uint16_t total_points = g29_grid_size * g29_grid_size, point_num = 1; for (uint8_t ix = 0; ix < g29_grid_size; ix++) { - const float rx = float(x_min) + ix * dx; + const float rx = x_min + ix * dx; for (int8_t iy = 0; iy < g29_grid_size; iy++) { - const float ry = float(y_min) + dy * (zig_zag ? g29_grid_size - 1 - iy : iy); + const float ry = y_min + dy * (zig_zag ? g29_grid_size - 1 - iy : iy); if (!abort_flag) { - SERIAL_ECHOLNPAIR("Tilting mesh point ", current, "/", total_points, "\n"); + SERIAL_ECHOLNPAIR("Tilting mesh point ", point_num, "/", total_points, "\n"); #if HAS_DISPLAY - ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " %i/%i"), current, total_points); + ui.status_printf_P(0, PSTR(MSG_LCD_TILTING_MESH " %i/%i"), point_num, total_points); #endif - measured_z = probe_pt(rx, ry, parser.seen('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level); // TODO: Needs error handling + measured_z = probe_at_point(rx, ry, parser.seen('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level); // TODO: Needs error handling abort_flag = isnan(measured_z); @@ -1507,7 +1522,7 @@ DEBUG_ECHOPAIR_F(" correction: ", get_z_correction(rx, ry), 7); } - measured_z -= get_z_correction(rx, ry) /* + zprobe_zoffset */ ; + measured_z -= get_z_correction(rx, ry) /* + probe_offset[Z_AXIS] */ ; if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR_F(" final >>>---> ", measured_z, 7); @@ -1518,7 +1533,7 @@ incremental_LSF(&lsf_results, rx, ry, measured_z); } - current++; + point_num++; } zig_zag ^= true; @@ -1605,34 +1620,34 @@ * is calculated. The Z error between the probed point locations and the get_z_correction() * numbers for those locations should be 0. */ - #if 0 - float t, t1, d; - t = normal.x * (PROBE_PT_1_X) + normal.y * (PROBE_PT_1_Y); - d = t + normal.z * z1; - DEBUG_ECHOPAIR_F("D from 1st point: ", d, 6); - DEBUG_ECHOLNPAIR_F(" Z error: ", normal.z*z1-get_z_correction(PROBE_PT_1_X, PROBE_PT_1_Y), 6); + #ifdef VALIDATE_MESH_TILT + float t, t1, d; + t = normal.x * x_min + normal.y * y_min; + d = t + normal.z * z1; + DEBUG_ECHOPAIR_F("D from 1st point: ", d, 6); + DEBUG_ECHOLNPAIR_F(" Z error: ", normal.z * z1 - get_z_correction(x_min, y_min), 6); - t = normal.x * (PROBE_PT_2_X) + normal.y * (PROBE_PT_2_Y); - d = t + normal.z * z2; - DEBUG_EOL(); - DEBUG_ECHOPAIR_F("D from 2nd point: ", d, 6); - DEBUG_ECHOLNPAIR_F(" Z error: ", normal.z*z2-get_z_correction(PROBE_PT_2_X, PROBE_PT_2_Y), 6); + t = normal.x * x_max + normal.y * y_min; + d = t + normal.z * z2; + DEBUG_EOL(); + DEBUG_ECHOPAIR_F("D from 2nd point: ", d, 6); + DEBUG_ECHOLNPAIR_F(" Z error: ", normal.z * z2 - get_z_correction(x_max, y_min), 6); - t = normal.x * (PROBE_PT_3_X) + normal.y * (PROBE_PT_3_Y); - d = t + normal.z * z3; - DEBUG_ECHOPAIR_F("D from 3rd point: ", d, 6); - DEBUG_ECHOLNPAIR_F(" Z error: ", normal.z*z3-get_z_correction(PROBE_PT_3_X, PROBE_PT_3_Y), 6); + t = normal.x * ((x_max - x_min) / 2) + normal.y * (y_min); + d = t + normal.z * z3; + DEBUG_ECHOPAIR_F("D from 3rd point: ", d, 6); + DEBUG_ECHOLNPAIR_F(" Z error: ", normal.z * z3 - get_z_correction((x_max - x_min) / 2, y_max), 6); - t = normal.x * (Z_SAFE_HOMING_X_POINT) + normal.y * (Z_SAFE_HOMING_Y_POINT); - d = t + normal.z * 0; - DEBUG_ECHOLNPAIR_F("D from home location with Z=0 : ", d, 6); + t = normal.x * (Z_SAFE_HOMING_X_POINT) + normal.y * (Z_SAFE_HOMING_Y_POINT); + d = t + normal.z * 0; + DEBUG_ECHOLNPAIR_F("D from home location with Z=0 : ", d, 6); - t = normal.x * (Z_SAFE_HOMING_X_POINT) + normal.y * (Z_SAFE_HOMING_Y_POINT); - d = t + get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT); // normal.z * 0; - DEBUG_ECHOPAIR_F("D from home location using mesh value for Z: ", d, 6); + t = normal.x * (Z_SAFE_HOMING_X_POINT) + normal.y * (Z_SAFE_HOMING_Y_POINT); + d = t + get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT); // normal.z * 0; + DEBUG_ECHOPAIR_F("D from home location using mesh value for Z: ", d, 6); - DEBUG_ECHOPAIR(" Z error: (", Z_SAFE_HOMING_X_POINT, ",", Z_SAFE_HOMING_Y_POINT); - DEBUG_ECHOLNPAIR_F(") = ", get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT), 6); + DEBUG_ECHOPAIR(" Z error: (", Z_SAFE_HOMING_X_POINT, ",", Z_SAFE_HOMING_Y_POINT); + DEBUG_ECHOLNPAIR_F(") = ", get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT), 6); #endif } // DEBUGGING(LEVELING) @@ -1713,13 +1728,13 @@ serial_delay(50); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - SERIAL_ECHOLNPAIR_F("planner.z_fade_height : ", planner.z_fade_height, 4); + SERIAL_ECHOLNPAIR_F("Fade Height M420 Z", planner.z_fade_height, 4); #endif adjust_mesh_to_mean(g29_c_flag, g29_constant); #if HAS_BED_PROBE - SERIAL_ECHOLNPAIR_F("zprobe_zoffset: ", zprobe_zoffset, 7); + SERIAL_ECHOLNPAIR_F("Probe Offset M851 Z", probe_offset[Z_AXIS], 7); #endif SERIAL_ECHOLNPAIR("MESH_MIN_X " STRINGIFY(MESH_MIN_X) "=", MESH_MIN_X); serial_delay(50); diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp index 4bb29d7e0b..fcce41169a 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp @@ -43,7 +43,7 @@ #if !UBL_SEGMENTED - void unified_bed_leveling::line_to_destination_cartesian(const float &feed_rate, const uint8_t extruder) { + void unified_bed_leveling::line_to_destination_cartesian(const feedRate_t &scaled_fr_mm_s, const uint8_t extruder) { /** * Much of the nozzle movement will be within the same cell. So we will do as little computation * as possible to determine if this is the case. If this move is within the same cell, we will @@ -79,16 +79,15 @@ + UBL_Z_RAISE_WHEN_OFF_MESH #endif ; - planner.buffer_segment(end[X_AXIS], end[Y_AXIS], end[Z_AXIS] + z_raise, end[E_AXIS], feed_rate, extruder); + planner.buffer_segment(end[X_AXIS], end[Y_AXIS], end[Z_AXIS] + z_raise, end[E_AXIS], scaled_fr_mm_s, extruder); set_current_from_destination(); - return; } FINAL_MOVE: // The distance is always MESH_X_DIST so multiply by the constant reciprocal. - const float xratio = (end[X_AXIS] - mesh_index_to_xpos(cell_dest_xi)) * (1.0f / (MESH_X_DIST)); + const float xratio = (end[X_AXIS] - mesh_index_to_xpos(cell_dest_xi)) * RECIPROCAL(MESH_X_DIST); float z1 = z_values[cell_dest_xi ][cell_dest_yi ] + xratio * (z_values[cell_dest_xi + 1][cell_dest_yi ] - z_values[cell_dest_xi][cell_dest_yi ]), @@ -98,13 +97,12 @@ if (cell_dest_xi >= GRID_MAX_POINTS_X - 1) z1 = z2 = 0.0; // X cell-fraction done. Interpolate the two Z offsets with the Y fraction for the final Z offset. - const float yratio = (end[Y_AXIS] - mesh_index_to_ypos(cell_dest_yi)) * (1.0f / (MESH_Y_DIST)), + const float yratio = (end[Y_AXIS] - mesh_index_to_ypos(cell_dest_yi)) * RECIPROCAL(MESH_Y_DIST), z0 = cell_dest_yi < GRID_MAX_POINTS_Y - 1 ? (z1 + (z2 - z1) * yratio) * planner.fade_scaling_factor_for_z(end[Z_AXIS]) : 0.0; // Undefined parts of the Mesh in z_values[][] are NAN. // Replace NAN corrections with 0.0 to prevent NAN propagation. - planner.buffer_segment(end[X_AXIS], end[Y_AXIS], end[Z_AXIS] + (isnan(z0) ? 0.0 : z0), end[E_AXIS], feed_rate, extruder); - + planner.buffer_segment(end[X_AXIS], end[Y_AXIS], end[Z_AXIS] + (isnan(z0) ? 0.0 : z0), end[E_AXIS], scaled_fr_mm_s, extruder); set_current_from_destination(); return; } @@ -194,7 +192,7 @@ z_position = end[Z_AXIS]; } - planner.buffer_segment(rx, ry, z_position + z0, e_position, feed_rate, extruder); + planner.buffer_segment(rx, ry, z_position + z0, e_position, scaled_fr_mm_s, extruder); } //else printf("FIRST MOVE PRUNED "); } @@ -242,7 +240,7 @@ z_position = end[Z_AXIS]; } - if (!planner.buffer_segment(rx, ry, z_position + z0, e_position, feed_rate, extruder)) + if (!planner.buffer_segment(rx, ry, z_position + z0, e_position, scaled_fr_mm_s, extruder)) break; } //else printf("FIRST MOVE PRUNED "); } @@ -297,7 +295,7 @@ e_position = end[E_AXIS]; z_position = end[Z_AXIS]; } - if (!planner.buffer_segment(rx, next_mesh_line_y, z_position + z0, e_position, feed_rate, extruder)) + if (!planner.buffer_segment(rx, next_mesh_line_y, z_position + z0, e_position, scaled_fr_mm_s, extruder)) break; current_yi += dyi; yi_cnt--; @@ -321,7 +319,7 @@ z_position = end[Z_AXIS]; } - if (!planner.buffer_segment(next_mesh_line_x, ry, z_position + z0, e_position, feed_rate, extruder)) + if (!planner.buffer_segment(next_mesh_line_x, ry, z_position + z0, e_position, scaled_fr_mm_s, extruder)) break; current_xi += dxi; xi_cnt--; @@ -356,27 +354,27 @@ * Returns true if did NOT move, false if moved (requires current_position update). */ - bool _O2 unified_bed_leveling::prepare_segmented_line_to(const float (&rtarget)[XYZE], const float &feedrate) { + bool _O2 unified_bed_leveling::line_to_destination_segmented(const feedRate_t &scaled_fr_mm_s) { - if (!position_is_reachable(rtarget[X_AXIS], rtarget[Y_AXIS])) // fail if moving outside reachable boundary + if (!position_is_reachable(destination[X_AXIS], destination[Y_AXIS])) // fail if moving outside reachable boundary return true; // did not move, so current_position still accurate const float total[XYZE] = { - rtarget[X_AXIS] - current_position[X_AXIS], - rtarget[Y_AXIS] - current_position[Y_AXIS], - rtarget[Z_AXIS] - current_position[Z_AXIS], - rtarget[E_AXIS] - current_position[E_AXIS] + destination[X_AXIS] - current_position[X_AXIS], + destination[Y_AXIS] - current_position[Y_AXIS], + destination[Z_AXIS] - current_position[Z_AXIS], + destination[E_AXIS] - current_position[E_AXIS] }; const float cartesian_xy_mm = HYPOT(total[X_AXIS], total[Y_AXIS]); // total horizontal xy distance #if IS_KINEMATIC - const float seconds = cartesian_xy_mm / feedrate; // seconds to move xy distance at requested rate - uint16_t segments = LROUND(delta_segments_per_second * seconds), // preferred number of segments for distance @ feedrate - seglimit = LROUND(cartesian_xy_mm * (1.0f / (DELTA_SEGMENT_MIN_LENGTH))); // number of segments at minimum segment length - NOMORE(segments, seglimit); // limit to minimum segment length (fewer segments) + const float seconds = cartesian_xy_mm / scaled_fr_mm_s; // Duration of XY move at requested rate + uint16_t segments = LROUND(delta_segments_per_second * seconds), // Preferred number of segments for distance @ feedrate + seglimit = LROUND(cartesian_xy_mm * RECIPROCAL(DELTA_SEGMENT_MIN_LENGTH)); // Number of segments at minimum segment length + NOMORE(segments, seglimit); // Limit to minimum segment length (fewer segments) #else - uint16_t segments = LROUND(cartesian_xy_mm * (1.0f / (DELTA_SEGMENT_MIN_LENGTH))); // cartesian fixed segment length + uint16_t segments = LROUND(cartesian_xy_mm * RECIPROCAL(DELTA_SEGMENT_MIN_LENGTH)); // cartesian fixed segment length #endif NOLESS(segments, 1U); // must have at least one segment @@ -384,7 +382,7 @@ const float segment_xyz_mm = HYPOT(cartesian_xy_mm, total[Z_AXIS]) * inv_segments; // length of each segment #if ENABLED(SCARA_FEEDRATE_SCALING) - const float inv_duration = feedrate / segment_xyz_mm; + const float inv_duration = scaled_fr_mm_s / segment_xyz_mm; #endif const float diff[XYZE] = { @@ -404,17 +402,17 @@ current_position[E_AXIS] }; - // Only compute leveling per segment if ubl active and target below z_fade_height. - if (!planner.leveling_active || !planner.leveling_active_at_z(rtarget[Z_AXIS])) { // no mesh leveling + // Just do plain segmentation if UBL is inactive or the target is above the fade height + if (!planner.leveling_active || !planner.leveling_active_at_z(destination[Z_AXIS])) { while (--segments) { LOOP_XYZE(i) raw[i] += diff[i]; - planner.buffer_line(raw, feedrate, active_extruder, segment_xyz_mm + planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, segment_xyz_mm #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif ); } - planner.buffer_line(rtarget, feedrate, active_extruder, segment_xyz_mm + planner.buffer_line(destination, scaled_fr_mm_s, active_extruder, segment_xyz_mm #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif @@ -425,7 +423,7 @@ // Otherwise perform per-segment leveling #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - const float fade_scaling_factor = planner.fade_scaling_factor_for_z(rtarget[Z_AXIS]); + const float fade_scaling_factor = planner.fade_scaling_factor_for_z(destination[Z_AXIS]); #endif // increment to first segment destination @@ -440,8 +438,8 @@ // in top of loop and again re-find same adjacent cell and use it, just less efficient // for mesh inset area. - int8_t cell_xi = (raw[X_AXIS] - (MESH_MIN_X)) * (1.0f / (MESH_X_DIST)), - cell_yi = (raw[Y_AXIS] - (MESH_MIN_Y)) * (1.0f / (MESH_Y_DIST)); + int8_t cell_xi = (raw[X_AXIS] - (MESH_MIN_X)) * RECIPROCAL(MESH_X_DIST), + cell_yi = (raw[Y_AXIS] - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST); LIMIT(cell_xi, 0, (GRID_MAX_POINTS_X) - 1); LIMIT(cell_yi, 0, (GRID_MAX_POINTS_Y) - 1); @@ -462,15 +460,15 @@ float cx = raw[X_AXIS] - x0, // cell-relative x and y cy = raw[Y_AXIS] - y0; - const float z_xmy0 = (z_x1y0 - z_x0y0) * (1.0f / (MESH_X_DIST)), // z slope per x along y0 (lower left to lower right) - z_xmy1 = (z_x1y1 - z_x0y1) * (1.0f / (MESH_X_DIST)); // z slope per x along y1 (upper left to upper right) + const float z_xmy0 = (z_x1y0 - z_x0y0) * RECIPROCAL(MESH_X_DIST), // z slope per x along y0 (lower left to lower right) + z_xmy1 = (z_x1y1 - z_x0y1) * RECIPROCAL(MESH_X_DIST); // z slope per x along y1 (upper left to upper right) float z_cxy0 = z_x0y0 + z_xmy0 * cx; // z height along y0 at cx (changes for each cx in cell) const float z_cxy1 = z_x0y1 + z_xmy1 * cx, // z height along y1 at cx z_cxyd = z_cxy1 - z_cxy0; // z height difference along cx from y0 to y1 - float z_cxym = z_cxyd * (1.0f / (MESH_Y_DIST)); // z slope per y along cx from y0 to y1 (changes for each cx in cell) + float z_cxym = z_cxyd * RECIPROCAL(MESH_Y_DIST); // z slope per y along cx from y0 to y1 (changes for each cx in cell) // float z_cxcy = z_cxy0 + z_cxym * cy; // interpolated mesh z height along cx at cy (do inside the segment loop) @@ -479,12 +477,11 @@ // each change by a constant for fixed segment lengths. const float z_sxy0 = z_xmy0 * diff[X_AXIS], // per-segment adjustment to z_cxy0 - z_sxym = (z_xmy1 - z_xmy0) * (1.0f / (MESH_Y_DIST)) * diff[X_AXIS]; // per-segment adjustment to z_cxym + z_sxym = (z_xmy1 - z_xmy0) * RECIPROCAL(MESH_Y_DIST) * diff[X_AXIS]; // per-segment adjustment to z_cxym for (;;) { // for all segments within this mesh cell - if (--segments == 0) // if this is last segment, use rtarget for exact - COPY(raw, rtarget); + if (--segments == 0) COPY(raw, destination); // if this is last segment, use destination for exact const float z_cxcy = (z_cxy0 + z_cxym * cy) // interpolated mesh z height along cx at cy #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) @@ -494,7 +491,7 @@ const float z = raw[Z_AXIS]; raw[Z_AXIS] += z_cxcy; - planner.buffer_line(raw, feedrate, active_extruder, segment_xyz_mm + planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, segment_xyz_mm #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif diff --git a/Marlin/src/feature/binary_protocol.h b/Marlin/src/feature/binary_protocol.h index 2db33e3505..58817f66ba 100644 --- a/Marlin/src/feature/binary_protocol.h +++ b/Marlin/src/feature/binary_protocol.h @@ -76,7 +76,7 @@ private: static bool file_open(char* filename) { if (!dummy_transfer) { - card.initsd(); + card.mount(); card.openFile(filename, false); if (!card.isFileOpen()) return false; } @@ -228,37 +228,41 @@ public: PACKET_PROCESS, PACKET_RESEND, PACKET_TIMEOUT, PACKET_ERROR }; struct Packet { // 10 byte protocol overhead, ascii with checksum and line number has a minimum of 7 increasing with line - struct [[gnu::packed]] Header { - static constexpr uint16_t HEADER_TOKEN = 0xB5AD; - uint16_t token; // packet start token - uint8_t sync; // stream sync, resend id and packet loss detection - uint8_t meta; // 4 bit protocol, - // 4 bit packet type - uint16_t size; // data length - uint16_t checksum; // header checksum + union Header { + static constexpr uint16_t HEADER_TOKEN = 0xB5AD; + struct [[gnu::packed]] { + uint16_t token; // packet start token + uint8_t sync; // stream sync, resend id and packet loss detection + uint8_t meta; // 4 bit protocol, + // 4 bit packet type + uint16_t size; // data length + uint16_t checksum; // header checksum + }; uint8_t protocol() { return (meta >> 4) & 0xF; } uint8_t type() { return meta & 0xF; } void reset() { token = 0; sync = 0; meta = 0; size = 0; checksum = 0; } + uint8_t data[1]; }; - struct [[gnu::packed]] Footer { - uint16_t checksum; // full packet checksum + union Footer { + struct [[gnu::packed]] { + uint16_t checksum; // full packet checksum + }; void reset() { checksum = 0; } + uint8_t data[1]; }; - uint8_t header_data[sizeof(Header)], - footer_data[sizeof(Footer)]; + Header header; + Footer footer; uint32_t bytes_received; uint16_t checksum, header_checksum; millis_t timeout; char* buffer; - Header& header() { return *reinterpret_cast(header_data); } - Footer& footer() { return *reinterpret_cast(footer_data); } void reset() { - header().reset(); - footer().reset(); + header.reset(); + footer.reset(); bytes_received = 0; checksum = 0; header_checksum = 0; @@ -312,46 +316,46 @@ public: stream_state = StreamState::PACKET_WAIT; case StreamState::PACKET_WAIT: if (!stream_read(data)) { idle(); return; } // no active packet so don't wait - packet.header_data[1] = data; - if (packet.header().token == Packet::Header::HEADER_TOKEN) { + packet.header.data[1] = data; + if (packet.header.token == packet.header.HEADER_TOKEN) { packet.bytes_received = 2; stream_state = StreamState::PACKET_HEADER; } else { // stream corruption drop data - packet.header_data[0] = data; + packet.header.data[0] = data; } break; case StreamState::PACKET_HEADER: if (!stream_read(data)) break; - packet.header_data[packet.bytes_received++] = data; + packet.header.data[packet.bytes_received++] = data; packet.checksum = checksum(packet.checksum, data); // header checksum calculation can't contain the checksum - if (packet.bytes_received == sizeof(Packet::Header) - 2) + if (packet.bytes_received == sizeof(Packet::header) - 2) packet.header_checksum = packet.checksum; - if (packet.bytes_received == sizeof(Packet::Header)) { - if (packet.header().checksum == packet.header_checksum) { + if (packet.bytes_received == sizeof(Packet::header)) { + if (packet.header.checksum == packet.header_checksum) { // The SYNC control packet is a special case in that it doesn't require the stream sync to be correct - if (static_cast(packet.header().protocol()) == Protocol::CONTROL && static_cast(packet.header().type()) == ProtocolControl::SYNC) { + if (static_cast(packet.header.protocol()) == Protocol::CONTROL && static_cast(packet.header.type()) == ProtocolControl::SYNC) { SERIAL_ECHOLNPAIR("ss", sync, ",", buffer_size, ",", VERSION_MAJOR, ".", VERSION_MINOR, ".", VERSION_PATCH); stream_state = StreamState::PACKET_RESET; break; } - if (packet.header().sync == sync) { + if (packet.header.sync == sync) { buffer_next_index = 0; packet.bytes_received = 0; - if (packet.header().size) { + if (packet.header.size) { stream_state = StreamState::PACKET_DATA; packet.buffer = static_cast(&buffer[0]); // multipacket buffering not implemented, always allocate whole buffer to packet } else stream_state = StreamState::PACKET_PROCESS; } - else if (packet.header().sync == sync - 1) { // ok response must have been lost - SERIAL_ECHOLNPAIR("ok", packet.header().sync); // transmit valid packet received and drop the payload + else if (packet.header.sync == sync - 1) { // ok response must have been lost + SERIAL_ECHOLNPAIR("ok", packet.header.sync); // transmit valid packet received and drop the payload stream_state = StreamState::PACKET_RESET; } else if (packet_retries) { @@ -364,7 +368,7 @@ public: } else { SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Packet Header(", packet.header().sync, "?) Corrupt"); + SERIAL_ECHOLNPAIR("Packet header(", packet.header.sync, "?) corrupt"); stream_state = StreamState::PACKET_RESEND; } } @@ -384,7 +388,7 @@ public: packet.bytes_received++; buffer_next_index++; - if (packet.bytes_received == packet.header().size) { + if (packet.bytes_received == packet.header.size) { stream_state = StreamState::PACKET_FOOTER; packet.bytes_received = 0; } @@ -392,14 +396,14 @@ public: case StreamState::PACKET_FOOTER: if (!stream_read(data)) break; - packet.footer_data[packet.bytes_received++] = data; - if (packet.bytes_received == sizeof(Packet::Footer)) { - if (packet.footer().checksum == packet.checksum) { + packet.footer.data[packet.bytes_received++] = data; + if (packet.bytes_received == sizeof(Packet::footer)) { + if (packet.footer.checksum == packet.checksum) { stream_state = StreamState::PACKET_PROCESS; } else { SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Packet(", packet.header().sync, ") Payload Corrupt"); + SERIAL_ECHOLNPAIR("Packet(", packet.header.sync, ") payload corrupt"); stream_state = StreamState::PACKET_RESEND; } } @@ -407,9 +411,9 @@ public: case StreamState::PACKET_PROCESS: sync++; packet_retries = 0; - bytes_received += packet.header().size; + bytes_received += packet.header.size; - SERIAL_ECHOLNPAIR("ok", packet.header().sync); // transmit valid packet received + SERIAL_ECHOLNPAIR("ok", packet.header.sync); // transmit valid packet received dispatch(); stream_state = StreamState::PACKET_RESET; break; @@ -429,7 +433,7 @@ public: stream_state = StreamState::PACKET_RESEND; break; case StreamState::PACKET_ERROR: - SERIAL_ECHOLNPAIR("fe", packet.header().sync); + SERIAL_ECHOLNPAIR("fe", packet.header.sync); reset(); // reset everything, resync required stream_state = StreamState::PACKET_RESET; break; @@ -438,9 +442,9 @@ public: } void dispatch() { - switch(static_cast(packet.header().protocol())) { + switch(static_cast(packet.header.protocol())) { case Protocol::CONTROL: - switch(static_cast(packet.header().type())) { + switch(static_cast(packet.header.type())) { case ProtocolControl::CLOSE: // revert back to ASCII mode card.flag.binary_mode = false; break; @@ -449,7 +453,7 @@ public: } break; case Protocol::FILE_TRANSFER: - SDFileTransferProtocol::process(packet.header().type(), packet.buffer, packet.header().size); // send user data to be processed + SDFileTransferProtocol::process(packet.header.type(), packet.buffer, packet.header.size); // send user data to be processed break; default: SERIAL_ECHO_MSG("Unsupported Binary Protocol"); diff --git a/Marlin/src/feature/bltouch.cpp b/Marlin/src/feature/bltouch.cpp index b768fc3e80..64c052269b 100644 --- a/Marlin/src/feature/bltouch.cpp +++ b/Marlin/src/feature/bltouch.cpp @@ -110,19 +110,19 @@ bool BLTouch::triggered() { bool BLTouch::deploy_proc() { // Do a DEPLOY - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("BLTouch DEPLOY requested"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch DEPLOY requested"); // Attempt to DEPLOY, wait for DEPLOY_DELAY or ALARM if (_deploy_query_alarm()) { // The deploy might have failed or the probe is already triggered (nozzle too low?) - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("BLTouch ALARM or TRIGGER after DEPLOY, recovering"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch ALARM or TRIGGER after DEPLOY, recovering"); clear(); // Get the probe into start condition // Last attempt to DEPLOY if (_deploy_query_alarm()) { // The deploy might have failed or the probe is actually triggered (nozzle too low?) again - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("BLTouch Recovery Failed"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch Recovery Failed"); SERIAL_ERROR_MSG(MSG_STOP_BLTOUCH); // Tell the user something is wrong, needs action stop(); // but it's not too bad, no need to kill, allow restart @@ -140,14 +140,14 @@ bool BLTouch::deploy_proc() { // The trigger STOW (see motion.cpp for example) will pull up the probes pin as soon as the pulse // is registered. - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("bltouch.deploy_proc() end"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("bltouch.deploy_proc() end"); return false; // report success to caller } bool BLTouch::stow_proc() { // Do a STOW - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("BLTouch STOW requested"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch STOW requested"); // A STOW will clear a triggered condition in the probe (10ms pulse). // At the moment that we come in here, we might (pulse) or will (SW mode) see the trigger on the pin. @@ -158,7 +158,7 @@ bool BLTouch::stow_proc() { // Attempt to STOW, wait for STOW_DELAY or ALARM if (_stow_query_alarm()) { // The stow might have failed - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("BLTouch ALARM or TRIGGER after STOW, recovering"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch ALARM or TRIGGER after STOW, recovering"); _reset(); // This RESET will then also pull up the pin. If it doesn't // work and the pin is still down, there will no longer be @@ -167,7 +167,7 @@ bool BLTouch::stow_proc() { // Last attempt to STOW if (_stow_query_alarm()) { // so if there is now STILL an ALARM condition: - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("BLTouch Recovery Failed"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch Recovery Failed"); SERIAL_ERROR_MSG(MSG_STOP_BLTOUCH); // Tell the user something is wrong, needs action stop(); // but it's not too bad, no need to kill, allow restart @@ -176,7 +176,7 @@ bool BLTouch::stow_proc() { } } - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("bltouch.stow_proc() end"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("bltouch.stow_proc() end"); return false; // report success to caller } @@ -187,7 +187,7 @@ bool BLTouch::status_proc() { * This function will ensure switch state is reset after execution */ - if (DEBUGGING(LEVELING)) DEBUG_ECHOLN("BLTouch STATUS requested"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch STATUS requested"); _set_SW_mode(); // Incidentally, _set_SW_mode() will also RESET any active alarm const bool tr = triggered(); // If triggered in SW mode, the pin is up, it is STOWED diff --git a/Marlin/src/feature/controllerfan.cpp b/Marlin/src/feature/controllerfan.cpp index 00d895aa68..1a458a2a55 100644 --- a/Marlin/src/feature/controllerfan.cpp +++ b/Marlin/src/feature/controllerfan.cpp @@ -24,7 +24,7 @@ #if ENABLED(USE_CONTROLLER_FAN) -#include "../module/stepper_indirection.h" +#include "../module/stepper/indirection.h" #include "../module/temperature.h" uint8_t controllerfan_speed; diff --git a/Marlin/src/feature/dac/dac_dac084s085.h b/Marlin/src/feature/dac/dac_dac084s085.h index 80d7869ab6..09d5bb857d 100644 --- a/Marlin/src/feature/dac/dac_dac084s085.h +++ b/Marlin/src/feature/dac/dac_dac084s085.h @@ -24,7 +24,7 @@ class dac084s085 { public: dac084s085(); - static void begin(void); + static void begin(); static void setValue(const uint8_t channel, const uint8_t value); private: static void cshigh(); diff --git a/Marlin/src/feature/dac/stepper_dac.cpp b/Marlin/src/feature/dac/stepper_dac.cpp index de497fdacd..d1e101bd50 100644 --- a/Marlin/src/feature/dac/stepper_dac.cpp +++ b/Marlin/src/feature/dac/stepper_dac.cpp @@ -74,8 +74,8 @@ void dac_current_raw(uint8_t channel, uint16_t val) { mcp4728_simpleCommand(UPDATE); } -static float dac_perc(int8_t n) { return 100.0 * mcp4728_getValue(dac_order[n]) * (1.0f / (DAC_STEPPER_MAX)); } -static float dac_amps(int8_t n) { return mcp4728_getDrvPct(dac_order[n]) * (DAC_STEPPER_MAX) * 0.125 * (1.0f / (DAC_STEPPER_SENSE)); } +static float dac_perc(int8_t n) { return 100.0 * mcp4728_getValue(dac_order[n]) * RECIPROCAL(DAC_STEPPER_MAX); } +static float dac_amps(int8_t n) { return mcp4728_getDrvPct(dac_order[n]) * (DAC_STEPPER_MAX) * 0.125 * RECIPROCAL(DAC_STEPPER_SENSE); } uint8_t dac_current_get_percent(AxisEnum axis) { return mcp4728_getDrvPct(dac_order[axis]); } void dac_current_set_percents(const uint8_t pct[XYZE]) { diff --git a/Marlin/src/feature/digipot/digipot_mcp4018.cpp b/Marlin/src/feature/digipot/digipot_mcp4018.cpp index 91a64d5432..86eeab63b4 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4018.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4018.cpp @@ -24,7 +24,6 @@ #if BOTH(DIGIPOT_I2C, DIGIPOT_MCP4018) -#include "../../core/enum.h" #include "Stream.h" #include "utility/twi.h" #include //https://github.com/stawel/SlowSoftI2CMaster diff --git a/Marlin/src/feature/digipot/digipot_mcp4451.cpp b/Marlin/src/feature/digipot/digipot_mcp4451.cpp index 61140d81b5..1b9672251f 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4451.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4451.cpp @@ -72,7 +72,7 @@ void digipot_i2c_set_current(const uint8_t channel, const float current) { // Set actual wiper value byte addresses[4] = { 0x00, 0x10, 0x60, 0x70 }; - i2c_send(addr, addresses[channel & 0x3], current_to_wiper(MIN((float) _MAX(current, 0), DIGIPOT_I2C_MAX_CURRENT))); + i2c_send(addr, addresses[channel & 0x3], current_to_wiper(_MIN(float(_MAX(current, 0)), DIGIPOT_I2C_MAX_CURRENT))); } void digipot_i2c_init() { diff --git a/Marlin/src/feature/emergency_parser.h b/Marlin/src/feature/emergency_parser.h index dadd677154..e9ce0f6645 100644 --- a/Marlin/src/feature/emergency_parser.h +++ b/Marlin/src/feature/emergency_parser.h @@ -25,7 +25,7 @@ * emergency_parser.h - Intercept special commands directly in the serial stream */ -#define FORCE_INLINE __attribute__((always_inline)) inline +#include "../inc/MarlinConfigPre.h" #if ENABLED(HOST_PROMPT_SUPPORT) #include "host_actions.h" diff --git a/Marlin/src/feature/fanmux.cpp b/Marlin/src/feature/fanmux.cpp index 7b293acbf8..6c7b56ac54 100644 --- a/Marlin/src/feature/fanmux.cpp +++ b/Marlin/src/feature/fanmux.cpp @@ -41,7 +41,7 @@ void fanmux_switch(const uint8_t e) { #endif } -void fanmux_init(void) { +void fanmux_init() { SET_OUTPUT(FANMUX0_PIN); #if PIN_EXISTS(FANMUX1) SET_OUTPUT(FANMUX1_PIN); diff --git a/Marlin/src/feature/fanmux.h b/Marlin/src/feature/fanmux.h index 517e7bfd57..492b9fd785 100644 --- a/Marlin/src/feature/fanmux.h +++ b/Marlin/src/feature/fanmux.h @@ -26,4 +26,4 @@ */ extern void fanmux_switch(const uint8_t e); -extern void fanmux_init(void); +extern void fanmux_init(); diff --git a/Marlin/src/feature/filwidth.cpp b/Marlin/src/feature/filwidth.cpp index ec90f3adf0..fb685bddc1 100644 --- a/Marlin/src/feature/filwidth.cpp +++ b/Marlin/src/feature/filwidth.cpp @@ -26,11 +26,24 @@ #include "filwidth.h" -bool filament_sensor; // = false; // M405/M406 turns filament sensor control ON/OFF. -float filament_width_nominal = DEFAULT_NOMINAL_FILAMENT_DIA, // Nominal filament width. Change with M404. - filament_width_meas = DEFAULT_MEASURED_FILAMENT_DIA; // Measured filament diameter -uint8_t meas_delay_cm = MEASUREMENT_DELAY_CM; // Distance delay setting -int8_t measurement_delay[MAX_MEASUREMENT_DELAY + 1], // Ring buffer to delayed measurement. Store extruder factor after subtracting 100 - filwidth_delay_index[2] = { 0, -1 }; // Indexes into ring buffer +FilamentWidthSensor filwidth; + +bool FilamentWidthSensor::enabled; // = false; // (M405-M406) Filament Width Sensor ON/OFF. +uint32_t FilamentWidthSensor::accum; // = 0 // ADC accumulator +uint16_t FilamentWidthSensor::raw; // = 0 // Measured filament diameter - one extruder only +float FilamentWidthSensor::nominal_mm = DEFAULT_NOMINAL_FILAMENT_DIA, // (M104) Nominal filament width + FilamentWidthSensor::measured_mm = DEFAULT_MEASURED_FILAMENT_DIA, // Measured filament diameter + FilamentWidthSensor::e_count = 0, + FilamentWidthSensor::delay_dist = 0; +uint8_t FilamentWidthSensor::meas_delay_cm = MEASUREMENT_DELAY_CM; // Distance delay setting +int8_t FilamentWidthSensor::ratios[MAX_MEASUREMENT_DELAY + 1], // Ring buffer to delay measurement. (Extruder factor minus 100) + FilamentWidthSensor::index_r, // Indexes into ring buffer + FilamentWidthSensor::index_w; + +void FilamentWidthSensor::init() { + const int8_t ratio = sample_to_size_ratio(); + for (uint8_t i = 0; i < COUNT(ratios); ++i) ratios[i] = ratio; + index_r = index_w = 0; +} #endif // FILAMENT_WIDTH_SENSOR diff --git a/Marlin/src/feature/filwidth.h b/Marlin/src/feature/filwidth.h index 91122a8605..74671b295b 100644 --- a/Marlin/src/feature/filwidth.h +++ b/Marlin/src/feature/filwidth.h @@ -22,10 +22,98 @@ #pragma once #include "../inc/MarlinConfig.h" +#include "../module/planner.h" -extern bool filament_sensor; // M405/M406 turns filament sensor control ON/OFF. -extern float filament_width_nominal, // Nominal filament width. Change with M404. - filament_width_meas; // Measured filament diameter -extern uint8_t meas_delay_cm; // Distance delay setting -extern int8_t measurement_delay[MAX_MEASUREMENT_DELAY + 1], // Ring buffer to delayed measurement. Store extruder factor after subtracting 100 - filwidth_delay_index[2]; // Indexes into ring buffer +class FilamentWidthSensor { +public: + static constexpr int MMD_CM = MAX_MEASUREMENT_DELAY + 1, MMD_MM = MMD_CM * 10; + static bool enabled; // (M405-M406) Filament Width Sensor ON/OFF. + static uint32_t accum; // ADC accumulator + static uint16_t raw; // Measured filament diameter - one extruder only + static float nominal_mm, // (M104) Nominal filament width + measured_mm, // Measured filament diameter + e_count, delay_dist; + static uint8_t meas_delay_cm; // Distance delay setting + static int8_t ratios[MMD_CM], // Ring buffer to delay measurement. (Extruder factor minus 100) + index_r, index_w; // Indexes into ring buffer + + FilamentWidthSensor() { init(); } + static void init(); + + static inline void enable(const bool ena) { enabled = ena; } + + static inline void set_delay_cm(const uint8_t cm) { + meas_delay_cm = _MIN(cm, MAX_MEASUREMENT_DELAY); + } + + /** + * Convert Filament Width (mm) to an extrusion ratio + * and reduce to an 8 bit value. + * + * A nominal width of 1.75 and measured width of 1.73 + * gives (100 * 1.75 / 1.73) for a ratio of 101 and + * a return value of 1. + */ + static int8_t sample_to_size_ratio() { + return ABS(nominal_mm - measured_mm) <= FILWIDTH_ERROR_MARGIN + ? int(100.0f * nominal_mm / measured_mm) - 100 : 0; + } + + // Apply a single ADC reading to the raw value + static void accumulate(const uint16_t adc) { + if (adc > 102) // Ignore ADC under 0.5 volts + accum += (uint32_t(adc) << 7) - (accum >> 7); + } + + // Convert raw measurement to mm + static inline float raw_to_mm(const uint16_t v) { return v * 5.0f * RECIPROCAL(16383.0f); } + static inline float raw_to_mm() { return raw_to_mm(raw); } + + // A scaled reading is ready + // Divide to get to 0-16384 range since we used 1/128 IIR filter approach + static inline void reading_ready() { raw = accum >> 10; } + + // Update mm from the raw measurement + static inline void update_measured_mm() { measured_mm = raw_to_mm(); } + + // Update ring buffer used to delay filament measurements + static inline void advance_e(const float &e_move) { + + // Increment counters with the E distance + e_count += e_move; + delay_dist += e_move; + + // Only get new measurements on forward E movement + if (!UNEAR_ZERO(e_count)) { + + // Loop the delay distance counter (modulus by the mm length) + while (delay_dist >= MMD_MM) delay_dist -= MMD_MM; + + // Convert into an index (cm) into the measurement array + index_r = int8_t(delay_dist * 0.1f); + + // If the ring buffer is not full... + if (index_r != index_w) { + e_count = 0; // Reset the E movement counter + const int8_t meas_sample = sample_to_size_ratio(); + do { + if (++index_w >= MMD_CM) index_w = 0; // The next unused slot + ratios[index_w] = meas_sample; // Store the measurement + } while (index_r != index_w); // More slots to fill? + } + } + } + + // Dynamically set the volumetric multiplier based on the delayed width measurement. + static inline void update_volumetric() { + if (enabled) { + int8_t read_index = index_r - meas_delay_cm; + if (read_index < 0) read_index += MMD_CM; // Loop around buffer if needed + LIMIT(read_index, 0, MAX_MEASUREMENT_DELAY); + planner.apply_filament_width_sensor(ratios[read_index]); + } + } + +}; + +extern FilamentWidthSensor filwidth; diff --git a/Marlin/src/feature/fwretract.cpp b/Marlin/src/feature/fwretract.cpp index dc9785c1d5..b4302cb17a 100644 --- a/Marlin/src/feature/fwretract.cpp +++ b/Marlin/src/feature/fwretract.cpp @@ -128,10 +128,7 @@ void FWRetract::retract(const bool retracting SERIAL_ECHOLNPAIR("current_hop ", current_hop); //*/ - const float old_feedrate_mm_s = feedrate_mm_s, - unscale_e = RECIPROCAL(planner.e_factor[active_extruder]), - unscale_fr = 100.0 / feedrate_percentage, // Disable feedrate scaling for retract moves - base_retract = ( + const float base_retract = ( (swapping ? settings.swap_retract_length : settings.retract_length) #if ENABLED(RETRACT_SYNC_MIXING) * (MIXING_STEPPERS) @@ -146,53 +143,53 @@ void FWRetract::retract(const bool retracting mixer.T(MIXER_AUTORETRACT_TOOL); #endif + const feedRate_t fr_max_z = planner.settings.max_feedrate_mm_s[Z_AXIS]; if (retracting) { // Retract by moving from a faux E position back to the current E position - feedrate_mm_s = ( - settings.retract_feedrate_mm_s * unscale_fr + current_retract[active_extruder] = base_retract; + prepare_internal_move_to_destination( // set_current_to_destination + settings.retract_feedrate_mm_s #if ENABLED(RETRACT_SYNC_MIXING) * (MIXING_STEPPERS) #endif ); - current_retract[active_extruder] = base_retract * unscale_e; - prepare_move_to_destination(); // set_current_to_destination // Is a Z hop set, and has the hop not yet been done? - if (settings.retract_zraise > 0.01 && !current_hop) { // Apply hop only once - current_hop += settings.retract_zraise; // Add to the hop total (again, only once) - feedrate_mm_s = planner.settings.max_feedrate_mm_s[Z_AXIS] * unscale_fr; // Maximum Z feedrate - prepare_move_to_destination(); // Raise up, set_current_to_destination + if (!current_hop && settings.retract_zraise > 0.01f) { // Apply hop only once + current_hop += settings.retract_zraise; // Add to the hop total (again, only once) + // Raise up, set_current_to_destination. Maximum Z feedrate + prepare_internal_move_to_destination(fr_max_z); } } else { // If a hop was done and Z hasn't changed, undo the Z hop if (current_hop) { - current_hop = 0.0; - feedrate_mm_s = planner.settings.max_feedrate_mm_s[Z_AXIS] * unscale_fr; // Z feedrate to max - prepare_move_to_destination(); // Lower Z, set_current_to_destination + current_hop = 0; + // Lower Z, set_current_to_destination. Maximum Z feedrate + prepare_internal_move_to_destination(fr_max_z); } const float extra_recover = swapping ? settings.swap_retract_recover_extra : settings.retract_recover_extra; - if (extra_recover != 0.0) { + if (extra_recover) { current_position[E_AXIS] -= extra_recover; // Adjust the current E position by the extra amount to recover sync_plan_position_e(); // Sync the planner position so the extra amount is recovered } - current_retract[active_extruder] = 0.0; - feedrate_mm_s = ( - (swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s) * unscale_fr + current_retract[active_extruder] = 0; + + const feedRate_t fr_mm_s = ( + (swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s) #if ENABLED(RETRACT_SYNC_MIXING) * (MIXING_STEPPERS) #endif ); - prepare_move_to_destination(); // Recover E, set_current_to_destination + prepare_internal_move_to_destination(fr_mm_s); // Recover E, set_current_to_destination } #if ENABLED(RETRACT_SYNC_MIXING) mixer.T(old_mixing_tool); // Restore original mixing tool #endif - feedrate_mm_s = old_feedrate_mm_s; // Restore original feedrate retracted[active_extruder] = retracting; // Active extruder now retracted / recovered // If swap retract/recover update the retracted_swap flag too diff --git a/Marlin/src/feature/fwretract.h b/Marlin/src/feature/fwretract.h index 7caba3dbe9..374667513d 100644 --- a/Marlin/src/feature/fwretract.h +++ b/Marlin/src/feature/fwretract.h @@ -27,21 +27,17 @@ #include "../inc/MarlinConfigPre.h" -#pragma pack(push, 1) // No padding between fields - typedef struct { - float retract_length, // M207 S - G10 Retract length - retract_feedrate_mm_s, // M207 F - G10 Retract feedrate - retract_zraise, // M207 Z - G10 Retract hop size - retract_recover_extra, // M208 S - G11 Recover length - retract_recover_feedrate_mm_s, // M208 F - G11 Recover feedrate - swap_retract_length, // M207 W - G10 Swap Retract length - swap_retract_recover_extra, // M208 W - G11 Swap Recover length - swap_retract_recover_feedrate_mm_s; // M208 R - G11 Swap Recover feedrate + float retract_length; // M207 S - G10 Retract length + feedRate_t retract_feedrate_mm_s; // M207 F - G10 Retract feedrate + float retract_zraise, // M207 Z - G10 Retract hop size + retract_recover_extra; // M208 S - G11 Recover length + feedRate_t retract_recover_feedrate_mm_s; // M208 F - G11 Recover feedrate + float swap_retract_length, // M207 W - G10 Swap Retract length + swap_retract_recover_extra; // M208 W - G11 Swap Recover length + feedRate_t swap_retract_recover_feedrate_mm_s; // M208 R - G11 Swap Recover feedrate } fwretract_settings_t; -#pragma pack(pop) - #if ENABLED(FWRETRACT) class FWRetract { diff --git a/Marlin/src/feature/host_actions.h b/Marlin/src/feature/host_actions.h index c93d3a16db..7477b6e6df 100644 --- a/Marlin/src/feature/host_actions.h +++ b/Marlin/src/feature/host_actions.h @@ -23,8 +23,6 @@ #include "../inc/MarlinConfigPre.h" -#include - void host_action(const char * const pstr, const bool eol=true); #ifdef ACTION_ON_KILL diff --git a/Marlin/src/feature/joystick.cpp b/Marlin/src/feature/joystick.cpp new file mode 100644 index 0000000000..bb54ff1d6d --- /dev/null +++ b/Marlin/src/feature/joystick.cpp @@ -0,0 +1,173 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ + +/** + * joystick.cpp - joystick input / jogging + */ + +#include "../inc/MarlinConfigPre.h" + +#if ENABLED(JOYSTICK) + +#include "joystick.h" + +#include "../inc/MarlinConfig.h" // for pins +#include "../module/planner.h" +#include "../module/temperature.h" + +Joystick joystick; + +#if ENABLED(EXTENSIBLE_UI) + #include "../lcd/extensible_ui/ui_api.h" +#endif + +#if HAS_JOY_ADC_X + temp_info_t Joystick::x; // = { 0 } +#endif +#if HAS_JOY_ADC_Y + temp_info_t Joystick::y; // = { 0 } +#endif +#if HAS_JOY_ADC_Z + temp_info_t Joystick::z; // = { 0 } +#endif + +#if ENABLED(JOYSTICK_DEBUG) + void Joystick::report() { + SERIAL_ECHOPGM("Joystick"); + #if HAS_JOY_ADC_X + SERIAL_ECHOPAIR(" X", x.raw); + #endif + #if HAS_JOY_ADC_Y + SERIAL_ECHOPAIR(" Y", y.raw); + #endif + #if HAS_JOY_ADC_Z + SERIAL_ECHOPAIR(" Z", z.raw); + #endif + #if HAS_JOY_ADC_EN + SERIAL_ECHO_TERNARY(READ(JOY_EN_PIN), " EN=", "HIGH (dis", "LOW (en", "abled)"); + #endif + SERIAL_EOL(); + } +#endif + +#if HAS_JOY_ADC_X || HAS_JOY_ADC_Y || HAS_JOY_ADC_Z + + void Joystick::calculate(float (&norm_jog)[XYZ]) { + // Do nothing if enable pin (active-low) is not LOW + #if HAS_JOY_ADC_EN + if (READ(JOY_EN_PIN)) return; + #endif + + auto _normalize_joy = [](float &norm_jog, const int16_t raw, const int16_t (&joy_limits)[4]) { + if (WITHIN(raw, joy_limits[0], joy_limits[3])) { + // within limits, check deadzone + if (raw > joy_limits[2]) + norm_jog = (raw - joy_limits[2]) / float(joy_limits[3] - joy_limits[2]); + else if (raw < joy_limits[1]) + norm_jog = (raw - joy_limits[1]) / float(joy_limits[1] - joy_limits[0]); // negative value + // Map normal to jog value via quadratic relationship + norm_jog = SIGN(norm_jog) * sq(norm_jog); + } + }; + + #if HAS_JOY_ADC_X + static constexpr int16_t joy_x_limits[4] = JOY_X_LIMITS; + _normalize_joy(norm_jog[X_AXIS], x.raw, joy_x_limits); + #endif + #if HAS_JOY_ADC_Y + static constexpr int16_t joy_y_limits[4] = JOY_Y_LIMITS; + _normalize_joy(norm_jog[Y_AXIS], y.raw, joy_y_limits); + #endif + #if HAS_JOY_ADC_Z + static constexpr int16_t joy_z_limits[4] = JOY_Z_LIMITS; + _normalize_joy(norm_jog[Z_AXIS], z.raw, joy_z_limits); + #endif + } + +#endif + +#if ENABLED(POLL_JOG) + + void Joystick::inject_jog_moves() { + // Recursion barrier + static bool injecting_now; // = false; + if (injecting_now) return; + + static constexpr int QUEUE_DEPTH = 5; // Insert up to this many movements + static constexpr float target_lag = 0.25f, // Aim for 1/4 second lag + seg_time = target_lag / QUEUE_DEPTH; // 0.05 seconds, short segments inserted every 1/20th of a second + static constexpr millis_t timer_limit_ms = millis_t(seg_time * 500); // 25 ms minimum delay between insertions + + // The planner can merge/collapse small moves, so the movement queue is unreliable to control the lag + static millis_t next_run = 0; + if (PENDING(millis(), next_run)) return; + next_run = millis() + timer_limit_ms; + + // Only inject a command if the planner has fewer than 5 moves and there are no unparsed commands + if (planner.movesplanned() >= QUEUE_DEPTH || queue.has_commands_queued()) + return; + + // Normalized jog values are 0 for no movement and -1 or +1 for as max feedrate (nonlinear relationship) + // Jog are initialized to zero and handling input can update values but doesn't have to + // You could use a two-axis joystick and a one-axis keypad and they might work together + float norm_jog[XYZ] = { 0 }; + + // Use ADC values and defined limits. The active zone is normalized: -1..0 (dead) 0..1 + #if HAS_JOY_ADC_X || HAS_JOY_ADC_Y || HAS_JOY_ADC_Z + joystick.calculate(norm_jog); + #endif + + // Other non-joystick poll-based jogging could be implemented here + // with "jogging" encapsulated as a more general class. + + #if ENABLED(EXTENSIBLE_UI) + ExtUI::_joystick_update(norm_jog); + #endif + + #if EITHER(ULTIPANEL, EXTENSIBLE_UI) + constexpr float manual_feedrate[XYZE] = MANUAL_FEEDRATE; + #endif + + // norm_jog values of [-1 .. 1] maps linearly to [-feedrate .. feedrate] + float move_dist[XYZ] = { 0 }, hypot2 = 0; + LOOP_XYZ(i) if (norm_jog[i]) { + move_dist[i] = seg_time * norm_jog[i] * + #if EITHER(ULTIPANEL, EXTENSIBLE_UI) + MMM_TO_MMS(manual_feedrate[i]); + #else + planner.settings.max_feedrate_mm_s[i]; + #endif + hypot2 += sq(move_dist[i]); + } + + if (!UNEAR_ZERO(hypot2)) { + LOOP_XYZ(i) current_position[i] += move_dist[i]; + const float length = sqrt(hypot2); + injecting_now = true; + planner.buffer_line(current_position, length / seg_time, active_extruder, length); + injecting_now = false; + } + } + +#endif // POLL_JOG + +#endif // JOYSTICK diff --git a/Marlin/src/feature/joystick.h b/Marlin/src/feature/joystick.h new file mode 100644 index 0000000000..e96120517e --- /dev/null +++ b/Marlin/src/feature/joystick.h @@ -0,0 +1,53 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * joystick.h - joystick input / jogging + */ + +#include "../core/macros.h" +#include "../module/temperature.h" + +//#define JOYSTICK_DEBUG + +class Joystick { + friend class Temperature; + private: + #if HAS_JOY_ADC_X + static temp_info_t x; + #endif + #if HAS_JOY_ADC_Y + static temp_info_t y; + #endif + #if HAS_JOY_ADC_Z + static temp_info_t z; + #endif + public: + #if ENABLED(JOYSTICK_DEBUG) + static void report(); + #endif + static void calculate(float (&norm_jog)[XYZ]); + static void inject_jog_moves(); +}; + +extern Joystick joystick; diff --git a/Marlin/src/feature/leds/tempstat.cpp b/Marlin/src/feature/leds/tempstat.cpp index 601e433687..f19ae0f092 100644 --- a/Marlin/src/feature/leds/tempstat.cpp +++ b/Marlin/src/feature/leds/tempstat.cpp @@ -31,7 +31,7 @@ #include "tempstat.h" #include "../../module/temperature.h" -void handle_status_leds(void) { +void handle_status_leds() { static int8_t old_red = -1; // Invalid value to force LED initialization static millis_t next_status_led_update_ms = 0; if (ELAPSED(millis(), next_status_led_update_ms)) { diff --git a/Marlin/src/feature/leds/tempstat.h b/Marlin/src/feature/leds/tempstat.h index 6d1e2490f3..834f2e491f 100644 --- a/Marlin/src/feature/leds/tempstat.h +++ b/Marlin/src/feature/leds/tempstat.h @@ -25,4 +25,4 @@ * Marlin general RGB LED support */ -void handle_status_leds(void); +void handle_status_leds(); diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index f1b8227b74..ff200d0afb 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -122,7 +122,7 @@ static bool ensure_safe_temperature(const PauseMode mode=PAUSE_MODE_SAME) { return thermalManager.wait_for_hotend(active_extruder); } -void do_pause_e_move(const float &length, const float &fr_mm_s) { +void do_pause_e_move(const float &length, const feedRate_t &fr_mm_s) { #if HAS_FILAMENT_SENSOR runout.reset(); #endif @@ -399,9 +399,10 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u #elif defined(ACTION_ON_PAUSE) host_action_pause(); #endif - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_INFO, PSTR("Pause")); - #endif + #endif + + #if ENABLED(HOST_PROMPT_SUPPORT) + host_prompt_open(PROMPT_INFO, PSTR("Pause"), PSTR("Dismiss")); #endif if (!DEBUGGING(DRYRUN) && unload_length && thermalManager.targetTooColdToExtrude(active_extruder)) { @@ -445,7 +446,7 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u do_pause_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE); // Park the nozzle by moving up by z_lift and then moving to (x_pos, y_pos) - if (!axis_unhomed_error()) + if (!axes_need_homing()) nozzle.park(2, park_point); #if ENABLED(DUAL_X_CARRIAGE) @@ -503,6 +504,8 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep #if HAS_BUZZER filament_change_beep(max_beep_count, true); + #else + UNUSED(max_beep_count); #endif // Start the heater idle timers @@ -555,7 +558,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep while (wait_for_user) idle(true); #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Reheating")); + host_prompt_do(PROMPT_INFO, PSTR("Reheating")); #endif #if ENABLED(EXTENSIBLE_UI) ExtUI::onStatusChanged(PSTR("Reheating...")); @@ -649,16 +652,16 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le #endif // If resume_position is negative - if (resume_position[E_AXIS] < 0) do_pause_e_move(resume_position[E_AXIS], PAUSE_PARK_RETRACT_FEEDRATE); + if (resume_position[E_AXIS] < 0) do_pause_e_move(resume_position[E_AXIS], feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE)); // Move XY to starting position, then Z - do_blocking_move_to_xy(resume_position[X_AXIS], resume_position[Y_AXIS], NOZZLE_PARK_XY_FEEDRATE); + do_blocking_move_to_xy(resume_position[X_AXIS], resume_position[Y_AXIS], feedRate_t(NOZZLE_PARK_XY_FEEDRATE)); // Move Z_AXIS to saved position - do_blocking_move_to_z(resume_position[Z_AXIS], NOZZLE_PARK_Z_FEEDRATE); + do_blocking_move_to_z(resume_position[Z_AXIS], feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); #if ADVANCED_PAUSE_RESUME_PRIME != 0 - do_pause_e_move(ADVANCED_PAUSE_RESUME_PRIME, ADVANCED_PAUSE_PURGE_FEEDRATE); + do_pause_e_move(ADVANCED_PAUSE_RESUME_PRIME, feedRate_t(ADVANCED_PAUSE_PURGE_FEEDRATE)); #endif // Now all extrusion positions are resumed and ready to be confirmed @@ -678,7 +681,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le --did_pause_print; #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_INFO, PSTR("Resume")); + host_prompt_open(PROMPT_INFO, PSTR("Resuming"), PSTR("Dismiss")); #endif #if ENABLED(SDSUPPORT) diff --git a/Marlin/src/feature/pause.h b/Marlin/src/feature/pause.h index 77cbe6b3f5..deb19f46a8 100644 --- a/Marlin/src/feature/pause.h +++ b/Marlin/src/feature/pause.h @@ -81,7 +81,7 @@ extern uint8_t did_pause_print; #define DXC_PASS #endif -void do_pause_e_move(const float &length, const float &fr_mm_s); +void do_pause_e_move(const float &length, const feedRate_t &fr_mm_s); bool pause_print(const float &retract, const point_t &park_point, const float &unload_length=0, const bool show_lcd=false DXC_PARAMS); diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index 2ff82331b3..777c7a052e 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -30,7 +30,7 @@ #include "power.h" #include "../module/temperature.h" -#include "../module/stepper_indirection.h" +#include "../module/stepper/indirection.h" #include "../Marlin.h" Power powerManager; diff --git a/Marlin/src/feature/power_loss_recovery.cpp b/Marlin/src/feature/power_loss_recovery.cpp index 5f826166a5..3420f205f6 100644 --- a/Marlin/src/feature/power_loss_recovery.cpp +++ b/Marlin/src/feature/power_loss_recovery.cpp @@ -36,6 +36,9 @@ bool PrintJobRecovery::enabled; // Initialized by settings.load() SdFile PrintJobRecovery::file; job_recovery_info_t PrintJobRecovery::info; const char PrintJobRecovery::filename[5] = "/PLR"; +uint8_t PrintJobRecovery::queue_index_r; +uint32_t PrintJobRecovery::cmd_sdpos, // = 0 + PrintJobRecovery::sdpos[BUFSIZE]; #include "../sd/cardreader.h" #include "../lcd/ultralcd.h" @@ -95,8 +98,8 @@ void PrintJobRecovery::changed() { */ void PrintJobRecovery::check() { if (enabled) { - if (!card.isDetected()) card.initsd(); - if (card.isDetected()) { + if (!card.isMounted()) card.mount(); + if (card.isMounted()) { load(); if (!valid()) return purge(); queue.inject_P(PSTR("M1000 S")); @@ -124,6 +127,14 @@ void PrintJobRecovery::load() { debug(PSTR("Load")); } +/** + * Set info fields that won't change + */ +void PrintJobRecovery::prepare() { + card.getAbsFilename(info.sd_filename); // SD filename + cmd_sdpos = 0; +} + /** * Save the current machine state to the power-loss recovery file */ @@ -141,9 +152,6 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*= // Did Z change since the last call? if (force #if DISABLED(SAVE_EACH_CMD_MODE) // Always save state when enabled - #if PIN_EXISTS(POWER_LOSS) // Save if power loss pin is triggered - || READ(POWER_LOSS_PIN) == POWER_LOSS_STATE - #endif #if SAVE_INFO_INTERVAL_MS > 0 // Save if interval is elapsed || ELAPSED(ms, next_save_ms) #endif @@ -175,7 +183,9 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*= info.active_extruder = active_extruder; #endif - HOTEND_LOOP() info.target_temperature[e] = thermalManager.temp_hotend[e].target; + #if EXTRUDERS + HOTEND_LOOP() info.target_temperature[e] = thermalManager.temp_hotend[e].target; + #endif #if HAS_HEATED_BED info.target_temperature_bed = thermalManager.temp_bed.target; @@ -205,31 +215,23 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*= info.retract_hop = fwretract.current_hop; #endif - // Relative mode - info.relative_mode = relative_mode; - info.relative_modes_e = gcode.axis_relative_modes[E_AXIS]; - - // Commands in the queue - info.queue_length = save_queue ? queue.length : 0; - info.queue_index_r = queue.index_r; - COPY(info.queue_buffer, queue.buffer); + // Relative axis modes + info.axis_relative = gcode.axis_relative; // Elapsed print job time info.print_job_elapsed = print_job_timer.duration(); - // SD file position - card.getAbsFilename(info.sd_filename); - info.sdpos = card.getIndex(); - write(); - - // KILL now if the power-loss pin was triggered - #if PIN_EXISTS(POWER_LOSS) - if (READ(POWER_LOSS_PIN) == POWER_LOSS_STATE) kill(PSTR(MSG_OUTAGE_RECOVERY)); - #endif } } +#if PIN_EXISTS(POWER_LOSS) + void PrintJobRecovery::_outage() { + save(true); + kill(PSTR(MSG_OUTAGE_RECOVERY)); + } +#endif + /** * Save the recovery info the recovery file */ @@ -251,6 +253,8 @@ void PrintJobRecovery::resume() { #define RECOVERY_ZRAISE 2 + const uint32_t resume_sdpos = info.sdpos; // Get here before the stepper ISR overwrites it + #if HAS_LEVELING // Make sure leveling is off before any G92 and G28 gcode.process_subcommands_now_P(PSTR("M420 S0 Z0")); @@ -297,17 +301,19 @@ void PrintJobRecovery::resume() { #endif // Restore all hotend temperatures - HOTEND_LOOP() { - const int16_t et = info.target_temperature[e]; - if (et) { - #if HOTENDS > 1 - sprintf_P(cmd, PSTR("T%i"), e); + #if HOTENDS + HOTEND_LOOP() { + const int16_t et = info.target_temperature[e]; + if (et) { + #if HOTENDS > 1 + sprintf_P(cmd, PSTR("T%i"), e); + gcode.process_subcommands_now(cmd); + #endif + sprintf_P(cmd, PSTR("M109 S%i"), et); gcode.process_subcommands_now(cmd); - #endif - sprintf_P(cmd, PSTR("M109 S%i"), et); - gcode.process_subcommands_now(cmd); + } } - } + #endif // Restore print cooling fan speeds FANS_LOOP(i) { @@ -385,9 +391,8 @@ void PrintJobRecovery::resume() { sprintf_P(cmd, PSTR("G92.9 E%s"), dtostrf(info.current_position[E_AXIS], 1, 3, str_1)); gcode.process_subcommands_now(cmd); - // Relative mode - relative_mode = info.relative_mode; - gcode.axis_relative_modes[E_AXIS] = info.relative_modes_e; + // Relative axis modes + gcode.axis_relative = info.axis_relative; #if HAS_HOME_OFFSET || HAS_POSITION_SHIFT LOOP_XYZ(i) { @@ -401,16 +406,11 @@ void PrintJobRecovery::resume() { } #endif - // Process commands from the old pending queue - uint8_t c = info.queue_length, r = info.queue_index_r; - for (; c--; r = (r + 1) % BUFSIZE) - gcode.process_subcommands_now(info.queue_buffer[r]); - // Resume the SD file from the last position char *fn = info.sd_filename; sprintf_P(cmd, PSTR("M23 %s"), fn); gcode.process_subcommands_now(cmd); - sprintf_P(cmd, PSTR("M24 S%ld T%ld"), info.sdpos, info.print_job_elapsed); + sprintf_P(cmd, PSTR("M24 S%ld T%ld"), resume_sdpos, info.print_job_elapsed); gcode.process_subcommands_now(cmd); } @@ -452,12 +452,14 @@ void PrintJobRecovery::resume() { DEBUG_ECHOLNPAIR("active_extruder: ", int(info.active_extruder)); #endif - DEBUG_ECHOPGM("target_temperature: "); - HOTEND_LOOP() { - DEBUG_ECHO(info.target_temperature[e]); - if (e < HOTENDS - 1) DEBUG_CHAR(','); - } - DEBUG_EOL(); + #if HOTENDS + DEBUG_ECHOPGM("target_temperature: "); + HOTEND_LOOP() { + DEBUG_ECHO(info.target_temperature[e]); + if (e < HOTENDS - 1) DEBUG_CHAR(','); + } + DEBUG_EOL(); + #endif #if HAS_HEATED_BED DEBUG_ECHOLNPAIR("target_temperature_bed: ", info.target_temperature_bed); @@ -484,9 +486,6 @@ void PrintJobRecovery::resume() { DEBUG_EOL(); DEBUG_ECHOLNPAIR("retract_hop: ", info.retract_hop); #endif - DEBUG_ECHOLNPAIR("queue_index_r: ", int(info.queue_index_r)); - DEBUG_ECHOLNPAIR("queue_length: ", int(info.queue_length)); - for (uint8_t i = 0; i < info.queue_length; i++) DEBUG_ECHOLNPAIR("> ", info.queue_buffer[i]); DEBUG_ECHOLNPAIR("sd_filename: ", info.sd_filename); DEBUG_ECHOLNPAIR("sdpos: ", info.sdpos); DEBUG_ECHOLNPAIR("print_job_elapsed: ", info.print_job_elapsed); diff --git a/Marlin/src/feature/power_loss_recovery.h b/Marlin/src/feature/power_loss_recovery.h index 34322243fd..58b6c1dc7a 100644 --- a/Marlin/src/feature/power_loss_recovery.h +++ b/Marlin/src/feature/power_loss_recovery.h @@ -59,7 +59,9 @@ typedef struct { uint8_t active_extruder; #endif - int16_t target_temperature[HOTENDS]; + #if HOTENDS + int16_t target_temperature[HOTENDS]; + #endif #if HAS_HEATED_BED int16_t target_temperature_bed; @@ -87,16 +89,12 @@ typedef struct { #endif #endif - // Relative mode - bool relative_mode, relative_modes_e; - - // Command queue - uint8_t queue_length, queue_index_r; - char queue_buffer[BUFSIZE][MAX_CMD_SIZE]; + // Relative axis modes + uint8_t axis_relative; // SD Filename and position char sd_filename[MAXPATHNAMELENGTH]; - uint32_t sdpos; + volatile uint32_t sdpos; // Job elapsed time millis_t print_job_elapsed; @@ -112,7 +110,12 @@ class PrintJobRecovery { static SdFile file; static job_recovery_info_t info; + static uint8_t queue_index_r; //!< Queue index of the active command + static uint32_t cmd_sdpos, //!< SD position of the next command + sdpos[BUFSIZE]; //!< SD positions of queued commands + static void init(); + static void prepare(); static inline void setup() { #if PIN_EXISTS(POWER_LOSS) @@ -128,6 +131,10 @@ class PrintJobRecovery { #endif } + // Track each command's file offsets + static inline uint32_t command_sdpos() { return sdpos[queue_index_r]; } + static inline void commit_sdpos(const uint8_t index_w) { sdpos[index_w] = cmd_sdpos; } + static bool enabled; static void enable(const bool onoff); static void changed(); @@ -150,6 +157,13 @@ class PrintJobRecovery { , const bool save_queue=true ); + #if PIN_EXISTS(POWER_LOSS) + static inline void outage() { + if (enabled && IS_SD_PRINTING() && READ(POWER_LOSS_PIN) == POWER_LOSS_STATE) + _outage(); + } + #endif + static inline bool valid() { return info.valid_head && info.valid_head == info.valid_foot; } #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) @@ -160,6 +174,10 @@ class PrintJobRecovery { private: static void write(); + + #if PIN_EXISTS(POWER_LOSS) + static void _outage(); + #endif }; extern PrintJobRecovery recovery; diff --git a/Marlin/src/feature/prusa_MMU2/mmu2.cpp b/Marlin/src/feature/prusa_MMU2/mmu2.cpp index 57d0418c4f..8f5537ba9c 100644 --- a/Marlin/src/feature/prusa_MMU2/mmu2.cpp +++ b/Marlin/src/feature/prusa_MMU2/mmu2.cpp @@ -35,7 +35,7 @@ MMU2 mmu2; #include "../../libs/nozzle.h" #include "../../module/temperature.h" #include "../../module/planner.h" -#include "../../module/stepper_indirection.h" +#include "../../module/stepper/indirection.h" #include "../../Marlin.h" #if ENABLED(HOST_PROMPT_SUPPORT) @@ -102,8 +102,8 @@ char MMU2::rx_buffer[16], MMU2::tx_buffer[16]; #if HAS_LCD_MENU && ENABLED(MMU2_MENUS) struct E_Step { - float extrude; //!< extrude distance in mm - float feedRate; //!< feed rate in mm/s + float extrude; //!< extrude distance in mm + feedRate_t feedRate; //!< feed rate in mm/s }; static constexpr E_Step ramming_sequence[] PROGMEM = { MMU2_RAMMING_SEQUENCE }; @@ -432,9 +432,7 @@ bool MMU2::rx_ok() { */ void MMU2::check_version() { if (buildnr < MMU_REQUIRED_FW_BUILDNR) { - SERIAL_ERROR_START(); - SERIAL_ECHOPGM("MMU2 firmware version invalid. Required version >= "); - SERIAL_ECHOLN(MMU_REQUIRED_FW_BUILDNR); + SERIAL_ERROR_MSG("Invalid MMU2 firmware. Version >= " STRINGIFY(MMU_REQUIRED_FW_BUILDNR) " required."); kill(MSG_MMU2_WRONG_FIRMWARE); } } @@ -533,7 +531,7 @@ void MMU2::command(const uint8_t mmu_cmd) { /** * Wait for response from MMU */ -bool MMU2::get_response(void) { +bool MMU2::get_response() { while (cmd != MMU_CMD_NONE) idle(); while (!ready) { @@ -606,10 +604,10 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) { BUZZ(200, 404); // Move XY to starting position, then Z - do_blocking_move_to_xy(resume_position[X_AXIS], resume_position[Y_AXIS], NOZZLE_PARK_XY_FEEDRATE); + do_blocking_move_to_xy(resume_position[X_AXIS], resume_position[Y_AXIS], feedRate_t(NOZZLE_PARK_XY_FEEDRATE)); // Move Z_AXIS to saved position - do_blocking_move_to_z(resume_position[Z_AXIS], NOZZLE_PARK_Z_FEEDRATE); + do_blocking_move_to_z(resume_position[Z_AXIS], feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); } else { BUZZ(200, 404); @@ -698,8 +696,6 @@ void MMU2::filament_runout() { } LCD_MESSAGEPGM(MSG_MMU2_EJECTING_FILAMENT); - const bool saved_e_relative_mode = gcode.axis_relative_modes[E_AXIS]; - gcode.axis_relative_modes[E_AXIS] = true; enable_E0(); current_position[E_AXIS] -= MMU2_FILAMENTCHANGE_EJECT_FEED; @@ -735,8 +731,6 @@ void MMU2::filament_runout() { BUZZ(200, 404); - gcode.axis_relative_modes[E_AXIS] = saved_e_relative_mode; - disable_E0(); return true; @@ -784,28 +778,22 @@ void MMU2::filament_runout() { planner.synchronize(); enable_E0(); - const bool saved_e_relative_mode = gcode.axis_relative_modes[E_AXIS]; - gcode.axis_relative_modes[E_AXIS] = true; - const E_Step* step = sequence; for (uint8_t i = 0; i < steps; i++) { - const float es = pgm_read_float(&(step->extrude)), - fr = pgm_read_float(&(step->feedRate)); + const float es = pgm_read_float(&(step->extrude)); + const feedRate_t fr_mm_m = pgm_read_float(&(step->feedRate)); DEBUG_ECHO_START(); - DEBUG_ECHOLNPAIR("E step ", es, "/", fr); + DEBUG_ECHOLNPAIR("E step ", es, "/", fr_mm_m); current_position[E_AXIS] += es; - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], - current_position[E_AXIS], MMM_TO_MMS(fr), active_extruder); + line_to_current_position(MMM_TO_MMS(fr_mm_m)); planner.synchronize(); step++; } - gcode.axis_relative_modes[E_AXIS] = saved_e_relative_mode; - disable_E0(); } diff --git a/Marlin/src/feature/prusa_MMU2/mmu2.h b/Marlin/src/feature/prusa_MMU2/mmu2.h index 0c20be9d8e..e102481c19 100644 --- a/Marlin/src/feature/prusa_MMU2/mmu2.h +++ b/Marlin/src/feature/prusa_MMU2/mmu2.h @@ -61,7 +61,7 @@ private: static void check_version(); static void command(const uint8_t cmd); - static bool get_response(void); + static bool get_response(); static void manage_response(const bool move_axes, const bool turn_off_nozzle); #if HAS_LCD_MENU && ENABLED(MMU2_MENUS) diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index faf2d8b110..ab92c1f7c1 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -27,7 +27,8 @@ #include "../sd/cardreader.h" #include "../module/printcounter.h" -#include "../module/stepper.h" +#include "../module/planner.h" +#include "../module/stepper.h" // for block_t #include "../gcode/queue.h" #include "../inc/MarlinConfig.h" @@ -97,7 +98,11 @@ class TFilamentMonitor : public FilamentMonitorBase { // Give the response a chance to update its counter. static inline void run() { - if (enabled && !filament_ran_out && (IS_SD_PRINTING() || print_job_timer.isRunning() || did_pause_print)) { + if (enabled && !filament_ran_out && (IS_SD_PRINTING() || print_job_timer.isRunning() + #if ENABLED(ADVANCED_PAUSE_FEATURE) + || did_pause_print + #endif + )) { #ifdef FILAMENT_RUNOUT_DISTANCE_MM cli(); // Prevent RunoutResponseDelayed::block_completed from accumulating here #endif diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index b3ea6e7cb7..329c511ecd 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -27,7 +27,7 @@ #include "tmc_util.h" #include "../Marlin.h" -#include "../module/stepper_indirection.h" +#include "../module/stepper/indirection.h" #include "../module/printcounter.h" #include "../libs/duration_t.h" #include "../gcode/gcode.h" @@ -1118,7 +1118,7 @@ void test_tmc_connection(const bool test_x, const bool test_y, const bool test_z #endif } - if (axis_connection) ui.set_status_P(PSTR("TMC CONNECTION ERROR")); + if (axis_connection) ui.set_status_P(PSTR(MSG_ERROR_TMC)); } #endif // HAS_TRINAMIC diff --git a/Marlin/src/feature/touch/xpt2046.cpp b/Marlin/src/feature/touch/xpt2046.cpp index f920627c29..b0ab10e7ce 100644 --- a/Marlin/src/feature/touch/xpt2046.cpp +++ b/Marlin/src/feature/touch/xpt2046.cpp @@ -43,11 +43,11 @@ XPT2046 touch; extern int8_t encoderDiff; -void XPT2046::init(void) { +void XPT2046::init() { SET_INPUT(TOUCH_MISO_PIN); SET_OUTPUT(TOUCH_MOSI_PIN); SET_OUTPUT(TOUCH_SCK_PIN); - OUT_WRITE(TOUCH_CS_PIN, 1); + OUT_WRITE(TOUCH_CS_PIN, HIGH); #if PIN_EXISTS(TOUCH_INT) // Optional Pendrive interrupt pin @@ -80,9 +80,10 @@ uint8_t XPT2046::read_buttons() { if (y < 175 || y > 234) return 0; - return WITHIN(x, 11, 109) ? EN_A - : WITHIN(x, 111, 209) ? EN_B - : WITHIN(x, 211, 309) ? EN_C + return WITHIN(x, 14, 77) ? EN_D + : WITHIN(x, 90, 153) ? EN_A + : WITHIN(x, 166, 229) ? EN_B + : WITHIN(x, 242, 305) ? EN_C : 0; } @@ -134,4 +135,12 @@ uint16_t XPT2046::getInTouch(const XPTCoordinate coordinate) { return (data[1] + data[2]) >> 1; } +bool XPT2046::getTouchPoint(uint16_t &x, uint16_t &y) { + if (isTouched()) { + x = getInTouch(XPT2046_X); + y = getInTouch(XPT2046_Y); + } + return isTouched(); +} + #endif // TOUCH_BUTTONS diff --git a/Marlin/src/feature/touch/xpt2046.h b/Marlin/src/feature/touch/xpt2046.h index aea840576c..384d7904bd 100644 --- a/Marlin/src/feature/touch/xpt2046.h +++ b/Marlin/src/feature/touch/xpt2046.h @@ -40,10 +40,13 @@ enum XPTCoordinate : uint8_t { class XPT2046 { public: - static void init(void); + static void init(); static uint8_t read_buttons(); -private: + bool getTouchPoint(uint16_t &x, uint16_t &y); static bool isTouched(); + inline void waitForRelease() { while (isTouched()) { /* nada */ } } + inline void waitForTouch(uint16_t &x, uint16_t &y) { while (!getTouchPoint(x, y)) { /* nada */ } } +private: static uint16_t getInTouch(const XPTCoordinate coordinate); }; diff --git a/Marlin/src/feature/twibus.cpp b/Marlin/src/feature/twibus.cpp index ccd778120d..f4fe512cdf 100644 --- a/Marlin/src/feature/twibus.cpp +++ b/Marlin/src/feature/twibus.cpp @@ -34,12 +34,12 @@ TWIBus::TWIBus() { #else Wire.begin(I2C_SLAVE_ADDRESS); // Join the bus as a slave #endif - this->reset(); + reset(); } void TWIBus::reset() { - this->buffer_s = 0; - this->buffer[0] = 0x00; + buffer_s = 0; + buffer[0] = 0x00; } void TWIBus::address(const uint8_t adr) { @@ -47,7 +47,7 @@ void TWIBus::address(const uint8_t adr) { SERIAL_ECHO_MSG("Bad I2C address (8-127)"); } - this->addr = adr; + addr = adr; #if ENABLED(DEBUG_TWIBUS) debug(PSTR("address"), adr); @@ -55,8 +55,8 @@ void TWIBus::address(const uint8_t adr) { } void TWIBus::addbyte(const char c) { - if (this->buffer_s >= COUNT(this->buffer)) return; - this->buffer[this->buffer_s++] = c; + if (buffer_s >= COUNT(buffer)) return; + buffer[buffer_s++] = c; #if ENABLED(DEBUG_TWIBUS) debug(PSTR("addbyte"), c); #endif @@ -66,26 +66,26 @@ void TWIBus::addbytes(char src[], uint8_t bytes) { #if ENABLED(DEBUG_TWIBUS) debug(PSTR("addbytes"), bytes); #endif - while (bytes--) this->addbyte(*src++); + while (bytes--) addbyte(*src++); } void TWIBus::addstring(char str[]) { #if ENABLED(DEBUG_TWIBUS) debug(PSTR("addstring"), str); #endif - while (char c = *str++) this->addbyte(c); + while (char c = *str++) addbyte(c); } void TWIBus::send() { #if ENABLED(DEBUG_TWIBUS) - debug(PSTR("send"), this->addr); + debug(PSTR("send"), addr); #endif - Wire.beginTransmission(I2C_ADDRESS(this->addr)); - Wire.write(this->buffer, this->buffer_s); + Wire.beginTransmission(I2C_ADDRESS(addr)); + Wire.write(buffer, buffer_s); Wire.endTransmission(); - this->reset(); + reset(); } // static @@ -103,22 +103,22 @@ void TWIBus::echodata(uint8_t bytes, const char prefix[], uint8_t adr) { } void TWIBus::echobuffer(const char prefix[], uint8_t adr) { - echoprefix(this->buffer_s, prefix, adr); - for (uint8_t i = 0; i < this->buffer_s; i++) SERIAL_CHAR(this->buffer[i]); + echoprefix(buffer_s, prefix, adr); + for (uint8_t i = 0; i < buffer_s; i++) SERIAL_CHAR(buffer[i]); SERIAL_EOL(); } bool TWIBus::request(const uint8_t bytes) { - if (!this->addr) return false; + if (!addr) return false; #if ENABLED(DEBUG_TWIBUS) debug(PSTR("request"), bytes); #endif // requestFrom() is a blocking function - if (Wire.requestFrom(this->addr, bytes) == 0) { + if (Wire.requestFrom(addr, bytes) == 0) { #if ENABLED(DEBUG_TWIBUS) - debug("request fail", this->addr); + debug("request fail", addr); #endif return false; } @@ -131,12 +131,12 @@ void TWIBus::relay(const uint8_t bytes) { debug(PSTR("relay"), bytes); #endif - if (this->request(bytes)) - echodata(bytes, PSTR("i2c-reply"), this->addr); + if (request(bytes)) + echodata(bytes, PSTR("i2c-reply"), addr); } uint8_t TWIBus::capture(char *dst, const uint8_t bytes) { - this->reset(); + reset(); uint8_t count = 0; while (count < bytes && Wire.available()) dst[count++] = Wire.read(); @@ -168,13 +168,13 @@ void TWIBus::flush() { #endif if (str) { - this->reset(); - this->addstring(str); + reset(); + addstring(str); } - Wire.write(this->buffer, this->buffer_s); + Wire.write(buffer, buffer_s); - this->reset(); + reset(); } #endif diff --git a/Marlin/src/feature/twibus.h b/Marlin/src/feature/twibus.h index 1e2f14cfc0..cc40476374 100644 --- a/Marlin/src/feature/twibus.h +++ b/Marlin/src/feature/twibus.h @@ -218,7 +218,7 @@ class TWIBus { * If a string is passed, write it into the buffer first. */ void reply(char str[]=nullptr); - inline void reply(const char str[]) { this->reply((char*)str); } + inline void reply(const char str[]) { reply((char*)str); } #endif diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 3b44a29301..f98ffc88cb 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -168,7 +168,7 @@ int8_t g26_prime_flag; */ bool user_canceled() { if (!ui.button_pressed()) return false; // Return if the button isn't pressed - ui.set_status_P(PSTR("Mesh Validation Stopped."), 99); + ui.set_status_P(PSTR(MSG_G26_CANCELED), 99); #if HAS_LCD_MENU ui.quick_feedback(); #endif @@ -216,41 +216,32 @@ mesh_index_pair find_closest_circle_to_print(const float &X, const float &Y) { return return_val; } -void G26_line_to_destination(const float &feed_rate) { - const float save_feedrate = feedrate_mm_s; - feedrate_mm_s = feed_rate; - prepare_move_to_destination(); // will ultimately call ubl.line_to_destination_cartesian or ubl.prepare_linear_move_to for UBL_SEGMENTED - feedrate_mm_s = save_feedrate; -} - void move_to(const float &rx, const float &ry, const float &z, const float &e_delta) { - float feed_value; static float last_z = -999.99; bool has_xy_component = (rx != current_position[X_AXIS] || ry != current_position[Y_AXIS]); // Check if X or Y is involved in the movement. if (z != last_z) { last_z = z; - feed_value = planner.settings.max_feedrate_mm_s[Z_AXIS]/(2.0); // Base the feed rate off of the configured Z_AXIS feed rate + const feedRate_t feed_value = planner.settings.max_feedrate_mm_s[Z_AXIS] * 0.5f; // Use half of the Z_AXIS max feed rate destination[X_AXIS] = current_position[X_AXIS]; destination[Y_AXIS] = current_position[Y_AXIS]; destination[Z_AXIS] = z; // We know the last_z!=z or we wouldn't be in this block of code. destination[E_AXIS] = current_position[E_AXIS]; - G26_line_to_destination(feed_value); + prepare_internal_move_to_destination(feed_value); set_destination_from_current(); } - // Check if X or Y is involved in the movement. - // Yes: a 'normal' movement. No: a retract() or recover() - feed_value = has_xy_component ? G26_XY_FEEDRATE : planner.settings.max_feedrate_mm_s[E_AXIS] / 1.5; + // If X or Y is involved do a 'normal' move. Otherwise retract/recover/hop. + const feedRate_t feed_value = has_xy_component ? feedRate_t(G26_XY_FEEDRATE) : planner.settings.max_feedrate_mm_s[E_AXIS] * 0.666f; destination[X_AXIS] = rx; destination[Y_AXIS] = ry; destination[E_AXIS] += e_delta; - G26_line_to_destination(feed_value); + prepare_internal_move_to_destination(feed_value); set_destination_from_current(); } @@ -386,7 +377,7 @@ inline bool turn_on_heaters() { if (g26_bed_temp > 25) { #if HAS_SPI_LCD - ui.set_status_P(PSTR("G26 Heating Bed."), 99); + ui.set_status_P(PSTR(MSG_G26_HEATING_BED), 99); ui.quick_feedback(); #if HAS_LCD_MENU ui.capture(); @@ -407,7 +398,7 @@ inline bool turn_on_heaters() { // Start heating the active nozzle #if HAS_SPI_LCD - ui.set_status_P(PSTR("G26 Heating Nozzle."), 99); + ui.set_status_P(PSTR(MSG_G26_HEATING_NOZZLE), 99); ui.quick_feedback(); #endif thermalManager.setTargetHotend(g26_hotend_temp, active_extruder); @@ -433,6 +424,7 @@ inline bool turn_on_heaters() { */ inline bool prime_nozzle() { + const feedRate_t fr_slow_e = planner.settings.max_feedrate_mm_s[E_AXIS] / 15.0f; #if HAS_LCD_MENU #if ENABLED(PREVENT_LENGTHY_EXTRUDE) float Total_Prime = 0.0; @@ -441,7 +433,7 @@ inline bool prime_nozzle() { if (g26_prime_flag == -1) { // The user wants to control how much filament gets purged ui.capture(); - ui.set_status_P(PSTR("User-Controlled Prime"), 99); + ui.set_status_P(PSTR(MSG_G26_MANUAL_PRIME), 99); ui.chirp(); set_destination_from_current(); @@ -455,7 +447,7 @@ inline bool prime_nozzle() { Total_Prime += 0.25; if (Total_Prime >= EXTRUDE_MAXLENGTH) return G26_ERR; #endif - G26_line_to_destination(planner.settings.max_feedrate_mm_s[E_AXIS] / 15.0); + prepare_internal_move_to_destination(fr_slow_e); set_destination_from_current(); planner.synchronize(); // Without this synchronize, the purge is more consistent, // but because the planner has a buffer, we won't be able @@ -465,7 +457,7 @@ inline bool prime_nozzle() { ui.wait_for_release(); - ui.set_status_P(PSTR("Done Priming"), 99); + ui.set_status_P(PSTR(MSG_G26_PRIME_DONE), 99); ui.quick_feedback(); ui.release(); } @@ -473,12 +465,12 @@ inline bool prime_nozzle() { #endif { #if HAS_SPI_LCD - ui.set_status_P(PSTR("Fixed Length Prime."), 99); + ui.set_status_P(PSTR(MSG_G26_FIXED_LENGTH), 99); ui.quick_feedback(); #endif set_destination_from_current(); destination[E_AXIS] += g26_prime_length; - G26_line_to_destination(planner.settings.max_feedrate_mm_s[E_AXIS] / 15.0); + prepare_internal_move_to_destination(fr_slow_e); set_destination_from_current(); retract_filament(destination); } @@ -486,12 +478,6 @@ inline bool prime_nozzle() { return G26_OK; } -float valid_trig_angle(float d) { - while (d > 360.0) d -= 360.0; - while (d < 0.0) d += 360.0; - return d; -} - /** * G26: Mesh Validation Pattern generation. * @@ -787,12 +773,13 @@ void GcodeSuite::G26() { move_to(sx, sy, g26_layer_height, 0.0); // Get to the starting point with no extrusion / un-Z bump recover_filament(destination); - const float save_feedrate = feedrate_mm_s; - feedrate_mm_s = PLANNER_XY_FEEDRATE() / 10.0; + const feedRate_t old_feedrate = feedrate_mm_s; + feedrate_mm_s = PLANNER_XY_FEEDRATE() * 0.1f; plan_arc(endpoint, arc_offset, false); // Draw a counter-clockwise arc - feedrate_mm_s = save_feedrate; + feedrate_mm_s = old_feedrate; set_destination_from_current(); + #if HAS_LCD_MENU if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation #endif @@ -852,7 +839,7 @@ void GcodeSuite::G26() { } while (--g26_repeats && location.x_index >= 0 && location.y_index >= 0); LEAVE: - ui.set_status_P(PSTR("Leaving G26"), -1); + ui.set_status_P(PSTR(MSG_G26_LEAVING), -1); retract_filament(destination); destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES; diff --git a/Marlin/src/gcode/bedlevel/G42.cpp b/Marlin/src/gcode/bedlevel/G42.cpp index 3240b94e8e..55bc82317c 100644 --- a/Marlin/src/gcode/bedlevel/G42.cpp +++ b/Marlin/src/gcode/bedlevel/G42.cpp @@ -45,21 +45,25 @@ void GcodeSuite::G42() { } set_destination_from_current(); + if (hasI) destination[X_AXIS] = _GET_MESH_X(ix); if (hasJ) destination[Y_AXIS] = _GET_MESH_Y(iy); - if (parser.boolval('P')) { - if (hasI) destination[X_AXIS] -= X_PROBE_OFFSET_FROM_EXTRUDER; - if (hasJ) destination[Y_AXIS] -= Y_PROBE_OFFSET_FROM_EXTRUDER; - } - const float fval = parser.linearval('F'); - if (fval > 0.0) feedrate_mm_s = MMM_TO_MMS(fval); + #if HAS_BED_PROBE + if (parser.boolval('P')) { + if (hasI) destination[X_AXIS] -= probe_offset[X_AXIS]; + if (hasJ) destination[Y_AXIS] -= probe_offset[Y_AXIS]; + } + #endif + + const feedRate_t fval = parser.linearval('F'), + fr_mm_s = fval > 0 ? MMM_TO_MMS(fval) : 0.0f; // SCARA kinematic has "safe" XY raw moves #if IS_SCARA - prepare_uninterpolated_move_to_destination(); + prepare_internal_fast_move_to_destination(fr_mm_s); #else - prepare_move_to_destination(); + prepare_internal_move_to_destination(fr_mm_s); #endif } } diff --git a/Marlin/src/gcode/bedlevel/M420.cpp b/Marlin/src/gcode/bedlevel/M420.cpp index 982ec6e035..d3d94a99cc 100644 --- a/Marlin/src/gcode/bedlevel/M420.cpp +++ b/Marlin/src/gcode/bedlevel/M420.cpp @@ -64,10 +64,12 @@ void GcodeSuite::M420() { #if ENABLED(MARLIN_DEV_MODE) if (parser.intval('S') == 2) { #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - bilinear_start[X_AXIS] = MIN_PROBE_X; - bilinear_start[Y_AXIS] = MIN_PROBE_Y; - bilinear_grid_spacing[X_AXIS] = (MAX_PROBE_X - (MIN_PROBE_X)) / (GRID_MAX_POINTS_X - 1); - bilinear_grid_spacing[Y_AXIS] = (MAX_PROBE_Y - (MIN_PROBE_Y)) / (GRID_MAX_POINTS_Y - 1); + const float x_min = probe_min_x(), x_max = probe_max_x(), + y_min = probe_min_y(), y_max = probe_max_y(); + bilinear_start[X_AXIS] = x_min; + bilinear_start[Y_AXIS] = y_min; + bilinear_grid_spacing[X_AXIS] = (x_max - x_min) / (GRID_MAX_POINTS_X - 1); + bilinear_grid_spacing[Y_AXIS] = (y_max - y_min) / (GRID_MAX_POINTS_Y - 1); #endif for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { @@ -76,11 +78,11 @@ void GcodeSuite::M420() { ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y)); #endif } - SERIAL_ECHOPGM("Simulated " STRINGIFY(GRID_MAX_POINTS_X) "x" STRINGIFY(GRID_MAX_POINTS_X) " mesh "); - SERIAL_ECHOPAIR(" (", MIN_PROBE_X); - SERIAL_CHAR(','); SERIAL_ECHO(MIN_PROBE_Y); - SERIAL_ECHOPAIR(")-(", MAX_PROBE_X); - SERIAL_CHAR(','); SERIAL_ECHO(MAX_PROBE_Y); + SERIAL_ECHOPGM("Simulated " STRINGIFY(GRID_MAX_POINTS_X) "x" STRINGIFY(GRID_MAX_POINTS_Y) " mesh "); + SERIAL_ECHOPAIR(" (", x_min); + SERIAL_CHAR(','); SERIAL_ECHO(y_min); + SERIAL_ECHOPAIR(")-(", x_max); + SERIAL_CHAR(','); SERIAL_ECHO(y_max); SERIAL_ECHOLNPGM(")"); } #endif @@ -125,7 +127,7 @@ void GcodeSuite::M420() { } // L or V display the map info - if (parser.seen('L') || parser.seen('V')) { + if (parser.seen("LV")) { ubl.display_map(parser.byteval('T')); SERIAL_ECHOPGM("Mesh is "); if (!ubl.mesh_is_valid()) SERIAL_ECHOPGM("in"); diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 667bf3e9fc..45eec2805d 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -266,10 +266,18 @@ G29_TYPE GcodeSuite::G29() { #endif // Probe at 3 arbitrary points + const float x_min = probe_min_x(), x_max = probe_max_x(), y_min = probe_min_y(), y_max = probe_max_y(); + ABL_VAR vector_3 points[3] = { + #if ENABLED(HAS_FIXED_3POINT) vector_3(PROBE_PT_1_X, PROBE_PT_1_Y, 0), vector_3(PROBE_PT_2_X, PROBE_PT_2_Y, 0), vector_3(PROBE_PT_3_X, PROBE_PT_3_Y, 0) + #else + vector_3(x_min, y_min, 0), + vector_3(x_max, y_min, 0), + vector_3((x_max - x_min) / 2, y_max, 0) + #endif }; #endif // AUTO_BED_LEVELING_3POINT @@ -349,7 +357,7 @@ G29_TYPE GcodeSuite::G29() { verbose_level = parser.intval('V'); if (!WITHIN(verbose_level, 0, 4)) { - SERIAL_ECHOLNPGM("?(V)erbose level is implausible (0-4)."); + SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4)."); G29_RETURN(false); } @@ -370,11 +378,11 @@ G29_TYPE GcodeSuite::G29() { if (parser.seenval('P')) abl_grid_points_x = abl_grid_points_y = parser.value_int(); if (!WITHIN(abl_grid_points_x, 2, GRID_MAX_POINTS_X)) { - SERIAL_ECHOLNPGM("?Probe points (X) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ")."); + SERIAL_ECHOLNPGM("?Probe points (X) implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ")."); G29_RETURN(false); } if (!WITHIN(abl_grid_points_y, 2, GRID_MAX_POINTS_Y)) { - SERIAL_ECHOLNPGM("?Probe points (Y) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); + SERIAL_ECHOLNPGM("?Probe points (Y) implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); G29_RETURN(false); } @@ -391,18 +399,21 @@ G29_TYPE GcodeSuite::G29() { xy_probe_feedrate_mm_s = MMM_TO_MMS(parser.linearval('S', XY_PROBE_SPEED)); + const float x_min = probe_min_x(), x_max = probe_max_x(), + y_min = probe_min_y(), y_max = probe_max_y(); + if (parser.seen('H')) { const int16_t size = (int16_t)parser.value_linear_units(); - left_probe_bed_position = _MAX(X_CENTER - size / 2, MIN_PROBE_X); - right_probe_bed_position = _MIN(left_probe_bed_position + size, MAX_PROBE_X); - front_probe_bed_position = _MAX(Y_CENTER - size / 2, MIN_PROBE_Y); - back_probe_bed_position = _MIN(front_probe_bed_position + size, MAX_PROBE_Y); + left_probe_bed_position = _MAX(X_CENTER - size / 2, x_min); + right_probe_bed_position = _MIN(left_probe_bed_position + size, x_max); + front_probe_bed_position = _MAX(Y_CENTER - size / 2, y_min); + back_probe_bed_position = _MIN(front_probe_bed_position + size, y_max); } else { - left_probe_bed_position = parser.seenval('L') ? (int)RAW_X_POSITION(parser.value_linear_units()) : LEFT_PROBE_BED_POSITION; - right_probe_bed_position = parser.seenval('R') ? (int)RAW_X_POSITION(parser.value_linear_units()) : RIGHT_PROBE_BED_POSITION; - front_probe_bed_position = parser.seenval('F') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : FRONT_PROBE_BED_POSITION; - back_probe_bed_position = parser.seenval('B') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : BACK_PROBE_BED_POSITION; + left_probe_bed_position = parser.seenval('L') ? (int)RAW_X_POSITION(parser.value_linear_units()) : _MAX(X_CENTER - X_BED_SIZE / 2, x_min); + right_probe_bed_position = parser.seenval('R') ? (int)RAW_X_POSITION(parser.value_linear_units()) : _MIN(left_probe_bed_position + X_BED_SIZE, x_max); + front_probe_bed_position = parser.seenval('F') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : _MAX(Y_CENTER - Y_BED_SIZE / 2, y_min); + back_probe_bed_position = parser.seenval('B') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : _MIN(front_probe_bed_position + Y_BED_SIZE, y_max); } if ( @@ -446,7 +457,7 @@ G29_TYPE GcodeSuite::G29() { } #endif - if (!faux) setup_for_endstop_or_probe_move(); + if (!faux) remember_feedrate_scaling_off(); #if ENABLED(AUTO_BED_LEVELING_BILINEAR) @@ -711,10 +722,10 @@ G29_TYPE GcodeSuite::G29() { if (verbose_level) SERIAL_ECHOLNPAIR("Probing mesh point ", int(pt_index), "/", int(GRID_MAX_POINTS), "."); #if HAS_DISPLAY - ui.status_printf_P(0, PSTR(MSG_PROBING_MESH " %i/%i"), int(pt_index), int(GRID_MAX_POINTS)); + ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), PSTR(MSG_PROBING_MESH), int(pt_index), int(GRID_MAX_POINTS)); #endif - measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, raise_after, verbose_level); + measured_z = faux ? 0.001 * random(-100, 101) : probe_at_point(xProbe, yProbe, raise_after, verbose_level); if (isnan(measured_z)) { set_bed_leveling_enabled(abl_should_enable); @@ -759,7 +770,7 @@ G29_TYPE GcodeSuite::G29() { // Retain the last probe position xProbe = points[i].x; yProbe = points[i].y; - measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, raise_after, verbose_level); + measured_z = faux ? 0.001 * random(-100, 101) : probe_at_point(xProbe, yProbe, raise_after, verbose_level); if (isnan(measured_z)) { set_bed_leveling_enabled(abl_should_enable); break; @@ -769,11 +780,7 @@ G29_TYPE GcodeSuite::G29() { if (!dryrun && !isnan(measured_z)) { vector_3 planeNormal = vector_3::cross(points[0] - points[1], points[2] - points[1]).get_normal(); - if (planeNormal.z < 0) { - planeNormal.x *= -1; - planeNormal.y *= -1; - planeNormal.z *= -1; - } + if (planeNormal.z < 0) planeNormal *= -1; planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal); // Can't re-enable (on error) until the new grid is written @@ -951,8 +958,8 @@ G29_TYPE GcodeSuite::G29() { planner.leveling_active = false; // Use the last measured distance to the bed, if possible - if ( NEAR(current_position[X_AXIS], xProbe - (X_PROBE_OFFSET_FROM_EXTRUDER)) - && NEAR(current_position[Y_AXIS], yProbe - (Y_PROBE_OFFSET_FROM_EXTRUDER)) + if ( NEAR(current_position[X_AXIS], xProbe - probe_offset[X_AXIS]) + && NEAR(current_position[Y_AXIS], yProbe - probe_offset[Y_AXIS]) ) { const float simple_z = current_position[Z_AXIS] - measured_z; if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Probed Z", simple_z, " Matrix Z", converted[Z_AXIS], " Discrepancy ", simple_z - converted[Z_AXIS]); @@ -984,7 +991,7 @@ G29_TYPE GcodeSuite::G29() { } // !isnan(measured_z) // Restore state after probing - if (!faux) clean_up_after_endstop_or_probe_move(); + if (!faux) restore_feedrate_and_scaling(); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G29"); diff --git a/Marlin/src/gcode/bedlevel/abl/M421.cpp b/Marlin/src/gcode/bedlevel/abl/M421.cpp index f755115317..b9470528a1 100644 --- a/Marlin/src/gcode/bedlevel/abl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/abl/M421.cpp @@ -29,7 +29,7 @@ #if ENABLED(AUTO_BED_LEVELING_BILINEAR) #include "../../gcode.h" -#include "../../../feature/bedlevel/abl/abl.h" +#include "../../../feature/bedlevel/bedlevel.h" #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extensible_ui/ui_api.h" diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index b0f6124422..eee542a6f5 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -143,8 +143,7 @@ void GcodeSuite::G29() { #if ENABLED(MESH_G28_REST_ORIGIN) current_position[Z_AXIS] = 0; - set_destination_from_current(); - buffer_line_to_destination(homing_feedrate(Z_AXIS)); + line_to_current_position(homing_feedrate(Z_AXIS)); planner.synchronize(); #endif diff --git a/Marlin/src/gcode/bedlevel/ubl/G29.cpp b/Marlin/src/gcode/bedlevel/ubl/G29.cpp index cb130c39d6..c0f8f20439 100644 --- a/Marlin/src/gcode/bedlevel/ubl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/ubl/G29.cpp @@ -29,7 +29,7 @@ #if ENABLED(AUTO_BED_LEVELING_UBL) #include "../../gcode.h" -#include "../../../feature/bedlevel/ubl/ubl.h" +#include "../../../feature/bedlevel/bedlevel.h" void GcodeSuite::G29() { ubl.G29(); } diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index d936809051..514bb65891 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -39,9 +39,7 @@ #include "../../feature/tmc_util.h" #endif -#if HOMING_Z_WITH_PROBE || ENABLED(BLTOUCH) - #include "../../module/probe.h" -#endif +#include "../../module/probe.h" #if ENABLED(BLTOUCH) #include "../../feature/bltouch.h" @@ -124,7 +122,7 @@ return; } - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Z_SAFE_HOMING >>>"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("home_z_safely >>>"); sync_plan_position(); @@ -136,13 +134,13 @@ destination[Z_AXIS] = current_position[Z_AXIS]; // Z is already at the right height #if HOMING_Z_WITH_PROBE - destination[X_AXIS] -= X_PROBE_OFFSET_FROM_EXTRUDER; - destination[Y_AXIS] -= Y_PROBE_OFFSET_FROM_EXTRUDER; + destination[X_AXIS] -= probe_offset[X_AXIS]; + destination[Y_AXIS] -= probe_offset[Y_AXIS]; #endif if (position_is_reachable(destination[X_AXIS], destination[Y_AXIS])) { - if (DEBUGGING(LEVELING)) DEBUG_POS("Z_SAFE_HOMING", destination); + if (DEBUGGING(LEVELING)) DEBUG_POS("home_z_safely", destination); // This causes the carriage on Dual X to unpark #if ENABLED(DUAL_X_CARRIAGE) @@ -161,7 +159,7 @@ SERIAL_ECHO_MSG(MSG_ZPROBE_OUT); } - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< Z_SAFE_HOMING"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< home_z_safely"); } #endif // Z_SAFE_HOMING @@ -261,7 +259,7 @@ void GcodeSuite::G28(const bool always_home_all) { extruder_duplication_enabled = false; #endif - setup_for_endstop_or_probe_move(); + remember_feedrate_scaling_off(); endstops.enable(true); // Enable endstops for next homing move @@ -427,7 +425,7 @@ void GcodeSuite::G28(const bool always_home_all) { set_bed_leveling_enabled(leveling_was_active); #endif - clean_up_after_endstop_or_probe_move(); + restore_feedrate_and_scaling(); // Restore the active tool after homing #if HOTENDS > 1 && (DISABLED(DELTA) || ENABLED(DELTA_HOME_TO_SAFE_ZONE)) @@ -453,6 +451,7 @@ void GcodeSuite::G28(const bool always_home_all) { ui.refresh(); report_current_position(); + #if ENABLED(NANODLP_Z_SYNC) #if ENABLED(NANODLP_ALL_AXIS) #define _HOME_SYNC true // For any axis, output sync text. diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index 5eaadeb77d..1e3e84a1e4 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -84,7 +84,7 @@ void ac_setup(const bool reset_bed) { #endif planner.synchronize(); - setup_for_endstop_or_probe_move(); + remember_feedrate_scaling_off(); #if HAS_LEVELING if (reset_bed) reset_bed_level(); // After full calibration bed-level data is no longer valid @@ -102,7 +102,7 @@ void ac_cleanup( #if HAS_BED_PROBE STOW_PROBE(); #endif - clean_up_after_endstop_or_probe_move(); + restore_feedrate_and_scaling(); #if HOTENDS > 1 tool_change(old_tool_index, true); #endif @@ -179,10 +179,10 @@ static float std_dev_points(float z_pt[NPP + 1], const bool _0p_cal, const bool S2 += sq(z_pt[rad]); N++; } - return LROUND(SQRT(S2 / N) * 1000.0) / 1000.0 + 0.00001; + return LROUND(SQRT(S2 / N) * 1000.0f) / 1000.0f + 0.00001f; } } - return 0.00001; + return 0.00001f; } /** @@ -190,7 +190,7 @@ static float std_dev_points(float z_pt[NPP + 1], const bool _0p_cal, const bool */ static float calibration_probe(const float &nx, const float &ny, const bool stow) { #if HAS_BED_PROBE - return probe_pt(nx, ny, stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, false); + return probe_at_point(nx, ny, stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, false); #else UNUSED(stow); return lcd_probe_pt(nx, ny); @@ -218,7 +218,7 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi _7p_6_center = probe_points >= 5 && probe_points <= 7, _7p_9_center = probe_points >= 8; - LOOP_CAL_ALL(rad) z_pt[rad] = 0.0; + LOOP_CAL_ALL(rad) z_pt[rad] = 0.0f; if (!_0p_calibration) { @@ -228,8 +228,8 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi } if (_7p_calibration) { // probe extra center points - const float start = _7p_9_center ? float(_CA) + _7P_STEP / 3.0 : _7p_6_center ? float(_CA) : float(__C), - steps = _7p_9_center ? _4P_STEP / 3.0 : _7p_6_center ? _7P_STEP : _4P_STEP; + const float start = _7p_9_center ? float(_CA) + _7P_STEP / 3.0f : _7p_6_center ? float(_CA) : float(__C), + steps = _7p_9_center ? _4P_STEP / 3.0f : _7p_6_center ? _7P_STEP : _4P_STEP; I_LOOP_CAL_PT(rad, start, steps) { const float a = RADIANS(210 + (360 / NPP) * (rad - 1)), r = delta_calibration_radius * 0.1; @@ -241,13 +241,13 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi if (!_1p_calibration) { // probe the radius const CalEnum start = _4p_opposite_points ? _AB : __A; - const float steps = _7p_14_intermediates ? _7P_STEP / 15.0 : // 15r * 6 + 10c = 100 - _7p_11_intermediates ? _7P_STEP / 12.0 : // 12r * 6 + 9c = 81 - _7p_8_intermediates ? _7P_STEP / 9.0 : // 9r * 6 + 10c = 64 - _7p_6_intermediates ? _7P_STEP / 7.0 : // 7r * 6 + 7c = 49 - _7p_4_intermediates ? _7P_STEP / 5.0 : // 5r * 6 + 6c = 36 - _7p_2_intermediates ? _7P_STEP / 3.0 : // 3r * 6 + 7c = 25 - _7p_1_intermediates ? _7P_STEP / 2.0 : // 2r * 6 + 4c = 16 + const float steps = _7p_14_intermediates ? _7P_STEP / 15.0f : // 15r * 6 + 10c = 100 + _7p_11_intermediates ? _7P_STEP / 12.0f : // 12r * 6 + 9c = 81 + _7p_8_intermediates ? _7P_STEP / 9.0f : // 9r * 6 + 10c = 64 + _7p_6_intermediates ? _7P_STEP / 7.0f : // 7r * 6 + 7c = 49 + _7p_4_intermediates ? _7P_STEP / 5.0f : // 5r * 6 + 6c = 36 + _7p_2_intermediates ? _7P_STEP / 3.0f : // 3r * 6 + 7c = 25 + _7p_1_intermediates ? _7P_STEP / 2.0f : // 2r * 6 + 4c = 16 _7p_no_intermediates ? _7P_STEP : // 1r * 6 + 3c = 9 _4P_STEP; // .5r * 6 + 1c = 4 bool zig_zag = true; @@ -269,7 +269,7 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi LOOP_CAL_RAD(rad) z_pt[rad] /= _7P_STEP / steps; - do_blocking_move_to_xy(0.0, 0.0); + do_blocking_move_to_xy(0.0f, 0.0f); } } return true; @@ -286,7 +286,7 @@ static void reverse_kinematics_probe_points(float z_pt[NPP + 1], float mm_at_pt_ LOOP_CAL_ALL(rad) { const float a = RADIANS(210 + (360 / NPP) * (rad - 1)), - r = (rad == CEN ? 0.0 : delta_calibration_radius); + r = (rad == CEN ? 0.0f : delta_calibration_radius); pos[X_AXIS] = cos(a) * r; pos[Y_AXIS] = sin(a) * r; pos[Z_AXIS] = z_pt[rad]; @@ -298,7 +298,7 @@ static void reverse_kinematics_probe_points(float z_pt[NPP + 1], float mm_at_pt_ static void forward_kinematics_probe_points(float mm_at_pt_axis[NPP + 1][ABC], float z_pt[NPP + 1]) { const float r_quot = delta_calibration_radius / delta_radius; - #define ZPP(N,I,A) ((1 / 3.0 + r_quot * (N) / 3.0 ) * mm_at_pt_axis[I][A]) + #define ZPP(N,I,A) ((1 / 3.0f + r_quot * (N) / 3.0f ) * mm_at_pt_axis[I][A]) #define Z00(I, A) ZPP( 0, I, A) #define Zp1(I, A) ZPP(+1, I, A) #define Zm1(I, A) ZPP(-1, I, A) @@ -339,44 +339,45 @@ static void calc_kinematics_diff_probe_points(float z_pt[NPP + 1], float delta_e static float auto_tune_h() { const float r_quot = delta_calibration_radius / delta_radius; - float h_fac = 0.0; + float h_fac = 0.0f; - h_fac = r_quot / (2.0 / 3.0); + h_fac = r_quot / (2.0f / 3.0f); h_fac = 1.0f / h_fac; // (2/3)/CR return h_fac; } static float auto_tune_r() { - const float diff = 0.01; - float r_fac = 0.0, - z_pt[NPP + 1] = { 0.0 }, - delta_e[ABC] = {0.0}, - delta_r = {0.0}, - delta_t[ABC] = {0.0}; + const float diff = 0.01f; + float r_fac = 0.0f, + z_pt[NPP + 1] = { 0.0f }, + delta_e[ABC] = { 0.0f }, + delta_r = { 0.0f }, + delta_t[ABC] = { 0.0f }; delta_r = diff; calc_kinematics_diff_probe_points(z_pt, delta_e, delta_r, delta_t); - r_fac = -(z_pt[__A] + z_pt[__B] + z_pt[__C] + z_pt[_BC] + z_pt[_CA] + z_pt[_AB]) / 6.0; - r_fac = diff / r_fac / 3.0; // 1/(3*delta_Z) + r_fac = -(z_pt[__A] + z_pt[__B] + z_pt[__C] + z_pt[_BC] + z_pt[_CA] + z_pt[_AB]) / 6.0f; + r_fac = diff / r_fac / 3.0f; // 1/(3*delta_Z) return r_fac; } static float auto_tune_a() { - const float diff = 0.01; - float a_fac = 0.0, - z_pt[NPP + 1] = { 0.0 }, - delta_e[ABC] = {0.0}, - delta_r = {0.0}, - delta_t[ABC] = {0.0}; + const float diff = 0.01f; + float a_fac = 0.0f, + z_pt[NPP + 1] = { 0.0f }, + delta_e[ABC] = { 0.0f }, + delta_r = { 0.0f }, + delta_t[ABC] = { 0.0f }; + ZERO(delta_t); LOOP_XYZ(axis) { - LOOP_XYZ(axis_2) delta_t[axis_2] = 0.0; delta_t[axis] = diff; calc_kinematics_diff_probe_points(z_pt, delta_e, delta_r, delta_t); - a_fac += z_pt[uint8_t((axis * _4P_STEP) - _7P_STEP + NPP) % NPP + 1] / 6.0; - a_fac -= z_pt[uint8_t((axis * _4P_STEP) + 1 + _7P_STEP)] / 6.0; + delta_t[axis] = 0; + a_fac += z_pt[uint8_t((axis * _4P_STEP) - _7P_STEP + NPP) % NPP + 1] / 6.0f; + a_fac -= z_pt[uint8_t((axis * _4P_STEP) + 1 + _7P_STEP)] / 6.0f; } - a_fac = diff / a_fac / 3.0; // 1/(3*delta_Z) + a_fac = diff / a_fac / 3.0f; // 1/(3*delta_Z) return a_fac; } @@ -411,27 +412,27 @@ void GcodeSuite::G33() { const int8_t probe_points = parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS); if (!WITHIN(probe_points, 0, 10)) { - SERIAL_ECHOLNPGM("?(P)oints is implausible (0-10)."); + SERIAL_ECHOLNPGM("?(P)oints implausible (0-10)."); return; } const bool towers_set = !parser.seen('T'); - const float calibration_precision = parser.floatval('C', 0.0); + const float calibration_precision = parser.floatval('C', 0.0f); if (calibration_precision < 0) { - SERIAL_ECHOLNPGM("?(C)alibration precision is implausible (>=0)."); + SERIAL_ECHOLNPGM("?(C)alibration precision implausible (>=0)."); return; } const int8_t force_iterations = parser.intval('F', 0); if (!WITHIN(force_iterations, 0, 30)) { - SERIAL_ECHOLNPGM("?(F)orce iteration is implausible (0-30)."); + SERIAL_ECHOLNPGM("?(F)orce iteration implausible (0-30)."); return; } const int8_t verbose_level = parser.byteval('V', 1); if (!WITHIN(verbose_level, 0, 3)) { - SERIAL_ECHOLNPGM("?(V)erbose level is implausible (0-3)."); + SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-3)."); return; } @@ -449,7 +450,7 @@ void GcodeSuite::G33() { static const char save_message[] PROGMEM = "Save with M500 and/or copy to Configuration.h"; int8_t iterations = 0; float test_precision, - zero_std_dev = (verbose_level ? 999.0 : 0.0), // 0.0 in dry-run mode : forced end + zero_std_dev = (verbose_level ? 999.0f : 0.0f), // 0.0 in dry-run mode : forced end zero_std_dev_min = zero_std_dev, zero_std_dev_old = zero_std_dev, h_factor, @@ -475,7 +476,7 @@ void GcodeSuite::G33() { const float a = RADIANS(210 + (360 / NPP) * (axis - 1)), r = delta_calibration_radius; if (!position_is_reachable(cos(a) * r, sin(a) * r)) { - SERIAL_ECHOLNPGM("?(M665 B)ed radius is implausible."); + SERIAL_ECHOLNPGM("?(M665 B)ed radius implausible."); return; } } @@ -496,9 +497,9 @@ void GcodeSuite::G33() { do { // start iterations - float z_at_pt[NPP + 1] = { 0.0 }; + float z_at_pt[NPP + 1] = { 0.0f }; - test_precision = zero_std_dev_old != 999.0 ? (zero_std_dev + zero_std_dev_old) / 2 : zero_std_dev; + test_precision = zero_std_dev_old != 999.0f ? (zero_std_dev + zero_std_dev_old) / 2.0f : zero_std_dev; iterations++; // Probe the points @@ -514,7 +515,7 @@ void GcodeSuite::G33() { if ((zero_std_dev < test_precision || iterations <= force_iterations) && zero_std_dev > calibration_precision) { #if !HAS_BED_PROBE - test_precision = 0.00; // forced end + test_precision = 0.0f; // forced end #endif if (zero_std_dev < zero_std_dev_min) { @@ -525,9 +526,9 @@ void GcodeSuite::G33() { COPY(a_old, delta_tower_angle_trim); } - float e_delta[ABC] = { 0.0 }, - r_delta = 0.0, - t_delta[ABC] = { 0.0 }; + float e_delta[ABC] = { 0.0f }, + r_delta = 0.0f, + t_delta[ABC] = { 0.0f }; /** * convergence matrices: @@ -535,7 +536,7 @@ void GcodeSuite::G33() { * - definition of the matrix scaling parameters * - matrices for 4 and 7 point calibration */ - #define ZP(N,I) ((N) * z_at_pt[I] / 4.0) // 4.0 = divider to normalize to integers + #define ZP(N,I) ((N) * z_at_pt[I] / 4.0f) // 4.0 = divider to normalize to integers #define Z12(I) ZP(12, I) #define Z4(I) ZP(4, I) #define Z2(I) ZP(2, I) @@ -544,7 +545,7 @@ void GcodeSuite::G33() { // calculate factors const float cr_old = delta_calibration_radius; - if (_7p_9_center) delta_calibration_radius *= 0.9; + if (_7p_9_center) delta_calibration_radius *= 0.9f; h_factor = auto_tune_h(); r_factor = auto_tune_r(); a_factor = auto_tune_a(); @@ -552,11 +553,11 @@ void GcodeSuite::G33() { switch (probe_points) { case 0: - test_precision = 0.00; // forced end + test_precision = 0.0f; // forced end break; case 1: - test_precision = 0.00; // forced end + test_precision = 0.0f; // forced end LOOP_XYZ(axis) e_delta[axis] = +Z4(CEN); break; @@ -604,9 +605,9 @@ void GcodeSuite::G33() { // Normalize angles to least-squares if (_angle_results) { - float a_sum = 0.0; + float a_sum = 0.0f; LOOP_XYZ(axis) a_sum += delta_tower_angle_trim[axis]; - LOOP_XYZ(axis) delta_tower_angle_trim[axis] -= a_sum / 3.0; + LOOP_XYZ(axis) delta_tower_angle_trim[axis] -= a_sum / 3.0f; } // adjust delta_height and endstops by the max amount @@ -638,7 +639,7 @@ void GcodeSuite::G33() { char mess[21]; strcpy_P(mess, PSTR("Calibration sd:")); if (zero_std_dev_min < 1) - sprintf_P(&mess[15], PSTR("0.%03i"), (int)LROUND(zero_std_dev_min * 1000.0)); + sprintf_P(&mess[15], PSTR("0.%03i"), (int)LROUND(zero_std_dev_min * 1000.0f)); else sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev_min)); ui.set_status(mess); @@ -670,7 +671,7 @@ void GcodeSuite::G33() { strcpy_P(mess, enddryrun); strcpy_P(&mess[11], PSTR(" sd:")); if (zero_std_dev < 1) - sprintf_P(&mess[15], PSTR("0.%03i"), (int)LROUND(zero_std_dev * 1000.0)); + sprintf_P(&mess[15], PSTR("0.%03i"), (int)LROUND(zero_std_dev * 1000.0f)); else sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev)); ui.set_status(mess); diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index 4b38eff325..b7b366a1cf 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -132,7 +132,7 @@ void GcodeSuite::G34() { ); // Home before the alignment procedure - if (homing_needed()) home_all_axes(); + if (!all_axes_known()) home_all_axes(); // Move the Z coordinate realm towards the positive - dirty trick current_position[Z_AXIS] -= z_probe * 0.5; @@ -162,7 +162,7 @@ void GcodeSuite::G34() { if (iteration == 0 || izstepper > 0) do_blocking_move_to_z(z_probe); // Probe a Z height for each stepper. - const float z_probed_height = probe_pt(z_auto_align_xpos[zstepper], z_auto_align_ypos[zstepper], raise_after, 0, true); + const float z_probed_height = probe_at_point(z_auto_align_xpos[zstepper], z_auto_align_ypos[zstepper], raise_after, 0, true); if (isnan(z_probed_height)) { SERIAL_ECHOLNPGM("Probing failed."); err_break = true; @@ -277,7 +277,7 @@ void GcodeSuite::G34() { // After this operation the z position needs correction set_axis_is_not_at_home(Z_AXIS); - // Stow the probe, as the last call to probe_pt(...) left + // Stow the probe, as the last call to probe_at_point(...) left // the probe deployed if it was successful. STOW_PROBE(); diff --git a/Marlin/src/gcode/calibrate/G425.cpp b/Marlin/src/gcode/calibrate/G425.cpp index 996b1515b3..5c4272346f 100644 --- a/Marlin/src/gcode/calibrate/G425.cpp +++ b/Marlin/src/gcode/calibrate/G425.cpp @@ -171,17 +171,16 @@ inline bool read_calibration_pin() { * fast in - Fast vs. precise measurement */ float measuring_movement(const AxisEnum axis, const int dir, const bool stop_state, const bool fast) { - const float step = fast ? 0.25 : CALIBRATION_MEASUREMENT_RESOLUTION; - const float mms = MMM_TO_MMS(fast ? CALIBRATION_FEEDRATE_FAST : CALIBRATION_FEEDRATE_SLOW); - const float limit = fast ? 50 : 5; + const float step = fast ? 0.25 : CALIBRATION_MEASUREMENT_RESOLUTION; + const feedRate_t mms = fast ? MMM_TO_MMS(CALIBRATION_FEEDRATE_FAST) : MMM_TO_MMS(CALIBRATION_FEEDRATE_SLOW); + const float limit = fast ? 50 : 5; set_destination_from_current(); for (float travel = 0; travel < limit; travel += step) { destination[axis] += dir * step; do_blocking_move_to(destination, mms); planner.synchronize(); - if (read_calibration_pin() == stop_state) - break; + if (read_calibration_pin() == stop_state) break; } return destination[axis]; } @@ -314,18 +313,16 @@ inline void probe_sides(measurements_t &m, const float uncertainty) { // The difference between the known and the measured location // of the calibration object is the positional error - m.pos_error[X_AXIS] = - #if HAS_X_CENTER - m.true_center[X_AXIS] - m.obj_center[X_AXIS]; - #else - 0; - #endif - m.pos_error[Y_AXIS] = - #if HAS_Y_CENTER - m.true_center[Y_AXIS] - m.obj_center[Y_AXIS]; - #else - 0; - #endif + m.pos_error[X_AXIS] = (0 + #if HAS_X_CENTER + + m.true_center[X_AXIS] - m.obj_center[X_AXIS] + #endif + ); + m.pos_error[Y_AXIS] = (0 + #if HAS_Y_CENTER + + m.true_center[Y_AXIS] - m.obj_center[Y_AXIS] + #endif + ); m.pos_error[Z_AXIS] = m.true_center[Z_AXIS] - m.obj_center[Z_AXIS]; } @@ -394,13 +391,13 @@ inline void probe_sides(measurements_t &m, const float uncertainty) { inline void report_measured_nozzle_dimensions(const measurements_t &m) { SERIAL_ECHOLNPGM("Nozzle Tip Outer Dimensions:"); - #if HAS_X_CENTER - SERIAL_ECHOLNPAIR(" X", m.nozzle_outer_dimension[X_AXIS]); - #else - UNUSED(m); - #endif - #if HAS_Y_CENTER - SERIAL_ECHOLNPAIR(" Y", m.nozzle_outer_dimension[Y_AXIS]); + #if HAS_X_CENTER || HAS_Y_CENTER + #if HAS_X_CENTER + SERIAL_ECHOLNPAIR(" X", m.nozzle_outer_dimension[X_AXIS]); + #endif + #if HAS_Y_CENTER + SERIAL_ECHOLNPAIR(" Y", m.nozzle_outer_dimension[Y_AXIS]); + #endif #else UNUSED(m); #endif @@ -412,16 +409,11 @@ inline void probe_sides(measurements_t &m, const float uncertainty) { // This function requires normalize_hotend_offsets() to be called // inline void report_hotend_offsets() { - for (uint8_t e = 1; e < HOTENDS; e++) { - SERIAL_ECHOPAIR("T", int(e)); - SERIAL_ECHOLNPGM(" Hotend Offset:"); - SERIAL_ECHOLNPAIR(" X: ", hotend_offset[X_AXIS][e]); - SERIAL_ECHOLNPAIR(" Y: ", hotend_offset[Y_AXIS][e]); - SERIAL_ECHOLNPAIR(" Z: ", hotend_offset[Z_AXIS][e]); - SERIAL_EOL(); - } + for (uint8_t e = 1; e < HOTENDS; e++) + SERIAL_ECHOLNPAIR("T", int(e), " Hotend Offset X", hotend_offset[X_AXIS][e], " Y", hotend_offset[Y_AXIS][e], " Z", hotend_offset[Z_AXIS][e]); } #endif + #endif // CALIBRATION_REPORTING /** diff --git a/Marlin/src/gcode/calibrate/M425.cpp b/Marlin/src/gcode/calibrate/M425.cpp index a9191d8217..a15287a5e6 100644 --- a/Marlin/src/gcode/calibrate/M425.cpp +++ b/Marlin/src/gcode/calibrate/M425.cpp @@ -46,10 +46,10 @@ void GcodeSuite::M425() { bool noArgs = true; - LOOP_XYZ(i) { - if (parser.seen(axis_codes[i])) { + LOOP_XYZ(a) { + if (parser.seen(axis_codes[a])) { planner.synchronize(); - backlash.distance_mm[i] = parser.has_value() ? parser.value_linear_units() : backlash.get_measurement(i); + backlash.distance_mm[a] = parser.has_value() ? parser.value_linear_units() : backlash.get_measurement(AxisEnum(a)); noArgs = false; } } @@ -88,10 +88,10 @@ void GcodeSuite::M425() { #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) SERIAL_ECHOPGM(" Average measured backlash (mm):"); if (backlash.has_any_measurement()) { - LOOP_XYZ(a) if (backlash.has_measurement(a)) { + LOOP_XYZ(a) if (backlash.has_measurement(AxisEnum(a))) { SERIAL_CHAR(' '); SERIAL_CHAR(axis_codes[a]); - SERIAL_ECHO(backlash.get_measurement(a)); + SERIAL_ECHO(backlash.get_measurement(AxisEnum(a))); } } else diff --git a/Marlin/src/gcode/calibrate/M48.cpp b/Marlin/src/gcode/calibrate/M48.cpp index 2b5edb0919..49fc9982dc 100644 --- a/Marlin/src/gcode/calibrate/M48.cpp +++ b/Marlin/src/gcode/calibrate/M48.cpp @@ -59,7 +59,7 @@ void GcodeSuite::M48() { const int8_t verbose_level = parser.byteval('V', 1); if (!WITHIN(verbose_level, 0, 4)) { - SERIAL_ECHOLNPGM("?(V)erbose level is implausible (0-4)."); + SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4)."); return; } @@ -77,8 +77,8 @@ void GcodeSuite::M48() { float X_current = current_position[X_AXIS], Y_current = current_position[Y_AXIS]; - const float X_probe_location = parser.linearval('X', X_current + X_PROBE_OFFSET_FROM_EXTRUDER), - Y_probe_location = parser.linearval('Y', Y_current + Y_PROBE_OFFSET_FROM_EXTRUDER); + const float X_probe_location = parser.linearval('X', X_current + probe_offset[X_AXIS]), + Y_probe_location = parser.linearval('Y', Y_current + probe_offset[Y_AXIS]); if (!position_is_reachable_by_probe(X_probe_location, Y_probe_location)) { SERIAL_ECHOLNPGM("? (X,Y) out of bounds."); @@ -111,12 +111,12 @@ void GcodeSuite::M48() { set_bed_leveling_enabled(false); #endif - setup_for_endstop_or_probe_move(); + remember_feedrate_scaling_off(); float mean = 0.0, sigma = 0.0, min = 99999.9, max = -99999.9, sample_set[n_samples]; // Move to the first point, deploy, and probe - const float t = probe_pt(X_probe_location, Y_probe_location, raise_after, verbose_level); + const float t = probe_at_point(X_probe_location, Y_probe_location, raise_after, verbose_level); bool probing_good = !isnan(t); if (probing_good) { @@ -165,8 +165,8 @@ void GcodeSuite::M48() { while (angle < 0.0) angle += 360.0; // outside of this range. It looks like they behave correctly with // numbers outside of the range, but just to be safe we clamp them. - X_current = X_probe_location - (X_PROBE_OFFSET_FROM_EXTRUDER) + cos(RADIANS(angle)) * radius; - Y_current = Y_probe_location - (Y_PROBE_OFFSET_FROM_EXTRUDER) + sin(RADIANS(angle)) * radius; + X_current = X_probe_location - probe_offset[X_AXIS] + cos(RADIANS(angle)) * radius; + Y_current = Y_probe_location - probe_offset[Y_AXIS] + sin(RADIANS(angle)) * radius; #if DISABLED(DELTA) LIMIT(X_current, X_MIN_POS, X_MAX_POS); @@ -190,7 +190,7 @@ void GcodeSuite::M48() { } // n_legs // Probe a single point - sample_set[n] = probe_pt(X_probe_location, Y_probe_location, raise_after, 0); + sample_set[n] = probe_at_point(X_probe_location, Y_probe_location, raise_after, 0); // Break the loop if the probe fails probing_good = !isnan(sample_set[n]); @@ -256,7 +256,7 @@ void GcodeSuite::M48() { #endif } - clean_up_after_endstop_or_probe_move(); + restore_feedrate_and_scaling(); // Re-enable bed level correction if it had been on #if HAS_LEVELING diff --git a/Marlin/src/gcode/config/M221.cpp b/Marlin/src/gcode/config/M221.cpp index cbb31628af..116ce776b2 100644 --- a/Marlin/src/gcode/config/M221.cpp +++ b/Marlin/src/gcode/config/M221.cpp @@ -23,6 +23,8 @@ #include "../gcode.h" #include "../../module/planner.h" +#if EXTRUDERS + /** * M221: Set extrusion percentage (M221 T0 S95) */ @@ -44,3 +46,5 @@ void GcodeSuite::M221() { SERIAL_EOL(); } } + +#endif // EXTRUDERS diff --git a/Marlin/src/gcode/config/M281.cpp b/Marlin/src/gcode/config/M281.cpp index ea9c032cf0..a694cb2df4 100644 --- a/Marlin/src/gcode/config/M281.cpp +++ b/Marlin/src/gcode/config/M281.cpp @@ -41,15 +41,14 @@ void GcodeSuite::M281() { } if (!angle_change) { SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(" Servo ", servo_index); - SERIAL_ECHOPAIR(" L", servo_angles[servo_index][0]); - SERIAL_ECHOLNPAIR(" U", servo_angles[servo_index][1]); + SERIAL_ECHOLNPAIR(" Servo ", servo_index, + " L", servo_angles[servo_index][0], + " U", servo_angles[servo_index][1]); } } else { SERIAL_ERROR_START(); - SERIAL_ECHOPAIR("Servo ", servo_index); - SERIAL_ECHOLNPGM(" out of range"); + SERIAL_ECHOLNPAIR("Servo ", servo_index, " out of range"); } } diff --git a/Marlin/src/gcode/config/M301.cpp b/Marlin/src/gcode/config/M301.cpp index 6c66ab48cb..25a15d7728 100644 --- a/Marlin/src/gcode/config/M301.cpp +++ b/Marlin/src/gcode/config/M301.cpp @@ -61,9 +61,9 @@ void GcodeSuite::M301() { #if ENABLED(PID_PARAMS_PER_HOTEND) SERIAL_ECHOPAIR(" e:", e); // specify extruder in serial output #endif // PID_PARAMS_PER_HOTEND - SERIAL_ECHOPAIR(" p:", PID_PARAM(Kp, e)); - SERIAL_ECHOPAIR(" i:", unscalePID_i(PID_PARAM(Ki, e))); - SERIAL_ECHOPAIR(" d:", unscalePID_d(PID_PARAM(Kd, e))); + SERIAL_ECHOPAIR(" p:", PID_PARAM(Kp, e), + " i:", unscalePID_i(PID_PARAM(Ki, e)), + " d:", unscalePID_d(PID_PARAM(Kd, e))); #if ENABLED(PID_EXTRUSION_SCALING) //Kc does not have scaling applied above, or in resetting defaults SERIAL_ECHOPAIR(" c:", PID_PARAM(Kc, e)); diff --git a/Marlin/src/gcode/config/M302.cpp b/Marlin/src/gcode/config/M302.cpp index e5ca1d3608..891f3c8258 100644 --- a/Marlin/src/gcode/config/M302.cpp +++ b/Marlin/src/gcode/config/M302.cpp @@ -56,8 +56,7 @@ void GcodeSuite::M302() { SERIAL_ECHO_START(); SERIAL_ECHOPGM("Cold extrudes are "); serialprintPGM(thermalManager.allow_cold_extrude ? PSTR("en") : PSTR("dis")); - SERIAL_ECHOPAIR("abled (min temp ", thermalManager.extrude_min_temp); - SERIAL_ECHOLNPGM("C)"); + SERIAL_ECHOLNPAIR("abled (min temp ", thermalManager.extrude_min_temp, "C)"); } } diff --git a/Marlin/src/gcode/config/M304.cpp b/Marlin/src/gcode/config/M304.cpp index f63fa03fce..3048c228d5 100644 --- a/Marlin/src/gcode/config/M304.cpp +++ b/Marlin/src/gcode/config/M304.cpp @@ -33,9 +33,9 @@ void GcodeSuite::M304() { if (parser.seen('D')) thermalManager.temp_bed.pid.Kd = scalePID_d(parser.value_float()); SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(" p:", thermalManager.temp_bed.pid.Kp); - SERIAL_ECHOPAIR(" i:", unscalePID_i(thermalManager.temp_bed.pid.Ki)); - SERIAL_ECHOLNPAIR(" d:", unscalePID_d(thermalManager.temp_bed.pid.Kd)); + SERIAL_ECHOLNPAIR(" p:", thermalManager.temp_bed.pid.Kp, + " i:", unscalePID_i(thermalManager.temp_bed.pid.Ki), + " d:", unscalePID_d(thermalManager.temp_bed.pid.Kd)); } #endif // PIDTEMPBED diff --git a/Marlin/src/gcode/config/M43.cpp b/Marlin/src/gcode/config/M43.cpp index 7b048f2190..e26f6d8ee2 100644 --- a/Marlin/src/gcode/config/M43.cpp +++ b/Marlin/src/gcode/config/M43.cpp @@ -50,6 +50,12 @@ #define GET_PIN_MAP_PIN_M43(Q) GET_PIN_MAP_PIN(Q) #endif +inline void _watchdog_reset() { + #if ENABLED(USE_WATCHDOG) + watchdog_reset(); + #endif +} + inline void toggle_pins() { const bool ignore_protection = parser.boolval('I'); const int repeat = parser.intval('R', 1), @@ -65,7 +71,7 @@ inline void toggle_pins() { SERIAL_EOL(); } else { - watchdog_reset(); + _watchdog_reset(); report_pin_state_extended(pin, ignore_protection, true, "Pulsing "); #if AVR_AT90USB1286_FAMILY // Teensy IDEs don't know about these pins so must use FASTIO if (pin == TEENSY_E2) { @@ -89,10 +95,10 @@ inline void toggle_pins() { { pinMode(pin, OUTPUT); for (int16_t j = 0; j < repeat; j++) { - watchdog_reset(); extDigitalWrite(pin, 0); safe_delay(wait); - watchdog_reset(); extDigitalWrite(pin, 1); safe_delay(wait); - watchdog_reset(); extDigitalWrite(pin, 0); safe_delay(wait); - watchdog_reset(); + _watchdog_reset(); extDigitalWrite(pin, 0); safe_delay(wait); + _watchdog_reset(); extDigitalWrite(pin, 1); safe_delay(wait); + _watchdog_reset(); extDigitalWrite(pin, 0); safe_delay(wait); + _watchdog_reset(); } } } diff --git a/Marlin/src/gcode/config/M575.cpp b/Marlin/src/gcode/config/M575.cpp index a90129f470..0abc8f9fea 100644 --- a/Marlin/src/gcode/config/M575.cpp +++ b/Marlin/src/gcode/config/M575.cpp @@ -67,7 +67,7 @@ void GcodeSuite::M575() { #endif } break; - default: SERIAL_ECHO_MSG("?(B)aud rate is implausible."); + default: SERIAL_ECHO_MSG("?(B)aud rate implausible."); } } diff --git a/Marlin/src/gcode/config/M92.cpp b/Marlin/src/gcode/config/M92.cpp index 3965136e6b..f0e27e82d1 100644 --- a/Marlin/src/gcode/config/M92.cpp +++ b/Marlin/src/gcode/config/M92.cpp @@ -25,9 +25,9 @@ void report_M92(const bool echo=true, const int8_t e=-1) { if (echo) SERIAL_ECHO_START(); else SERIAL_CHAR(' '); - SERIAL_ECHOPAIR(" M92 X", LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS])); - SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS])); - SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Z_AXIS])); + SERIAL_ECHOPAIR(" M92 X", LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS]), + " Y", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS]), + " Z", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Z_AXIS])); #if DISABLED(DISTINCT_E_FACTORS) SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS])); #endif @@ -37,8 +37,8 @@ void report_M92(const bool echo=true, const int8_t e=-1) { for (uint8_t i = 0; i < E_STEPPERS; i++) { if (e >= 0 && i != e) continue; if (echo) SERIAL_ECHO_START(); else SERIAL_CHAR(' '); - SERIAL_ECHOPAIR(" M92 T", (int)i); - SERIAL_ECHOLNPAIR(" E", VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS_N(i)])); + SERIAL_ECHOLNPAIR(" M92 T", (int)i, + " E", VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS_N(i)])); } #endif @@ -101,12 +101,10 @@ void GcodeSuite::M92() { micro_steps = argH ? argH : Z_MICROSTEPS; const float z_full_step_mm = micro_steps * planner.steps_to_mm[Z_AXIS]; SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("{ micro_steps:", micro_steps); - SERIAL_ECHOPAIR(", z_full_step_mm:", z_full_step_mm); + SERIAL_ECHOPAIR("{ micro_steps:", micro_steps, ", z_full_step_mm:", z_full_step_mm); if (wanted) { const float best = uint16_t(wanted / z_full_step_mm) * z_full_step_mm; - SERIAL_ECHOPGM(", best:["); - SERIAL_ECHO(best); + SERIAL_ECHOPAIR(", best:[", best); if (best != wanted) { SERIAL_CHAR(','); SERIAL_ECHO(best + z_full_step_mm); } SERIAL_CHAR(']'); } diff --git a/Marlin/src/gcode/control/M108_M112_M410.cpp b/Marlin/src/gcode/control/M108_M112_M410.cpp index 242aac1c06..9b6193bd93 100644 --- a/Marlin/src/gcode/control/M108_M112_M410.cpp +++ b/Marlin/src/gcode/control/M108_M112_M410.cpp @@ -38,10 +38,10 @@ void GcodeSuite::M108() { } /** - * M112: Emergency Stop + * M112: Full Shutdown */ void GcodeSuite::M112() { - kill(); + kill(PSTR("M112 Shutdown"), true); } /** diff --git a/Marlin/src/gcode/control/M280.cpp b/Marlin/src/gcode/control/M280.cpp index 3626f0bf67..6b65e9b753 100644 --- a/Marlin/src/gcode/control/M280.cpp +++ b/Marlin/src/gcode/control/M280.cpp @@ -43,14 +43,12 @@ void GcodeSuite::M280() { } else { SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(" Servo ", servo_index); - SERIAL_ECHOLNPAIR(": ", servo[servo_index].read()); + SERIAL_ECHOLNPAIR(" Servo ", servo_index, ": ", servo[servo_index].read()); } } else { SERIAL_ERROR_START(); - SERIAL_ECHOPAIR("Servo ", servo_index); - SERIAL_ECHOLNPGM(" out of range"); + SERIAL_ECHOLNPAIR("Servo ", servo_index, " out of range"); } } diff --git a/Marlin/src/gcode/control/M605.cpp b/Marlin/src/gcode/control/M605.cpp index 4009a23706..84a75686a4 100644 --- a/Marlin/src/gcode/control/M605.cpp +++ b/Marlin/src/gcode/control/M605.cpp @@ -137,8 +137,8 @@ DEBUG_EOL(); HOTEND_LOOP() { - DEBUG_ECHOPAIR(" nozzle:", int(e)); - LOOP_XYZ(j) DEBUG_ECHOPAIR(" hotend_offset[", axis_codes[j], "_AXIS][", int(e), "]=", hotend_offset[j][e]); + DEBUG_ECHOPAIR(" T", int(e)); + LOOP_XYZ(a) DEBUG_ECHOPAIR(" hotend_offset[", axis_codes[a], "_AXIS][", int(e), "]=", hotend_offset[a][e]); DEBUG_EOL(); } DEBUG_EOL(); diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp index efb7495017..03f73fe877 100644 --- a/Marlin/src/gcode/control/M80_M81.cpp +++ b/Marlin/src/gcode/control/M80_M81.cpp @@ -86,7 +86,7 @@ /** * M81: Turn off Power, including Power Supply, if there is one. * - * This code should ALWAYS be available for EMERGENCY SHUTDOWN! + * This code should ALWAYS be available for FULL SHUTDOWN! */ void GcodeSuite::M81() { thermalManager.disable_all_heaters(); diff --git a/Marlin/src/gcode/feature/L6470/M122.cpp b/Marlin/src/gcode/feature/L6470/M122.cpp index 2e50d8ff79..1fbb72aacf 100644 --- a/Marlin/src/gcode/feature/L6470/M122.cpp +++ b/Marlin/src/gcode/feature/L6470/M122.cpp @@ -26,7 +26,7 @@ #include "../../gcode.h" #include "../../../libs/L6470/L6470_Marlin.h" -#include "../../../module/stepper_indirection.h" +#include "../../../module/stepper/indirection.h" inline void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PSTR(" NO ")); } diff --git a/Marlin/src/gcode/feature/L6470/M906.cpp b/Marlin/src/gcode/feature/L6470/M906.cpp index df0c085bc6..143a6fea8d 100644 --- a/Marlin/src/gcode/feature/L6470/M906.cpp +++ b/Marlin/src/gcode/feature/L6470/M906.cpp @@ -26,7 +26,7 @@ #include "../../gcode.h" #include "../../../libs/L6470/L6470_Marlin.h" -#include "../../../module/stepper_indirection.h" +#include "../../../module/stepper/indirection.h" #include "../../../module/planner.h" #define DEBUG_OUT ENABLED(L6470_CHITCHAT) @@ -151,7 +151,7 @@ void L6470_report_current(L6470 &motor, const uint8_t axis) { break; } SERIAL_ECHO(dtostrf(val * 100 / 256, 10, 2, numstr)); - SERIAL_ECHO("%% "); + SERIAL_ECHOPGM("%% "); serialprintPGM(suf); SERIAL_EOL(); } diff --git a/Marlin/src/gcode/feature/L6470/M916-918.cpp b/Marlin/src/gcode/feature/L6470/M916-918.cpp index 0e79d5f233..3b62a0f45e 100644 --- a/Marlin/src/gcode/feature/L6470/M916-918.cpp +++ b/Marlin/src/gcode/feature/L6470/M916-918.cpp @@ -25,14 +25,14 @@ #if HAS_DRIVER(L6470) #include "../../gcode.h" -#include "../../../module/stepper_indirection.h" +#include "../../../module/stepper/indirection.h" #include "../../../module/planner.h" #include "../../../libs/L6470/L6470_Marlin.h" #define DEBUG_OUT ENABLED(L6470_CHITCHAT) #include "../../../core/debug_out.h" -static void jiggle_axis(const char axis_char, const float &min, const float &max, const float &rate) { +static void jiggle_axis(const char axis_char, const float &min, const float &max, const feedRate_t &fr_mm_m) { char gcode_string[30], str1[11], str2[11]; // Turn the motor(s) both directions @@ -84,7 +84,7 @@ void GcodeSuite::M916() { uint8_t driver_count = 1; float position_max; float position_min; - float final_feedrate; + feedRate_t final_fr_mm_m; uint8_t kval_hold; uint8_t ocd_th_val = 0; uint8_t stall_th_val = 0; @@ -93,10 +93,10 @@ void GcodeSuite::M916() { uint8_t j; // general purpose counter - if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) + if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_fr_mm_m, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) return; // quit if invalid user input - DEBUG_ECHOLNPAIR("feedrate = ", final_feedrate); + DEBUG_ECHOLNPAIR("feedrate = ", final_fr_mm_m); planner.synchronize(); // Wait for moves to finish @@ -115,7 +115,7 @@ void GcodeSuite::M916() { L6470.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); // Turn the motor(s) both directions - jiggle_axis(axis_mon[0][0], position_min, position_max, final_feedrate); + jiggle_axis(axis_mon[0][0], position_min, position_max, final_fr_mm_m); status_composite = 0; // clear out the old bits @@ -190,7 +190,7 @@ void GcodeSuite::M917() { uint8_t driver_count = 1; float position_max; float position_min; - float final_feedrate; + feedRate_t final_fr_mm_m; uint8_t kval_hold; uint8_t ocd_th_val = 0; uint8_t stall_th_val = 0; @@ -199,10 +199,10 @@ void GcodeSuite::M917() { uint8_t j; // general purpose counter - if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) + if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_fr_mm_m, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) return; // quit if invalid user input - DEBUG_ECHOLNPAIR("feedrate = ", final_feedrate); + DEBUG_ECHOLNPAIR("feedrate = ", final_fr_mm_m); planner.synchronize(); // Wait for moves to finish for (j = 0; j < driver_count; j++) @@ -225,7 +225,7 @@ void GcodeSuite::M917() { DEBUG_ECHOPAIR("STALL threshold : ", (stall_th_val + 1) * 31.25); DEBUG_ECHOLNPAIR(" OCD threshold : ", (ocd_th_val + 1) * 375); - jiggle_axis(axis_mon[0][0], position_min, position_max, final_feedrate); + jiggle_axis(axis_mon[0][0], position_min, position_max, final_fr_mm_m); status_composite = 0; // clear out the old bits @@ -452,7 +452,7 @@ void GcodeSuite::M918() { uint16_t axis_status[3]; uint8_t driver_count = 1; float position_max, position_min; - float final_feedrate; + feedRate_t final_fr_mm_m; uint8_t kval_hold; uint8_t ocd_th_val = 0; uint8_t stall_th_val = 0; @@ -461,7 +461,7 @@ void GcodeSuite::M918() { uint8_t j; // general purpose counter - if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) + if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_fr_mm_m, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold)) return; // quit if invalid user input uint8_t m_steps = parser.byteval('M'); @@ -489,10 +489,7 @@ void GcodeSuite::M918() { for (j = 0; j < driver_count; j++) L6470.set_param(axis_index[j], L6470_STEP_MODE, m_bits); // set microsteps - DEBUG_ECHOLNPAIR("target (maximum) feedrate = ",final_feedrate); - - float feedrate_inc = final_feedrate / 10, // start at 1/10 of max & go up by 1/10 per step) - current_feedrate = 0; + DEBUG_ECHOLNPAIR("target (maximum) feedrate = ", final_fr_mm_m); planner.synchronize(); // Wait for moves to finish @@ -502,18 +499,19 @@ void GcodeSuite::M918() { uint16_t status_composite = 0; DEBUG_ECHOLNPGM(".\n.\n."); // Make the feedrate prints easier to see - do { - current_feedrate += feedrate_inc; - DEBUG_ECHOLNPAIR("...feedrate = ", current_feedrate); + constexpr uint8_t iterations = 10; + for (uint8_t i = 1; i <= iterations; i++) { + const feedRate_t fr_mm_m = i * final_fr_mm_m / iterations; + DEBUG_ECHOLNPAIR("...feedrate = ", fr_mm_m); - jiggle_axis(axis_mon[0][0], position_min, position_max, current_feedrate); + jiggle_axis(axis_mon[0][0], position_min, position_max, fr_mm_m); for (j = 0; j < driver_count; j++) { axis_status[j] = (~L6470.get_status(axis_index[j])) & 0x0800; // bits of interest are all active low status_composite |= axis_status[j]; } if (status_composite) break; // quit if any errors flags are raised - } while (current_feedrate < final_feedrate * 0.99); + } DEBUG_ECHOPGM("Completed with errors"); if (status_composite) { diff --git a/Marlin/src/gcode/feature/advance/M900.cpp b/Marlin/src/gcode/feature/advance/M900.cpp index a5c0dc5cd7..f030511422 100644 --- a/Marlin/src/gcode/feature/advance/M900.cpp +++ b/Marlin/src/gcode/feature/advance/M900.cpp @@ -99,13 +99,13 @@ void GcodeSuite::M900() { if (!parser.seen_any()) { #if EXTRUDERS < 2 - SERIAL_ECHOLNPAIR("Advance S", ext_slot, " K", planner.extruder_advance_K[0]); - SERIAL_ECHOLNPAIR("(Slot ", 1 - ext_slot, " K", saved_extruder_advance_K[0], ")"); + SERIAL_ECHOLNPAIR("Advance S", ext_slot, " K", planner.extruder_advance_K[0], + "(Slot ", 1 - ext_slot, " K", saved_extruder_advance_K[0], ")"); #else LOOP_L_N(i, EXTRUDERS) { const int slot = (int)TEST(lin_adv_slot, i); - SERIAL_ECHOLNPAIR("Advance T", int(i), " S", slot, " K", planner.extruder_advance_K[i]); - SERIAL_ECHOLNPAIR("(Slot ", 1 - slot, " K", saved_extruder_advance_K[i], ")"); + SERIAL_ECHOLNPAIR("Advance T", int(i), " S", slot, " K", planner.extruder_advance_K[i], + "(Slot ", 1 - slot, " K", saved_extruder_advance_K[i], ")"); SERIAL_EOL(); } #endif diff --git a/Marlin/src/gcode/feature/camera/M240.cpp b/Marlin/src/gcode/feature/camera/M240.cpp index b4234cb823..3144126fe5 100644 --- a/Marlin/src/gcode/feature/camera/M240.cpp +++ b/Marlin/src/gcode/feature/camera/M240.cpp @@ -43,7 +43,7 @@ #endif #ifdef PHOTO_RETRACT_MM - inline void e_move_m240(const float length, const float fr_mm_s) { + inline void e_move_m240(const float length, const feedRate_t &fr_mm_s) { if (length && thermalManager.hotEnoughToExtrude(active_extruder)) { #if ENABLED(ADVANCED_PAUSE_FEATURE) do_pause_e_move(length, fr_mm_s); @@ -104,7 +104,8 @@ void GcodeSuite::M240() { }; #ifdef PHOTO_RETRACT_MM - constexpr float rfr = (MMS_TO_MMM( + const float rval = parser.seenval('R') ? parser.value_linear_units() : _PHOTO_RETRACT_MM; + feedRate_t sval = ( #if ENABLED(ADVANCED_PAUSE_FEATURE) PAUSE_PARK_RETRACT_FEEDRATE #elif ENABLED(FWRETRACT) @@ -112,13 +113,12 @@ void GcodeSuite::M240() { #else 45 #endif - )); - const float rval = parser.seenval('R') ? parser.value_linear_units() : _PHOTO_RETRACT_MM, - sval = parser.seenval('S') ? MMM_TO_MMS(parser.value_feedrate()) : rfr; + ); + if (parser.seenval('S')) sval = parser.value_feedrate(); e_move_m240(-rval, sval); #endif - float fr_mm_s = MMM_TO_MMS(parser.linearval('F')); + feedRate_t fr_mm_s = MMM_TO_MMS(parser.linearval('F')); if (fr_mm_s) NOLESS(fr_mm_s, 10.0f); constexpr float photo_position[XYZ] = PHOTO_POSITION; diff --git a/Marlin/src/gcode/feature/filwidth/M404-M407.cpp b/Marlin/src/gcode/feature/filwidth/M404-M407.cpp index e65a59850a..5b58416b43 100644 --- a/Marlin/src/gcode/feature/filwidth/M404-M407.cpp +++ b/Marlin/src/gcode/feature/filwidth/M404-M407.cpp @@ -34,12 +34,12 @@ * M404: Display or set (in current units) the nominal filament width (3mm, 1.75mm ) W<3.0> */ void GcodeSuite::M404() { - if (parser.seen('W')) { - filament_width_nominal = parser.value_linear_units(); - planner.volumetric_area_nominal = CIRCLE_AREA(filament_width_nominal * 0.5); + if (parser.seenval('W')) { + filwidth.nominal_mm = parser.value_linear_units(); + planner.volumetric_area_nominal = CIRCLE_AREA(filwidth.nominal_mm * 0.5); } else - SERIAL_ECHOLNPAIR("Filament dia (nominal mm):", filament_width_nominal); + SERIAL_ECHOLNPAIR("Filament dia (nominal mm):", filwidth.nominal_mm); } /** @@ -48,28 +48,17 @@ void GcodeSuite::M404() { void GcodeSuite::M405() { // This is technically a linear measurement, but since it's quantized to centimeters and is a different // unit than everything else, it uses parser.value_byte() instead of parser.value_linear_units(). - if (parser.seen('D')) { - meas_delay_cm = parser.value_byte(); - NOMORE(meas_delay_cm, MAX_MEASUREMENT_DELAY); - } + if (parser.seenval('D')) + filwidth.set_delay_cm(parser.value_byte()); - if (filwidth_delay_index[1] == -1) { // Initialize the ring buffer if not done since startup - const int8_t temp_ratio = thermalManager.widthFil_to_size_ratio(); - - for (uint8_t i = 0; i < COUNT(measurement_delay); ++i) - measurement_delay[i] = temp_ratio; - - filwidth_delay_index[0] = filwidth_delay_index[1] = 0; - } - - filament_sensor = true; + filwidth.enable(true); } /** * M406: Turn off filament sensor for control */ void GcodeSuite::M406() { - filament_sensor = false; + filwidth.enable(false); planner.calculate_volumetric_multipliers(); // Restore correct 'volumetric_multiplier' value } @@ -77,7 +66,7 @@ void GcodeSuite::M406() { * M407: Get measured filament diameter on serial output */ void GcodeSuite::M407() { - SERIAL_ECHOLNPAIR("Filament dia (measured mm):", filament_width_meas); + SERIAL_ECHOLNPAIR("Filament dia (measured mm):", filwidth.measured_mm); } #endif // FILAMENT_WIDTH_SENSOR diff --git a/Marlin/src/gcode/feature/mixing/M166.cpp b/Marlin/src/gcode/feature/mixing/M166.cpp index 1bb2e4b8f1..8b74182cde 100644 --- a/Marlin/src/gcode/feature/mixing/M166.cpp +++ b/Marlin/src/gcode/feature/mixing/M166.cpp @@ -30,15 +30,12 @@ #include "../../../feature/mixing.h" inline void echo_mix() { - SERIAL_ECHOPAIR(" (", int(mixer.mix[0])); - SERIAL_ECHOPAIR("%|", int(mixer.mix[1])); - SERIAL_ECHOPGM("%)"); + SERIAL_ECHOPAIR(" (", int(mixer.mix[0]), "%|", int(mixer.mix[1]), "%)"); } inline void echo_zt(const int t, const float &z) { mixer.update_mix_from_vtool(t); - SERIAL_ECHOPAIR(" Z", z); - SERIAL_ECHOPAIR(" T", t); + SERIAL_ECHOPAIR(" Z", z, " T", t); echo_mix(); } diff --git a/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin/src/gcode/feature/pause/M600.cpp index 6cadbe6080..f2ade740b4 100644 --- a/Marlin/src/gcode/feature/pause/M600.cpp +++ b/Marlin/src/gcode/feature/pause/M600.cpp @@ -98,7 +98,7 @@ void GcodeSuite::M600() { #if ENABLED(HOME_BEFORE_FILAMENT_CHANGE) // Don't allow filament change without homing first - if (axis_unhomed_error()) home_all_axes(); + if (axes_need_homing()) home_all_axes(); #endif #if EXTRUDERS > 1 diff --git a/Marlin/src/gcode/feature/pause/M701_M702.cpp b/Marlin/src/gcode/feature/pause/M701_M702.cpp index b127a9fbad..6add2ebfae 100644 --- a/Marlin/src/gcode/feature/pause/M701_M702.cpp +++ b/Marlin/src/gcode/feature/pause/M701_M702.cpp @@ -60,8 +60,8 @@ void GcodeSuite::M701() { point_t park_point = NOZZLE_PARK_POINT; #if ENABLED(NO_MOTION_BEFORE_HOMING) - // Only raise Z if the machine is homed - if (axis_unhomed_error()) park_point.z = 0; + // Don't raise Z if the machine isn't homed + if (axes_need_homing()) park_point.z = 0; #endif #if ENABLED(MIXING_EXTRUDER) @@ -97,7 +97,7 @@ void GcodeSuite::M701() { // Lift Z axis if (park_point.z > 0) - do_blocking_move_to_z(_MIN(current_position[Z_AXIS] + park_point.z, Z_MAX_POS), NOZZLE_PARK_Z_FEEDRATE); + do_blocking_move_to_z(_MIN(current_position[Z_AXIS] + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); // Load filament #if ENABLED(PRUSA_MMU2) @@ -116,7 +116,7 @@ void GcodeSuite::M701() { // Restore Z axis if (park_point.z > 0) - do_blocking_move_to_z(_MAX(current_position[Z_AXIS] - park_point.z, 0), NOZZLE_PARK_Z_FEEDRATE); + do_blocking_move_to_z(_MAX(current_position[Z_AXIS] - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); #if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) // Restore toolhead if it was changed @@ -149,8 +149,8 @@ void GcodeSuite::M702() { point_t park_point = NOZZLE_PARK_POINT; #if ENABLED(NO_MOTION_BEFORE_HOMING) - // Only raise Z if the machine is homed - if (axis_unhomed_error()) park_point.z = 0; + // Don't raise Z if the machine isn't homed + if (axes_need_homing()) park_point.z = 0; #endif #if ENABLED(MIXING_EXTRUDER) @@ -196,7 +196,7 @@ void GcodeSuite::M702() { // Lift Z axis if (park_point.z > 0) - do_blocking_move_to_z(_MIN(current_position[Z_AXIS] + park_point.z, Z_MAX_POS), NOZZLE_PARK_Z_FEEDRATE); + do_blocking_move_to_z(_MIN(current_position[Z_AXIS] + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); // Unload filament #if ENABLED(PRUSA_MMU2) @@ -226,7 +226,7 @@ void GcodeSuite::M702() { // Restore Z axis if (park_point.z > 0) - do_blocking_move_to_z(_MAX(current_position[Z_AXIS] - park_point.z, 0), NOZZLE_PARK_Z_FEEDRATE); + do_blocking_move_to_z(_MAX(current_position[Z_AXIS] - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); #if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) // Restore toolhead if it was changed diff --git a/Marlin/src/gcode/feature/powerloss/M413.cpp b/Marlin/src/gcode/feature/powerloss/M413.cpp index 49f4c250af..cd1dd801b9 100644 --- a/Marlin/src/gcode/feature/powerloss/M413.cpp +++ b/Marlin/src/gcode/feature/powerloss/M413.cpp @@ -47,7 +47,7 @@ void GcodeSuite::M413() { } #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - if (parser.seen('R') || parser.seen('L')) recovery.load(); + if (parser.seen("RL")) recovery.load(); if (parser.seen('W')) recovery.save(true); if (parser.seen('P')) recovery.purge(); if (parser.seen('E')) serialprintPGM(recovery.exists() ? PSTR("PLR Exists\n") : PSTR("No PLR\n")); diff --git a/Marlin/src/gcode/feature/trinamic/M569.cpp b/Marlin/src/gcode/feature/trinamic/M569.cpp index 6463889c2a..e8239838d7 100644 --- a/Marlin/src/gcode/feature/trinamic/M569.cpp +++ b/Marlin/src/gcode/feature/trinamic/M569.cpp @@ -26,7 +26,7 @@ #include "../../gcode.h" #include "../../../feature/tmc_util.h" -#include "../../../module/stepper_indirection.h" +#include "../../../module/stepper/indirection.h" template void tmc_say_stealth_status(TMC &st) { diff --git a/Marlin/src/gcode/feature/trinamic/M906.cpp b/Marlin/src/gcode/feature/trinamic/M906.cpp index ba57fbb4ce..072f7ba1fd 100644 --- a/Marlin/src/gcode/feature/trinamic/M906.cpp +++ b/Marlin/src/gcode/feature/trinamic/M906.cpp @@ -26,7 +26,7 @@ #include "../../gcode.h" #include "../../../feature/tmc_util.h" -#include "../../../module/stepper_indirection.h" +#include "../../../module/stepper/indirection.h" /** * M906: Set motor current in milliamps. diff --git a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp index 459c3f6aa8..27a0be9a64 100644 --- a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp +++ b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp @@ -26,7 +26,7 @@ #include "../../gcode.h" #include "../../../feature/tmc_util.h" -#include "../../../module/stepper_indirection.h" +#include "../../../module/stepper/indirection.h" #include "../../../module/planner.h" #include "../../queue.h" diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 91282d0ab5..f542f842ce 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -49,7 +49,13 @@ GcodeSuite gcode; millis_t GcodeSuite::previous_move_ms; -bool GcodeSuite::axis_relative_modes[] = AXIS_RELATIVE_MODES; +static constexpr bool ar_init[XYZE] = AXIS_RELATIVE_MODES; +uint8_t GcodeSuite::axis_relative = ( + (ar_init[X_AXIS] ? _BV(REL_X) : 0) + | (ar_init[Y_AXIS] ? _BV(REL_Y) : 0) + | (ar_init[Z_AXIS] ? _BV(REL_Z) : 0) + | (ar_init[E_AXIS] ? _BV(REL_E) : 0) +); #if ENABLED(HOST_KEEPALIVE_FEATURE) GcodeSuite::MarlinBusyState GcodeSuite::busy_state = NOT_BUSY; @@ -110,22 +116,20 @@ void GcodeSuite::get_destination_from_command() { LOOP_XYZE(i) { if ( (seen[i] = parser.seenval(axis_codes[i])) ) { const float v = parser.value_axis_units((AxisEnum)i); - destination[i] = (axis_relative_modes[i] || relative_mode) - ? current_position[i] + v - : (i == E_AXIS) ? v : LOGICAL_TO_NATIVE(v, i); + destination[i] = axis_is_relative(AxisEnum(i)) ? current_position[i] + v : (i == E_AXIS) ? v : LOGICAL_TO_NATIVE(v, i); } else destination[i] = current_position[i]; } - #if ENABLED(POWER_LOSS_RECOVERY) + #if ENABLED(POWER_LOSS_RECOVERY) && !PIN_EXISTS(POWER_LOSS) // Only update power loss recovery on moves with E if (recovery.enabled && IS_SD_PRINTING() && seen[E_AXIS] && (seen[X_AXIS] || seen[Y_AXIS])) recovery.save(); #endif if (parser.linearval('F') > 0) - feedrate_mm_s = MMM_TO_MMS(parser.value_feedrate()); + feedrate_mm_s = parser.value_feedrate(); #if ENABLED(PRINTCOUNTER) if (!DEBUGGING(DRYRUN)) @@ -295,8 +299,8 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 80: G80(); break; // G80: Reset the current motion mode #endif - case 90: relative_mode = false; break; // G90: Relative Mode - case 91: relative_mode = true; break; // G91: Absolute Mode + case 90: set_relative_mode(false); break; // G90: Absolute Mode + case 91: set_relative_mode(true); break; // G91: Relative Mode case 92: G92(); break; // G92: Set current axis position(s) @@ -400,17 +404,27 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 100: M100(); break; // M100: Free Memory Report #endif - case 104: M104(); break; // M104: Set hot end temperature - case 109: M109(); break; // M109: Wait for hotend temperature to reach target + #if EXTRUDERS + case 104: M104(); break; // M104: Set hot end temperature + case 109: M109(); break; // M109: Wait for hotend temperature to reach target + #endif + + case 105: M105(); return; // M105: Report Temperatures (and say "ok") + + #if FAN_COUNT > 0 + case 106: M106(); break; // M106: Fan On + case 107: M107(); break; // M107: Fan Off + #endif + case 110: M110(); break; // M110: Set Current Line Number case 111: M111(); break; // M111: Set debug level #if DISABLED(EMERGENCY_PARSER) case 108: M108(); break; // M108: Cancel Waiting - case 112: M112(); break; // M112: Emergency Stop + case 112: M112(); break; // M112: Full Shutdown case 410: M410(); break; // M410: Quickstop - Abort all the planned moves. #if ENABLED(HOST_PROMPT_SUPPORT) - case 876: M876(); break; // M876: Handle Host prompt responses + case 876: M876(); break; // M876: Handle Host prompt responses #endif #else case 108: case 112: case 410: @@ -434,17 +448,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { //case 191: M191(); break; // M191: Wait for chamber temperature to reach target #endif - case 105: M105(); return; // M105: Report Temperatures (and say "ok") - #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR case 155: M155(); break; // M155: Set temperature auto-report interval #endif - #if FAN_COUNT > 0 - case 106: M106(); break; // M106: Fan On - case 107: M107(); break; // M107: Fan Off - #endif - #if ENABLED(PARK_HEAD_ON_PAUSE) case 125: M125(); break; // M125: Store current position and move to filament change position #endif @@ -481,7 +488,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 120: M120(); break; // M120: Enable endstops case 121: M121(); break; // M121: Disable endstops - #if HAS_LCD_MENU + #if HOTENDS && HAS_LCD_MENU case 145: M145(); break; // M145: Set material heatup parameters #endif @@ -553,7 +560,11 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { #endif case 220: M220(); break; // M220: Set Feedrate Percentage: S ("FR" on your LCD) - case 221: M221(); break; // M221: Set Flow Percentage + + #if EXTRUDERS + case 221: M221(); break; // M221: Set Flow Percentage + #endif + case 226: M226(); break; // M226: Wait until a pin reaches a state #if HAS_SERVOS @@ -812,16 +823,20 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { * This is called from the main loop() */ void GcodeSuite::process_next_command() { - char * const current_command = queue.buffer[queue.index_r]; + char * const current_command = queue.command_buffer[queue.index_r]; PORT_REDIRECT(queue.port[queue.index_r]); + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.queue_index_r = queue.index_r; + #endif + if (DEBUGGING(ECHO)) { SERIAL_ECHO_START(); SERIAL_ECHOLN(current_command); #if ENABLED(M100_FREE_MEMORY_DUMPER) SERIAL_ECHOPAIR("slot:", queue.index_r); - M100_dump_routine(PSTR(" Command Queue:"), queue.buffer, queue.buffer + sizeof(queue.buffer)); + M100_dump_routine(PSTR(" Command Queue:"), queue.command_buffer, queue.command_buffer + sizeof(queue.command_buffer)); #endif } diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index c12d5bde84..f871d6d216 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -132,7 +132,7 @@ * If AUTOTEMP is enabled, S B F. Exit autotemp by any M109 without F * M110 - Set the current line number. (Used by host printing) * M111 - Set debug flags: "M111 S". See flag bits defined in enum.h. - * M112 - Emergency stop. + * M112 - Full Shutdown. * M113 - Get or set the timeout interval for Host Keepalive "busy" messages. (Requires HOST_KEEPALIVE_FEATURE) * M114 - Report current position. * M115 - Report capabilities. (Extended capabilities requires EXTENDED_CAPABILITIES_REPORT) @@ -229,7 +229,7 @@ * M701 - Load filament (Requires FILAMENT_LOAD_UNLOAD_GCODES) * M702 - Unload filament (Requires FILAMENT_LOAD_UNLOAD_GCODES) * M810-M819 - Define/execute a G-code macro (Requires GCODE_MACROS) - * M851 - Set Z probe's Z offset in current units. (Negative = below the nozzle.) + * M851 - Set Z probe's XYZ offsets in current units. (Negative values: X=left, Y=front, Z=below) * M852 - Set skew factors: "M852 [I] [J] [K]". (Requires SKEW_CORRECTION_GCODE, and SKEW_CORRECTION_FOR_Z for IJ) * M860 - Report the position of position encoder modules. * M861 - Report the status of position encoder modules. @@ -283,12 +283,31 @@ #include "../feature/I2CPositionEncoder.h" #endif +enum AxisRelative : uint8_t { REL_X, REL_Y, REL_Z, REL_E, E_MODE_ABS, E_MODE_REL }; + class GcodeSuite { public: - GcodeSuite() {} + static uint8_t axis_relative; - static bool axis_relative_modes[]; + static inline bool axis_is_relative(const AxisEnum a) { + if (a == E_AXIS) { + if (TEST(axis_relative, E_MODE_REL)) return true; + if (TEST(axis_relative, E_MODE_ABS)) return false; + } + return TEST(axis_relative, a); + } + static inline void set_relative_mode(const bool rel) { + axis_relative = rel ? _BV(REL_X) | _BV(REL_Y) | _BV(REL_Z) | _BV(REL_E) : 0; + } + static inline void set_e_relative() { + CBI(axis_relative, E_MODE_ABS); + SBI(axis_relative, E_MODE_REL); + } + static inline void set_e_absolute() { + CBI(axis_relative, E_MODE_REL); + SBI(axis_relative, E_MODE_ABS); + } #if ENABLED(CNC_WORKSPACE_PLANES) /** @@ -351,7 +370,7 @@ private: static void G0_G1( #if IS_SCARA || defined(G0_FEEDRATE) - bool fast_move=false + const bool fast_move=false #endif ); @@ -543,10 +562,17 @@ private: static void M100(); #endif - static void M104(); + #if EXTRUDERS + static void M104(); + static void M109(); + #endif + static void M105(); - static void M106(); - static void M107(); + + #if FAN_COUNT > 0 + static void M106(); + static void M107(); + #endif #if DISABLED(EMERGENCY_PARSER) static void M108(); @@ -557,8 +583,6 @@ private: #endif #endif - static void M109(); - static void M110(); static void M111(); @@ -599,7 +623,7 @@ private: //static void M191(); #endif - #if HAS_LCD_MENU + #if HOTENDS && HAS_LCD_MENU static void M145(); #endif @@ -660,7 +684,11 @@ private: #endif static void M220(); - static void M221(); + + #if EXTRUDERS + static void M221(); + #endif + static void M226(); #if ENABLED(PHOTO_GCODE) diff --git a/Marlin/src/gcode/geometry/G53-G59.cpp b/Marlin/src/gcode/geometry/G53-G59.cpp index 813c026e75..88914ccffd 100644 --- a/Marlin/src/gcode/geometry/G53-G59.cpp +++ b/Marlin/src/gcode/geometry/G53-G59.cpp @@ -27,23 +27,21 @@ #include "../../module/stepper.h" +//#define DEBUG_M53 + /** * Select a coordinate system and update the workspace offset. * System index -1 is used to specify machine-native. */ bool GcodeSuite::select_coordinate_system(const int8_t _new) { if (active_coordinate_system == _new) return false; - planner.synchronize(); - float old_offset[XYZ] = { 0 }, new_offset[XYZ] = { 0 }; - if (WITHIN(active_coordinate_system, 0, MAX_COORDINATE_SYSTEMS - 1)) - COPY(old_offset, coordinate_system[active_coordinate_system]); + active_coordinate_system = _new; + float new_offset[XYZ] = { 0 }; if (WITHIN(_new, 0, MAX_COORDINATE_SYSTEMS - 1)) COPY(new_offset, coordinate_system[_new]); - active_coordinate_system = _new; LOOP_XYZ(i) { - const float diff = new_offset[i] - old_offset[i]; - if (diff) { - position_shift[i] += diff; + if (position_shift[i] != new_offset[i]) { + position_shift[i] = new_offset[i]; update_workspace_offset((AxisEnum)i); } } @@ -60,11 +58,20 @@ bool GcodeSuite::select_coordinate_system(const int8_t _new) { * Marlin also uses G53 on a line by itself to go back to native space. */ void GcodeSuite::G53() { - const int8_t _system = active_coordinate_system; - active_coordinate_system = -1; - if (parser.chain()) { // If this command has more following... - process_parsed_command(); - active_coordinate_system = _system; + const int8_t old_system = active_coordinate_system; + select_coordinate_system(-1); // Always remove workspace offsets + #ifdef DEBUG_M53 + SERIAL_ECHOLNPGM("Go to native space"); + report_current_position(); + #endif + + if (parser.chain()) { // Command to chain? + process_parsed_command(); // ...process the chained command + select_coordinate_system(old_system); + #ifdef DEBUG_M53 + SERIAL_ECHOLNPAIR("Go back to workspace ", old_system); + report_current_position(); + #endif } } diff --git a/Marlin/src/gcode/geometry/G92.cpp b/Marlin/src/gcode/geometry/G92.cpp index 9304274520..0ecf43e580 100644 --- a/Marlin/src/gcode/geometry/G92.cpp +++ b/Marlin/src/gcode/geometry/G92.cpp @@ -52,12 +52,9 @@ void GcodeSuite::G92() { case 1: { // Zero the G92 values and restore current position #if !IS_SCARA - LOOP_XYZ(i) { - const float v = position_shift[i]; - if (v) { - position_shift[i] = 0; - update_workspace_offset((AxisEnum)i); - } + LOOP_XYZ(i) if (position_shift[i]) { + position_shift[i] = 0; + update_workspace_offset((AxisEnum)i); } #endif // Not SCARA } return; diff --git a/Marlin/src/gcode/host/M114.cpp b/Marlin/src/gcode/host/M114.cpp index b4b2f58d33..c10b58f705 100644 --- a/Marlin/src/gcode/host/M114.cpp +++ b/Marlin/src/gcode/host/M114.cpp @@ -31,18 +31,18 @@ #if HAS_DRIVER(L6470) //C:\Users\bobku\Documents\GitHub\Marlin-Bob-2\Marlin\src\gcode\host\M114.cpp //C:\Users\bobku\Documents\GitHub\Marlin-Bob-2\Marlin\src\module\bob_L6470.cpp - #include "../../module/L6470/L6470_Marlin.h" + #include "../../libs/L6470/L6470_Marlin.h" #define DEBUG_OUT ENABLED(L6470_CHITCHAT) #include "../../core/debug_out.h" #endif void report_xyze(const float pos[], const uint8_t n = 4, const uint8_t precision = 3) { char str[12]; - for (uint8_t i = 0; i < n; i++) { + for (uint8_t a = 0; a < n; a++) { SERIAL_CHAR(' '); - SERIAL_CHAR(axis_codes[i]); + SERIAL_CHAR(axis_codes[a]); SERIAL_CHAR(':'); - SERIAL_ECHO(dtostrf(pos[i], 1, precision, str)); + SERIAL_ECHO(dtostrf(pos[a], 1, precision, str)); } SERIAL_EOL(); } diff --git a/Marlin/src/gcode/host/M118.cpp b/Marlin/src/gcode/host/M118.cpp index 7655a27f15..3d8a84fb5f 100644 --- a/Marlin/src/gcode/host/M118.cpp +++ b/Marlin/src/gcode/host/M118.cpp @@ -21,24 +21,55 @@ */ #include "../gcode.h" +#include "../../core/serial.h" /** * M118: Display a message in the host console. * * A1 Prepend '// ' for an action command, as in OctoPrint * E1 Have the host 'echo:' the text + * Pn Redirect to another serial port + * 0 : Announce to all ports + * 1-9 : Serial ports 1 to 9 */ void GcodeSuite::M118() { bool hasE = false, hasA = false; + #if NUM_SERIAL > 1 + int8_t port = -1; // Assume no redirect + #endif char *p = parser.string_arg; - for (uint8_t i = 2; i--;) - if ((p[0] == 'A' || p[0] == 'E') && p[1] == '1') { - if (p[0] == 'A') hasA = true; - if (p[0] == 'E') hasE = true; - p += 2; - while (*p == ' ') ++p; + for (uint8_t i = 3; i--;) { + // A1, E1, and Pn are always parsed out + if (!( ((p[0] == 'A' || p[0] == 'E') && p[1] == '1') || (p[0] == 'P' && NUMERIC(p[1])) )) break; + switch (p[0]) { + case 'A': hasA = true; break; + case 'E': hasE = true; break; + #if NUM_SERIAL > 1 + case 'P': port = p[1] - '0'; break; + #endif } + p += 2; + while (*p == ' ') ++p; + } + + #if NUM_SERIAL > 1 + const int8_t old_serial = serial_port_index; + if (WITHIN(port, 0, NUM_SERIAL)) + serial_port_index = ( + port == 0 ? SERIAL_BOTH + : port == 1 ? SERIAL_PORT + #ifdef SERIAL_PORT_2 + : port == 2 ? SERIAL_PORT_2 + #endif + : SERIAL_PORT + ); + #endif + if (hasE) SERIAL_ECHO_START(); if (hasA) SERIAL_ECHOPGM("// "); SERIAL_ECHOLN(p); + + #if NUM_SERIAL > 1 + serial_port_index = old_serial; + #endif } diff --git a/Marlin/src/gcode/lcd/M145.cpp b/Marlin/src/gcode/lcd/M145.cpp index 693a32d242..297ece268e 100644 --- a/Marlin/src/gcode/lcd/M145.cpp +++ b/Marlin/src/gcode/lcd/M145.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if HAS_LCD_MENU +#if HOTENDS && HAS_LCD_MENU #include "../gcode.h" #include "../../lcd/ultralcd.h" @@ -58,4 +58,4 @@ void GcodeSuite::M145() { } } -#endif // HAS_LCD_MENU +#endif // HOTENDS && HAS_LCD_MENU diff --git a/Marlin/src/gcode/motion/G0_G1.cpp b/Marlin/src/gcode/motion/G0_G1.cpp index 8d88ac91dd..fed70f553e 100644 --- a/Marlin/src/gcode/motion/G0_G1.cpp +++ b/Marlin/src/gcode/motion/G0_G1.cpp @@ -38,7 +38,7 @@ extern float destination[XYZE]; #if ENABLED(VARIABLE_G0_FEEDRATE) - float saved_g0_feedrate_mm_s = MMM_TO_MMS(G0_FEEDRATE); + feedRate_t fast_move_feedrate = MMM_TO_MMS(G0_FEEDRATE); #endif /** @@ -46,34 +46,37 @@ extern float destination[XYZE]; */ void GcodeSuite::G0_G1( #if IS_SCARA || defined(G0_FEEDRATE) - bool fast_move/*=false*/ + const bool fast_move/*=false*/ #endif ) { if (IsRunning() #if ENABLED(NO_MOTION_BEFORE_HOMING) - && !axis_unhomed_error(parser.seen('X'), parser.seen('Y'), parser.seen('Z')) + && !axis_unhomed_error( + (parser.seen('X') ? _BV(X_AXIS) : 0) + | (parser.seen('Y') ? _BV(Y_AXIS) : 0) + | (parser.seen('Z') ? _BV(Z_AXIS) : 0) ) #endif ) { #ifdef G0_FEEDRATE - float saved_feedrate_mm_s; + feedRate_t old_feedrate; #if ENABLED(VARIABLE_G0_FEEDRATE) if (fast_move) { - saved_feedrate_mm_s = feedrate_mm_s; // Back up the (old) motion mode feedrate - feedrate_mm_s = saved_g0_feedrate_mm_s; // Get G0 feedrate from last usage + old_feedrate = feedrate_mm_s; // Back up the (old) motion mode feedrate + feedrate_mm_s = fast_move_feedrate; // Get G0 feedrate from last usage } #endif #endif - get_destination_from_command(); // For X Y Z E F + get_destination_from_command(); // Process X Y Z E F parameters #ifdef G0_FEEDRATE if (fast_move) { #if ENABLED(VARIABLE_G0_FEEDRATE) - saved_g0_feedrate_mm_s = feedrate_mm_s; // Save feedrate for the next G0 + fast_move_feedrate = feedrate_mm_s; // Save feedrate for the next G0 #else - saved_feedrate_mm_s = feedrate_mm_s; // Back up the (new) motion mode feedrate + old_feedrate = feedrate_mm_s; // Back up the (new) motion mode feedrate feedrate_mm_s = MMM_TO_MMS(G0_FEEDRATE); // Get the fixed G0 feedrate #endif } @@ -97,14 +100,14 @@ void GcodeSuite::G0_G1( #endif // FWRETRACT #if IS_SCARA - fast_move ? prepare_uninterpolated_move_to_destination() : prepare_move_to_destination(); + fast_move ? prepare_fast_move_to_destination() : prepare_move_to_destination(); #else prepare_move_to_destination(); #endif #ifdef G0_FEEDRATE // Restore the motion mode feedrate - if (fast_move) feedrate_mm_s = saved_feedrate_mm_s; + if (fast_move) feedrate_mm_s = old_feedrate; #endif #if ENABLED(NANODLP_Z_SYNC) diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index 030675c230..2a713a9f41 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -146,10 +146,10 @@ void plan_arc( // Initialize the extruder axis raw[E_AXIS] = current_position[E_AXIS]; - const float fr_mm_s = MMS_SCALED(feedrate_mm_s); + const feedRate_t scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s); #if ENABLED(SCARA_FEEDRATE_SCALING) - const float inv_duration = fr_mm_s / MM_PER_ARC_SEGMENT; + const float inv_duration = scaled_fr_mm_s / MM_PER_ARC_SEGMENT; #endif millis_t next_idle_ms = millis() + 200UL; @@ -206,7 +206,7 @@ void plan_arc( planner.apply_leveling(raw); #endif - if (!planner.buffer_line(raw, fr_mm_s, active_extruder, MM_PER_ARC_SEGMENT + if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, MM_PER_ARC_SEGMENT #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif @@ -220,11 +220,13 @@ void plan_arc( raw[l_axis] = start_L; #endif + apply_motion_limits(raw); + #if HAS_LEVELING && !PLANNER_LEVELING planner.apply_leveling(raw); #endif - planner.buffer_line(raw, fr_mm_s, active_extruder, MM_PER_ARC_SEGMENT + planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, MM_PER_ARC_SEGMENT #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif @@ -278,20 +280,22 @@ void GcodeSuite::G2_G3(const bool clockwise) { float arc_offset[2] = { 0, 0 }; if (parser.seenval('R')) { - const float r = parser.value_linear_units(), - p1 = current_position[X_AXIS], q1 = current_position[Y_AXIS], - p2 = destination[X_AXIS], q2 = destination[Y_AXIS]; - if (r && (p2 != p1 || q2 != q1)) { - const float e = clockwise ^ (r < 0) ? -1 : 1, // clockwise -1/1, counterclockwise 1/-1 - dx = p2 - p1, dy = q2 - q1, // X and Y differences - d = HYPOT(dx, dy), // Linear distance between the points - dinv = 1/d, // Inverse of d - h = SQRT(sq(r) - sq(d * 0.5f)), // Distance to the arc pivot-point - mx = (p1 + p2) * 0.5f, my = (q1 + q2) * 0.5f,// Point between the two points - sx = -dy * dinv, sy = dx * dinv, // Slope of the perpendicular bisector - cx = mx + e * h * sx, cy = my + e * h * sy; // Pivot-point of the arc - arc_offset[0] = cx - p1; - arc_offset[1] = cy - q1; + const float r = parser.value_linear_units(); + if (r) { + const float p1 = current_position[X_AXIS], q1 = current_position[Y_AXIS], + p2 = destination[X_AXIS], q2 = destination[Y_AXIS]; + if (p2 != p1 || q2 != q1) { + const float e = clockwise ^ (r < 0) ? -1 : 1, // clockwise -1/1, counterclockwise 1/-1 + dx = p2 - p1, dy = q2 - q1, // X and Y differences + d = HYPOT(dx, dy), // Linear distance between the points + dinv = 1/d, // Inverse of d + h = SQRT(sq(r) - sq(d * 0.5f)), // Distance to the arc pivot-point + mx = (p1 + p2) * 0.5f, my = (q1 + q2) * 0.5f,// Point between the two points + sx = -dy * dinv, sy = dx * dinv, // Slope of the perpendicular bisector + cx = mx + e * h * sx, cy = my + e * h * sy; // Pivot-point of the arc + arc_offset[0] = cx - p1; + arc_offset[1] = cy - q1; + } } } else { diff --git a/Marlin/src/gcode/motion/M290.cpp b/Marlin/src/gcode/motion/M290.cpp index d3eb81a8fc..a2ac85cd0b 100644 --- a/Marlin/src/gcode/motion/M290.cpp +++ b/Marlin/src/gcode/motion/M290.cpp @@ -42,17 +42,17 @@ && active_extruder == 0 #endif ) { - zprobe_zoffset += offs; + probe_offset[Z_AXIS] += offs; SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_PROBE_Z_OFFSET ": ", zprobe_zoffset); + SERIAL_ECHOLNPAIR(MSG_PROBE_OFFSET MSG_Z ": ", probe_offset[Z_AXIS]); } - #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) - else { + else { + #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) hotend_offset[Z_AXIS][active_extruder] -= offs; SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_Z_OFFSET ": ", hotend_offset[Z_AXIS][active_extruder]); - } - #endif + SERIAL_ECHOLNPAIR(MSG_PROBE_OFFSET MSG_Z ": ", hotend_offset[Z_AXIS][active_extruder]); + #endif + } } #endif diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index 8798ed486a..a4fd629b16 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -34,6 +34,14 @@ #include "../libs/hex_print_routines.h" #endif +#if ENABLED(TEMPERATURE_UNITS_SUPPORT) + typedef enum : uint8_t { TEMPUNIT_C, TEMPUNIT_K, TEMPUNIT_F } TempUnit; +#endif + +#if ENABLED(INCH_MODE_SUPPORT) + typedef enum : uint8_t { LINEARUNIT_MM, LINEARUNIT_INCH } LinearUnit; +#endif + /** * GCode parser * @@ -254,7 +262,6 @@ public: // Units modes: Inches, Fahrenheit, Kelvin #if ENABLED(INCH_MODE_SUPPORT) - static inline float mm_to_linear_unit(const float mm) { return mm / linear_unit_factor; } static inline float mm_to_volumetric_unit(const float mm) { return mm / (volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); } @@ -263,13 +270,9 @@ public: static inline void set_input_linear_units(const LinearUnit units) { switch (units) { - case LINEARUNIT_INCH: - linear_unit_factor = 25.4f; - break; - case LINEARUNIT_MM: default: - linear_unit_factor = 1; - break; + case LINEARUNIT_MM: linear_unit_factor = 1.0f; break; + case LINEARUNIT_INCH: linear_unit_factor = 25.4f; break; } volumetric_unit_factor = POW(linear_unit_factor, 3); } @@ -302,7 +305,7 @@ public: #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - static inline void set_input_temp_units(TempUnit units) { input_temp_units = units; } + static inline void set_input_temp_units(const TempUnit units) { input_temp_units = units; } #if HAS_LCD_MENU && DISABLED(DISABLE_M503) @@ -361,7 +364,7 @@ public: #endif // !TEMPERATURE_UNITS_SUPPORT - static inline float value_feedrate() { return value_linear_units(); } + static inline feedRate_t value_feedrate() { return MMM_TO_MMS(value_linear_units()); } void unknown_command_error(); diff --git a/Marlin/src/gcode/probe/G30.cpp b/Marlin/src/gcode/probe/G30.cpp index 08f978bf93..50d0ea6ae3 100644 --- a/Marlin/src/gcode/probe/G30.cpp +++ b/Marlin/src/gcode/probe/G30.cpp @@ -39,8 +39,8 @@ * E Engage the probe for each probe (default 1) */ void GcodeSuite::G30() { - const float xpos = parser.linearval('X', current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER), - ypos = parser.linearval('Y', current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER); + const float xpos = parser.linearval('X', current_position[X_AXIS] + probe_offset[X_AXIS]), + ypos = parser.linearval('Y', current_position[Y_AXIS] + probe_offset[Y_AXIS]); if (!position_is_reachable_by_probe(xpos, ypos)) return; @@ -49,18 +49,15 @@ void GcodeSuite::G30() { set_bed_leveling_enabled(false); #endif - setup_for_endstop_or_probe_move(); + remember_feedrate_scaling_off(); const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE; - const float measured_z = probe_pt(xpos, ypos, raise_after, 1); + const float measured_z = probe_at_point(xpos, ypos, raise_after, 1); - if (!isnan(measured_z)) { - SERIAL_ECHOPAIR("Bed X: ", FIXFLOAT(xpos)); - SERIAL_ECHOPAIR(" Y: ", FIXFLOAT(ypos)); - SERIAL_ECHOLNPAIR(" Z: ", FIXFLOAT(measured_z)); - } + if (!isnan(measured_z)) + SERIAL_ECHOLNPAIR("Bed X: ", FIXFLOAT(xpos), " Y: ", FIXFLOAT(ypos), " Z: ", FIXFLOAT(measured_z)); - clean_up_after_endstop_or_probe_move(); + restore_feedrate_and_scaling(); #ifdef Z_AFTER_PROBING if (raise_after == PROBE_PT_STOW) move_z_after_probing(); diff --git a/Marlin/src/gcode/probe/G38.cpp b/Marlin/src/gcode/probe/G38.cpp index 1444521350..33f5611a43 100644 --- a/Marlin/src/gcode/probe/G38.cpp +++ b/Marlin/src/gcode/probe/G38.cpp @@ -109,7 +109,7 @@ void GcodeSuite::G38(const int8_t subcode) { // Get X Y Z E F get_destination_from_command(); - setup_for_endstop_or_probe_move(); + remember_feedrate_scaling_off(); const bool error_on_fail = #if ENABLED(G38_PROBE_AWAY) @@ -128,7 +128,7 @@ void GcodeSuite::G38(const int8_t subcode) { break; } - clean_up_after_endstop_or_probe_move(); + restore_feedrate_and_scaling(); } #endif // G38_PROBE_TARGET diff --git a/Marlin/src/gcode/probe/M851.cpp b/Marlin/src/gcode/probe/M851.cpp index 6ab53f9f77..eec6b2f255 100644 --- a/Marlin/src/gcode/probe/M851.cpp +++ b/Marlin/src/gcode/probe/M851.cpp @@ -28,17 +28,53 @@ #include "../../feature/bedlevel/bedlevel.h" #include "../../module/probe.h" +/** + * M851: Set the nozzle-to-probe offsets in current units + */ void GcodeSuite::M851() { - if (parser.seenval('Z')) { - const float value = parser.value_linear_units(); - if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) - zprobe_zoffset = value; - else - SERIAL_ERROR_MSG("?Z out of range (" STRINGIFY(Z_PROBE_OFFSET_RANGE_MIN) " to " STRINGIFY(Z_PROBE_OFFSET_RANGE_MAX) ")"); + + // Show usage with no parameters + if (!parser.seen("XYZ")) { + SERIAL_ECHOLNPAIR(MSG_PROBE_OFFSET " X", probe_offset[X_AXIS], " Y", probe_offset[Y_AXIS], " Z", probe_offset[Z_AXIS]); return; } - SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_PROBE_Z_OFFSET ": ", zprobe_zoffset); + + float offs[XYZ] = { probe_offset[X_AXIS], probe_offset[Y_AXIS], probe_offset[Z_AXIS] }; + + bool ok = true; + + if (parser.seenval('X')) { + const float x = parser.value_float(); + if (WITHIN(x, -(X_BED_SIZE), X_BED_SIZE)) + offs[X_AXIS] = x; + else { + SERIAL_ECHOLNPAIR("?X out of range (-", int(X_BED_SIZE), " to ", int(X_BED_SIZE), ")"); + ok = false; + } + } + + if (parser.seenval('Y')) { + const float y = parser.value_float(); + if (WITHIN(y, -(Y_BED_SIZE), Y_BED_SIZE)) + offs[Y_AXIS] = y; + else { + SERIAL_ECHOLNPAIR("?Y out of range (-", int(Y_BED_SIZE), " to ", int(Y_BED_SIZE), ")"); + ok = false; + } + } + + if (parser.seenval('Z')) { + const float z = parser.value_float(); + if (WITHIN(z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) + offs[Z_AXIS] = z; + else { + SERIAL_ECHOLNPAIR("?Z out of range (", int(Z_PROBE_OFFSET_RANGE_MIN), " to ", int(Z_PROBE_OFFSET_RANGE_MAX), ")"); + ok = false; + } + } + + // Save the new offsets + if (ok) COPY(probe_offset, offs); } #endif // HAS_BED_PROBE diff --git a/Marlin/src/gcode/probe/M951.cpp b/Marlin/src/gcode/probe/M951.cpp index 3e27a7397f..d8d2e8f8e0 100644 --- a/Marlin/src/gcode/probe/M951.cpp +++ b/Marlin/src/gcode/probe/M951.cpp @@ -28,11 +28,10 @@ #include "../../module/tool_change.h" #include "../../module/motion.h" - mpe_settings_t mpe_settings; inline void mpe_settings_report() { - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Magnetic Parking Extruder"); + SERIAL_ECHO_MSG("Magnetic Parking Extruder"); SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("L: Left parking :", mpe_settings.parking_xpos[0]); SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("R: Right parking :", mpe_settings.parking_xpos[1]); SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("I: Grab Offset :", mpe_settings.grab_distance); diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 8159fa3285..a9bd714c1e 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -43,6 +43,9 @@ GCodeQueue queue; #include "../feature/binary_protocol.h" #endif +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../feature/power_loss_recovery.h" +#endif /** * GCode line number handling. Hosts may opt to include line numbers when @@ -64,7 +67,7 @@ uint8_t GCodeQueue::length = 0, // Count of commands in the queue GCodeQueue::index_r = 0, // Ring buffer read position GCodeQueue::index_w = 0; // Ring buffer write position -char GCodeQueue::buffer[BUFSIZE][MAX_CMD_SIZE]; +char GCodeQueue::command_buffer[BUFSIZE][MAX_CMD_SIZE]; /* * The port that the command was received on @@ -120,6 +123,9 @@ void GCodeQueue::_commit_command(bool say_ok #if NUM_SERIAL > 1 port[index_w] = p; #endif + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.commit_sdpos(index_w); + #endif if (++index_w >= BUFSIZE) index_w = 0; length++; } @@ -135,7 +141,7 @@ bool GCodeQueue::_enqueue(const char* cmd, bool say_ok/*=false*/ #endif ) { if (*cmd == ';' || length >= BUFSIZE) return false; - strcpy(buffer[index_w], cmd); + strcpy(command_buffer[index_w], cmd); _commit_command(say_ok #if NUM_SERIAL > 1 , pn @@ -242,7 +248,7 @@ void GCodeQueue::ok_to_send() { if (!send_ok[index_r]) return; SERIAL_ECHOPGM(MSG_OK); #if ENABLED(ADVANCED_OK) - char* p = buffer[index_r]; + char* p = command_buffer[index_r]; if (*p == 'N') { SERIAL_ECHO(' '); SERIAL_ECHO(*p++); @@ -553,10 +559,14 @@ void GCodeQueue::get_serial_commands() { // Skip empty lines and comments if (!sd_count) { thermalManager.manage_heater(); continue; } - buffer[index_w][sd_count] = '\0'; // terminate string + command_buffer[index_w][sd_count] = '\0'; // terminate string sd_count = 0; // clear sd line buffer _commit_command(false); + + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.cmd_sdpos = card.getIndex(); // Prime for the next _commit_command + #endif } else if (sd_count >= MAX_CMD_SIZE - 1) { /** @@ -574,7 +584,7 @@ void GCodeQueue::get_serial_commands() { #if ENABLED(PAREN_COMMENTS) && ! sd_comment_paren_mode #endif - ) buffer[index_w][sd_count++] = sd_char; + ) command_buffer[index_w][sd_count++] = sd_char; } } } @@ -610,7 +620,7 @@ void GCodeQueue::advance() { #if ENABLED(SDSUPPORT) if (card.flag.saving) { - char* command = buffer[index_r]; + char* command = command_buffer[index_r]; if (is_M29(command)) { // M29 closes the file card.closefile(); diff --git a/Marlin/src/gcode/queue.h b/Marlin/src/gcode/queue.h index 671793e2bd..173cadc68e 100644 --- a/Marlin/src/gcode/queue.h +++ b/Marlin/src/gcode/queue.h @@ -51,7 +51,7 @@ public: static uint8_t length, // Count of commands in the queue index_r; // Ring buffer read position - static char buffer[BUFSIZE][MAX_CMD_SIZE]; + static char command_buffer[BUFSIZE][MAX_CMD_SIZE]; /* * The port that the command was received on diff --git a/Marlin/src/gcode/sdcard/M21_M22.cpp b/Marlin/src/gcode/sdcard/M21_M22.cpp index 91b117602d..9362db0808 100644 --- a/Marlin/src/gcode/sdcard/M21_M22.cpp +++ b/Marlin/src/gcode/sdcard/M21_M22.cpp @@ -30,7 +30,7 @@ /** * M21: Init SD Card */ -void GcodeSuite::M21() { card.initsd(); } +void GcodeSuite::M21() { card.mount(); } /** * M22: Release SD Card diff --git a/Marlin/src/gcode/sdcard/M24_M25.cpp b/Marlin/src/gcode/sdcard/M24_M25.cpp index 81b7350f72..154a4f7c55 100644 --- a/Marlin/src/gcode/sdcard/M24_M25.cpp +++ b/Marlin/src/gcode/sdcard/M24_M25.cpp @@ -38,6 +38,10 @@ #include "../../feature/host_actions.h" #endif +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../feature/power_loss_recovery.h" +#endif + /** * M24: Start or Resume SD Print */ @@ -58,15 +62,18 @@ void GcodeSuite::M24() { if (card.isFileOpen()) { card.startFileprint(); print_job_timer.start(); + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.prepare(); + #endif } #if ENABLED(HOST_ACTION_COMMANDS) - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_INFO, PSTR("Resume SD")); - #endif #ifdef ACTION_ON_RESUME host_action_resume(); #endif + #if ENABLED(HOST_PROMPT_SUPPORT) + host_prompt_open(PROMPT_INFO, PSTR("Resuming SD"), PSTR("Dismiss")); + #endif #endif ui.reset_status(); diff --git a/Marlin/src/gcode/sdcard/M26.cpp b/Marlin/src/gcode/sdcard/M26.cpp index e14ee5b349..0003758804 100644 --- a/Marlin/src/gcode/sdcard/M26.cpp +++ b/Marlin/src/gcode/sdcard/M26.cpp @@ -31,7 +31,7 @@ * M26: Set SD Card file index */ void GcodeSuite::M26() { - if (card.isDetected() && parser.seenval('S')) + if (card.isMounted() && parser.seenval('S')) card.setIndex(parser.value_long()); } diff --git a/Marlin/src/gcode/sdcard/M30.cpp b/Marlin/src/gcode/sdcard/M30.cpp index f4e67c0a4a..2f318687ad 100644 --- a/Marlin/src/gcode/sdcard/M30.cpp +++ b/Marlin/src/gcode/sdcard/M30.cpp @@ -31,7 +31,7 @@ * M30 : Delete SD Card file */ void GcodeSuite::M30() { - if (card.isDetected()) { + if (card.isMounted()) { card.closefile(); card.removeFile(parser.string_arg); } diff --git a/Marlin/src/gcode/sdcard/M32.cpp b/Marlin/src/gcode/sdcard/M32.cpp index dde94c1d89..7e838fe2f5 100644 --- a/Marlin/src/gcode/sdcard/M32.cpp +++ b/Marlin/src/gcode/sdcard/M32.cpp @@ -42,7 +42,7 @@ void GcodeSuite::M32() { if (IS_SD_PRINTING()) planner.synchronize(); - if (card.isDetected()) { + if (card.isMounted()) { const bool call_procedure = parser.boolval('P'); card.openFile(parser.string_arg, true, call_procedure); diff --git a/Marlin/src/gcode/stats/M31.cpp b/Marlin/src/gcode/stats/M31.cpp index 39c922071c..fdad76e99a 100644 --- a/Marlin/src/gcode/stats/M31.cpp +++ b/Marlin/src/gcode/stats/M31.cpp @@ -31,8 +31,8 @@ */ void GcodeSuite::M31() { char buffer[21]; - duration_t elapsed = print_job_timer.duration(); - elapsed.toString(buffer); + duration_t(print_job_timer.duration()).toString(buffer); + ui.set_status(buffer); SERIAL_ECHO_START(); diff --git a/Marlin/src/gcode/stats/M75-M78.cpp b/Marlin/src/gcode/stats/M75-M78.cpp index d8589031ed..85d36daa9b 100644 --- a/Marlin/src/gcode/stats/M75-M78.cpp +++ b/Marlin/src/gcode/stats/M75-M78.cpp @@ -24,10 +24,6 @@ #include "../../module/printcounter.h" #include "../../lcd/ultralcd.h" -#if ENABLED(EXTENSIBLE_UI) - #include "../../lcd/extensible_ui/ui_api.h" -#endif - /** * M75: Start print timer */ @@ -40,9 +36,6 @@ void GcodeSuite::M75() { */ void GcodeSuite::M76() { print_job_timer.pause(); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPrintTimerPaused(); - #endif } /** @@ -50,9 +43,6 @@ void GcodeSuite::M76() { */ void GcodeSuite::M77() { print_job_timer.stop(); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPrintTimerStopped(); - #endif } #if ENABLED(PRINTCOUNTER) diff --git a/Marlin/src/gcode/temperature/M104_M109.cpp b/Marlin/src/gcode/temperature/M104_M109.cpp index f4259abff9..86da46a89e 100644 --- a/Marlin/src/gcode/temperature/M104_M109.cpp +++ b/Marlin/src/gcode/temperature/M104_M109.cpp @@ -20,6 +20,10 @@ * */ +#include "../../inc/MarlinConfigPre.h" + +#if EXTRUDERS + #include "../gcode.h" #include "../../module/temperature.h" #include "../../module/motion.h" @@ -138,3 +142,5 @@ void GcodeSuite::M109() { if (set_temp) (void)thermalManager.wait_for_hotend(target_extruder, no_wait_for_cooling); } + +#endif // EXTRUDERS diff --git a/Marlin/src/gcode/units/M82_M83.cpp b/Marlin/src/gcode/units/M82_M83.cpp index 110701b6b0..11868b6ddc 100644 --- a/Marlin/src/gcode/units/M82_M83.cpp +++ b/Marlin/src/gcode/units/M82_M83.cpp @@ -25,9 +25,9 @@ /** * M82: Set E codes absolute (default) */ -void GcodeSuite::M82() { axis_relative_modes[E_AXIS] = false; } +void GcodeSuite::M82() { set_e_absolute(); } /** * M83: Set E codes relative while in Absolute Coordinates (G90) mode */ -void GcodeSuite::M83() { axis_relative_modes[E_AXIS] = true; } +void GcodeSuite::M83() { set_e_relative(); } diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 2d088ed30b..0e1e65c87f 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -288,7 +288,11 @@ #endif #ifndef STD_ENCODER_PULSES_PER_STEP - #define STD_ENCODER_PULSES_PER_STEP 5 + #if ENABLED(TOUCH_BUTTONS) + #define STD_ENCODER_PULSES_PER_STEP 1 + #else + #define STD_ENCODER_PULSES_PER_STEP 5 + #endif #endif #ifndef STD_ENCODER_STEPS_PER_MENU_ITEM #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index bb9ca6be30..b9b8855428 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -26,6 +26,34 @@ * Defines that depend on advanced configuration. */ +#if EXTRUDERS == 0 + #define NO_VOLUMETRICS + #undef TEMP_SENSOR_0 + #undef TEMP_SENSOR_1 + #undef TEMP_SENSOR_2 + #undef TEMP_SENSOR_3 + #undef TEMP_SENSOR_4 + #undef TEMP_SENSOR_5 + #undef FWRETRACT + #undef PIDTEMP + #undef AUTOTEMP + #undef PID_EXTRUSION_SCALING + #undef LIN_ADVANCE + #undef FILAMENT_RUNOUT_SENSOR + #undef ADVANCED_PAUSE_FEATURE + #undef FILAMENT_RUNOUT_DISTANCE_MM + #undef FILAMENT_LOAD_UNLOAD_GCODES + #undef DISABLE_INACTIVE_EXTRUDER + #undef FILAMENT_LOAD_UNLOAD_GCODES + #undef EXTRUDER_RUNOUT_PREVENT + #undef PREVENT_COLD_EXTRUSION + #undef PREVENT_LENGTHY_EXTRUDE + #undef THERMAL_PROTECTION_HOTENDS + #undef THERMAL_PROTECTION_PERIOD + #undef WATCH_TEMP_PERIOD + #undef SHOW_TEMP_ADC_VALUES +#endif + #define HAS_CUTTER EITHER(SPINDLE_FEATURE, LASER_FEATURE) #if !defined(__AVR__) || !defined(USBCON) @@ -102,3 +130,11 @@ // Extensible UI pin mapping for RepRapDiscount #define TOUCH_UI_ULTIPANEL ENABLED(LULZBOT_TOUCH_UI) && ANY(AO_EXP1_PINMAP, AO_EXP2_PINMAP, CR10_TFT_PINMAP) + +// TMC SPI Chaining +#define TMC_USE_CHAIN (X_CHAIN_POS||Y_CHAIN_POS||Z_CHAIN_POS||X2_CHAIN_POS||Y2_CHAIN_POS||Z2_CHAIN_POS||Z3_CHAIN_POS||E0_CHAIN_POS||E1_CHAIN_POS||E2_CHAIN_POS||E3_CHAIN_POS||E4_CHAIN_POS||E5_CHAIN_POS) + +// Poll-based jogging for joystick and other devices +#if ENABLED(JOYSTICK) + #define POLL_JOG +#endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index a8f251164c..d5aae1e0f8 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -43,16 +43,6 @@ #define NOT_A_PIN 0 // For PINS_DEBUGGING #endif -#if EXTRUDERS == 0 - #define NO_VOLUMETRICS - #undef FWRETRACT - #undef LIN_ADVANCE - #undef ADVANCED_PAUSE_FEATURE - #undef DISABLE_INACTIVE_EXTRUDER - #undef EXTRUDER_RUNOUT_PREVENT - #undef FILAMENT_LOAD_UNLOAD_GCODES -#endif - #define HAS_CLASSIC_JERK (IS_KINEMATIC || DISABLED(JUNCTION_DEVIATION)) /** @@ -76,20 +66,21 @@ #endif // Define center values for future use +#define _X_HALF_BED ((X_BED_SIZE) / 2) +#define _Y_HALF_BED ((Y_BED_SIZE) / 2) #if ENABLED(BED_CENTER_AT_0_0) #define X_CENTER 0 #define Y_CENTER 0 #else - #define X_CENTER ((X_BED_SIZE) / 2) - #define Y_CENTER ((Y_BED_SIZE) / 2) + #define X_CENTER _X_HALF_BED + #define Y_CENTER _Y_HALF_BED #endif -#define Z_CENTER ((Z_MIN_POS + Z_MAX_POS) / 2) // Get the linear boundaries of the bed -#define X_MIN_BED (X_CENTER - (X_BED_SIZE) / 2) -#define X_MAX_BED (X_CENTER + (X_BED_SIZE) / 2) -#define Y_MIN_BED (Y_CENTER - (Y_BED_SIZE) / 2) -#define Y_MAX_BED (Y_CENTER + (Y_BED_SIZE) / 2) +#define X_MIN_BED (X_CENTER - _X_HALF_BED) +#define X_MAX_BED (X_MIN_BED + X_BED_SIZE) +#define Y_MIN_BED (Y_CENTER - _Y_HALF_BED) +#define Y_MAX_BED (Y_MIN_BED + Y_BED_SIZE) /** * Dual X Carriage @@ -209,6 +200,10 @@ #undef SLOWDOWN #endif +#ifndef MESH_INSET + #define MESH_INSET 0 +#endif + /** * Safe Homing Options */ @@ -267,7 +262,8 @@ #define _LCD_CONTRAST_MIN 120 #define _LCD_CONTRAST_INIT 190 #elif ENABLED(MKS_MINI_12864) - #define _LCD_CONTRAST_INIT 150 + #define _LCD_CONTRAST_MIN 120 + #define _LCD_CONTRAST_INIT 195 #elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) #define _LCD_CONTRAST_INIT 220 #elif ENABLED(ULTI_CONTROLLER) @@ -538,13 +534,13 @@ /** * ARRAY_BY_EXTRUDERS based on EXTRUDERS */ -#define ARRAY_BY_EXTRUDERS(...) ARRAY_N(EXTRUDERS, __VA_ARGS__) +#define ARRAY_BY_EXTRUDERS(V...) ARRAY_N(EXTRUDERS, V) #define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1, v1, v1) /** * ARRAY_BY_HOTENDS based on HOTENDS */ -#define ARRAY_BY_HOTENDS(...) ARRAY_N(HOTENDS, __VA_ARGS__) +#define ARRAY_BY_HOTENDS(V...) ARRAY_N(HOTENDS, V) #define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1) /** @@ -555,26 +551,30 @@ #define TRINAMICS (HAS_TRINAMIC || HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC2209_STANDALONE) || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) || HAS_DRIVER(TMC5130_STANDALONE) || HAS_DRIVER(TMC5160_STANDALONE) || HAS_DRIVER(TMC2160_STANDALONE)) -#ifndef MINIMUM_STEPPER_DIR_DELAY +#ifndef MINIMUM_STEPPER_POST_DIR_DELAY #if HAS_DRIVER(TB6560) - #define MINIMUM_STEPPER_DIR_DELAY 15000 + #define MINIMUM_STEPPER_POST_DIR_DELAY 15000 #elif HAS_DRIVER(TB6600) - #define MINIMUM_STEPPER_DIR_DELAY 1500 + #define MINIMUM_STEPPER_POST_DIR_DELAY 1500 #elif HAS_DRIVER(DRV8825) - #define MINIMUM_STEPPER_DIR_DELAY 650 + #define MINIMUM_STEPPER_POST_DIR_DELAY 650 #elif HAS_DRIVER(LV8729) - #define MINIMUM_STEPPER_DIR_DELAY 500 + #define MINIMUM_STEPPER_POST_DIR_DELAY 500 #elif HAS_DRIVER(A5984) - #define MINIMUM_STEPPER_DIR_DELAY 400 + #define MINIMUM_STEPPER_POST_DIR_DELAY 400 #elif HAS_DRIVER(A4988) - #define MINIMUM_STEPPER_DIR_DELAY 200 + #define MINIMUM_STEPPER_POST_DIR_DELAY 200 #elif TRINAMICS - #define MINIMUM_STEPPER_DIR_DELAY 20 + #define MINIMUM_STEPPER_POST_DIR_DELAY 20 #else - #define MINIMUM_STEPPER_DIR_DELAY 0 // Expect at least 10µS since one Stepper ISR must transpire + #define MINIMUM_STEPPER_POST_DIR_DELAY 0 // Expect at least 10µS since one Stepper ISR must transpire #endif #endif +#ifndef MINIMUM_STEPPER_PRE_DIR_DELAY + #define MINIMUM_STEPPER_PRE_DIR_DELAY MINIMUM_STEPPER_POST_DIR_DELAY +#endif + #ifndef MINIMUM_STEPPER_PULSE #if HAS_DRIVER(TB6560) #define MINIMUM_STEPPER_PULSE 30 @@ -974,9 +974,10 @@ #if HOMING_Z_WITH_PROBE #undef Z_STALL_SENSITIVITY #endif - #define X_SENSORLESS (AXIS_HAS_STALLGUARD(X) && defined(X_STALL_SENSITIVITY)) - #define Y_SENSORLESS (AXIS_HAS_STALLGUARD(Y) && defined(Y_STALL_SENSITIVITY)) - #define Z_SENSORLESS (AXIS_HAS_STALLGUARD(Z) && defined(Z_STALL_SENSITIVITY)) + #define X_SENSORLESS (AXIS_HAS_STALLGUARD(X) && defined(X_STALL_SENSITIVITY)) + #define X2_SENSORLESS (AXIS_HAS_STALLGUARD(X2) && defined(X2_STALL_SENSITIVITY)) + #define Y_SENSORLESS (AXIS_HAS_STALLGUARD(Y) && defined(Y_STALL_SENSITIVITY)) + #define Z_SENSORLESS (AXIS_HAS_STALLGUARD(Z) && defined(Z_STALL_SENSITIVITY)) #if ENABLED(SPI_ENDSTOPS) #define X_SPI_SENSORLESS X_SENSORLESS #define Y_SPI_SENSORLESS Y_SENSORLESS @@ -1024,6 +1025,13 @@ #define HAS_TEMP_CHAMBER HAS_TEMP_ADC_CHAMBER #define HAS_HEATED_CHAMBER (HAS_TEMP_CHAMBER && PIN_EXISTS(HEATER_CHAMBER)) +#if ENABLED(JOYSTICK) + #define HAS_JOY_ADC_X PIN_EXISTS(JOY_X) + #define HAS_JOY_ADC_Y PIN_EXISTS(JOY_Y) + #define HAS_JOY_ADC_Z PIN_EXISTS(JOY_Z) + #define HAS_JOY_ADC_EN PIN_EXISTS(JOY_EN) +#endif + // Heaters #define HAS_HEATER_0 (PIN_EXISTS(HEATER_0)) #define HAS_HEATER_1 (PIN_EXISTS(HEATER_1)) @@ -1035,7 +1043,12 @@ // Shorthand for common combinations #define HAS_HEATED_BED (HAS_TEMP_BED && HAS_HEATER_BED) -#define HAS_TEMP_SENSOR (HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_TEMP_CHAMBER) +#define BED_OR_CHAMBER (HAS_HEATED_BED || HAS_TEMP_CHAMBER) +#define HAS_TEMP_SENSOR (HAS_TEMP_HOTEND || BED_OR_CHAMBER) + +#if !HAS_TEMP_SENSOR + #undef AUTO_REPORT_TEMPERATURES +#endif // PID heating #if !HAS_HEATED_BED @@ -1339,12 +1352,7 @@ #endif #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 + #undef NOZZLE_TO_PROBE_OFFSET #endif /** @@ -1437,10 +1445,25 @@ * Bed Probing rectangular bounds * These can be further constrained in code for Delta and SCARA */ - #ifndef MIN_PROBE_EDGE #define MIN_PROBE_EDGE 0 #endif +#ifndef MIN_PROBE_EDGE_LEFT + #define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE +#endif +#ifndef MIN_PROBE_EDGE_RIGHT + #define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE +#endif +#ifndef MIN_PROBE_EDGE_FRONT + #define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE +#endif +#ifndef MIN_PROBE_EDGE_BACK + #define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#ifndef NOZZLE_TO_PROBE_OFFSET + #define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } +#endif #if ENABLED(DELTA) /** @@ -1448,8 +1471,8 @@ */ #define _PROBE_RADIUS (DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) #ifndef DELTA_CALIBRATION_RADIUS - #ifdef X_PROBE_OFFSET_FROM_EXTRUDER - #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - _MAX(ABS(X_PROBE_OFFSET_FROM_EXTRUDER), ABS(Y_PROBE_OFFSET_FROM_EXTRUDER), ABS(MIN_PROBE_EDGE))) + #ifdef NOZZLE_TO_PROBE_OFFSET + #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - _MAX(ABS(nozzle_to_probe_offset[X_AXIS]), ABS(nozzle_to_probe_offset[Y_AXIS]), ABS(MIN_PROBE_EDGE))) #else #define DELTA_CALIBRATION_RADIUS _PROBE_RADIUS #endif @@ -1458,64 +1481,41 @@ #define DELTA_ENDSTOP_ADJ { 0, 0, 0 } #endif #ifndef DELTA_TOWER_ANGLE_TRIM - #define DELTA_TOWER_ANGLE_TRIM {0, 0, 0} + #define DELTA_TOWER_ANGLE_TRIM { 0, 0, 0 } #endif #ifndef DELTA_RADIUS_TRIM_TOWER - #define DELTA_RADIUS_TRIM_TOWER {0, 0, 0} + #define DELTA_RADIUS_TRIM_TOWER { 0, 0, 0 } #endif #ifndef DELTA_DIAGONAL_ROD_TRIM_TOWER - #define DELTA_DIAGONAL_ROD_TRIM_TOWER {0, 0, 0} + #define DELTA_DIAGONAL_ROD_TRIM_TOWER { 0, 0, 0 } #endif // Probing points may be verified at compile time within the radius // using static_assert(HYPOT2(X2-X1,Y2-Y1)<=sq(DELTA_PRINTABLE_RADIUS),"bad probe point!") // so that may be added to SanityCheck.h in the future. - #define _MIN_PROBE_X (X_CENTER - (_PROBE_RADIUS)) - #define _MIN_PROBE_Y (Y_CENTER - (_PROBE_RADIUS)) - #define _MAX_PROBE_X (X_CENTER + _PROBE_RADIUS) - #define _MAX_PROBE_Y (Y_CENTER + _PROBE_RADIUS) + #define PROBE_X_MIN (X_CENTER - (_PROBE_RADIUS)) + #define PROBE_Y_MIN (Y_CENTER - (_PROBE_RADIUS)) + #define PROBE_X_MAX (X_CENTER + _PROBE_RADIUS) + #define PROBE_Y_MAX (Y_CENTER + _PROBE_RADIUS) #elif IS_SCARA #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) #define _PROBE_RADIUS (SCARA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - #define _MIN_PROBE_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MIN_PROBE_EDGE) - #define _MIN_PROBE_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MIN_PROBE_EDGE) - #define _MAX_PROBE_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - #define _MAX_PROBE_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - -#else - - // Boundaries for Cartesian probing based on bed limits - #define _MIN_PROBE_X (_MAX(X_MIN_BED + MIN_PROBE_EDGE, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) - #define _MIN_PROBE_Y (_MAX(Y_MIN_BED + MIN_PROBE_EDGE, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) - #define _MAX_PROBE_X (_MIN(X_MAX_BED - (MIN_PROBE_EDGE), X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) - #define _MAX_PROBE_Y (_MIN(Y_MAX_BED - (MIN_PROBE_EDGE), Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) - + #define PROBE_X_MIN (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MIN_PROBE_EDGE_LEFT) + #define PROBE_Y_MIN (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MIN_PROBE_EDGE_FRONT) + #define PROBE_X_MAX (X_CENTER + SCARA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE_RIGHT)) + #define PROBE_Y_MAX (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE_BACK)) #endif #if ENABLED(SEGMENT_LEVELED_MOVES) && !defined(LEVELED_SEGMENT_LENGTH) #define LEVELED_SEGMENT_LENGTH 5 #endif -// These may be overridden in Configuration.h if a smaller area is desired -#ifndef MIN_PROBE_X - #define MIN_PROBE_X _MIN_PROBE_X -#endif -#ifndef MIN_PROBE_Y - #define MIN_PROBE_Y _MIN_PROBE_Y -#endif -#ifndef MAX_PROBE_X - #define MAX_PROBE_X _MAX_PROBE_X -#endif -#ifndef MAX_PROBE_Y - #define MAX_PROBE_Y _MAX_PROBE_Y -#endif - /** * Default mesh area is an area with an inset margin on the print area. */ -#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) +#if HAS_LEVELING #if IS_KINEMATIC // Probing points may be verified at compile time within the radius // using static_assert(HYPOT2(X2-X1,Y2-Y1)<=sq(DELTA_PRINTABLE_RADIUS),"bad probe point!") @@ -1526,16 +1526,16 @@ #define _MESH_MAX_Y (Y_MAX_BED - (MESH_INSET)) #else // Boundaries for Cartesian probing based on set limits - #if ENABLED(AUTO_BED_LEVELING_UBL) + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) #define _MESH_MIN_X (_MAX(X_MIN_BED + MESH_INSET, X_MIN_POS)) // UBL is careful not to probe off the bed. It does not - #define _MESH_MIN_Y (_MAX(Y_MIN_BED + MESH_INSET, Y_MIN_POS)) // need *_PROBE_OFFSET_FROM_EXTRUDER in the mesh dimensions + #define _MESH_MIN_Y (_MAX(Y_MIN_BED + MESH_INSET, Y_MIN_POS)) // need NOZZLE_TO_PROBE_OFFSET in the mesh dimensions #define _MESH_MAX_X (_MIN(X_MAX_BED - (MESH_INSET), X_MAX_POS)) #define _MESH_MAX_Y (_MIN(Y_MAX_BED - (MESH_INSET), Y_MAX_POS)) #else - #define _MESH_MIN_X (_MAX(X_MIN_BED + MESH_INSET, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) - #define _MESH_MIN_Y (_MAX(Y_MIN_BED + MESH_INSET, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) - #define _MESH_MAX_X (_MIN(X_MAX_BED - (MESH_INSET), X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) - #define _MESH_MAX_Y (_MIN(Y_MAX_BED - (MESH_INSET), Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) + #define _MESH_MIN_X (_MAX(X_MIN_BED + MESH_INSET, X_MIN_POS + nozzle_to_probe_offset[X_AXIS])) + #define _MESH_MIN_Y (_MAX(Y_MIN_BED + MESH_INSET, Y_MIN_POS + nozzle_to_probe_offset[Y_AXIS])) + #define _MESH_MAX_X (_MIN(X_MAX_BED - (MESH_INSET), X_MAX_POS + nozzle_to_probe_offset[X_AXIS])) + #define _MESH_MAX_Y (_MIN(Y_MAX_BED - (MESH_INSET), Y_MAX_POS + nozzle_to_probe_offset[Y_AXIS])) #endif #endif @@ -1555,8 +1555,12 @@ #endif // MESH_BED_LEVELING || AUTO_BED_LEVELING_UBL -#if EITHER(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_3POINT) - #if IS_KINEMATIC +#if ALL(PROBE_PT_1_X, PROBE_PT_2_X, PROBE_PT_3_X, PROBE_PT_1_Y, PROBE_PT_2_Y, PROBE_PT_3_Y) + #define HAS_FIXED_3POINT; +#endif + +#if EITHER(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_3POINT) && IS_KINEMATIC + #define HAS_FIXED_3POINT #define SIN0 0.0 #define SIN120 0.866025 #define SIN240 -0.866025 @@ -1581,41 +1585,6 @@ #ifndef PROBE_PT_3_Y #define PROBE_PT_3_Y (Y_CENTER + (_PROBE_RADIUS) * SIN240) #endif - #else - #ifndef PROBE_PT_1_X - #define PROBE_PT_1_X MIN_PROBE_X - #endif - #ifndef PROBE_PT_1_Y - #define PROBE_PT_1_Y MIN_PROBE_Y - #endif - #ifndef PROBE_PT_2_X - #define PROBE_PT_2_X MAX_PROBE_X - #endif - #ifndef PROBE_PT_2_Y - #define PROBE_PT_2_Y MIN_PROBE_Y - #endif - #ifndef PROBE_PT_3_X - #define PROBE_PT_3_X X_CENTER - #endif - #ifndef PROBE_PT_3_Y - #define PROBE_PT_3_Y MAX_PROBE_Y - #endif - #endif -#endif - -#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) - #ifndef LEFT_PROBE_BED_POSITION - #define LEFT_PROBE_BED_POSITION MIN_PROBE_X - #endif - #ifndef RIGHT_PROBE_BED_POSITION - #define RIGHT_PROBE_BED_POSITION MAX_PROBE_X - #endif - #ifndef FRONT_PROBE_BED_POSITION - #define FRONT_PROBE_BED_POSITION MIN_PROBE_Y - #endif - #ifndef BACK_PROBE_BED_POSITION - #define BACK_PROBE_BED_POSITION MAX_PROBE_Y - #endif #endif /** @@ -1813,13 +1782,13 @@ #endif #endif -// -// The external SD card is not used. Hardware SPI is used to access the card. -// When sharing the SD card with a PC we want the menu options to -// mount/unmount the card and refresh it. So we disable card detect. -// #if ENABLED(SDSUPPORT) #if SD_CONNECTION_IS(ONBOARD) && DISABLED(NO_SD_HOST_DRIVE) + // + // The external SD card is not used. Hardware SPI is used to access the card. + // When sharing the SD card with a PC we want the menu options to + // mount/unmount the card and refresh it. So we disable card detect. + // #undef SD_DETECT_PIN #define SHARED_SD_CARD #endif diff --git a/Marlin/src/inc/MarlinConfigPre.h b/Marlin/src/inc/MarlinConfigPre.h index 63c5a6095d..96ee5d347c 100644 --- a/Marlin/src/inc/MarlinConfigPre.h +++ b/Marlin/src/inc/MarlinConfigPre.h @@ -21,11 +21,14 @@ */ #pragma once +#ifndef __MARLIN_FIRMWARE__ #define __MARLIN_FIRMWARE__ +#endif // // Prefix header to acquire configurations // +#include #include "../HAL/platforms.h" diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index f1ea163952..e60c747cc0 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -248,9 +248,17 @@ #elif defined(UBL_MESH_MIN_X) || defined(UBL_MESH_MIN_Y) || defined(UBL_MESH_MAX_X) || defined(UBL_MESH_MAX_Y) #error "UBL_MESH_(MIN|MAX)_[XY] is now just MESH_(MIN|MAX)_[XY]. Please update your configuration." #elif defined(ABL_PROBE_PT_1_X) || defined(ABL_PROBE_PT_1_Y) || defined(ABL_PROBE_PT_2_X) || defined(ABL_PROBE_PT_2_Y) || defined(ABL_PROBE_PT_3_X) || defined(ABL_PROBE_PT_3_Y) - #error "ABL_PROBE_PT_[123]_[XY] is now PROBE_PT_[123]_[XY]. Please update your configuration." + #error "ABL_PROBE_PT_[123]_[XY] is no longer required. Please remove it from Configuration.h." #elif defined(UBL_PROBE_PT_1_X) || defined(UBL_PROBE_PT_1_Y) || defined(UBL_PROBE_PT_2_X) || defined(UBL_PROBE_PT_2_Y) || defined(UBL_PROBE_PT_3_X) || defined(UBL_PROBE_PT_3_Y) - #error "UBL_PROBE_PT_[123]_[XY] is now PROBE_PT_[123]_[XY]. Please update your configuration." + #error "UBL_PROBE_PT_[123]_[XY] is no longer required. Please remove it from Configuration.h." +#elif defined(LEFT_PROBE_BED_POSITION) + #error "LEFT_PROBE_BED_POSITION has been replaced by MIN_PROBE_EDGE_LEFT. Please note the differences and update your configuration." +#elif defined(RIGHT_PROBE_BED_POSITION) + #error "RIGHT_PROBE_BED_POSITION has been replaced by MIN_PROBE_EDGE_RIGHT. Please note the differences and update your configuration." +#elif defined(FRONT_PROBE_BED_POSITION) + #error "FRONT_PROBE_BED_POSITION has been replaced by MIN_PROBE_EDGE_FRONT. Please note the differences and update your configuration." +#elif defined(BACK_PROBE_BED_POSITION) + #error "BACK_PROBE_BED_POSITION has been replaced by MIN_PROBE_EDGE_BACK. Please note the differences and update your configuration." #elif defined(ENABLE_MESH_EDIT_GFX_OVERLAY) #error "ENABLE_MESH_EDIT_GFX_OVERLAY is now MESH_EDIT_GFX_OVERLAY. Please update your configuration." #elif defined(BABYSTEP_ZPROBE_GFX_REVERSE) @@ -386,13 +394,22 @@ #error "MKS_ROBIN_TFT is now FSMC_GRAPHICAL_TFT. Please update your configuration." #elif defined(SDPOWER) #error "SDPOWER is now SDPOWER_PIN. Please update your configuration and/or pins." +#elif defined(STRING_SPLASH_LINE1) || defined(STRING_SPLASH_LINE2) + #error "STRING_SPLASH_LINE[12] are now obsolete. Please remove them from Configuration.h." +#elif defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_X) + #error "Z_PROBE_ALLEN_KEY_(DEPLOY|STOW) coordinates are now a single setting. Please update your configuration." +#elif defined(X_PROBE_OFFSET_FROM_EXTRUDER) || defined(Y_PROBE_OFFSET_FROM_EXTRUDER) || defined(Z_PROBE_OFFSET_FROM_EXTRUDER) + #error "[XYZ]_PROBE_OFFSET_FROM_EXTRUDER is now NOZZLE_TO_PROBE_OFFSET. Please update your configuration." +#elif defined(MIN_PROBE_X) || defined(MIN_PROBE_Y) || defined(MAX_PROBE_X) || defined(MAX_PROBE_Y) + #error "(MIN|MAX)_PROBE_[XY] are now calculated at runtime. Please remove them from Configuration.h." #endif -#define BOARD_MKS_13 -1109 -#define BOARD_TRIGORILLA -1131 -#define BOARD_RURAMPS4D -3020 -#define BOARD_FORMBOT_TREX2 -1125 -#define BOARD_BIQU_SKR_V1_1 -2014 +#define BOARD_MKS_13 -1000 +#define BOARD_TRIGORILLA -1001 +#define BOARD_RURAMPS4D -1002 +#define BOARD_FORMBOT_TREX2 -1003 +#define BOARD_BIQU_SKR_V1_1 -1004 +#define BOARD_STM32F1R -1005 #if MB(MKS_13) #error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration." #elif MB(TRIGORILLA) @@ -401,14 +418,17 @@ #error "BOARD_RURAMPS4D has been renamed BOARD_RURAMPS4D_11. Please update your configuration." #elif MB(FORMBOT_TREX2) #error "FORMBOT_TREX2 has been renamed BOARD_FORMBOT_TREX2PLUS. Please update your configuration." -#elif MB(BOARD_BIQU_SKR_V1_1) - #error "BIQU_SKR_V1_1 has been renamed BOARD_BIGTREE_SKR_V1_1. Please update your configuration." +#elif MB(BIQU_SKR_V1_1) + #error "BOARD_BIQU_SKR_V1_1 has been renamed BOARD_BIGTREE_SKR_V1_1. Please update your configuration." +#elif MB(STM32F1R) + #error "BOARD_STM32F1R has been renamed BOARD_STM32F103R. Please update your configuration." #endif #undef BOARD_MKS_13 #undef BOARD_TRIGORILLA #undef BOARD_RURAMPS4D #undef BOARD_FORMBOT_TREX2 #undef BOARD_BIQU_SKR_V1_1 +#undef BOARD_STM32F1R /** * Marlin release, version and default string @@ -555,6 +575,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Graphical LCD, or EXTENSIBLE_UI." #endif +#if !HAS_LCD_MENU && ENABLED(SD_REPRINT_LAST_SELECTED_FILE) + #error "SD_REPRINT_LAST_SELECTED_FILE currently requires a Marlin-native LCD menu." +#endif + /** * Custom Boot and Status screens */ @@ -825,7 +849,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS */ #if ENABLED(MIXING_EXTRUDER) #if EXTRUDERS > 1 - #error "MIXING_EXTRUDER currently only supports one extruder." + #error "For MIXING_EXTRUDER set MIXING_STEPPERS > 1 instead of EXTRUDERS > 1." #elif MIXING_STEPPERS < 2 #error "You must set MIXING_STEPPERS >= 2 for a mixing extruder." #elif ENABLED(FILAMENT_SENSOR) @@ -890,7 +914,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * Switching Toolhead requirements */ #if ENABLED(SWITCHING_TOOLHEAD) - #if !defined(SWITCHING_TOOLHEAD_SERVO_NR) + #ifndef SWITCHING_TOOLHEAD_SERVO_NR #error "SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_SERVO_NR." #elif EXTRUDERS < 2 #error "SWITCHING_TOOLHEAD requires at least 2 EXTRUDERS." @@ -1032,15 +1056,13 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS + ENABLED(SOLENOID_PROBE) \ + ENABLED(Z_PROBE_ALLEN_KEY) \ + ENABLED(Z_PROBE_SLED) \ - + ENABLED(RACK_AND_PINION_PROBE) - #error "Please enable only one probe option: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo." + + ENABLED(RACK_AND_PINION_PROBE) \ + + ENABLED(SENSORLESS_PROBING) + #error "Please enable only one probe option: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, FIX_MOUNTED_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo." #endif #if HAS_BED_PROBE - static_assert(FLOOR(float(X_PROBE_OFFSET_FROM_EXTRUDER)) == float(X_PROBE_OFFSET_FROM_EXTRUDER), "X_PROBE_OFFSET_FROM_EXTRUDER must be an integer!"); - static_assert(FLOOR(float(Y_PROBE_OFFSET_FROM_EXTRUDER)) == float(Y_PROBE_OFFSET_FROM_EXTRUDER), "Y_PROBE_OFFSET_FROM_EXTRUDER must be an integer!"); - /** * Z_PROBE_SLED is incompatible with DELTA */ @@ -1106,6 +1128,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING to be set to false." #elif DISABLED(BABYSTEP_ZPROBE_OFFSET) #error "TOUCH_MI_PROBE requires BABYSTEPPING with BABYSTEP_ZPROBE_OFFSET." + #elif !HAS_RESUME_CONTINUE + #error "TOUCH_MI_PROBE currently requires an LCD controller or EMERGENCY_PARSER." #endif #endif @@ -1190,15 +1214,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * Bed Leveling Requirements */ -#if EITHER(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_3POINT) - static_assert(WITHIN(PROBE_PT_1_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_1_X is outside the probe region."); - static_assert(WITHIN(PROBE_PT_2_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_2_X is outside the probe region."); - static_assert(WITHIN(PROBE_PT_3_X, MIN_PROBE_X, MAX_PROBE_X), "PROBE_PT_3_X is outside the probe region."); - static_assert(WITHIN(PROBE_PT_1_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_1_Y is outside the probe region."); - static_assert(WITHIN(PROBE_PT_2_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_2_Y is outside the probe region."); - static_assert(WITHIN(PROBE_PT_3_Y, MIN_PROBE_Y, MAX_PROBE_Y), "PROBE_PT_3_Y is outside the probe region."); -#endif - #if ENABLED(AUTO_BED_LEVELING_UBL) /** @@ -1231,20 +1246,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "SCARA machines can only use the AUTO_BED_LEVELING_BILINEAR leveling option." #endif - /** - * Check auto bed leveling probe points - */ - #if ABL_GRID - - static_assert(LEFT_PROBE_BED_POSITION < RIGHT_PROBE_BED_POSITION, "LEFT_PROBE_BED_POSITION must be less than RIGHT_PROBE_BED_POSITION."); - static_assert(FRONT_PROBE_BED_POSITION < BACK_PROBE_BED_POSITION, "FRONT_PROBE_BED_POSITION must be less than BACK_PROBE_BED_POSITION."); - static_assert(LEFT_PROBE_BED_POSITION >= MIN_PROBE_X, "LEFT_PROBE_BED_POSITION is outside the probe region."); - static_assert(RIGHT_PROBE_BED_POSITION <= MAX_PROBE_X, "RIGHT_PROBE_BED_POSITION is outside the probe region."); - static_assert(FRONT_PROBE_BED_POSITION >= MIN_PROBE_Y, "FRONT_PROBE_BED_POSITION is outside the probe region."); - static_assert(BACK_PROBE_BED_POSITION <= MAX_PROBE_Y, "BACK_PROBE_BED_POSITION is outside the probe region."); - - #endif - #elif ENABLED(MESH_BED_LEVELING) // Hide PROBE_MANUALLY from the rest of the code @@ -1312,9 +1313,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * Make sure Z_SAFE_HOMING point is reachable */ #if ENABLED(Z_SAFE_HOMING) - #if HAS_BED_PROBE - static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, MIN_PROBE_X, MAX_PROBE_X), "Z_SAFE_HOMING_X_POINT is outside the probe region."); - static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, MIN_PROBE_Y, MAX_PROBE_Y), "Z_SAFE_HOMING_Y_POINT is outside the probe region."); + #if HAS_BED_PROBE && (ENABLED(DELTA) || IS_SCARA) + static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, PROBE_X_MIN, PROBE_X_MAX), "Z_SAFE_HOMING_X_POINT is outside the probe region."); + static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, PROBE_Y_MIN, PROBE_Y_MAX), "Z_SAFE_HOMING_Y_POINT is outside the probe region."); #else static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, X_MIN_POS, X_MAX_POS), "Z_SAFE_HOMING_X_POINT can't be reached by the nozzle."); static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle."); @@ -1468,8 +1469,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board." #elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP, E0_DIR) || !HAS_E0_ENABLE)) #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board." -#elif TEMP_SENSOR_0 == 0 - #error "TEMP_SENSOR_0 is required." +#elif EXTRUDERS && TEMP_SENSOR_0 == 0 + #error "TEMP_SENSOR_0 is required with any extruders." #endif // Pins are required for heaters @@ -2024,18 +2025,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * TMC2208/2209 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI) */ #if HAS_TMC220x && !defined(TARGET_LPC1768) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \ - defined(X_HARDWARE_SERIAL ) \ - || defined(X2_HARDWARE_SERIAL) \ - || defined(Y_HARDWARE_SERIAL ) \ - || defined(Y2_HARDWARE_SERIAL) \ - || defined(Z_HARDWARE_SERIAL ) \ - || defined(Z2_HARDWARE_SERIAL) \ - || defined(Z3_HARDWARE_SERIAL) \ - || defined(E0_HARDWARE_SERIAL) \ - || defined(E1_HARDWARE_SERIAL) \ - || defined(E2_HARDWARE_SERIAL) \ - || defined(E3_HARDWARE_SERIAL) \ - || defined(E4_HARDWARE_SERIAL) \ + defined(X_HARDWARE_SERIAL ) || defined(X2_HARDWARE_SERIAL) \ + || defined(Y_HARDWARE_SERIAL ) || defined(Y2_HARDWARE_SERIAL) \ + || defined(Z_HARDWARE_SERIAL ) || defined(Z2_HARDWARE_SERIAL) \ + || defined(Z3_HARDWARE_SERIAL) || defined(E0_HARDWARE_SERIAL) \ + || defined(E1_HARDWARE_SERIAL) || defined(E2_HARDWARE_SERIAL) \ + || defined(E3_HARDWARE_SERIAL) || defined(E4_HARDWARE_SERIAL) \ || defined(E5_HARDWARE_SERIAL) ) #error "Select hardware UART for TMC2208 to use both TMC2208 and ENDSTOP_INTERRUPTS_FEATURE." #endif @@ -2044,18 +2039,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * TMC2208/2209 software UART is only supported on AVR, LPC, STM32F1 and STM32F4 */ #if HAS_TMC220x && !defined(__AVR__) && !defined(TARGET_LPC1768) && !defined(TARGET_STM32F1) && !defined(TARGET_STM32F4) && !( \ - defined(X_HARDWARE_SERIAL ) \ - || defined(X2_HARDWARE_SERIAL) \ - || defined(Y_HARDWARE_SERIAL ) \ - || defined(Y2_HARDWARE_SERIAL) \ - || defined(Z_HARDWARE_SERIAL ) \ - || defined(Z2_HARDWARE_SERIAL) \ - || defined(Z3_HARDWARE_SERIAL) \ - || defined(E0_HARDWARE_SERIAL) \ - || defined(E1_HARDWARE_SERIAL) \ - || defined(E2_HARDWARE_SERIAL) \ - || defined(E3_HARDWARE_SERIAL) \ - || defined(E4_HARDWARE_SERIAL) \ + defined(X_HARDWARE_SERIAL ) || defined(X2_HARDWARE_SERIAL) \ + || defined(Y_HARDWARE_SERIAL ) || defined(Y2_HARDWARE_SERIAL) \ + || defined(Z_HARDWARE_SERIAL ) || defined(Z2_HARDWARE_SERIAL) \ + || defined(Z3_HARDWARE_SERIAL) || defined(E0_HARDWARE_SERIAL) \ + || defined(E1_HARDWARE_SERIAL) || defined(E2_HARDWARE_SERIAL) \ + || defined(E3_HARDWARE_SERIAL) || defined(E4_HARDWARE_SERIAL) \ || defined(E5_HARDWARE_SERIAL) ) #error "TMC2208 Software Serial is supported only on AVR, LPC1768, STM32F1 and STM32F4 platforms." #endif @@ -2074,18 +2063,54 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if ENABLED(DELTA) && !BOTH(STEALTHCHOP_XY, STEALTHCHOP_Z) #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP_XY and STEALTHCHOP_Z." - #elif X_SENSORLESS && X_HOME_DIR < 0 && (X_MIN_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_XMIN)) - #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMIN when homing to X_MIN." - #elif X_SENSORLESS && X_HOME_DIR > 0 && (X_MAX_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_XMAX)) - #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMAX when homing to X_MAX." - #elif Y_SENSORLESS && Y_HOME_DIR < 0 && (Y_MIN_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_YMIN)) - #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMIN when homing to Y_MIN." - #elif Y_SENSORLESS && Y_HOME_DIR > 0 && (Y_MAX_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_YMAX)) - #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMAX when homing to Y_MAX." - #elif Z_SENSORLESS && Z_HOME_DIR < 0 && (Z_MIN_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_ZMIN)) - #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMIN when homing to Z_MIN." - #elif Z_SENSORLESS && Z_HOME_DIR > 0 && (Z_MAX_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_ZMAX)) - #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMAX when homing to Z_MAX." + #elif X_SENSORLESS && X_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUPS, ENDSTOPPULLUP_XMIN) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMIN (or ENDSTOPPULLUPS) when homing to X_MIN." + #elif X_SENSORLESS && X_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUPS, ENDSTOPPULLUP_XMAX) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMAX (or ENDSTOPPULLUPS) when homing to X_MAX." + #elif Y_SENSORLESS && Y_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUPS, ENDSTOPPULLUP_YMIN) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMIN (or ENDSTOPPULLUPS) when homing to Y_MIN." + #elif Y_SENSORLESS && Y_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUPS, ENDSTOPPULLUP_YMAX) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMAX (or ENDSTOPPULLUPS) when homing to Y_MAX." + #elif Z_SENSORLESS && Z_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) when homing to Z_MIN." + #elif Z_SENSORLESS && Z_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMAX) + #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) when homing to Z_MAX." + #elif X_SENSORLESS && X_HOME_DIR < 0 && X_MIN_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING + #if X_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = true when homing to X_MIN." + #else + #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to X_MIN." + #endif + #elif X_SENSORLESS && X_HOME_DIR > 0 && X_MAX_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING + #if X_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = true when homing to X_MAX." + #else + #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to X_MAX." + #endif + #elif Y_SENSORLESS && Y_HOME_DIR < 0 && Y_MIN_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING + #if Y_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = true when homing to Y_MIN." + #else + #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MIN." + #endif + #elif Y_SENSORLESS && Y_HOME_DIR > 0 && Y_MAX_ENDSTOP_INVERTING != Y_ENDSTOP_INVERTING + #if Y_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = true when homing to Y_MAX." + #else + #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Y_MAX." + #endif + #elif Z_SENSORLESS && Z_HOME_DIR < 0 && Z_MIN_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING + #if Z_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = true when homing to Z_MIN." + #else + #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MIN." + #endif + #elif Z_SENSORLESS && Z_HOME_DIR > 0 && Z_MAX_ENDSTOP_INVERTING != Z_ENDSTOP_INVERTING + #if Z_ENDSTOP_INVERTING + #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = true when homing to Z_MAX." + #else + #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MAX." + #endif #elif ENDSTOP_NOISE_THRESHOLD #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_THRESHOLD." #elif !(X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS) @@ -2126,6 +2151,70 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "STEALTHCHOP requires TMC2130, TMC2160, TMC2208, TMC2209, or TMC5160 stepper drivers." #endif +#if TMC_USE_CHAIN + #if (X_CHAIN_POS && !PIN_EXISTS(X_CS) ) \ + || (Y_CHAIN_POS && !PIN_EXISTS(Y_CS) ) \ + || (Z_CHAIN_POS && !PIN_EXISTS(Z_CS) ) \ + || (X2_CHAIN_POS && !PIN_EXISTS(X2_CS)) \ + || (Y2_CHAIN_POS && !PIN_EXISTS(Y2_CS)) \ + || (Z2_CHAIN_POS && !PIN_EXISTS(Z2_CS)) \ + || (Z3_CHAIN_POS && !PIN_EXISTS(Z3_CS)) \ + || (E0_CHAIN_POS && !PIN_EXISTS(E0_CS)) \ + || (E1_CHAIN_POS && !PIN_EXISTS(E1_CS)) \ + || (E2_CHAIN_POS && !PIN_EXISTS(E2_CS)) \ + || (E3_CHAIN_POS && !PIN_EXISTS(E3_CS)) \ + || (E4_CHAIN_POS && !PIN_EXISTS(E4_CS)) \ + || (E5_CHAIN_POS && !PIN_EXISTS(E5_CS)) + #error "With TMC_USE_CHAIN all chained TMC drivers need a CS pin." + #else + #if X_CHAIN_POS + #define CS_COMPARE X_CS_PIN + #elif Y_CHAIN_POS + #define CS_COMPARE Y_CS_PIN + #elif Z_CHAIN_POS + #define CS_COMPARE Z_CS_PIN + #elif X2_CHAIN_POS + #define CS_COMPARE X2_CS_PIN + #elif Y2_CHAIN_POS + #define CS_COMPARE Y2_CS_PIN + #elif Z2_CHAIN_POS + #define CS_COMPARE Z2_CS_PIN + #elif Z3_CHAIN_POS + #define CS_COMPARE Z3_CS_PIN + #elif E0_CHAIN_POS + #define CS_COMPARE E0_CS_PIN + #elif E1_CHAIN_POS + #define CS_COMPARE E1_CS_PIN + #elif E2_CHAIN_POS + #define CS_COMPARE E2_CS_PIN + #elif E3_CHAIN_POS + #define CS_COMPARE E3_CS_PIN + #elif E4_CHAIN_POS + #define CS_COMPARE E4_CS_PIN + #elif E5_CHAIN_POS + #define CS_COMPARE E5_CS_PIN + #else + #error "With TMC_USE_CHAIN some TMC drivers should be chained." + #endif + #if (X_CHAIN_POS && X_CS_PIN != CS_COMPARE) \ + || (Y_CHAIN_POS && Y_CS_PIN != CS_COMPARE) \ + || (Z_CHAIN_POS && Z_CS_PIN != CS_COMPARE) \ + || (X2_CHAIN_POS && X2_CS_PIN != CS_COMPARE) \ + || (Y2_CHAIN_POS && Y2_CS_PIN != CS_COMPARE) \ + || (Z2_CHAIN_POS && Z2_CS_PIN != CS_COMPARE) \ + || (Z3_CHAIN_POS && Z3_CS_PIN != CS_COMPARE) \ + || (E0_CHAIN_POS && E0_CS_PIN != CS_COMPARE) \ + || (E1_CHAIN_POS && E1_CS_PIN != CS_COMPARE) \ + || (E2_CHAIN_POS && E2_CS_PIN != CS_COMPARE) \ + || (E3_CHAIN_POS && E3_CS_PIN != CS_COMPARE) \ + || (E4_CHAIN_POS && E4_CS_PIN != CS_COMPARE) \ + || (E5_CHAIN_POS && E5_CS_PIN != CS_COMPARE) + #error "With TMC_USE_CHAIN all TMC drivers must use the same CS pin." + #endif + #endif + #undef CS_COMPARE +#endif // TMC_USE_CHAIN + #if ENABLED(DELTA) && (ENABLED(STEALTHCHOP_XY) != ENABLED(STEALTHCHOP_Z)) #error "STEALTHCHOP_XY and STEALTHCHOP_Z must be the same on DELTA." #endif @@ -2215,7 +2304,7 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) constexpr float sanity_arr_z_align_x[] = Z_STEPPER_ALIGN_X, sanity_arr_z_align_y[] = Z_STEPPER_ALIGN_Y; static_assert( COUNT(sanity_arr_z_align_x) == Z_STEPPER_COUNT && COUNT(sanity_arr_z_align_y) == Z_STEPPER_COUNT, - "Z_STEPPER_ALIGN_[XY]POS settings require one element per Z stepper." + "Z_STEPPER_ALIGN_[XY] settings require one element per Z stepper." ); #endif @@ -2258,8 +2347,16 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #endif #endif -#if ENABLED(BACKLASH_COMPENSATION) && IS_CORE - #error "BACKLASH_COMPENSATION is incompatible with CORE kinematics." +#if ENABLED(BACKLASH_COMPENSATION) + #if IS_CORE + #error "BACKLASH_COMPENSATION is incompatible with CORE kinematics." + #endif + #ifndef BACKLASH_DISTANCE_MM + #error "BACKLASH_COMPENSATION requires BACKLASH_DISTANCE_MM" + #endif + #ifndef BACKLASH_CORRECTION + #error "BACKLASH_COMPENSATION requires BACKLASH_CORRECTION" + #endif #endif #if ENABLED(GRADIENT_MIX) && MIXING_VIRTUAL_TOOLS < 2 diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 7551ce96c9..ca5a51c4b7 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -38,7 +38,7 @@ /** * Marlin release version identifier */ - #define SHORT_BUILD_VERSION "2.0.x_R1" + #define SHORT_BUILD_VERSION "2.0.x_R3" /** * Verbose version identifier which should contain a reference to the location @@ -51,7 +51,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ - #define STRING_DISTRIBUTION_DATE "2019-08-25" + #define STRING_DISTRIBUTION_DATE "2019-09-28" /** * Required minimum Configuration.h and Configuration_adv.h file versions. diff --git a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp index 781e76d379..af1fa56460 100644 --- a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp +++ b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp @@ -29,7 +29,7 @@ #endif extern LCD_CLASS lcd; -int lcd_glyph_height(void) { return 1; } +int lcd_glyph_height() { return 1; } typedef struct _hd44780_charmap_t { wchar_t uchar; // the unicode char @@ -1012,7 +1012,7 @@ int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) { return 0; } - int test_hd44780_charmap_all(void) { + int test_hd44780_charmap_all() { int flg_error = 0; if (test_hd44780_charmap(g_hd44780_charmap_device, COUNT(g_hd44780_charmap_device), "g_hd44780_charmap_device", 0) < 0) { flg_error = 1; diff --git a/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp b/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp index 47666857b3..1465637504 100644 --- a/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp @@ -47,7 +47,7 @@ #endif #if ENABLED(AUTO_BED_LEVELING_UBL) - #include "../../feature/bedlevel/ubl/ubl.h" + #include "../../feature/bedlevel/bedlevel.h" #endif // @@ -371,8 +371,8 @@ bool MarlinUI::detected() { #if HAS_SLOW_BUTTONS uint8_t MarlinUI::read_slow_buttons() { #if ENABLED(LCD_I2C_TYPE_MCP23017) - // Reading these buttons this is likely to be too slow to call inside interrupt context - // so they are called during normal lcd_update + // Reading these buttons is too slow for interrupt context + // so they are read during LCD update in the main loop. uint8_t slow_bits = lcd.readButtons() #if !BUTTON_EXISTS(ENC) << B_I2C_BTN_OFFSET @@ -381,7 +381,7 @@ bool MarlinUI::detected() { #if ENABLED(LCD_I2C_VIKI) if ((slow_bits & (B_MI | B_RI)) && PENDING(millis(), next_button_update_ms)) // LCD clicked slow_bits &= ~(B_MI | B_RI); // Disable LCD clicked buttons if screen is updated - #endif // LCD_I2C_VIKI + #endif return slow_bits; #endif // LCD_I2C_TYPE_MCP23017 } @@ -449,59 +449,28 @@ void MarlinUI::clear_lcd() { lcd.clear(); } lcd_scroll(0, 3, PSTR(STRING), LCD_WIDTH, DELAY); \ } - #ifdef STRING_SPLASH_LINE1 + // + // Show the Marlin logo with splash line 1 + // + if (LCD_EXTRA_SPACE >= utf8_strlen(SHORT_BUILD_VERSION) + 1) { // - // Show the Marlin logo with splash line 1 + // Show the Marlin logo, splash line1, and splash line 2 // - if (LCD_EXTRA_SPACE >= utf8_strlen(STRING_SPLASH_LINE1) + 1) { - // - // Show the Marlin logo, splash line1, and splash line 2 - // - logo_lines(PSTR(" " STRING_SPLASH_LINE1)); - #ifdef STRING_SPLASH_LINE2 - CENTER_OR_SCROLL(STRING_SPLASH_LINE2, 2000); - #else - safe_delay(2000); - #endif - } - else { - // - // Show the Marlin logo with splash line 1 - // After a delay show splash line 2, if it exists - // - #ifdef STRING_SPLASH_LINE2 - #define _SPLASH_WAIT_1 1500 - #else - #define _SPLASH_WAIT_1 2000 - #endif - logo_lines(PSTR("")); - CENTER_OR_SCROLL(STRING_SPLASH_LINE1, _SPLASH_WAIT_1); - #ifdef STRING_SPLASH_LINE2 - CENTER_OR_SCROLL(STRING_SPLASH_LINE2, 1500); - #ifdef STRING_SPLASH_LINE3 - CENTER_OR_SCROLL(STRING_SPLASH_LINE3, 1500); - #endif - #endif - } - #elif defined(STRING_SPLASH_LINE2) + logo_lines(PSTR(" " SHORT_BUILD_VERSION)); + CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 2000); + } + else { // - // Show splash line 2 only, alongside the logo if possible - // - if (LCD_EXTRA_SPACE >= utf8_strlen(STRING_SPLASH_LINE2) + 1) { - logo_lines(PSTR(" " STRING_SPLASH_LINE2)); - safe_delay(2000); - } - else { - logo_lines(PSTR("")); - CENTER_OR_SCROLL(STRING_SPLASH_LINE2, 2000); - } - #else - // - // Show only the Marlin logo + // Show the Marlin logo and short build version + // After a delay show the website URL // logo_lines(PSTR("")); - safe_delay(2000); - #endif + CENTER_OR_SCROLL(SHORT_BUILD_VERSION, 1500); + CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 1500); + #ifdef STRING_SPLASH_LINE3 + CENTER_OR_SCROLL(STRING_SPLASH_LINE3, 1500); + #endif + } lcd.clear(); safe_delay(100); @@ -585,11 +554,13 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const char pref FORCE_INLINE void _draw_bed_status(const bool blink) { _draw_heater_status(H_BED, ( - #if HAS_LEVELING - planner.leveling_active && blink ? '_' : - #endif - LCD_STR_BEDTEMP[0] - ), blink); + #if HAS_LEVELING + planner.leveling_active && blink ? '_' : + #endif + LCD_STR_BEDTEMP[0] + ), + blink + ); } #if HAS_PRINT_PROGRESS @@ -651,14 +622,9 @@ void MarlinUI::draw_status_message(const bool blink) { // Alternate Status message and Filament display if (ELAPSED(millis(), next_filament_display)) { lcd_put_u8str_P(PSTR("Dia ")); - lcd_put_u8str(ftostr12ns(filament_width_meas)); + lcd_put_u8str(ftostr12ns(filwidth.measured_mm)); lcd_put_u8str_P(PSTR(" V")); - lcd_put_u8str(i16tostr3(100.0 * ( - parser.volumetric_enabled - ? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - : planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - ) - )); + lcd_put_u8str(i16tostr3(planner.volumetric_percent(parser.volumetric_enabled))); lcd_put_wchar('%'); return; } @@ -895,7 +861,11 @@ void MarlinUI::draw_status_screen() { char c; uint16_t per; #if HAS_FAN0 - if (blink || thermalManager.fan_speed_scaler[0] < 128) { + if (true + #if EXTRUDERS + && (blink || thermalManager.fan_speed_scaler[0] < 128) + #endif + ) { uint16_t spd = thermalManager.fan_speed[0]; if (blink) c = 'F'; #if ENABLED(ADAPTIVE_FAN_SLOWING) @@ -906,8 +876,10 @@ void MarlinUI::draw_status_screen() { else #endif { - c = 'E'; - per = planner.flow_percentage[0]; + #if EXTRUDERS + c = 'E'; + per = planner.flow_percentage[0]; + #endif } lcd_put_wchar(c); lcd_put_u8str(i16tostr3(per)); @@ -993,6 +965,8 @@ void MarlinUI::draw_status_screen() { #if HAS_LCD_MENU + #include "../menu/menu.h" + #if ENABLED(ADVANCED_PAUSE_FEATURE) void MarlinUI::draw_hotend_status(const uint8_t row, const uint8_t extruder) { @@ -1004,11 +978,10 @@ void MarlinUI::draw_status_screen() { #endif // ADVANCED_PAUSE_FEATURE - void draw_menu_item_static(const uint8_t row, PGM_P pstr, const bool center/*=true*/, const bool invert/*=false*/, const char *valstr/*=nullptr*/) { - UNUSED(invert); + void draw_menu_item_static(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_CENTER*/, const char * const valstr/*=nullptr*/) { int8_t n = LCD_WIDTH; lcd_moveto(0, row); - if (center && !valstr) { + if ((style & SS_CENTER) && !valstr) { int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; while (--pad >= 0) { lcd_put_wchar(' '); n--; } } diff --git a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h index 6412e59869..427685cadb 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h +++ b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h @@ -23,78 +23,99 @@ // Use this file to select the com driver for device drivers that are NOT in the U8G library +#include + #ifndef U8G_HAL_LINKS #ifdef __SAM3X8E__ + uint8_t u8g_com_HAL_DUE_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_DUE_sw_spi_fn uint8_t u8g_com_HAL_DUE_shared_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_HW_SPI_FN u8g_com_HAL_DUE_shared_hw_spi_fn uint8_t u8g_com_HAL_DUE_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); + #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_DUE_sw_spi_fn + #define U8G_COM_HAL_HW_SPI_FN u8g_com_HAL_DUE_shared_hw_spi_fn #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_HAL_DUE_ST7920_sw_spi_fn - #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_arduino_st7920_hw_spi_fn + + #elif defined(__SAMD51__) + + #define U8G_COM_HAL_HW_SPI_FN u8g_com_samd51_hw_spi_fn + #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_samd51_st7920_hw_spi_fn + #elif defined(__STM32F1__) + uint8_t u8g_com_HAL_STM32F1_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_STM32F1_sw_spi_fn - #define U8G_COM_HAL_HW_SPI_FN u8g_com_stm32duino_hw_spi_fn + uint8_t u8g_com_stm32duino_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); + #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_STM32F1_sw_spi_fn + #define U8G_COM_HAL_HW_SPI_FN u8g_com_stm32duino_hw_spi_fn #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_std_sw_spi_fn #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_stm32duino_hw_spi_fn + #elif defined(ARDUINO_ARCH_STM32) - uint8_t u8g_com_arduino_std_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_SW_SPI_FN u8g_com_arduino_std_sw_spi_fn + uint8_t u8g_com_stm32duino_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_HW_SPI_FN u8g_com_stm32duino_hw_spi_fn - uint8_t u8g_com_arduino_st7920_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_arduino_st7920_spi_fn - uint8_t u8g_com_arduino_st7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_arduino_st7920_hw_spi_fn + #define U8G_COM_HAL_HW_SPI_FN u8g_com_stm32duino_hw_spi_fn + #elif defined(__AVR__) + uint8_t u8g_com_HAL_AVR_sw_sp_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_AVR_sw_sp_fn - #define U8G_COM_HAL_HW_SPI_FN u8g_com_arduino_hw_spi_fn - #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_arduino_st7920_spi_fn - #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_arduino_st7920_hw_spi_fn - #else - #define U8G_COM_HAL_SW_SPI_FN u8g_com_arduino_std_sw_spi_fn - #define U8G_COM_HAL_HW_SPI_FN u8g_com_arduino_hw_spi_fn + #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_AVR_sw_sp_fn + + #endif + + #ifndef U8G_COM_HAL_SW_SPI_FN + #define U8G_COM_HAL_SW_SPI_FN u8g_com_arduino_std_sw_spi_fn + #endif + #ifndef U8G_COM_HAL_HW_SPI_FN + #define U8G_COM_HAL_HW_SPI_FN u8g_com_arduino_hw_spi_fn + #endif + #ifndef U8G_COM_ST7920_HAL_SW_SPI #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_arduino_st7920_spi_fn + #endif + #ifndef U8G_COM_ST7920_HAL_HW_SPI #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_arduino_st7920_hw_spi_fn #endif - uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_SSD_I2C_HAL u8g_com_arduino_ssd_i2c_fn + #ifdef TARGET_LPC1768 + uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); + #endif + + #define U8G_COM_SSD_I2C_HAL u8g_com_arduino_ssd_i2c_fn #if PIN_EXISTS(FSMC_CS) uint8_t u8g_com_stm32duino_fsmc_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_FSMC_FN u8g_com_stm32duino_fsmc_fn - #else - #define U8G_COM_HAL_FSMC_FN u8g_com_null_fn + #define U8G_COM_HAL_FSMC_FN u8g_com_stm32duino_fsmc_fn #endif -#elif TARGET_LPC1768 +#elif defined(TARGET_LPC1768) + uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_LPC1768_sw_spi_fn - uint8_t u8g_com_HAL_LPC1768_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_HW_SPI_FN u8g_com_HAL_LPC1768_hw_spi_fn - uint8_t u8g_com_HAL_LPC1768_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_HAL_LPC1768_ST7920_sw_spi_fn - uint8_t u8g_com_HAL_LPC1768_ST7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_HAL_LPC1768_ST7920_hw_spi_fn - uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_SSD_I2C_HAL u8g_com_HAL_LPC1768_ssd_hw_i2c_fn + #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_LPC1768_sw_spi_fn + #define U8G_COM_HAL_HW_SPI_FN u8g_com_HAL_LPC1768_hw_spi_fn + #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_HAL_LPC1768_ST7920_sw_spi_fn + #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_HAL_LPC1768_ST7920_hw_spi_fn + #define U8G_COM_SSD_I2C_HAL u8g_com_HAL_LPC1768_ssd_hw_i2c_fn - #define U8G_COM_HAL_FSMC_FN u8g_com_null_fn - -#else // need to give them some definition or else get compiler errors - uint8_t u8g_com_null_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_HAL_SW_SPI_FN u8g_com_null_fn - #define U8G_COM_HAL_HW_SPI_FN u8g_com_null_fn - #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_null_fn - #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_null_fn - #define U8G_COM_SSD_I2C_HAL u8g_com_null_fn - #define U8G_COM_HAL_FSMC_FN u8g_com_null_fn +#endif + +#ifndef U8G_COM_HAL_SW_SPI_FN + #define U8G_COM_HAL_SW_SPI_FN u8g_com_null_fn +#endif +#ifndef U8G_COM_HAL_HW_SPI_FN + #define U8G_COM_HAL_HW_SPI_FN u8g_com_null_fn +#endif +#ifndef U8G_COM_ST7920_HAL_SW_SPI + #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_null_fn +#endif +#ifndef U8G_COM_ST7920_HAL_HW_SPI + #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_null_fn +#endif +#ifndef U8G_COM_SSD_I2C_HAL + #define U8G_COM_SSD_I2C_HAL u8g_com_null_fn +#endif +#ifndef U8G_COM_HAL_FSMC_FN + #define U8G_COM_HAL_FSMC_FN u8g_com_null_fn #endif diff --git a/Marlin/src/lcd/dogm/dogm_Statusscreen.h b/Marlin/src/lcd/dogm/dogm_Statusscreen.h index ed2978a42b..a09e778809 100644 --- a/Marlin/src/lcd/dogm/dogm_Statusscreen.h +++ b/Marlin/src/lcd/dogm/dogm_Statusscreen.h @@ -29,11 +29,14 @@ */ #include "../../inc/MarlinConfig.h" +#include "ultralcd_DOGM.h" #define BW(N) ((N + 7) / 8) -#if ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) +#if ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) && DISABLED(STATUS_COMBINE_HEATERS) + #undef STATUS_HEATERS_X + #undef STATUS_BED_X /** * Custom _Statusscreen.h files can define: * - A custom logo image @@ -50,54 +53,44 @@ #endif -#if ENABLED(STATUS_COMBINE_HEATERS) - #undef STATUS_HOTEND_ANIM - #undef STATUS_BED_ANIM -#endif - // // Default Status Screen Heater or Hotends bitmaps // - #if !STATUS_HEATERS_WIDTH && !STATUS_HOTEND1_WIDTH #if ENABLED(STATUS_COMBINE_HEATERS) + #undef STATUS_HOTEND_ANIM + #undef STATUS_BED_ANIM + #define STATUS_HEATERS_XSPACE 24 + // // Status Screen Combined Heater bitmaps // - - #if HAS_HEATED_BED && HOTENDS == 0 - #define STATUS_HEATERS_X 80 - #endif - - #if HAS_HEATED_BED && HOTENDS <= 3 - - #define STATUS_BED_WIDTH 21 + #if HAS_HEATED_BED && HOTENDS <= 4 #if HOTENDS == 0 - #define STATUS_HEATERS_WIDTH 21 + #define STATUS_HEATERS_WIDTH 96 const unsigned char status_heaters_bmp[] PROGMEM = { - B00000100,B00010000,B01000000, - B00000010,B00001000,B00100000, - B00000010,B00001000,B00100000, - B00000100,B00010000,B01000000, - B00001000,B00100000,B10000000, - B00010000,B01000001,B00000000, - B00010000,B01000001,B00000000, - B00001000,B00100000,B10000000, - B00000100,B00010000,B01000000, - B00000000,B00000000,B00000000, - B00011111,B11111111,B11111000, - B00011111,B11111111,B11111000 + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000, + B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000 }; #elif HOTENDS == 1 - #define STATUS_HEATERS_WIDTH 90 - #define STATUS_BED_X 80 + #define STATUS_HEATERS_WIDTH 96 const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, @@ -116,7 +109,7 @@ #elif HOTENDS == 2 - #define STATUS_HEATERS_WIDTH 90 + #define STATUS_HEATERS_WIDTH 96 const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000, @@ -133,9 +126,9 @@ B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000 }; - #else // HOTENDS > 2 + #elif HOTENDS == 3 - #define STATUS_HEATERS_WIDTH 90 + #define STATUS_HEATERS_WIDTH 96 const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000100,B00010000,B01000000, @@ -152,13 +145,38 @@ B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00011111,B11111111,B11111000 }; + #else // HOTENDS > 3 + + #define STATUS_HEATERS_WIDTH 120 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000100,B00010000,B01000000, + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00000100,B00010000,B01000000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00001000,B00100000,B10000000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00010000,B01000001,B00000000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00010000,B01000001,B00000000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00001000,B00100000,B10000000, + B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000100,B00010000,B01000000, + B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000, + B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00011111,B11111111,B11111000, + B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00011111,B11111111,B11111000 + }; + #endif // HOTENDS + #define STATUS_BED_TEXT_X (STATUS_HEATERS_WIDTH - 10) + #else // !HAS_HEATED_BED || HOTENDS > 3 - #if HOTENDS == 1 + #if HOTENDS == 0 - #define STATUS_HEATERS_WIDTH 11 + #define STATUS_HEATERS_WIDTH 0 + + #elif HOTENDS == 1 + + #define STATUS_HEATERS_WIDTH 12 const unsigned char status_heaters_bmp[] PROGMEM = { B00011111,B11100000, @@ -213,7 +231,7 @@ B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000 }; - #elif HOTENDS > 3 + #elif HOTENDS == 4 #define STATUS_HEATERS_WIDTH 84 @@ -232,6 +250,25 @@ B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000 }; + #else // HOTENDS > 4 + + #define STATUS_HEATERS_WIDTH 108 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000, + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111000,B01110000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B11110000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00111000,B11110000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00011111,B01100000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00011111,B01100000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00111100,B11110000, + B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000, + B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000, + B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000, + B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000 + }; + #endif // HOTENDS #endif // !HAS_HEATED_BED || HOTENDS > 3 @@ -241,10 +278,16 @@ // // Status Screen Hotends bitmaps // - #if HOTENDS - #define STATUS_HOTEND1_WIDTH 12 + #define STATUS_HOTEND1_WIDTH 16 + + #define MAX_HOTEND_BITMAPS 5 + #if HOTENDS > MAX_HOTEND_BITMAPS + #define STATUS_HOTEND_BITMAPS MAX_HOTEND_BITMAPS + #else + #define STATUS_HOTEND_BITMAPS HOTENDS + #endif #if HOTENDS == 1 || ENABLED(STATUS_HOTEND_NUMBERLESS) @@ -282,116 +325,101 @@ #endif - #else + #elif HOTENDS >= 2 - #if HOTENDS >= 2 + #ifdef STATUS_HOTEND_ANIM - #if HAS_HEATED_BED - #define MAX_HOTEND_BITMAPS 3 - #else - #define MAX_HOTEND_BITMAPS 4 - #endif - #if HOTENDS > MAX_HOTEND_BITMAPS - #define STATUS_HOTEND_BITMAPS MAX_HOTEND_BITMAPS - #else - #define STATUS_HOTEND_BITMAPS HOTENDS - #endif + const unsigned char status_hotend1_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111110,B11110000, + B00111100,B11110000, + B00011010,B11100000, + B00011110,B11100000, + B00111110,B11110000, + B00111110,B11110000, + B00111110,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; - #ifdef STATUS_HOTEND_ANIM + const unsigned char status_hotend1_b_bmp[] PROGMEM = { + B00011111,B11100000, + B00100000,B00010000, + B00100001,B00010000, + B00100011,B00010000, + B00010101,B00100000, + B00010001,B00100000, + B00100001,B00010000, + B00100001,B00010000, + B00110001,B00110000, + B00001000,B01000000, + B00000100,B10000000, + B00000011,B00000000 + }; - const unsigned char status_hotend1_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111111,B11110000, - B00111110,B11110000, - B00111100,B11110000, - B00011010,B11100000, - B00011110,B11100000, - B00111110,B11110000, - B00111110,B11110000, - B00111110,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; + const unsigned char status_hotend2_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111100,B11110000, + B00111011,B01110000, + B00011111,B01100000, + B00011110,B11100000, + B00111101,B11110000, + B00111011,B11110000, + B00111000,B01110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; - const unsigned char status_hotend1_b_bmp[] PROGMEM = { - B00011111,B11100000, - B00100000,B00010000, - B00100001,B00010000, - B00100011,B00010000, - B00010101,B00100000, - B00010001,B00100000, - B00100001,B00010000, - B00100001,B00010000, - B00110001,B00110000, - B00001000,B01000000, - B00000100,B10000000, - B00000011,B00000000 - }; + const unsigned char status_hotend2_b_bmp[] PROGMEM = { + B00011111,B11100000, + B00100000,B00010000, + B00100011,B00010000, + B00100100,B10010000, + B00010000,B10100000, + B00010001,B00100000, + B00100010,B00010000, + B00100100,B00010000, + B00110111,B10110000, + B00001000,B01000000, + B00000100,B10000000, + B00000011,B00000000 + }; - const unsigned char status_hotend2_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111111,B11110000, - B00111100,B11110000, - B00111011,B01110000, - B00011111,B01100000, - B00011110,B11100000, - B00111101,B11110000, - B00111011,B11110000, - B00111000,B01110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; + #else - const unsigned char status_hotend2_b_bmp[] PROGMEM = { - B00011111,B11100000, - B00100000,B00010000, - B00100011,B00010000, - B00100100,B10010000, - B00010000,B10100000, - B00010001,B00100000, - B00100010,B00010000, - B00100100,B00010000, - B00110111,B10110000, - B00001000,B01000000, - B00000100,B10000000, - B00000011,B00000000 - }; + const unsigned char status_hotend1_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111110,B11110000, + B00111100,B11110000, + B00111010,B11110000, + B00011110,B11100000, + B00011110,B11100000, + B00111110,B11110000, + B00111110,B11110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; - #else - - const unsigned char status_hotend1_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111110,B11110000, - B00111100,B11110000, - B00111010,B11110000, - B00011110,B11100000, - B00011110,B11100000, - B00111110,B11110000, - B00111110,B11110000, - B00111111,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - const unsigned char status_hotend2_a_bmp[] PROGMEM = { - B00011111,B11100000, - B00111100,B11110000, - B00111011,B01110000, - B00111111,B01110000, - B00011110,B11100000, - B00011101,B11100000, - B00111011,B11110000, - B00111000,B01110000, - B00111111,B11110000, - B00001111,B11000000, - B00000111,B10000000, - B00000011,B00000000 - }; - - #endif + const unsigned char status_hotend2_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111100,B11110000, + B00111011,B01110000, + B00111111,B01110000, + B00011110,B11100000, + B00011101,B11100000, + B00111011,B11110000, + B00111000,B01110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; #endif @@ -450,7 +478,7 @@ #endif - #if STATUS_HOTEND_BITMAPS >= 4 && !HAS_HEATED_BED + #if STATUS_HOTEND_BITMAPS >= 4 #ifdef STATUS_HOTEND_ANIM @@ -505,7 +533,7 @@ #endif - #if STATUS_HOTEND_BITMAPS >= 5 && !HAS_HEATED_BED + #if STATUS_HOTEND_BITMAPS >= 5 #ifdef STATUS_HOTEND_ANIM @@ -562,6 +590,8 @@ #endif + #else + #define STATUS_HEATERS_HEIGHT 20 #endif #endif @@ -571,17 +601,16 @@ // // Default Status Screen Bed bitmaps // - -#if !STATUS_BED_WIDTH && DISABLED(STATUS_COMBINE_HEATERS) && HAS_HEATED_BED && HOTENDS < 4 +#if !STATUS_BED_WIDTH && HAS_HEATED_BED && DISABLED(STATUS_COMBINE_HEATERS) #if ENABLED(STATUS_ALT_BED_BITMAP) #define STATUS_BED_ANIM #define STATUS_BED_WIDTH 24 #ifndef STATUS_BED_X - #define STATUS_BED_X 72 + #define STATUS_BED_X (LCD_PIXEL_WIDTH - (STATUS_BED_BYTEWIDTH + STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) #endif - #define STATUS_BED_TEXT_X (STATUS_BED_X + 13) + #define STATUS_BED_TEXT_X (STATUS_BED_X + 11) const unsigned char status_bed_bmp[] PROGMEM = { B11111111,B11111111,B11000000, @@ -612,7 +641,7 @@ #define STATUS_BED_WIDTH 21 #ifndef STATUS_BED_X - #define STATUS_BED_X 80 + #define STATUS_BED_X (LCD_PIXEL_WIDTH - (STATUS_BED_BYTEWIDTH + STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) #endif #ifdef STATUS_BED_ANIM @@ -657,81 +686,100 @@ #endif #endif +#else + #define STATUS_BED_WIDTH 0 +#endif -#endif // !STATUS_BED_WIDTH && !STATUS_COMBINE_HEATERS && HAS_HEATED_BED && HOTENDS < 4 - -#if HAS_HEATED_CHAMBER - - #define STATUS_CHAMBER_WIDTH 16 +#if !STATUS_CHAMBER_WIDTH && HAS_TEMP_CHAMBER && ((HOTENDS <= 4 && !HAS_HEATED_BED) || (HOTENDS <= 3 && HAS_HEATED_BED)) + #define STATUS_CHAMBER_WIDTH 21 + #if STATUS_HEATERS_WIDTH + #if ENABLED(STATUS_COMBINE_HEATERS) + #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - 2 - (STATUS_CHAMBER_BYTEWIDTH) * 8) + #elif HAS_FAN0 && HAS_HEATED_BED && HOTENDS <= 2 + #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - 2 - (STATUS_HEATERS_BYTEWIDTH - STATUS_CHAMBER_BYTEWIDTH) * 8) + #elif HAS_FAN0 && !HAS_HEATED_BED + #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) + #else + #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH) * 8) + #endif + #endif #ifdef STATUS_CHAMBER_ANIM const unsigned char status_chamber_bmp[] PROGMEM = { - B11111111,B11111111, - B10000000,B00000001, - B10000000,B00000001, - B10000000,B00000001, - B10000000,B00000001, - B10000000,B00000001, - B10000000,B00000001, - B10000000,B00000001, - B10000000,B00000001, - B10000000,B00000001, - B11111111,B11111111, - B11111111,B11111111 + B00011111,B11111111,B11111000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00010000,B00000000,B00001000, + B00011111,B11111111,B11111000, + B00011111,B11111111,B11111000 }; - const unsigned char status_chamber_on_bmp[] PROGMEM = { - B11111111,B11111111, - B10000000,B00000001, - B10000100,B00100001, - B10000010,B00010001, - B10000010,B00010001, - B10000100,B00100001, - B10001000,B01000001, - B10001000,B01000001, - B10000100,B00100001, - B10000000,B00000001, - B11111111,B11111111, - B11111111,B11111111 + B00011111,B11111111,B11111000, + B00010000,B00000000,B00001000, + B00010000,B10000100,B00001000, + B00010000,B01000010,B00001000, + B00010000,B01000010,B00001000, + B00010000,B10000100,B00001000, + B00010001,B00001000,B00001000, + B00010001,B00001000,B00001000, + B00010000,B10000100,B00001000, + B00010000,B00000000,B00001000, + B00011111,B11111111,B11111000, + B00011111,B11111111,B11111000 }; #else const unsigned char status_chamber_bmp[] PROGMEM = { - B11111111,B11111111, - B10000000,B00000001, - B10000100,B00100001, - B10000010,B00010001, - B10000010,B00010001, - B10000100,B00100001, - B10001000,B01000001, - B10001000,B01000001, - B10000100,B00100001, - B10000000,B00000001, - B11111111,B11111111, - B11111111,B11111111 + B00011111,B11111111,B11111000, + B00010000,B00000000,B00001000, + B00010000,B10000100,B00001000, + B00010000,B01000010,B00001000, + B00010000,B01000010,B00001000, + B00010000,B10000100,B00001000, + B00010001,B00001000,B00001000, + B00010001,B00001000,B00001000, + B00010000,B10000100,B00001000, + B00010000,B00000000,B00001000, + B00011111,B11111111,B11111000, + B00011111,B11111111,B11111000 }; #endif +#else // HAS_HEATED_CHAMBER + #define STATUS_CHAMBER_WIDTH 0 +#endif -#endif // HAS_HEATED_CHAMBER +#define BED_OR_CHAMBER_OR_FAN (BED_OR_CHAMBER || HAS_FAN0) -// Can also be overridden in Configuration.h +// Can also be overridden in Configuration_adv.h // If you can afford it, try the 3-frame fan animation! // Don't compile in the fan animation with no fan -#if !HAS_FAN0 +#if !HAS_FAN0 || (HOTENDS == 5 || (HOTENDS == 4 && BED_OR_CHAMBER) || (ENABLED(STATUS_COMBINE_HEATERS) && HAS_HEATED_CHAMBER)) #undef STATUS_FAN_FRAMES -#elif !defined(STATUS_FAN_FRAMES) +#elif !STATUS_FAN_FRAMES #define STATUS_FAN_FRAMES 2 #elif STATUS_FAN_FRAMES > 4 #error "A maximum of 4 fan animation frames is currently supported." #endif +#if HOTENDS > 4 + #undef STATUS_LOGO_WIDTH + #undef STATUS_HEATERS_XSPACE + #define STATUS_HEATERS_XSPACE 24 +#endif + // // Provide default Fan Bitmaps // -#if !defined(STATUS_FAN_WIDTH) && STATUS_FAN_FRAMES > 0 +#if !STATUS_FAN_WIDTH && STATUS_FAN_FRAMES > 0 // Provide a fan animation if none exists @@ -836,7 +884,7 @@ #elif STATUS_FAN_FRAMES == 3 - #define STATUS_FAN_WIDTH 21 + #define STATUS_FAN_WIDTH 20 #if ENABLED(STATUS_ALT_FAN_BITMAP) @@ -974,7 +1022,7 @@ #elif STATUS_FAN_FRAMES == 4 - #define STATUS_FAN_WIDTH 21 + #define STATUS_FAN_WIDTH 20 #if ENABLED(STATUS_ALT_FAN_BITMAP) @@ -1153,6 +1201,57 @@ #endif // !STATUS_ALT_FAN_BITMAP #endif +#else + #undef STATUS_FAN_FRAMES + #define STATUS_FAN_WIDTH 0 +#endif + +#define _EXTRA_WIDTH (STATUS_FAN_WIDTH + STATUS_CHAMBER_WIDTH + STATUS_BED_WIDTH) + +// +// Heater Bitmap X Space Requirements +// +#if !defined(STATUS_HEATERS_XSPACE) && (STATUS_HOTEND1_WIDTH || STATUS_HEATERS_WIDTH) + #if (HOTENDS == 3 || HOTENDS == 4) && ENABLED(STATUS_COMBINE_HEATERS) + // If more heaters or they're combined, 3 bytes + #define STATUS_HEATERS_XSPACE 24 + #elif STATUS_LOGO_WIDTH > (LCD_PIXEL_WIDTH - (_EXTRA_WIDTH) - 26 * (HOTENDS)) // 128 - (20 + 24 + 26) == 58 + // If the logo won't fit at 26 width + #define STATUS_HEATERS_XSPACE 24 + #else + #define STATUS_HEATERS_XSPACE 26 + #endif +#endif + +#if ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) + + // + // Disable the logo bitmap if insufficient space + // + #if STATUS_HEATERS_XSPACE + #define _HEATERS_WIDTH (HOTENDS * (STATUS_HEATERS_XSPACE)) // as many hotends as possible + #elif STATUS_HEATERS_WIDTH + #define _HEATERS_WIDTH STATUS_HEATERS_WIDTH + #else + #error "Status screen heaters region was not specified." + #endif + #if STATUS_LOGO_WIDTH > (LCD_PIXEL_WIDTH - (_EXTRA_WIDTH + _HEATERS_WIDTH)) + #warning "Unable to fit custom Status Screen logo. Disabling." + #undef STATUS_LOGO_WIDTH + #endif + + #if (HOTENDS > 1 && STATUS_LOGO_WIDTH && BED_OR_CHAMBER_OR_FAN) || (HOTENDS >= 3 && !BED_OR_CHAMBER_OR_FAN) + #define _STATUS_HEATERS_X(H,S,N) ((LCD_PIXEL_WIDTH - (H * (S + N)) - (_EXTRA_WIDTH) + (STATUS_LOGO_WIDTH)) / 2) + #if STATUS_HOTEND1_WIDTH + #if HOTENDS > 2 + #define STATUS_HEATERS_X _STATUS_HEATERS_X(HOTENDS, STATUS_HOTEND1_WIDTH, 6) + #else + #define STATUS_HEATERS_X _STATUS_HEATERS_X(HOTENDS, STATUS_HOTEND1_WIDTH, 4) + #endif + #else + #define STATUS_HEATERS_X _STATUS_HEATERS_X(1, STATUS_HEATERS_WIDTH, 4) + #endif + #endif #endif @@ -1182,22 +1281,21 @@ #endif // -// Heater Bitmap Properties +// Hotend Heater Bitmap starting X position // -#if STATUS_HOTEND1_WIDTH || STATUS_HEATERS_WIDTH - - #ifndef STATUS_HEATERS_XSPACE - #define STATUS_HEATERS_XSPACE 24 // Like the included bitmaps - #endif - - #ifndef STATUS_HEATERS_X - #if STATUS_LOGO_BYTEWIDTH - #define STATUS_HEATERS_X ((STATUS_LOGO_BYTEWIDTH + 0) * 8) +#if !defined(STATUS_HEATERS_X) && (STATUS_HOTEND1_WIDTH || STATUS_HEATERS_WIDTH) + #if STATUS_LOGO_BYTEWIDTH + #define STATUS_HEATERS_X (STATUS_LOGO_BYTEWIDTH * 8) + #elif ((STATUS_CHAMBER_WIDTH || STATUS_FAN_WIDTH) && (STATUS_BED_WIDTH && STATUS_HOTEND_BITMAPS == 3)) || \ + ((STATUS_CHAMBER_WIDTH || STATUS_FAN_WIDTH || STATUS_BED_WIDTH) && STATUS_HOTEND_BITMAPS == 4) + #define STATUS_HEATERS_X 5 + #else + #if ENABLED(STATUS_COMBINE_HEATERS) && HAS_HEATED_BED && HOTENDS <= 4 + #define STATUS_HEATERS_X 5 #else #define STATUS_HEATERS_X 8 // Like the included bitmaps #endif #endif - #endif #if STATUS_HOTEND1_WIDTH @@ -1205,7 +1303,6 @@ // // Hotend images. A base hotend image and optional "ON" state image. // - #ifndef STATUS_HOTEND_BITMAPS #define STATUS_HOTEND_BITMAPS 1 #endif @@ -1257,20 +1354,21 @@ #ifndef STATUS_HOTEND2_X #define STATUS_HOTEND2_X STATUS_HOTEND1_X + STATUS_HEATERS_XSPACE #endif - #ifndef STATUS_HOTEND3_X - #define STATUS_HOTEND3_X STATUS_HOTEND2_X + STATUS_HEATERS_XSPACE - #endif - #ifndef STATUS_HOTEND4_X - #define STATUS_HOTEND4_X STATUS_HOTEND3_X + STATUS_HEATERS_XSPACE - #endif - #ifndef STATUS_HOTEND5_X - #define STATUS_HOTEND5_X STATUS_HOTEND4_X + STATUS_HEATERS_XSPACE - #endif - #ifndef STATUS_HOTEND6_X - #define STATUS_HOTEND6_X STATUS_HOTEND5_X + STATUS_HEATERS_XSPACE - #endif #if HOTENDS > 2 + #ifndef STATUS_HOTEND3_X + #define STATUS_HOTEND3_X STATUS_HOTEND2_X + STATUS_HEATERS_XSPACE + #endif + #ifndef STATUS_HOTEND4_X + #define STATUS_HOTEND4_X STATUS_HOTEND3_X + STATUS_HEATERS_XSPACE + #endif + #ifndef STATUS_HOTEND5_X + #define STATUS_HOTEND5_X STATUS_HOTEND4_X + STATUS_HEATERS_XSPACE + #endif + #ifndef STATUS_HOTEND6_X + #define STATUS_HOTEND6_X STATUS_HOTEND5_X + STATUS_HEATERS_XSPACE + #endif + constexpr uint8_t status_hotend_x[HOTENDS] = ARRAY_N(HOTENDS, STATUS_HOTEND1_X, STATUS_HOTEND2_X, STATUS_HOTEND3_X, STATUS_HOTEND4_X, STATUS_HOTEND5_X, STATUS_HOTEND6_X); #define STATUS_HOTEND_X(N) status_hotend_x[N] #elif HOTENDS > 1 @@ -1303,7 +1401,7 @@ #endif #endif - #if STATUS_HOTEND_BITMAPS > 1 + #if STATUS_HOTEND_BITMAPS > 1 && DISABLED(STATUS_HOTEND_NUMBERLESS) #define TEST_BITMAP_OFF status_hotend1_a_bmp #define TEST_BITMAP_ON status_hotend1_b_bmp #else @@ -1341,7 +1439,11 @@ #define STATUS_HOTEND_X(N) (STATUS_HEATERS_X + 2 + (N) * (STATUS_HEATERS_XSPACE)) #endif #ifndef STATUS_HOTEND_TEXT_X - #define STATUS_HOTEND_TEXT_X(N) (STATUS_HEATERS_X + 6 + (N) * (STATUS_HEATERS_XSPACE)) + #if HOTENDS == 4 && STATUS_LOGO_WIDTH + #define STATUS_HOTEND_TEXT_X(N) (STATUS_HEATERS_X + 6 + (N) * (STATUS_HEATERS_XSPACE)) + #else + #define STATUS_HOTEND_TEXT_X(N) (STATUS_HEATERS_X + 6 + (N) * (STATUS_HEATERS_XSPACE)) + #endif #endif #ifndef STATUS_HEATERS_BYTEWIDTH #define STATUS_HEATERS_BYTEWIDTH BW(STATUS_HEATERS_WIDTH) @@ -1358,21 +1460,22 @@ "Status heaters bitmap (status_heaters_bmp) dimensions don't match data." ); +#else // HOTENDS == 0 + + //#error "Incomplete status header" + #endif // // Chamber Bitmap Properties // -#ifndef STATUS_CHAMBER_WIDTH - #define STATUS_CHAMBER_WIDTH 0 -#endif #ifndef STATUS_CHAMBER_BYTEWIDTH #define STATUS_CHAMBER_BYTEWIDTH BW(STATUS_CHAMBER_WIDTH) #endif -#if STATUS_CHAMBER_WIDTH && !STATUS_HEATERS_WIDTH +#if STATUS_CHAMBER_WIDTH #ifndef STATUS_CHAMBER_X - #define STATUS_CHAMBER_X (128 - (STATUS_FAN_BYTEWIDTH + STATUS_CHAMBER_BYTEWIDTH) * 8) + #define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) #endif #ifndef STATUS_CHAMBER_HEIGHT @@ -1388,7 +1491,7 @@ #endif #ifndef STATUS_CHAMBER_TEXT_X - #define STATUS_CHAMBER_TEXT_X (STATUS_CHAMBER_X + 7) + #define STATUS_CHAMBER_TEXT_X (STATUS_CHAMBER_X + 11) #endif static_assert( @@ -1407,16 +1510,13 @@ // // Bed Bitmap Properties // -#ifndef STATUS_BED_WIDTH - #define STATUS_BED_WIDTH 0 -#endif #ifndef STATUS_BED_BYTEWIDTH #define STATUS_BED_BYTEWIDTH BW(STATUS_BED_WIDTH) #endif #if STATUS_BED_WIDTH && !STATUS_HEATERS_WIDTH #ifndef STATUS_BED_X - #define STATUS_BED_X (128 - (STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH + STATUS_BED_BYTEWIDTH) * 8) + #define STATUS_BED_X (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH + STATUS_BED_BYTEWIDTH) * 8) #endif #ifndef STATUS_BED_HEIGHT @@ -1432,7 +1532,7 @@ #endif #ifndef STATUS_BED_TEXT_X - #define STATUS_BED_TEXT_X (STATUS_BED_X + 11) + #define STATUS_BED_TEXT_X (STATUS_BED_X + 9) #endif static_assert( @@ -1445,27 +1545,23 @@ "Status bed bitmap (status_bed_on_bmp) dimensions don't match data." ); #endif - #endif // // Fan Bitmap Properties // -#ifndef STATUS_FAN_WIDTH - #define STATUS_FAN_WIDTH 0 -#endif #ifndef STATUS_FAN_BYTEWIDTH #define STATUS_FAN_BYTEWIDTH BW(STATUS_FAN_WIDTH) #endif #if STATUS_FAN_FRAMES #ifndef STATUS_FAN_X - #define STATUS_FAN_X (128 - (STATUS_FAN_BYTEWIDTH) * 8) + #define STATUS_FAN_X (LCD_PIXEL_WIDTH - (STATUS_FAN_BYTEWIDTH) * 8) #endif #ifndef STATUS_FAN_Y #define STATUS_FAN_Y 1 #endif #ifndef STATUS_FAN_TEXT_X - #define STATUS_FAN_TEXT_X 103 + #define STATUS_FAN_TEXT_X (STATUS_FAN_X - 1) #endif #ifndef STATUS_FAN_TEXT_Y #define STATUS_FAN_TEXT_Y 28 diff --git a/Marlin/src/lcd/dogm/lcdprint_u8g.cpp b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp index c9ff96547b..0ad5e998ab 100644 --- a/Marlin/src/lcd/dogm/lcdprint_u8g.cpp +++ b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp @@ -20,7 +20,7 @@ #include "u8g_fontutf8.h" #include "../lcdprint.h" -int lcd_glyph_height(void) { return u8g_GetFontBBXHeight(u8g.getU8g()); } +int lcd_glyph_height() { return u8g_GetFontBBXHeight(u8g.getU8g()); } void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row) { u8g.setPrintPos(col, row); } diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 4db6752b45..e9023515cf 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -63,13 +63,18 @@ #define EXTRAS_BASELINE (40 + INFO_FONT_ASCENT) #define STATUS_BASELINE (LCD_PIXEL_HEIGHT - INFO_FONT_DESCENT) -#define DO_DRAW_BED (HAS_HEATED_BED && STATUS_BED_WIDTH && HOTENDS <= 3 && DISABLED(STATUS_COMBINE_HEATERS)) -#define DO_DRAW_FAN (HAS_FAN0 && STATUS_FAN_WIDTH && STATUS_FAN_FRAMES) +#define DO_DRAW_LOGO (STATUS_LOGO_WIDTH && ENABLED(CUSTOM_STATUS_SCREEN_IMAGE)) +#define DO_DRAW_BED (HAS_HEATED_BED && STATUS_BED_WIDTH && HOTENDS <= 4) +#define DO_DRAW_CHAMBER (HAS_TEMP_CHAMBER && STATUS_CHAMBER_WIDTH && HOTENDS <= 4) +#define DO_DRAW_FAN (HAS_FAN0 && STATUS_FAN_WIDTH && HOTENDS <= 4 && defined(STATUS_FAN_FRAMES)) + #define ANIM_HOTEND (HOTENDS && ENABLED(STATUS_HOTEND_ANIM)) #define ANIM_BED (DO_DRAW_BED && ENABLED(STATUS_BED_ANIM)) -#define ANIM_CHAMBER (HAS_HEATED_CHAMBER && ENABLED(STATUS_CHAMBER_ANIM)) +#define ANIM_CHAMBER (DO_DRAW_CHAMBER && ENABLED(STATUS_CHAMBER_ANIM)) -#if ANIM_HOTEND || ANIM_BED +#define ANIM_HBC (ANIM_HOTEND || ANIM_BED || ANIM_CHAMBER) + +#if ANIM_HBC uint8_t heat_bits; #endif #if ANIM_HOTEND @@ -88,7 +93,10 @@ #define CHAMBER_ALT() false #endif -#define MAX_HOTEND_DRAW _MIN(HOTENDS, ((LCD_PIXEL_WIDTH - (STATUS_LOGO_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) / (STATUS_HEATERS_XSPACE))) +#if HOTENDS + #define MAX_HOTEND_DRAW _MIN(HOTENDS, ((LCD_PIXEL_WIDTH - (STATUS_LOGO_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) / (STATUS_HEATERS_XSPACE))) +#endif + #define STATUS_HEATERS_BOT (STATUS_HEATERS_Y + STATUS_HEATERS_HEIGHT - 1) #if ENABLED(MARLIN_DEV_MODE) @@ -109,7 +117,7 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const bool blin UNUSED(blink); #endif - #if HAS_HEATED_BED + #if DO_DRAW_BED && DISABLED(STATUS_COMBINE_HEATERS) || (HAS_HEATED_BED && ENABLED(STATUS_COMBINE_HEATERS) && HOTENDS <= 4) const bool isBed = heater < 0; #define IFBED(A,B) (isBed ? (A) : (B)) #else @@ -122,14 +130,19 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const bool blin const bool isHeat = IFBED(BED_ALT(), HOTEND_ALT(heater)); #endif + #ifndef STATUS_HOTEND_TEXT_X + #define STATUS_HOTEND_TEXT_X(N) 0 + #define STATUS_HEATERS_Y 0 + #endif + const uint8_t tx = IFBED(STATUS_BED_TEXT_X, STATUS_HOTEND_TEXT_X(heater)); #if ENABLED(MARLIN_DEV_MODE) - const float temp = 20 + (millis() >> 8) % IFBED(100, 200); - const float target = IFBED(100, 200); + const float temp = 20 + (millis() >> 8) % IFBED(100, 200), + target = IFBED(100, 200); #else const float temp = IFBED(thermalManager.degBed(), thermalManager.degHotend(heater)), - target = IFBED(thermalManager.degTargetBed(), thermalManager.degTargetHotend(heater)); + target = IFBED(thermalManager.degTargetBed(), thermalManager.degTargetHotend(heater)); #endif #if DISABLED(STATUS_HOTEND_ANIM) @@ -140,7 +153,7 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const bool blin #define HOTEND_DOT false #endif - #if HAS_HEATED_BED && DISABLED(STATUS_BED_ANIM) + #if DO_DRAW_BED && DISABLED(STATUS_BED_ANIM) #define STATIC_BED true #define BED_DOT isHeat #else @@ -148,7 +161,13 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const bool blin #define BED_DOT false #endif - #if ANIM_HOTEND && ENABLED(STATUS_HOTEND_INVERTED) + #if ANIM_HOTEND && BOTH(STATUS_HOTEND_INVERTED, STATUS_HOTEND_NUMBERLESS) + #define OFF_BMP(N) status_hotend_b_bmp + #define ON_BMP(N) status_hotend_a_bmp + #elif ANIM_HOTEND && DISABLED(STATUS_HOTEND_INVERTED) && ENABLED(STATUS_HOTEND_NUMBERLESS) + #define OFF_BMP(N) status_hotend_a_bmp + #define ON_BMP(N) status_hotend_b_bmp + #elif ANIM_HOTEND && ENABLED(STATUS_HOTEND_INVERTED) #define OFF_BMP(N) status_hotend##N##_b_bmp #define ON_BMP(N) status_hotend##N##_a_bmp #else @@ -179,10 +198,11 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const bool blin uint8_t tall = uint8_t(perc * BAR_TALL + 0.5f); NOMORE(tall, BAR_TALL); - #ifdef STATUS_HOTEND_ANIM + #if ANIM_HOTEND // Draw hotend bitmap, either whole or split by the heating percent if (IFBED(0, 1)) { - const uint8_t hx = STATUS_HOTEND_X(heater), bw = STATUS_HOTEND_BYTEWIDTH(heater); + const uint8_t hx = STATUS_HOTEND_X(heater), + bw = STATUS_HOTEND_BYTEWIDTH(heater); #if ENABLED(STATUS_HEAT_PERCENT) if (isHeat && tall <= BAR_TALL) { const uint8_t ph = STATUS_HEATERS_HEIGHT - 1 - tall; @@ -196,10 +216,10 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const bool blin #endif // Draw a heating progress bar, if specified - #if ENABLED(STATUS_HEAT_PERCENT) + #if DO_DRAW_BED && ENABLED(STATUS_HEAT_PERCENT) if (IFBED(true, STATIC_HOTEND) && isHeat) { - const uint8_t bx = IFBED(STATUS_BED_X + STATUS_BED_WIDTH, STATUS_HOTEND_X(heater) + STATUS_HOTEND_WIDTH(heater)) + 1; + const uint8_t bx = IFBED(STATUS_BED_X + STATUS_BED_WIDTH - 1, STATUS_HOTEND_X(heater) + STATUS_HOTEND_WIDTH(heater)) + 1; u8g.drawFrame(bx, STATUS_HEATERS_Y, 3, STATUS_HEATERS_HEIGHT); if (tall) { const uint8_t ph = STATUS_HEATERS_HEIGHT - 1 - tall; @@ -233,14 +253,23 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const bool blin } -#if HAS_HEATED_CHAMBER +#if DO_DRAW_CHAMBER FORCE_INLINE void _draw_chamber_status(const bool blink) { - const float temp = thermalManager.degChamber(), - target = thermalManager.degTargetChamber(); + #if ENABLED(MARLIN_DEV_MODE) + const float temp = 10 + (millis() >> 8) % CHAMBER_MAXTEMP, + target = CHAMBER_MAXTEMP; + #else + const float temp = thermalManager.degChamber(); + #if HAS_HEATED_CHAMBER + const float target = thermalManager.degTargetChamber(); + #endif + #endif + #if !HEATER_IDLE_HANDLER UNUSED(blink); #endif + if (PAGE_UNDER(7)) { #if HEATER_IDLE_HANDLER const bool is_idle = false, // thermalManager.chamber_idle.timed_out, @@ -248,13 +277,17 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const bool blin #else constexpr bool dodraw = true; #endif - if (dodraw) _draw_centered_temp(target + 0.5, STATUS_CHAMBER_TEXT_X, 7); + #if HAS_HEATED_CHAMBER + if (dodraw) _draw_centered_temp(target + 0.5, STATUS_CHAMBER_TEXT_X, 7); + #else + UNUSED(dodraw); + #endif } if (PAGE_CONTAINS(28 - INFO_FONT_ASCENT, 28 - 1)) _draw_centered_temp(temp + 0.5f, STATUS_CHAMBER_TEXT_X, 28); } -#endif +#endif // DO_DRAW_CHAMBER // // Before homing, blink '123' <-> '???'. @@ -299,7 +332,7 @@ void MarlinUI::draw_status_screen() { // At the first page, generate new display values if (first_page) { - #if ANIM_HOTEND || ANIM_BED || ANIM_CHAMBER + #if ANIM_HBC uint8_t new_bits = 0; #if ANIM_HOTEND HOTEND_LOOP() if (thermalManager.isHeatingHotend(e) ^ SHOW_ON_STATE) SBI(new_bits, e); @@ -307,22 +340,17 @@ void MarlinUI::draw_status_screen() { #if ANIM_BED if (thermalManager.isHeatingBed() ^ SHOW_ON_STATE) SBI(new_bits, 7); #endif - #if ANIM_CHAMBER + #if DO_DRAW_CHAMBER && HAS_HEATED_CHAMBER if (thermalManager.isHeatingChamber() ^ SHOW_ON_STATE) SBI(new_bits, 6); #endif heat_bits = new_bits; #endif strcpy(xstring, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS]))); strcpy(ystring, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS]))); - strcpy(zstring, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS]))); + strcpy(zstring, ftostr52sp( LOGICAL_Z_POSITION(current_position[Z_AXIS]))); #if ENABLED(FILAMENT_LCD_DISPLAY) - strcpy(wstring, ftostr12ns(filament_width_meas)); - strcpy(mstring, i16tostr3(100.0 * ( - parser.volumetric_enabled - ? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - : planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - ) - )); + strcpy(wstring, ftostr12ns(filwidth.measured_mm)); + strcpy(mstring, i16tostr3(planner.volumetric_percent(parser.volumetric_enabled))); #endif } @@ -335,7 +363,7 @@ void MarlinUI::draw_status_screen() { TCNT5 = 0; #endif - #if STATUS_LOGO_WIDTH + #if DO_DRAW_LOGO if (PAGE_CONTAINS(STATUS_LOGO_Y, STATUS_LOGO_Y + STATUS_LOGO_HEIGHT - 1)) u8g.drawBitmapP(STATUS_LOGO_X, STATUS_LOGO_Y, STATUS_LOGO_BYTEWIDTH, STATUS_LOGO_HEIGHT, status_logo_bmp); #endif @@ -346,13 +374,14 @@ void MarlinUI::draw_status_screen() { u8g.drawBitmapP(STATUS_HEATERS_X, STATUS_HEATERS_Y, STATUS_HEATERS_BYTEWIDTH, STATUS_HEATERS_HEIGHT, status_heaters_bmp); #endif - #if DO_DRAW_BED + #if DO_DRAW_BED && DISABLED(STATUS_COMBINE_HEATERS) #if ANIM_BED #define BED_BITMAP(S) ((S) ? status_bed_on_bmp : status_bed_bmp) #else #define BED_BITMAP(S) status_bed_bmp #endif - const uint8_t bedy = STATUS_BED_Y(BED_ALT()), bedh = STATUS_BED_HEIGHT(BED_ALT()); + const uint8_t bedy = STATUS_BED_Y(BED_ALT()), + bedh = STATUS_BED_HEIGHT(BED_ALT()); if (PAGE_CONTAINS(bedy, bedy + bedh - 1)) u8g.drawBitmapP(STATUS_BED_X, bedy, STATUS_BED_BYTEWIDTH, bedh, BED_BITMAP(BED_ALT())); #endif @@ -363,12 +392,10 @@ void MarlinUI::draw_status_screen() { #else #define CHAMBER_BITMAP(S) status_chamber_bmp #endif - if (PAGE_CONTAINS(STATUS_CHAMBER_Y, STATUS_CHAMBER_Y + STATUS_CHAMBER_HEIGHT - 1)) - u8g.drawBitmapP( - STATUS_CHAMBER_X, STATUS_CHAMBER_Y, - STATUS_CHAMBER_BYTEWIDTH, STATUS_CHAMBER_HEIGHT, - CHAMBER_BITMAP(CHAMBER_ALT()) - ); + const uint8_t chambery = STATUS_CHAMBER_Y(CHAMBER_ALT()), + chamberh = STATUS_CHAMBER_HEIGHT(CHAMBER_ALT()); + if (PAGE_CONTAINS(chambery, chambery + chamberh - 1)) + u8g.drawBitmapP(STATUS_CHAMBER_X, chambery, STATUS_CHAMBER_BYTEWIDTH, chamberh, CHAMBER_BITMAP(CHAMBER_ALT())); #endif #if DO_DRAW_FAN @@ -381,9 +408,7 @@ void MarlinUI::draw_status_screen() { } #endif if (PAGE_CONTAINS(STATUS_FAN_Y, STATUS_FAN_Y + STATUS_FAN_HEIGHT - 1)) - u8g.drawBitmapP( - STATUS_FAN_X, STATUS_FAN_Y, - STATUS_FAN_BYTEWIDTH, STATUS_FAN_HEIGHT, + u8g.drawBitmapP(STATUS_FAN_X, STATUS_FAN_Y, STATUS_FAN_BYTEWIDTH, STATUS_FAN_HEIGHT, #if STATUS_FAN_FRAMES > 2 fan_frame == 1 ? status_fan1_bmp : fan_frame == 2 ? status_fan2_bmp : @@ -400,18 +425,19 @@ void MarlinUI::draw_status_screen() { // // Temperature Graphics and Info // - if (PAGE_UNDER(6 + 1 + 12 + 1 + 6 + 1)) { // Extruders - for (uint8_t e = 0; e < MAX_HOTEND_DRAW; ++e) - _draw_heater_status((heater_ind_t)e, blink); + #if HOTENDS + for (uint8_t e = 0; e < MAX_HOTEND_DRAW; ++e) + _draw_heater_status((heater_ind_t)e, blink); + #endif // Heated bed - #if HAS_HEATED_BED && HOTENDS < 4 + #if DO_DRAW_BED && DISABLED(STATUS_COMBINE_HEATERS) || (HAS_HEATED_BED && ENABLED(STATUS_COMBINE_HEATERS) && HOTENDS <= 4) _draw_heater_status(H_BED, blink); #endif - #if HAS_HEATED_CHAMBER + #if DO_DRAW_CHAMBER _draw_chamber_status(blink); #endif @@ -575,7 +601,6 @@ void MarlinUI::draw_status_screen() { // // Feedrate // - #define EXTRAS_2_BASELINE (EXTRAS_BASELINE + 3) if (PAGE_CONTAINS(EXTRAS_2_BASELINE - INFO_FONT_ASCENT, EXTRAS_2_BASELINE - 1)) { @@ -602,7 +627,6 @@ void MarlinUI::draw_status_screen() { // // Status line // - if (PAGE_CONTAINS(STATUS_BASELINE - INFO_FONT_ASCENT, STATUS_BASELINE + INFO_FONT_DESCENT)) { lcd_moveto(0, STATUS_BASELINE); diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp index f651945beb..660cf07673 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp @@ -612,6 +612,8 @@ void ST7920_Lite_Status_Screen::draw_feedrate_percentage(const uint16_t percenta begin_data(); write_number(percentage, 3); write_byte('%'); + #else + UNUSED(percentage); #endif } @@ -658,7 +660,7 @@ void ST7920_Lite_Status_Screen::draw_status_message() { #endif } -void ST7920_Lite_Status_Screen::draw_position(const float x, const float y, const float z, bool position_known) { +void ST7920_Lite_Status_Screen::draw_position(const float (&pos)[XYZE], const bool position_known) { char str[7]; set_ddram_address(DDRAM_LINE_4); begin_data(); @@ -667,13 +669,13 @@ void ST7920_Lite_Status_Screen::draw_position(const float x, const float y, cons const unsigned char alt_label = position_known ? 0 : (ui.get_blink() ? ' ' : 0); write_byte(alt_label ? alt_label : 'X'); - write_str(dtostrf(x, -4, 0, str), 4); + write_str(dtostrf(pos[X_AXIS], -4, 0, str), 4); write_byte(alt_label ? alt_label : 'Y'); - write_str(dtostrf(y, -4, 0, str), 4); + write_str(dtostrf(pos[Y_AXIS], -4, 0, str), 4); write_byte(alt_label ? alt_label : 'Z'); - write_str(dtostrf(z, -5, 1, str), 5); + write_str(dtostrf(pos[Z_AXIS], -5, 1, str), 5); } bool ST7920_Lite_Status_Screen::indicators_changed() { @@ -826,16 +828,14 @@ void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) { } } - if (countdown == 0 && (forceUpdate || position_changed() || + if (countdown == 0 && (forceUpdate || position_changed() #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) - blink_changed() + || blink_changed() #endif )) { - draw_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], - #if ENABLED(DISABLE_REDUCED_ACCURACY_WARNING) - true - #else - all_axes_known() + draw_position(current_position, true + #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) + && all_axes_known() #endif ); } diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h index 1fb707ca1d..18a5ed77f2 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h @@ -86,7 +86,7 @@ class ST7920_Lite_Status_Screen { static void draw_print_time(const duration_t &elapsed); static void draw_feedrate_percentage(const uint16_t percentage); static void draw_status_message(); - static void draw_position(const float x, const float y, const float z, bool position_known = true); + static void draw_position(const float (&pos)[XYZE], bool position_known = true); static bool indicators_changed(); static bool position_changed(); diff --git a/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp b/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp index 82bfca8197..d1d740e235 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp @@ -69,7 +69,6 @@ #if HAS_GRAPHICAL_LCD -#include #include "HAL_LCD_com_defines.h" #define WIDTH 128 diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp index c1961117c4..8db341293a 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp @@ -58,7 +58,6 @@ #if HAS_GRAPHICAL_LCD #include - #include "HAL_LCD_com_defines.h" #define WIDTH 128 diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp index 71c8efd500..1b9a80f9d2 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp @@ -57,8 +57,6 @@ #if HAS_GRAPHICAL_LCD -#include - #include "HAL_LCD_com_defines.h" #define LCD_PIXEL_WIDTH 128 @@ -203,7 +201,7 @@ u8g_dev_t u8g_dev_st7920_128x64_HAL_4x_sw_spi = { u8g_dev_st7920_128x64_HAL_4x_f U8G_PB_DEV(u8g_dev_st7920_128x64_HAL_hw_spi, LCD_PIXEL_WIDTH, LCD_PIXEL_HEIGHT, PAGE_HEIGHT, u8g_dev_st7920_128x64_HAL_fn, U8G_COM_ST7920_HAL_HW_SPI); u8g_dev_t u8g_dev_st7920_128x64_HAL_4x_hw_spi = { u8g_dev_st7920_128x64_HAL_4x_fn, &u8g_dev_st7920_128x64_HAL_4x_pb, U8G_COM_ST7920_HAL_HW_SPI }; -#if defined(U8G_HAL_LINKS) || defined(__SAM3X8E__) +#if NONE(__AVR__, ARDUINO_ARCH_STM32) || defined(U8G_HAL_LINKS) // Also use this device for HAL version of rrd class. This results in the same device being used // for the ST7920 for HAL systems no matter what is selected in ultralcd_impl_DOGM.h. u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = { u8g_dev_st7920_128x64_HAL_4x_fn, &u8g_dev_st7920_128x64_HAL_4x_pb, U8G_COM_ST7920_HAL_SW_SPI }; diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp index dfd327e2a1..8c1dfa3ffe 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp @@ -59,8 +59,9 @@ #if HAS_GRAPHICAL_LCD && PIN_EXISTS(FSMC_CS) -#include "U8glib.h" #include "HAL_LCD_com_defines.h" +#include "ultralcd_DOGM.h" + #include #if ENABLED(LCD_USE_DMA_FSMC) @@ -70,12 +71,12 @@ extern void LCD_IO_WriteMultiple(uint16_t color, uint32_t count); #endif -#define WIDTH 128 -#define HEIGHT 64 +#define WIDTH LCD_PIXEL_WIDTH +#define HEIGHT LCD_PIXEL_HEIGHT #define PAGE_HEIGHT 8 -#define X_LO 32 -#define Y_LO 32 +#define X_LO LCD_PIXEL_OFFSET_X +#define Y_LO LCD_PIXEL_OFFSET_Y #define X_HI (X_LO + 2 * WIDTH - 1) #define Y_HI (Y_LO + 2 * HEIGHT - 1) @@ -85,11 +86,31 @@ // see https://ee-programming-notepad.blogspot.com/2016/10/16-bit-color-generator-picker.html -#define COLOR_BLACK 0x0000 -#define COLOR_WHITE 0xFFFF -#define COLOR_BLUE 0x21DD -#define COLOR_RED 0xF800 -#define COLOR_DARK 0x0003 // Some dark color +#define COLOR_BLACK 0x0000 // #000000 +#define COLOR_WHITE 0xFFFF // #FFFFFF +#define COLOR_SILVER 0xC618 // #C0C0C0 +#define COLOR_GREY 0x7BEF // #808080 +#define COLOR_DARKGREY 0x4208 // #404040 +#define COLOR_DARKGREY2 0x39E7 // #303030 +#define COLOR_DARK 0x0003 // Some dark color + +#define COLOR_RED 0xF800 // #FF0000 +#define COLOR_LIME 0x7E00 // #00FF00 +#define COLOR_BLUE 0x001F // #0000FF +#define COLOR_YELLOW 0xFFE0 // #FFFF00 +#define COLOR_MAGENTA 0xF81F // #FF00FF +#define COLOR_FUCHSIA 0xF81F // #FF00FF +#define COLOR_CYAN 0x07FF // #00FFFF +#define COLOR_AQUA 0x07FF // #00FFFF + +#define COLOR_MAROON 0x7800 // #800000 +#define COLOR_GREEN 0x03E0 // #008000 +#define COLOR_NAVY 0x000F // #000080 +#define COLOR_OLIVE 0x8400 // #808000 +#define COLOR_PURPLE 0x8010 // #800080 +#define COLOR_TEAL 0x0410 // #008080 + +#define COLOR_ORANGE 0xFC00 // #FF7F00 #ifndef TFT_MARLINUI_COLOR #define TFT_MARLINUI_COLOR COLOR_WHITE @@ -100,11 +121,14 @@ #ifndef TFT_DISABLED_COLOR #define TFT_DISABLED_COLOR COLOR_DARK #endif -#ifndef TFT_BTSLEFT_COLOR - #define TFT_BTSLEFT_COLOR COLOR_BLUE +#ifndef TFT_BTCANCEL_COLOR + #define TFT_BTCANCEL_COLOR COLOR_RED #endif -#ifndef TFT_BTRIGHT_COLOR - #define TFT_BTRIGHT_COLOR COLOR_RED +#ifndef TFT_BTARROWS_COLOR + #define TFT_BTARROWS_COLOR COLOR_BLUE +#endif +#ifndef TFT_BTOKMENU_COLOR + #define TFT_BTOKMENU_COLOR COLOR_RED #endif static uint32_t lcd_id = 0; @@ -119,8 +143,8 @@ static const uint8_t page_first_sequence[] = { }; static const uint8_t clear_screen_sequence[] = { - U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), 0x00, 0x00, 0x01, 0x3F, - U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), 0x00, 0x00, 0x00, 0xEF, + U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), 0x00, 0x00, U8G_ESC_DATA(LCD_FULL_PIXEL_WIDTH), + U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), 0x00, 0x00, U8G_ESC_DATA(LCD_FULL_PIXEL_HEIGHT), U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1), U8G_ESC_END }; @@ -141,22 +165,29 @@ static const uint8_t clear_screen_sequence[] = { U8G_ESC_END }; - static const uint8_t button0_sequence[] = { - U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(20), U8G_ESC_DATA(99), + static const uint8_t buttonD_sequence[] = { + U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(14), U8G_ESC_DATA(77), U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), U8G_ESC_DATA(185), U8G_ESC_DATA(224), U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1), U8G_ESC_END }; - static const uint8_t button1_sequence[] = { - U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(120), U8G_ESC_DATA(199), + static const uint8_t buttonA_sequence[] = { + U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(90), U8G_ESC_DATA(153), U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), U8G_ESC_DATA(185), U8G_ESC_DATA(224), U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1), U8G_ESC_END }; - static const uint8_t button2_sequence[] = { - U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(220), U8G_ESC_DATA(299), + static const uint8_t buttonB_sequence[] = { + U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(166), U8G_ESC_DATA(229), + U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), U8G_ESC_DATA(185), U8G_ESC_DATA(224), + U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1), + U8G_ESC_END + }; + + static const uint8_t buttonC_sequence[] = { + U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), U8G_ESC_DATA(242), U8G_ESC_DATA(305), U8G_ESC_ADR(0), LCD_ROW, U8G_ESC_ADR(1), U8G_ESC_DATA(185), U8G_ESC_DATA(224), U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1), U8G_ESC_END @@ -213,77 +244,151 @@ static const uint8_t ili9341_init_sequence[] = { // 0x9341 - ILI9341 #if ENABLED(TOUCH_BUTTONS) - static const uint8_t button0[] = { - B01111111,B11111111,B11111111,B11111111,B11111110, - B10000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00010000,B00000000,B00000001, - B10000000,B00000000,B00010000,B00000000,B00000001, - B10000000,B01000000,B00010000,B00000000,B00000001, - B10000000,B11100000,B00010000,B00000000,B00000001, - B10000001,B11110000,B00010000,B00000000,B00000001, - B10000011,B11111000,B00010000,B00000000,B00000001, - B10000111,B11111100,B00010000,B11111111,B11100001, - B10000000,B11100000,B00010000,B11111111,B11100001, - B10000000,B11100000,B00010000,B00000000,B00000001, - B10000000,B11100000,B00010000,B00000000,B00000001, - B10000000,B11100000,B00010000,B00000000,B00000001, - B10000000,B11100000,B00010000,B00000000,B00000001, - B10000000,B00000000,B00010000,B00000000,B00000001, - B10000000,B00000000,B00010000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000001, - B01111111,B11111111,B11111111,B11111111,B11111110, + static const uint8_t buttonD[] = { + B01111111,B11111111,B11111111,B11111110, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00011000,B00110000,B00000001, + B10000000,B00001100,B01100000,B00000001, + B10000000,B00000110,B11000000,B00000001, + B10000000,B00000011,B10000000,B00000001, + B10000000,B00000011,B10000000,B00000001, + B10000000,B00000110,B11000000,B00000001, + B10000000,B00001100,B01100000,B00000001, + B10000000,B00011000,B00110000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B01111111,B11111111,B11111111,B11111110, }; - static const uint8_t button1[] = { - B01111111,B11111111,B11111111,B11111111,B11111110, - B10000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00010000,B00000000,B00000001, - B10000000,B00000000,B00010000,B00000110,B00000001, - B10000000,B11100000,B00010000,B00000110,B00000001, - B10000000,B11100000,B00010000,B00000110,B00000001, - B10000000,B11100000,B00010000,B00000110,B00000001, - B10000000,B11100000,B00010000,B00000110,B00000001, - B10000000,B11100000,B00010000,B11111111,B11110001, - B10000111,B11111100,B00010000,B11111111,B11110001, - B10000011,B11111000,B00010000,B00000110,B00000001, - B10000001,B11110000,B00010000,B00000110,B00000001, - B10000000,B11100000,B00010000,B00000110,B00000001, - B10000000,B01000000,B00010000,B00000110,B00000001, - B10000000,B00000000,B00010000,B00000110,B00000001, - B10000000,B00000000,B00010000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000001, - B01111111,B11111111,B11111111,B11111111,B11111110, - }; + #if ENABLED(REVERSE_MENU_DIRECTION) - static const uint8_t button2[] = { - B01111111,B11111111,B11111111,B11111111,B11111110, - B10000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000001,B11000000,B00000001, - B10000000,B00000000,B01000001,B11000000,B00000001, - B10000000,B00000000,B11000001,B11000000,B00000001, - B10000000,B00000001,B11111111,B11000000,B00000001, - B10000000,B00000011,B11111111,B11000000,B00000001, - B10000000,B00000001,B11111111,B11000000,B00000001, - B10000000,B00000000,B11000000,B00000000,B00000001, - B10000000,B00000000,B01000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000001, - B10000000,B00000000,B00000000,B00000000,B00000001, - B01111111,B11111111,B11111111,B11111111,B11111110, + static const uint8_t buttonA[] = { + B01111111,B11111111,B11111111,B11111110, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B11100000,B00111111,B11100001, + B10000111,B11111100,B00111111,B11100001, + B10000011,B11111000,B00000000,B00000001, + B10000001,B11110000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B01000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B01111111,B11111111,B11111111,B11111110, + }; + static const uint8_t buttonB[] = { + B01111111,B11111111,B11111111,B11111110, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B01100000,B00000010,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B01100000,B00001111,B10000001, + B10000000,B01100000,B00011111,B11000001, + B10000111,B11111110,B00111111,B11100001, + B10000111,B11111110,B00000111,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B01111111,B11111111,B11111111,B11111110, + }; + + #else + + static const uint8_t buttonA[] = { + B01111111,B11111111,B11111111,B11111110, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B01000000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000001,B11110000,B00000000,B00000001, + B10000011,B11111000,B00000000,B00000001, + B10000111,B11111100,B00111111,B11100001, + B10000000,B11100000,B00111111,B11100001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B11100000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B01111111,B11111111,B11111111,B11111110, + }; + + static const uint8_t buttonB[] = { + B01111111,B11111111,B11111111,B11111110, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B01100000,B00000111,B00000001, + B10000111,B11111110,B00000111,B00000001, + B10000111,B11111110,B00111111,B11100001, + B10000000,B01100000,B00011111,B11000001, + B10000000,B01100000,B00001111,B10000001, + B10000000,B01100000,B00000111,B00000001, + B10000000,B01100000,B00000010,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B01111111,B11111111,B11111111,B11111110, + }; + + #endif + + static const uint8_t buttonC[] = { + B01111111,B11111111,B11111111,B11111110, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00011100,B00000001, + B10000000,B00000100,B00011100,B00000001, + B10000000,B00001100,B00011100,B00000001, + B10000000,B00011111,B11111100,B00000001, + B10000000,B00111111,B11111100,B00000001, + B10000000,B00011111,B11111100,B00000001, + B10000000,B00001100,B00000000,B00000001, + B10000000,B00000100,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000001, + B01111111,B11111111,B11111111,B11111110, }; void drawImage(const uint8_t *data, u8g_t *u8g, u8g_dev_t *dev, uint16_t length, uint16_t height, uint16_t color) { - uint16_t buffer[160]; + uint16_t buffer[128]; for (uint16_t i = 0; i < height; i++) { uint16_t k = 0; @@ -315,11 +420,8 @@ static const uint8_t ili9341_init_sequence[] = { // 0x9341 - ILI9341 // Used to fill RGB565 (16bits) background inline void memset2(const void *ptr, uint16_t fill, size_t cnt) { - uint16_t* wptr = (uint16_t*) ptr; - for (size_t i = 0; i < cnt; i += 2) { - *wptr = fill; - wptr++; - } + uint16_t* wptr = (uint16_t*)ptr; + for (size_t i = 0; i < cnt; i += 2) { *wptr = fill; wptr++; } } static bool preinit = true; @@ -332,7 +434,7 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u uint16_t* buffer = &bufferA[0]; bool allow_async = true; #else - uint16_t buffer[256]; // 16-bit RGB 565 pixel line buffer + uint16_t buffer[WIDTH*2]; // 16-bit RGB 565 pixel line buffer #endif switch (msg) { case U8G_DEV_MSG_INIT: @@ -350,6 +452,7 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u return u8g_dev_pb8v1_base_fn(u8g, dev, msg, arg); } + // Clear Screen Sequence u8g_WriteEscSeqP(u8g, dev, clear_screen_sequence); #ifdef LCD_USE_DMA_FSMC LCD_IO_WriteMultiple(TFT_MARLINBG_COLOR, (320*240)); @@ -377,15 +480,17 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u u8g_WriteSequence(u8g, dev, 150, (uint8_t *)buffer); #endif - u8g_WriteEscSeqP(u8g, dev, button0_sequence); - drawImage(button0, u8g, dev, 40, 20, TFT_BTSLEFT_COLOR); + u8g_WriteEscSeqP(u8g, dev, buttonD_sequence); + drawImage(buttonD, u8g, dev, 32, 20, TFT_BTCANCEL_COLOR); - u8g_WriteEscSeqP(u8g, dev, button1_sequence); - drawImage(button1, u8g, dev, 40, 20, TFT_BTSLEFT_COLOR); + u8g_WriteEscSeqP(u8g, dev, buttonA_sequence); + drawImage(buttonA, u8g, dev, 32, 20, TFT_BTARROWS_COLOR); - u8g_WriteEscSeqP(u8g, dev, button2_sequence); - drawImage(button2, u8g, dev, 40, 20, TFT_BTRIGHT_COLOR); + u8g_WriteEscSeqP(u8g, dev, buttonB_sequence); + drawImage(buttonB, u8g, dev, 32, 20, TFT_BTARROWS_COLOR); + u8g_WriteEscSeqP(u8g, dev, buttonC_sequence); + drawImage(buttonC, u8g, dev, 32, 20, TFT_BTOKMENU_COLOR); #endif // TOUCH_BUTTONS return 0; @@ -398,9 +503,9 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u break; case U8G_DEV_MSG_PAGE_NEXT: - if (++page > 8) return 1; + if (++page > (HEIGHT / PAGE_HEIGHT)) return 1; - for (uint8_t y = 0; y < 8; y++) { + for (uint8_t y = 0; y < PAGE_HEIGHT; y++) { uint32_t k = 0; #ifdef LCD_USE_DMA_FSMC buffer = (y & 1) ? bufferB : bufferA; @@ -422,11 +527,12 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u else LCD_IO_WriteSequence(buffer, 512); #else + uint8_t* bufptr = (uint8_t*) buffer; for (uint8_t i = 2; i--;) { - u8g_WriteSequence(u8g, dev, 128, (uint8_t*)buffer); - u8g_WriteSequence(u8g, dev, 128, (uint8_t*)&(buffer[64])); - u8g_WriteSequence(u8g, dev, 128, (uint8_t*)&(buffer[128])); - u8g_WriteSequence(u8g, dev, 128, (uint8_t*)&(buffer[192])); + u8g_WriteSequence(u8g, dev, WIDTH, &bufptr[0]); + u8g_WriteSequence(u8g, dev, WIDTH, &bufptr[WIDTH]); + u8g_WriteSequence(u8g, dev, WIDTH, &bufptr[WIDTH*2]); + u8g_WriteSequence(u8g, dev, WIDTH, &bufptr[WIDTH*3]); } #endif } diff --git a/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp index e7750b4ac4..5a1326daf9 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp @@ -57,8 +57,6 @@ #if HAS_GRAPHICAL_LCD -#include - #include "HAL_LCD_com_defines.h" #define WIDTH 128 @@ -75,7 +73,8 @@ #define UC1701_V5_RATIO(N) (0x20 | ((N) & 0x7)) #define UC1701_CONTRAST(N) (0x81), (N) -#define UC1701_COLUMN_ADR(N) (0x10 | (((N) >> 4) & 0xF)), ((N) & 0xF) +#define UC1701_COLUMN_HI(N) (0x10 | (((N) >> 4) & 0xF)) +#define UC1701_COLUMN_ADR(N) UC1701_COLUMN_HI(N), ((N) & 0xF) #define UC1701_PAGE_ADR(N) (0xB0 | (N)) #define UC1701_START_LINE(N) (0x40 | (N)) #define UC1701_INDICATOR(N) (0xAC), (N) @@ -84,43 +83,57 @@ #define UC1701_BOOST_RATIO(N) (0xF8), (N) static const uint8_t u8g_dev_uc1701_mini12864_HAL_init_seq[] PROGMEM = { - U8G_ESC_CS(0), /* disable chip */ - U8G_ESC_ADR(0), /* instruction mode */ - U8G_ESC_RST(1), /* do reset low pulse with (1*16)+2 milliseconds */ - U8G_ESC_CS(1), /* enable chip */ + U8G_ESC_CS(0), // disable chip + U8G_ESC_ADR(0), // instruction mode + U8G_ESC_RST(1), // do reset low pulse with (1*16)+2 milliseconds + U8G_ESC_CS(1), // enable chip - UC1701_RESET(), /* soft reset */ - UC1701_START_LINE(0), /* set display start line to 0 */ - UC1701_ADC_REVERSE(0), /* ADC set to reverse */ - UC1701_OUT_MODE(1), /* common output mode */ - UC1701_INVERTED(0), /* display normal, bit val 0: LCD pixel off. */ - UC1701_BIAS_MODE(0), /* LCD bias 1/9 */ - UC1701_POWER_CONTROL(0x7), /* all power control circuits on */ - UC1701_BOOST_RATIO(0x0), /* set booster ratio to 4x */ - UC1701_V5_RATIO(3), /* set V0 voltage resistor ratio to large */ - UC1701_CONTRAST(0x27), /* set contrast */ - UC1701_INDICATOR(0), /* indicator */ - UC1701_ON(1), /* display on */ + UC1701_RESET(), // soft reset + UC1701_START_LINE(0), // set display start line to 0 + UC1701_ADC_REVERSE(0), // ADC set to reverse + UC1701_OUT_MODE(1), // common output mode + UC1701_INVERTED(0), // display normal, bit val 0: LCD pixel off + UC1701_BIAS_MODE(0), // LCD bias 1/9 + UC1701_POWER_CONTROL(0x7), // all power control circuits on + UC1701_BOOST_RATIO(0x0), // set booster ratio to 4x + UC1701_V5_RATIO(3), // set V0 voltage resistor ratio to large + UC1701_CONTRAST(0x27), // set contrast + UC1701_INDICATOR(0), // indicator disable + UC1701_ON(1), // display on - U8G_ESC_CS(0), /* disable chip */ - U8G_ESC_DLY(100), /* delay 100 ms */ - U8G_ESC_CS(1), /* enable chip */ + U8G_ESC_CS(0), // disable chip + U8G_ESC_DLY(100), // delay 100 ms + U8G_ESC_CS(1), // enable chip - UC1701_ALL_PIX(1), /* display all points, ST7565 */ - U8G_ESC_CS(0), /* disable chip */ - U8G_ESC_DLY(100), /* delay 100 ms */ - U8G_ESC_DLY(100), /* delay 100 ms */ - U8G_ESC_CS(1), /* enable chip */ - UC1701_ALL_PIX(0), /* normal display */ - U8G_ESC_CS(0), /* disable chip */ - U8G_ESC_END /* end of sequence */ + UC1701_ALL_PIX(1), // display all points, ST7565 + U8G_ESC_CS(0), // disable chip + U8G_ESC_DLY(100), // delay 100 ms + U8G_ESC_DLY(100), // delay 100 ms + U8G_ESC_CS(1), // enable chip + UC1701_ALL_PIX(0), // normal display + U8G_ESC_CS(0), // disable chip + U8G_ESC_END // end of sequence }; static const uint8_t u8g_dev_uc1701_mini12864_HAL_data_start[] PROGMEM = { - U8G_ESC_ADR(0), /* instruction mode */ - U8G_ESC_CS(1), /* enable chip */ - UC1701_COLUMN_ADR(0), /* address 0 */ - U8G_ESC_END /* end of sequence */ + U8G_ESC_ADR(0), // instruction mode + U8G_ESC_CS(1), // enable chip + #if ENABLED(MKS_MINI_12864) + UC1701_START_LINE(0), // set display start line to 0 + UC1701_ADC_REVERSE(0), // ADC set to reverse + UC1701_OUT_MODE(1), // common output mode + UC1701_INVERTED(0), // display normal, bit val 0: LCD pixel off + UC1701_BIAS_MODE(0), // LCD bias 1/9 + UC1701_POWER_CONTROL(0x7),// all power control circuits on + UC1701_BOOST_RATIO(0x0), // set booster ratio to 4x + UC1701_V5_RATIO(3), // set V0 voltage resistor ratio to large + UC1701_INDICATOR(0), // indicator disable + UC1701_ON(1), // display on + UC1701_COLUMN_HI(0), // set upper 4 bit of the col adr to 0 + #else + UC1701_COLUMN_ADR(0), // address 0 + #endif + U8G_ESC_END // end of sequence }; uint8_t u8g_dev_uc1701_mini12864_HAL_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { @@ -157,32 +170,45 @@ uint8_t u8g_dev_uc1701_mini12864_HAL_2x_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t m case U8G_DEV_MSG_INIT: u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS); u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_init_seq); + #if ENABLED(MKS_MINI_12864) + u8g_Delay(5); + #endif break; case U8G_DEV_MSG_STOP: break; case U8G_DEV_MSG_PAGE_NEXT: { u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem); - u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start); - u8g_WriteByte(u8g, dev, 0x0B0 | (2*pb->p.page)); /* select current page */ - u8g_SetAddress(u8g, dev, 1); /* data mode */ + #if ENABLED(MKS_MINI_12864) + u8g_Delay(5); + #endif + u8g_WriteByte(u8g, dev, 0x0B0 | (2 * pb->p.page)); /* select current page */ + u8g_SetAddress(u8g, dev, 1); /* data mode */ u8g_WriteSequence(u8g, dev, pb->width, (uint8_t *)pb->buf); u8g_SetChipSelect(u8g, dev, 0); - u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start); - u8g_WriteByte(u8g, dev, 0x0B0 | (2*pb->p.page+1)); /* select current page */ - u8g_SetAddress(u8g, dev, 1); /* data mode */ + #if ENABLED(MKS_MINI_12864) + u8g_Delay(5); + #endif + u8g_WriteByte(u8g, dev, 0x0B0 | (2 * pb->p.page + 1)); /* select current page */ + u8g_SetAddress(u8g, dev, 1); /* data mode */ u8g_WriteSequence(u8g, dev, pb->width, (uint8_t *)(pb->buf)+pb->width); u8g_SetChipSelect(u8g, dev, 0); } break; case U8G_DEV_MSG_CONTRAST: u8g_SetChipSelect(u8g, dev, 1); - u8g_SetAddress(u8g, dev, 0); /* instruction mode */ + #if ENABLED(MKS_MINI_12864) + u8g_Delay(5); + #endif + u8g_SetAddress(u8g, dev, 0); /* instruction mode */ u8g_WriteByte(u8g, dev, 0x081); u8g_WriteByte(u8g, dev, (*(uint8_t *)arg) >> 2); u8g_SetChipSelect(u8g, dev, 0); + #if ENABLED(MKS_MINI_12864) + u8g_Delay(5); + #endif return 1; } return u8g_dev_pb16v1_base_fn(u8g, dev, msg, arg); diff --git a/Marlin/src/lcd/dogm/u8g_fontutf8.cpp b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp index fe6cf9266c..b976e2777c 100644 --- a/Marlin/src/lcd/dogm/u8g_fontutf8.cpp +++ b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp @@ -119,7 +119,7 @@ static font_group_t g_fontgroup_root = { nullptr, 0 }; /** * @brief check if font is loaded */ -static inline bool uxg_Utf8FontIsInited(void) { return flag_fontgroup_was_inited; } +static inline bool uxg_Utf8FontIsInited() { return flag_fontgroup_was_inited; } int uxg_SetUtf8Fonts (const uxg_fontinfo_t * fntinfo, int number) { flag_fontgroup_was_inited = 1; diff --git a/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp b/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp index 9d9622cd61..7eb51eea4d 100644 --- a/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp +++ b/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp @@ -21,7 +21,7 @@ */ /** - * ultralcd_DOGM.cpp + * lcd/dogm/ultralcd_DOGM.h * * Implementation of the LCD display routines for a DOGM128 graphic display. * by STB for ErikZalm/Marlin. Common LCD 128x64 pixel graphic displays. @@ -30,9 +30,9 @@ * License: http://opensource.org/licenses/BSD-3-Clause * * With the use of: - * u8glib by Oliver Kraus - * https://github.com/olikraus/U8glib_Arduino - * License: http://opensource.org/licenses/BSD-3-Clause + * u8glib by Oliver Kraus + * https://github.com/olikraus/U8glib_Arduino + * License: http://opensource.org/licenses/BSD-3-Clause */ #include "../../inc/MarlinConfigPre.h" @@ -60,7 +60,7 @@ #endif #if ENABLED(AUTO_BED_LEVELING_UBL) - #include "../../feature/bedlevel/ubl/ubl.h" + #include "../../feature/bedlevel/bedlevel.h" #endif /** @@ -81,7 +81,7 @@ U8G_CLASS u8g(U8G_PARAM); #if HAS_LCD_CONTRAST - int16_t MarlinUI::contrast; // Initialized by settings.load() + int16_t MarlinUI::contrast = DEFAULT_LCD_CONTRAST; void MarlinUI::set_contrast(const int16_t value) { contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX); @@ -159,22 +159,19 @@ bool MarlinUI::detected() { return true; } } #endif // SHOW_CUSTOM_BOOTSCREEN - // Draws a slice of the Marlin bootscreen, without the u8g loop - void MarlinUI::draw_marlin_bootscreen() { - // Screen dimensions. - //const u8g_uint_t width = u8g.getWidth(), height = u8g.getHeight(); - constexpr u8g_uint_t width = LCD_PIXEL_WIDTH, height = LCD_PIXEL_HEIGHT; + // Two-part needed to display all info + constexpr bool two_part = ((LCD_PIXEL_HEIGHT) - (START_BMPHEIGHT)) < ((MENU_FONT_ASCENT) * 2); + + // Draw the static Marlin bootscreen from a u8g loop + // or the animated boot screen within its own u8g loop + void MarlinUI::draw_marlin_bootscreen(const bool line2/*=false*/) { // Determine text space needed - #ifndef STRING_SPLASH_LINE2 - constexpr u8g_uint_t text_total_height = MENU_FONT_HEIGHT, - text_width_2 = 0; - #else - constexpr u8g_uint_t text_total_height = (MENU_FONT_HEIGHT) * 2, - text_width_2 = u8g_uint_t((sizeof(STRING_SPLASH_LINE2) - 1) * (MENU_FONT_WIDTH)); - #endif - constexpr u8g_uint_t text_width_1 = u8g_uint_t((sizeof(STRING_SPLASH_LINE1) - 1) * (MENU_FONT_WIDTH)), + constexpr u8g_uint_t text_width_1 = u8g_uint_t((sizeof(SHORT_BUILD_VERSION) - 1) * (MENU_FONT_WIDTH)), + text_width_2 = u8g_uint_t((sizeof(MARLIN_WEBSITE_URL) - 1) * (MENU_FONT_WIDTH)), text_max_width = _MAX(text_width_1, text_width_2), + text_total_height = (MENU_FONT_HEIGHT) * 2, + width = LCD_PIXEL_WIDTH, height = LCD_PIXEL_HEIGHT, rspace = width - (START_BMPWIDTH); u8g_int_t offx, offy, txt_base, txt_offx_1, txt_offx_2; @@ -189,8 +186,8 @@ bool MarlinUI::detected() { return true; } } else { constexpr int8_t inter = (height - text_total_height - (START_BMPHEIGHT)) / 3; // Evenly distribute vertical space - offy = inter; // V-align boot logo proportionally offx = rspace / 2; // Center the boot logo in the whole space + offy = inter; // V-align boot logo proportionally txt_offx_1 = (width - text_width_1) / 2; // Text 1 centered txt_offx_2 = (width - text_width_2) / 2; // Text 2 centered txt_base = offy + START_BMPHEIGHT + offy + text_total_height - (MENU_FONT_DESCENT); // Even spacing looks best @@ -198,15 +195,15 @@ bool MarlinUI::detected() { return true; } NOLESS(offx, 0); NOLESS(offy, 0); - auto draw_bootscreen_bmp = [&](const uint8_t *bitmap) { + auto _draw_bootscreen_bmp = [&](const uint8_t *bitmap) { u8g.drawBitmapP(offx, offy, START_BMP_BYTEWIDTH, START_BMPHEIGHT, bitmap); set_font(FONT_MENU); - #ifndef STRING_SPLASH_LINE2 - lcd_put_u8str_P(txt_offx_1, txt_base, PSTR(STRING_SPLASH_LINE1)); - #else - lcd_put_u8str_P(txt_offx_1, txt_base - (MENU_FONT_HEIGHT), PSTR(STRING_SPLASH_LINE1)); - lcd_put_u8str_P(txt_offx_2, txt_base, PSTR(STRING_SPLASH_LINE2)); - #endif + if (!two_part || !line2) lcd_put_u8str_P(txt_offx_1, txt_base - (MENU_FONT_HEIGHT), PSTR(SHORT_BUILD_VERSION)); + if (!two_part || line2) lcd_put_u8str_P(txt_offx_2, txt_base, PSTR(MARLIN_WEBSITE_URL)); + }; + + auto draw_bootscreen_bmp = [&](const uint8_t *bitmap) { + u8g.firstPage(); do { _draw_bootscreen_bmp(bitmap); } while (u8g.nextPage()); }; #if DISABLED(BOOT_MARLIN_LOGO_ANIMATED) @@ -214,24 +211,22 @@ bool MarlinUI::detected() { return true; } #else constexpr millis_t d = MARLIN_BOOTSCREEN_FRAME_TIME; LOOP_L_N(f, COUNT(marlin_bootscreen_animation)) { - u8g.firstPage(); - do { - const u8g_pgm_uint8_t * const bmp = (u8g_pgm_uint8_t*)pgm_read_ptr(&marlin_bootscreen_animation[f]); - draw_bootscreen_bmp(bmp); - } while (u8g.nextPage()); + draw_bootscreen_bmp((uint8_t*)pgm_read_ptr(&marlin_bootscreen_animation[f])); if (d) safe_delay(d); } #endif } - // Shows the Marlin bootscreen, with the u8g loop and delays + // Show the Marlin bootscreen, with the u8g loop and delays void MarlinUI::show_marlin_bootscreen() { #ifndef BOOTSCREEN_TIMEOUT #define BOOTSCREEN_TIMEOUT 2500 #endif - u8g.firstPage(); - do { draw_marlin_bootscreen(); } while (u8g.nextPage()); - safe_delay(BOOTSCREEN_TIMEOUT); + constexpr uint8_t pages = two_part ? 2 : 1; + for (uint8_t q = pages; q--;) { + draw_marlin_bootscreen(q == 0); + safe_delay((BOOTSCREEN_TIMEOUT) / pages); + } } void MarlinUI::show_bootscreen() { @@ -314,6 +309,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop #if HAS_LCD_MENU + #include "../menu/menu.h" + u8g_uint_t row_y1, row_y2; #if ENABLED(ADVANCED_PAUSE_FEATURE) @@ -366,13 +363,13 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop } // Draw a static line of text in the same idiom as a menu item - void draw_menu_item_static(const uint8_t row, PGM_P pstr, const bool center/*=true*/, const bool invert/*=false*/, const char* valstr/*=nullptr*/) { + void draw_menu_item_static(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_CENTER*/, const char * const valstr/*=nullptr*/) { - if (mark_as_selected(row, invert)) { + if (mark_as_selected(row, (style & SS_INVERT))) { u8g_uint_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed - if (center && !valstr) { + if ((style & SS_CENTER) && !valstr) { int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; while (--pad >= 0) { lcd_put_wchar(' '); n--; } } diff --git a/Marlin/src/lcd/dogm/ultralcd_DOGM.h b/Marlin/src/lcd/dogm/ultralcd_DOGM.h index 4d9662d7db..e8d1b8a1e3 100644 --- a/Marlin/src/lcd/dogm/ultralcd_DOGM.h +++ b/Marlin/src/lcd/dogm/ultralcd_DOGM.h @@ -22,7 +22,7 @@ #pragma once /** - * ultralcd_DOGM.h + * lcd/dogm/ultralcd_DOGM.h */ #include "../../inc/MarlinConfigPre.h" @@ -30,7 +30,8 @@ #include #include "HAL_LCD_class_defines.h" -// LCD selection +//#define ALTERNATIVE_LCD + #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #define U8G_CLASS U8GLIB_ST7920_128X64_4X #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN) @@ -40,102 +41,159 @@ #endif #elif ENABLED(U8GLIB_ST7920) + // RepRap Discount Full Graphics Smart Controller + #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN) - #define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL - #define U8G_PARAM LCD_PINS_RS // 2 stripes, HW SPI (shared with SD card, on AVR does not use standard LCD adapter) + #define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL // 2 stripes, HW SPI (Shared with SD card. Non-standard LCD adapter on AVR.) + #define U8G_PARAM LCD_PINS_RS #else - //#define U8G_CLASS U8GLIB_ST7920_128X64_4X - //#define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS // Original u8glib device. 2 stripes, SW SPI - #define U8G_CLASS U8GLIB_ST7920_128X64_RRD - #define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS // Number of stripes can be adjusted in ultralcd_st7920_u8glib_rrd.h with PAGE_HEIGHT - // AVR version ignores these pin settings - // HAL version uses these pin settings + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_ST7920_128X64_4X // 2 stripes, SW SPI (Original u8glib device) + #else + #define U8G_CLASS U8GLIB_ST7920_128X64_RRD // Adjust stripes with PAGE_HEIGHT in ultralcd_st7920_u8glib_rrd.h + #endif + #define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS // AVR version ignores these pin settings + // HAL version uses these pin settings #endif #elif ENABLED(CARTESIO_UI) - // The CartesioUI display - //#define U8G_CLASS U8GLIB_DOGM128_2X - //#define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes - #define U8G_CLASS U8GLIB_DOGM128_2X - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 4 stripes + + // CartesioUI LCD + + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_DOGM128_2X // 4 stripes + #define FORCE_SOFT_SPI // SW-SPI + #else + #define U8G_CLASS U8GLIB_DOGM128_2X // 4 stripes (HW-SPI) + #endif #elif ENABLED(U8GLIB_LM6059_AF) + // Based on the Adafruit ST7565 (http://www.adafruit.com/products/250) - //#define U8G_CLASS U8GLIB_LM6059 - //#define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 8 stripes - #define U8G_CLASS U8GLIB_LM6059_2X - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 4 stripes + + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_LM6059 // 8 stripes (HW-SPI) + #else + #define U8G_CLASS U8GLIB_LM6059_2X // 4 stripes (HW-SPI) + #endif #elif ENABLED(U8GLIB_ST7565_64128N) - // The MaKrPanel, Mini Viki, Viki 2.0 & AZSMZ 12864 ST7565 controller + + // MaKrPanel, Mini Viki, Viki 2.0, AZSMZ 12864 ST7565 controller + #define SMART_RAMPS (MB(RAMPS_SMART_EFB) || MB(RAMPS_SMART_EEB) || MB(RAMPS_SMART_EFF) || MB(RAMPS_SMART_EEF) || MB(RAMPS_SMART_SF)) - #if DOGLCD_SCK == SCK_PIN && DOGLCD_MOSI == MOSI_PIN && !SMART_RAMPS - #define U8G_CLASS U8GLIB_64128N_2X_HAL - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // using HW-SPI - #else - #define U8G_CLASS U8GLIB_64128N_2X_HAL - #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // using SW-SPI + #define U8G_CLASS U8GLIB_64128N_2X_HAL // 4 stripes (HW-SPI) + #if SMART_RAMPS || DOGLCD_SCK != SCK_PIN || DOGLCD_MOSI != MOSI_PIN + #define FORCE_SOFT_SPI // SW-SPI #endif #elif ENABLED(MKS_12864OLED_SSD1306) + // MKS 128x64 (SSD1306) OLED I2C LCD - #define U8G_CLASS U8GLIB_SSD1306_128X64 - #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 8 stripes - //#define U8G_CLASS U8GLIB_SSD1306_128X64_2X - //#define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes + + #define FORCE_SOFT_SPI // SW-SPI + + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_SSD1306_128X64_2X // 4 stripes + #else + #define U8G_CLASS U8GLIB_SSD1306_128X64 // 8 stripes + #endif #elif ENABLED(U8GLIB_SSD1306) - // Generic support for SSD1306 OLED I2C LCDs - //#define U8G_CLASS U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE - //#define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes - #define U8G_CLASS U8GLIB_SSD1306_128X64_2X - #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes + + // Generic SSD1306 OLED I2C LCD + + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE // 4 stripes + #else + #define U8G_CLASS U8GLIB_SSD1306_128X64_2X // 4 stripes + #endif + #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) #elif ENABLED(MKS_12864OLED) + // MKS 128x64 (SH1106) OLED I2C LCD - #define U8G_CLASS U8GLIB_SH1106_128X64 - #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 8 stripes - //#define U8G_CLASS U8GLIB_SH1106_128X64_2X - //#define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes -#elif ENABLED(U8GLIB_SH1106) - // Generic support for SH1106 OLED I2C LCDs - //#define U8G_CLASS U8GLIB_SH1106_128X64_2X_I2C_2_WIRE - //#define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes - #define U8G_CLASS U8GLIB_SH1106_128X64_2X - #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes -#elif ENABLED(U8GLIB_SSD1309) - // Generic support for SSD1309 OLED I2C LCDs - #define U8G_CLASS U8GLIB_SSD1309_128X64 - #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) -#elif ENABLED(MINIPANEL) - // MINIPanel display - //#define U8G_CLASS U8GLIB_MINI12864 - //#define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 8 stripes - #define U8G_CLASS U8GLIB_MINI12864_2X - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 8 stripes -#elif ENABLED(FYSETC_MINI_12864) - // The FYSETC_MINI_12864 display - #define U8G_CLASS U8GLIB_MINI12864_2X_HAL - #if ENABLED(FORCE_SOFT_SPI) - #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes SW-SPI + + #define FORCE_SOFT_SPI // SW-SPI + + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_SH1106_128X64_2X // 4 stripes #else - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 4 stripes HW-SPI + #define U8G_CLASS U8GLIB_SH1106_128X64 // 8 stripes #endif + +#elif ENABLED(U8GLIB_SH1106) + + // Generic SH1106 OLED I2C LCD + + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_SH1106_128X64_2X_I2C_2_WIRE // 4 stripes + #else + #define U8G_CLASS U8GLIB_SH1106_128X64_2X // 4 stripes + #endif + #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // I2C + +#elif ENABLED(U8GLIB_SSD1309) + + // Generic support for SSD1309 OLED I2C LCDs + + #define U8G_CLASS U8GLIB_SSD1309_128X64 + #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // I2C + +#elif ENABLED(FYSETC_MINI_12864) + + // The FYSETC Mini 12864 display + + #define U8G_CLASS U8GLIB_MINI12864_2X_HAL // 4 stripes + +#elif ENABLED(MKS_MINI_12864) + + // The MKS_MINI_12864 V1/V2 aren't exact copies of the MiniPanel. + // Panel management is in u8g_dev_uc1701_mini12864_HAL.cpp with + // extra delays added to remove glitches seen with fast MCUs. + + #define U8G_CLASS U8GLIB_MINI12864_2X_HAL // 8 stripes (HW-SPI) + +#elif ENABLED(MINIPANEL) + + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_MINI12864 + #else + #define U8G_CLASS U8GLIB_MINI12864_2X // 8 stripes (HW-SPI) + #endif + #elif ENABLED(U8GLIB_SH1106_EINSTART) + // Connected via motherboard header + #define U8G_CLASS U8GLIB_SH1106_128X64 #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, LCD_PINS_DC, LCD_PINS_RS + #elif ENABLED(FSMC_GRAPHICAL_TFT) + // Unspecified 320x240 TFT pre-initialized by built-in bootloader + #define U8G_CLASS U8GLIB_TFT_320X240_UPSCALE_FROM_128X64 #define U8G_PARAM FSMC_CS_PIN, FSMC_RS_PIN + #else - // for regular DOGM128 display with HW-SPI - //#define U8G_CLASS U8GLIB_DOGM128 - //#define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // HW-SPI Com: CS, A0 // 8 stripes - #define U8G_CLASS U8GLIB_DOGM128_2X - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // HW-SPI Com: CS, A0 // 4 stripes + + #if ENABLED(ALTERNATIVE_LCD) + #define U8G_CLASS U8GLIB_DOGM128 // 8 stripes (HW-SPI) + #else + #define U8G_CLASS U8GLIB_DOGM128_2X // 4 stripes (HW-SPI) + #endif + +#endif + +// Use HW-SPI if no other option is specified +#ifndef U8G_PARAM + #if ENABLED(FORCE_SOFT_SPI) + #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // SW-SPI + #else + #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // HW-SPI + #endif #endif #ifndef LCD_PIXEL_WIDTH @@ -145,6 +203,15 @@ #define LCD_PIXEL_HEIGHT 64 #endif +// LCD_FULL_PIXEL_WIDTH = +// LCD_PIXEL_OFFSET_X + (LCD_PIXEL_WIDTH * 2) + LCD_PIXEL_OFFSET_X +#if ENABLED(FSMC_GRAPHICAL_TFT) + #define LCD_FULL_PIXEL_WIDTH 320 + #define LCD_PIXEL_OFFSET_X 32 + #define LCD_FULL_PIXEL_HEIGHT 240 + #define LCD_PIXEL_OFFSET_Y 32 +#endif + // For selective rendering within a Y range #define PAGE_OVER(ya) ((ya) <= u8g.getU8g()->current_page.y1) // Does the current page follow a region top? #define PAGE_UNDER(yb) ((yb) >= u8g.getU8g()->current_page.y0) // Does the current page precede a region bottom? diff --git a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp index bc808b2a35..2187185146 100644 --- a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp +++ b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp @@ -23,9 +23,13 @@ // NOTE - the HAL version of the rrd device uses a generic ST7920 device. See the // file u8g_dev_st7920_128x64_HAL.cpp for the HAL version. +#include "../../inc/MarlinConfigPre.h" + +#if !defined(U8G_HAL_LINKS) && ANY(__AVR__, ARDUINO_ARCH_STM32) + #include "../../inc/MarlinConfig.h" -#if ENABLED(U8GLIB_ST7920) && !defined(U8G_HAL_LINKS) && !defined(__SAM3X8E__) +#if ENABLED(U8GLIB_ST7920) #include "ultralcd_st7920_u8glib_rrd_AVR.h" @@ -135,8 +139,8 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo } uint8_t u8g_dev_st7920_128x64_rrd_buf[(LCD_PIXEL_WIDTH) * (PAGE_HEIGHT) / 8] U8G_NOCOMMON; -u8g_pb_t u8g_dev_st7920_128x64_rrd_pb = {{PAGE_HEIGHT, LCD_PIXEL_HEIGHT, 0, 0, 0}, LCD_PIXEL_WIDTH, u8g_dev_st7920_128x64_rrd_buf}; -u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = {u8g_dev_rrd_st7920_128x64_fn, &u8g_dev_st7920_128x64_rrd_pb, &u8g_com_null_fn}; +u8g_pb_t u8g_dev_st7920_128x64_rrd_pb = { { PAGE_HEIGHT, LCD_PIXEL_HEIGHT, 0, 0, 0 }, LCD_PIXEL_WIDTH, u8g_dev_st7920_128x64_rrd_buf }; +u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = { u8g_dev_rrd_st7920_128x64_fn, &u8g_dev_st7920_128x64_rrd_pb, &u8g_com_null_fn }; #pragma GCC reset_options @@ -149,4 +153,5 @@ u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = {u8g_dev_rrd_st7920_128x64_fn, &u8g void ST7920_write_byte(const uint8_t val) { ST7920_WRITE_BYTE(val); } #endif -#endif // U8GLIB_ST7920 && !U8G_HAL_LINKS && !__SAM3X8E__ +#endif // U8GLIB_ST7920 +#endif // __AVR__ && !U8G_HAL_LINKS diff --git a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h index 12f5ef9a86..960375ae43 100644 --- a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h +++ b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h @@ -25,9 +25,6 @@ // file u8g_dev_st7920_128x64_HAL.cpp for the HAL version. #include "../../inc/MarlinConfig.h" - -#if ENABLED(U8GLIB_ST7920) && !defined(U8G_HAL_LINKS) && !defined(__SAM3X8E__) - #include "../../HAL/shared/Delay.h" #define ST7920_CLK_PIN LCD_PINS_D4 @@ -94,5 +91,3 @@ void ST7920_SWSPI_SND_8BIT(uint8_t val); #define ST7920_SET_DAT() { ST7920_SWSPI_SND_8BIT(0xFA); U8G_DELAY(); } #define ST7920_WRITE_BYTE(a) { ST7920_SWSPI_SND_8BIT((uint8_t)((a)&0xF0u)); ST7920_SWSPI_SND_8BIT((uint8_t)((a)<<4u)); U8G_DELAY(); } #define ST7920_WRITE_BYTES(p,l) { for (uint8_t i = l + 1; --i;) { ST7920_SWSPI_SND_8BIT(*p&0xF0); ST7920_SWSPI_SND_8BIT(*p<<4); p++; } U8G_DELAY(); } - -#endif // U8GLIB_ST7920 && !U8G_HAL_LINKS && !__SAM3X8E__ diff --git a/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.cpp b/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.cpp index 60a534a307..1fb3783b2d 100644 --- a/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplay.cpp @@ -103,7 +103,7 @@ public: // ISR for Rx void store_rxd_char(); // ISR for Tx (UDRE vector) - void tx_udr_empty_irq(void); + void tx_udr_empty_irq(); inline volatile bool is_rx_overrun() { return dgus_rx_overrun; @@ -289,11 +289,11 @@ void DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable // Don't let the user in the dark why there is no reaction. if (!ExtUI::isMediaInserted()) { - setstatusmessagePGM(PSTR("No SD Card")); + setstatusmessagePGM(PSTR(MSG_NO_MEDIA)); return; } if (card.flag.abort_sd_printing) { - setstatusmessagePGM(PSTR("Aborting...")); + setstatusmessagePGM(PSTR(MSG_MEDIA_ABORTING)); return; } } @@ -313,7 +313,7 @@ void DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable DEBUG_ECHOPAIR("new topfile calculated:", top_file); if (top_file < 0) { top_file = 0; - DEBUG_ECHOLN("Top of filelist reached"); + DEBUG_ECHOLNPGM("Top of filelist reached"); } else { int16_t max_top = filelist.count() - DGUS_SD_FILESPERSCREEN; @@ -497,21 +497,25 @@ void DGUSScreenVariableHandler::HandleTemperatureChanged(DGUS_VP_Variable &var, } void DGUSScreenVariableHandler::HandleFlowRateChanged(DGUS_VP_Variable &var, void *val_ptr) { - uint16_t newvalue = swap16(*(uint16_t*)val_ptr); - uint8_t target_extruder; - switch (var.VP) { - default: return; - #if (HOTENDS >= 1) - case VP_Flowrate_E1: target_extruder = 0; break; - #endif - #if (HOTENDS >= 2) - case VP_Flowrate_E2: target_extruder = 1; break; - #endif - } + #if EXTRUDERS + uint16_t newvalue = swap16(*(uint16_t*)val_ptr); + uint8_t target_extruder; + switch (var.VP) { + default: return; + #if (HOTENDS >= 1) + case VP_Flowrate_E1: target_extruder = 0; break; + #endif + #if (HOTENDS >= 2) + case VP_Flowrate_E2: target_extruder = 1; break; + #endif + } - planner.flow_percentage[target_extruder] = newvalue; - planner.refresh_e_factor(target_extruder); - ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel + planner.flow_percentage[target_extruder] = newvalue; + planner.refresh_e_factor(target_extruder); + ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel + #else + UNUSED(var); UNUSED(val_ptr); + #endif } void DGUSScreenVariableHandler::HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr) { @@ -575,7 +579,7 @@ void DGUSScreenVariableHandler::HandleManualMove(DGUS_VP_Variable &var, void *va buf[4] = axiscode; //DEBUG_ECHOPAIR(" ", buf); while (!enqueue_and_echo_command(buf)) idle(); - //DEBUG_ECHOLN(" ✓"); + //DEBUG_ECHOLNPGM(" ✓"); ScreenHandler.ForceCompleteUpdate(); return; } @@ -584,7 +588,7 @@ void DGUSScreenVariableHandler::HandleManualMove(DGUS_VP_Variable &var, void *va DEBUG_ECHOPAIR(" move ", axiscode); bool old_relative_mode = relative_mode; if (!relative_mode) { - //DEBUG_ECHO(" G91"); + //DEBUG_ECHOPGM(" G91"); while (!enqueue_and_echo_command("G91")) idle(); //DEBUG_ECHOPGM(" ✓ "); } @@ -597,18 +601,18 @@ void DGUSScreenVariableHandler::HandleManualMove(DGUS_VP_Variable &var, void *va snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed); //DEBUG_ECHOPAIR(" ", buf); while (!enqueue_and_echo_command(buf)) idle(); - //DEBUG_ECHOLN(" ✓ "); + //DEBUG_ECHOLNPGM(" ✓ "); if (backup_speed != speed) { snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed); while (!enqueue_and_echo_command(buf)) idle(); //DEBUG_ECHOPAIR(" ", buf); } //while (!enqueue_and_echo_command(buf)) idle(); - //DEBUG_ECHOLN(" ✓ "); + //DEBUG_ECHOLNPGM(" ✓ "); if (!old_relative_mode) { - //DEBUG_ECHO("G90"); + //DEBUG_ECHOPGM("G90"); while (!enqueue_and_echo_command("G90")) idle(); - //DEBUG_ECHO(" ✓ "); + //DEBUG_ECHOPGM(" ✓ "); } } @@ -1009,7 +1013,7 @@ FORCE_INLINE void DGUSSerial::store_rxd_char() { } // (called with TX irqs disabled) -FORCE_INLINE void DGUSSerial::tx_udr_empty_irq(void) { +FORCE_INLINE void DGUSSerial::tx_udr_empty_irq() { // Read positions uint8_t t = tx_buffer.tail; const uint8_t h = tx_buffer.head; @@ -1035,7 +1039,7 @@ FORCE_INLINE void DGUSSerial::tx_udr_empty_irq(void) { if (h == t) CBI(DGUS_UCSRxB, UDRIEx); } -r_ring_buffer_pos_t DGUSSerial::available(void) { +r_ring_buffer_pos_t DGUSSerial::available() { const r_ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail; return (r_ring_buffer_pos_t) (DGUS_RX_BUFFER_SIZE + h - t) & (DGUS_RX_BUFFER_SIZE - 1); } diff --git a/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.cpp b/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.cpp index 8830873202..1ac5270c4b 100644 --- a/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/dgus/DGUSDisplayDefinition.cpp @@ -166,14 +166,14 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { // Temperature Data #if HOTENDS >= 1 - VPHELPER(VP_T_E1_Is, &thermalManager.temp_hotend[0].current, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<0>), + VPHELPER(VP_T_E1_Is, &thermalManager.temp_hotend[0].celsius, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<0>), VPHELPER(VP_T_E1_Set, &thermalManager.temp_hotend[0].target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), VPHELPER(VP_Flowrate_E1, nullptr, DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), VPHELPER(VP_EPos, &destination[3], nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>), VPHELPER(VP_MOVE_E1, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr), #endif #if HOTENDS >= 2 - VPHELPER(VP_T_E2_I, &thermalManager.temp_hotend[1].current, nullptr, DGUSLCD_SendFloatAsLongValueToDisplay<0>), + VPHELPER(VP_T_E2_I, &thermalManager.temp_hotend[1].celsius, nullptr, DGUSLCD_SendFloatAsLongValueToDisplay<0>), VPHELPER(VP_T_E2_S, &thermalManager.temp_hotend[1].target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), VPHELPER(VP_Flowrate_E2, nullptr, DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), VPHELPER(VP_MOVE_E2, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr), @@ -182,7 +182,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { #error More than 2 Hotends currently not implemented on the Display UI design. #endif #if HAS_HEATED_BED - VPHELPER(VP_T_Bed_Is, &thermalManager.temp_bed.current, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<0>), + VPHELPER(VP_T_Bed_Is, &thermalManager.temp_bed.celsius, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<0>), VPHELPER(VP_T_Bed_Set, &thermalManager.temp_bed.target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay), #endif @@ -200,7 +200,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = { VPHELPER(VP_ZPos, ¤t_position[2], nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>), // Print Progress. - VPHELPER(VP_PrintProgress_Percentage, &MarlinUI::progress_bar_percent, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay ), + VPHELPER(VP_PrintProgress_Percentage, &ui.progress_bar_percent, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay ), // Print Time VPHELPER_STR(VP_PrintTime, nullptr, VP_PrintTime_LEN, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendPrintTimeToDisplay ), diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/archim2-flash/flash_storage.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/archim2-flash/flash_storage.cpp index 2e17c6492c..360f2562a1 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/archim2-flash/flash_storage.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/archim2-flash/flash_storage.cpp @@ -178,7 +178,7 @@ bool UIFlashStorage::is_present = false; ((manufacturer_id == 0x1F) && (device_type == 0x86) && (capacity == 0x01)) ; // Adesto AT255F161 if (!is_known) { - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Unable to locate supported SPI Flash Memory."); + SERIAL_ECHO_MSG("Unable to locate supported SPI Flash Memory."); SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" Manufacturer ID, got: ", manufacturer_id); SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" Device Type , got: ", device_type); SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" Capacity , got: ", capacity); @@ -252,7 +252,7 @@ bool UIFlashStorage::is_present = false; return -1; } } - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("No LULZ delimiter found."); + SERIAL_ECHO_MSG("No LULZ delimiter found."); return -1; } @@ -264,7 +264,7 @@ bool UIFlashStorage::is_present = false; int32_t write_offset = read_offset + 4 + block_size; if ((write_offset + 4 + block_size) > data_storage_area_size) { - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Not enough free space in Flash."); + SERIAL_ECHO_MSG("Not enough free space in Flash."); return -1; // Not enough free space } return write_offset; @@ -300,7 +300,7 @@ bool UIFlashStorage::is_present = false; void UIFlashStorage::write_config_data(const void *data, size_t size) { if (!is_present) { - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("SPI Flash chip not present. Not saving UI settings."); + SERIAL_ECHO_MSG("SPI Flash chip not present. Not saving UI settings."); return; } @@ -308,7 +308,7 @@ bool UIFlashStorage::is_present = false; // make sure that the data is different before rewriting. if (verify_config_data(data, size)) { - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("UI settings already written, skipping write."); + SERIAL_ECHO_MSG("UI settings already written, skipping write."); return; } @@ -427,12 +427,12 @@ bool UIFlashStorage::is_present = false; MediaFileReader reader; if (!reader.open((char*) buff)) { - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Unable to find media file"); + SERIAL_ECHO_MSG("Unable to find media file"); return FILE_NOT_FOUND; } if (get_media_file_size(slot) != 0xFFFFFFFFUL) { - SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Media file already exists"); + SERIAL_ECHO_MSG("Media file already exists"); return WOULD_OVERWRITE; } @@ -518,9 +518,8 @@ bool UIFlashStorage::is_present = false; SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("Boot media file size:", bytes_remaining); addr = get_media_file_start(slot); return true; - } else { - return false; } + return false; } int16_t UIFlashStorage::BootMediaReader::read(void *data, const size_t size) { diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/config.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/config.h index 5313bb947f..458c901206 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/config.h +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/config.h @@ -76,6 +76,36 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED +// Enable UTF8 processing and rendering. Unsupported characters +// will be shown as '?'. +//#define TOUCH_UI_USE_UTF8 +#ifdef TOUCH_UI_USE_UTF8 + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #ifdef TOUCH_UI_UTF8_WESTERN_CHARSET + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif +#endif + +// When labels do not fit buttons, use smaller font +//#define TOUCH_UI_FIT_TEXT + +// Enable support for selection of languages at run-time +// (otherwise will use the value of LCD_LANGUAGE) +//#define TOUCH_UI_LANGUAGE_MENU + // Use a numeric passcode for "Parental lock". // This is a recommended for smaller displays. //#define TOUCH_UI_PASSCODE @@ -84,14 +114,11 @@ //#define LCD_TIMEOUT_TO_STATUS 15000 // Enable this to debug the event framework -//#define UI_FRAMEWORK_DEBUG +//#define TOUCH_UI_DEBUG // Enable the developer's menu and screens //#define DEVELOPER_SCREENS -// Maximum feed rate for manual extrusion (mm/s) -//#define MAX_MANUAL_FEEDRATE 240 - // Sets the SPI speed in Hz #define SPI_FREQUENCY 8000000 >> SPI_SPEED diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/commands.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/commands.cpp index ad34f4f191..9a04c9e835 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/commands.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/commands.cpp @@ -29,15 +29,15 @@ using namespace FTDI; using namespace FTDI::SPI; -void CLCD::enable (void) { +void CLCD::enable() { mem_write_8(REG::PCLK, Pclk); } -void CLCD::disable (void) { +void CLCD::disable() { mem_write_8(REG::PCLK, 0x00); } -void CLCD::set_brightness (uint8_t brightness) { +void CLCD::set_brightness(uint8_t brightness) { mem_write_8(REG::PWM_DUTY, min(128,brightness)); } @@ -45,11 +45,12 @@ uint8_t CLCD::get_brightness() { return mem_read_8(REG::PWM_DUTY); } -void CLCD::turn_on_backlight (void) { +void CLCD::turn_on_backlight() { mem_write_8(REG::PWM_DUTY, 128); } void CLCD::FontMetrics::load(const uint8_t font) { + static_assert(sizeof(FontMetrics) == 148, "Sizeof font metrics is incorrect"); uint32_t rom_fontroot = mem_read_32(MAP::ROM_FONT_ADDR); mem_read_bulk(rom_fontroot + 148 * (font - 16), (uint8_t*) this, 148); } @@ -65,7 +66,7 @@ uint16_t CLCD::FontMetrics::get_text_width(const char *str, size_t n) const { return width; } -uint16_t CLCD::FontMetrics::get_text_width_P(const char *str, size_t n) const { +uint16_t CLCD::FontMetrics::get_text_width(progmem_str str, size_t n) const { uint16_t width = 0; const uint8_t *p = (const uint8_t *) str; for(;;) { @@ -866,6 +867,21 @@ void CLCD::CommandFifo::setrotate (uint8_t rotation) { } #endif +#if FTDI_API_LEVEL >= 810 +void CLCD::CommandFifo::romfont (uint8_t font, uint8_t romslot) { + struct { + uint32_t type = CMD_ROMFONT; + uint32_t font; + uint32_t romslot; + } cmd_data; + + cmd_data.font = font; + cmd_data.romslot = romslot; + + cmd( &cmd_data, sizeof(cmd_data) ); +} +#endif + /**************************** FT800/810 Co-Processor Command FIFO ****************************/ bool CLCD::CommandFifo::is_processing() { @@ -905,10 +921,9 @@ template bool CLCD::CommandFifo::_write_unaligned(T data, uint16_t len uint32_t bytes_tail, bytes_head; uint32_t command_read_ptr; - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) if (command_write_ptr == 0xFFFFFFFFul) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Attempt to write to FIFO before CommandFifo::Cmd_Start()."); + SERIAL_ECHO_MSG("Attempt to write to FIFO before CommandFifo::Cmd_Start()."); } #endif @@ -924,7 +939,7 @@ template bool CLCD::CommandFifo::_write_unaligned(T data, uint16_t len } // Check for faults which can lock up the command processor if (has_fault()) { - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) SERIAL_ECHOLNPGM("Fault waiting for space in the command processor"); #endif return false; @@ -969,7 +984,7 @@ void CLCD::CommandFifo::execute() { } void CLCD::CommandFifo::reset() { - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) SERIAL_ECHOLNPGM("Resetting command processor"); #endif safe_delay(100); @@ -988,7 +1003,7 @@ template bool CLCD::CommandFifo::write(T data, uint16_t len) { const uint8_t padding = MULTIPLE_OF_4(len) - len; if (has_fault()) { - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) SERIAL_ECHOLNPGM("Faulted... ignoring write."); #endif return false; @@ -998,21 +1013,21 @@ template bool CLCD::CommandFifo::write(T data, uint16_t len) { // management. uint16_t Command_Space = mem_read_32(REG::CMDB_SPACE) & 0x0FFF; if (Command_Space < (len + padding)) { - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Waiting for ", len + padding); - SERIAL_ECHOPAIR(" bytes in command queue, now free: ", Command_Space); + SERIAL_ECHOPAIR("Waiting for ", len + padding, + " bytes in command queue, now free: ", Command_Space); #endif do { Command_Space = mem_read_32(REG::CMDB_SPACE) & 0x0FFF; if (has_fault()) { - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) SERIAL_ECHOLNPGM("... fault"); #endif return false; } } while (Command_Space < len + padding); - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) SERIAL_ECHOLNPGM("... done"); #endif } @@ -1026,17 +1041,17 @@ template bool CLCD::CommandFifo::write(progmem_str, uint16_t); // CO_PROCESSOR COMMANDS -void CLCD::CommandFifo::str (const char * data) { +void CLCD::CommandFifo::str(const char * data) { write(data, strlen(data)+1); } -void CLCD::CommandFifo::str (progmem_str data) { +void CLCD::CommandFifo::str(progmem_str data) { write(data, strlen_P((const char*)data)+1); } /******************* LCD INITIALIZATION ************************/ -void CLCD::init (void) { +void CLCD::init() { spi_init(); // Set Up I/O Lines for SPI and FT800/810 Control ftdi_reset(); // Power down/up the FT8xx with the apropriate delays @@ -1054,9 +1069,8 @@ void CLCD::init (void) { for(counter = 0; counter < 250; counter++) { uint8_t device_id = mem_read_8(REG::ID); // Read Device ID, Should Be 0x7C; if (device_id == 0x7c) { - #ifdef UI_FRAMEWORK_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("FTDI chip initialized "); + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_MSG("FTDI chip initialized "); #endif break; } @@ -1064,7 +1078,7 @@ void CLCD::init (void) { delay(1); } if (counter == 249) { - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("Timeout waiting for device ID, should be 124, got ", device_id); #endif @@ -1089,9 +1103,9 @@ void CLCD::init (void) { mem_write_8(REG::CSPREAD, FTDI::CSpread); /* write a basic display-list to get things started */ - mem_write_32(MAP::RAM_DL, DL::CLEAR_COLOR_RGB); - mem_write_32(MAP::RAM_DL + 4, (DL::CLEAR | 0x07)); /* clear color, stencil and tag buffer */ - mem_write_32(MAP::RAM_DL + 8, DL::DL_DISPLAY); /* end of display list */ + mem_write_32(MAP::RAM_DL, DL::CLEAR_COLOR_RGB); + mem_write_32(MAP::RAM_DL + 4, (DL::CLEAR | 0x07)); /* clear color, stencil and tag buffer */ + mem_write_32(MAP::RAM_DL + 8, DL::DL_DISPLAY); /* end of display list */ mem_write_8(REG::DLSWAP, 0x02); // activate display list, Bad Magic Cookie 2 = switch to new list after current frame is scanned out diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/commands.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/commands.h index f78dd45769..0426911edb 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/commands.h +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/commands.h @@ -124,12 +124,12 @@ class CLCD { class CommandFifo; class FontMetrics; - static void init (void); - static void default_touch_transform (void); - static void default_display_orientation (void); - static void turn_on_backlight (void); - static void enable (void); - static void disable (void); + static void init(); + static void default_touch_transform(); + static void default_display_orientation(); + static void turn_on_backlight(); + static void enable(); + static void disable(); static void set_brightness (uint8_t brightness); static uint8_t get_brightness(); static void host_cmd (unsigned char host_command, unsigned char byte2); @@ -159,13 +159,14 @@ class CLCD::FontMetrics { uint32_t height; uint32_t ptr; + FontMetrics() {} FontMetrics(uint8_t font) {load(font);} void load(uint8_t font); // Returns width of string, up to a maximum of n characters. uint16_t get_text_width(const char *str, size_t n = SIZE_MAX) const; - uint16_t get_text_width_P(const char *str, size_t n = SIZE_MAX) const; + uint16_t get_text_width(progmem_str str, size_t n = SIZE_MAX) const; }; /******************* FT800/810 Graphic Commands *********************************/ @@ -178,7 +179,7 @@ class CLCD::CommandFifo { static uint32_t command_write_ptr; template bool _write_unaligned(T data, uint16_t len); #endif - void start(void); + void start(); public: template bool write(T data, uint16_t len); @@ -186,11 +187,11 @@ class CLCD::CommandFifo { public: CommandFifo() {start();} - static void reset (void); + static void reset(); static bool is_processing(); static bool has_fault(); - void execute(void); + void execute(); void cmd(uint32_t cmd32); void cmd(void* data, uint16_t len); @@ -235,6 +236,7 @@ class CLCD::CommandFifo { void playvideo (uint32_t options); void videostart(); void videoframe(uint32_t dst, uint32_t ptr); + void romfont (uint8_t font, uint8_t romslot); #endif // All the following must be followed by str() diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/constants.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/constants.h index d8a0a20c07..5f60881bdd 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/constants.h +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/constants.h @@ -148,7 +148,7 @@ namespace FTDI { constexpr uint8_t STENCIL_OP_DECR = 4; constexpr uint8_t STENCIL_OP_INVERT = 5; - typedef enum: uint32_t { + typedef enum : uint32_t { BITMAPS = 1, POINTS = 2, LINES = 3, @@ -272,13 +272,16 @@ namespace FTDI_FT810 { constexpr uint32_t CMD_SETBASE = 0xFFFFFF38; constexpr uint32_t CMD_MEDIAFIFO = 0xFFFFFF39; constexpr uint32_t CMD_PLAYVIDEO = 0xFFFFFF3A; + constexpr uint32_t CMD_SETFONT2 = 0xFFFFFF3B; + constexpr uint32_t CMD_SETSCRATCH = 0xFFFFFF3C; + constexpr uint32_t CMD_ROMFONT = 0xFFFFFF3F; constexpr uint32_t CMD_VIDEOSTART = 0xFFFFFF40; constexpr uint32_t CMD_VIDEOFRAME = 0xFFFFFF41; constexpr uint32_t CMD_SETBITMAP = 0xFFFFFF43; } namespace FTDI { - enum effect_t { + enum effect_t : unsigned char { SILENCE = 0x00, SQUARE_WAVE = 0x01, SINE_WAVE = 0x02, @@ -339,7 +342,7 @@ namespace FTDI { UNMUTE = 0x61 }; - enum note_t { + enum note_t : unsigned char { END_SONG = 0xFF, REST = 0x00, diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/display_list.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/display_list.h index d4f9c28497..99a9e0e810 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/display_list.h +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/display_list.h @@ -38,7 +38,7 @@ namespace FTDI { inline uint32_t ALPHA_FUNC(uint8_t func, uint8_t ref) {return DL::ALPHA_FUNC|((func&7UL)<<8)|(ref&255UL);} inline uint32_t BEGIN(begin_t prim) {return DL::BEGIN|(prim&15UL);} - inline uint32_t BITMAP_SOURCE(uint32_t ram_g_addr) {return DL::BITMAP_SOURCE|(ram_g_addr & (FTDI::ftdi_memory_map::RAM_G_SIZE-1));} + inline uint32_t BITMAP_SOURCE(uint32_t ram_g_addr) {return DL::BITMAP_SOURCE|(ram_g_addr);} inline uint32_t BITMAP_HANDLE(uint8_t handle) {return DL::BITMAP_HANDLE|(handle&31UL);} inline uint32_t BITMAP_LAYOUT(uint8_t format, uint16_t linestride, uint16_t height) {return DL::BITMAP_LAYOUT|((format&31UL)<<19)|((linestride&1023UL)<<9)|(height&511UL);} diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/ftdi_basic.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/ftdi_basic.h index 3d6541e707..e8f9f424d0 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/ftdi_basic.h +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/ftdi_basic.h @@ -24,7 +24,7 @@ #include "../compat.h" -#if !defined(__MARLIN_FIRMWARE__) +#ifndef __MARLIN_FIRMWARE__ #define FTDI_BASIC #endif diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/registers_ft810.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/registers_ft810.h index 6cc975896c..3e4044e194 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/registers_ft810.h +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/registers_ft810.h @@ -36,6 +36,8 @@ * * * 0x1E0000 0x2FFFFB 1152 kB ROM_FONT Font table and bitmap * * * + * 0x201EE0 0x2029DC 2812 B ROM_FONT_ROOT ROM font table * + * * * 0x2FFFFC 0x2FFFFF 4 B ROM_FONT_ADDR Font table pointer address * * * * 0x300000 0x301FFF 8 kB RAM_DL Display List RAM * diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/spi.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/spi.cpp index af33b5f055..7f666be45b 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/spi.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/spi.cpp @@ -27,11 +27,11 @@ /********************************* SPI Functions *********************************/ namespace FTDI { - #if !defined(CLCD_USE_SOFT_SPI) + #ifndef CLCD_USE_SOFT_SPI SPISettings SPI::spi_settings(SPI_FREQUENCY, MSBFIRST, SPI_MODE0); #endif - void SPI::spi_init (void) { + void SPI::spi_init() { SET_OUTPUT(CLCD_MOD_RESET); // Module Reset (a.k.a. PD, not SPI) WRITE(CLCD_MOD_RESET, 0); // start with module in power-down @@ -63,20 +63,11 @@ namespace FTDI { uint8_t k; noInterrupts(); - for(k = 0; k <8; k++) { // Output and Read each bit of spiOutByte and spiInByte - if (spiOutByte & spiIndex) { // Output MOSI Bit - WRITE(CLCD_SOFT_SPI_MOSI, 1); - } - else { - WRITE(CLCD_SOFT_SPI_MOSI, 0); - } + for (k = 0; k < 8; k++) { // Output and Read each bit of spiOutByte and spiInByte + WRITE(CLCD_SOFT_SPI_MOSI, (spiOutByte & spiIndex) ? 1 : 0); // Output MOSI Bit WRITE(CLCD_SOFT_SPI_SCLK, 1); // Pulse Clock WRITE(CLCD_SOFT_SPI_SCLK, 0); - - if (READ(CLCD_SOFT_SPI_MISO)) { - spiInByte |= spiIndex; - } - + if (READ(CLCD_SOFT_SPI_MISO)) spiInByte |= spiIndex; spiIndex >>= 1; } interrupts(); @@ -86,20 +77,13 @@ namespace FTDI { #ifdef CLCD_USE_SOFT_SPI void SPI::_soft_spi_send (uint8_t spiOutByte) { - uint8_t spiIndex = 0x80; - uint8_t k; + uint8_t k, spiIndex = 0x80; noInterrupts(); - for(k = 0; k <8; k++) { // Output each bit of spiOutByte - if (spiOutByte & spiIndex) { // Output MOSI Bit - WRITE(CLCD_SOFT_SPI_MOSI, 1); - } - else { - WRITE(CLCD_SOFT_SPI_MOSI, 0); - } + for (k = 0; k < 8; k++) { // Output each bit of spiOutByte + WRITE(CLCD_SOFT_SPI_MOSI, (spiOutByte & spiIndex) ? 1 : 0); // Output MOSI Bit WRITE(CLCD_SOFT_SPI_SCLK, 1); // Pulse Clock WRITE(CLCD_SOFT_SPI_SCLK, 0); - spiIndex >>= 1; } interrupts(); @@ -108,7 +92,7 @@ namespace FTDI { void SPI::spi_read_bulk (void *data, uint16_t len) { uint8_t* p = (uint8_t *)data; - #if !defined(CLCD_USE_SOFT_SPI) + #ifndef CLCD_USE_SOFT_SPI ::SPI.transfer(p, len); #else while (len--) *p++ = spi_recv(); @@ -122,8 +106,8 @@ namespace FTDI { } // CLCD SPI - Chip Select - void SPI::spi_ftdi_select (void) { - #if !defined(CLCD_USE_SOFT_SPI) + void SPI::spi_ftdi_select() { + #ifndef CLCD_USE_SOFT_SPI ::SPI.beginTransaction(spi_settings); #endif WRITE(CLCD_SPI_CS, 0); @@ -131,9 +115,9 @@ namespace FTDI { } // CLCD SPI - Chip Deselect - void SPI::spi_ftdi_deselect (void) { + void SPI::spi_ftdi_deselect() { WRITE(CLCD_SPI_CS, 1); - #if !defined(CLCD_USE_SOFT_SPI) + #ifndef CLCD_USE_SOFT_SPI ::SPI.endTransaction(); #endif } @@ -141,7 +125,7 @@ namespace FTDI { #ifdef SPI_FLASH_SS // Serial SPI Flash SPI - Chip Select void SPI::spi_flash_select () { - #if !defined(CLCD_USE_SOFT_SPI) + #ifndef CLCD_USE_SOFT_SPI ::SPI.beginTransaction(spi_settings); #endif WRITE(SPI_FLASH_SS, 0); @@ -151,14 +135,14 @@ namespace FTDI { // Serial SPI Flash SPI - Chip Deselect void SPI::spi_flash_deselect () { WRITE(SPI_FLASH_SS, 1); - #if !defined(CLCD_USE_SOFT_SPI) + #ifndef CLCD_USE_SOFT_SPI ::SPI.endTransaction(); #endif } #endif // Not really a SPI signal... - void SPI::ftdi_reset (void) { + void SPI::ftdi_reset() { WRITE(CLCD_MOD_RESET, 0); delay(6); /* minimum time for power-down is 5ms */ WRITE(CLCD_MOD_RESET, 1); @@ -166,8 +150,7 @@ namespace FTDI { } // Not really a SPI signal... - void SPI::test_pulse(void) - { + void SPI::test_pulse() { #ifdef CLCD_AUX_0 WRITE(CLCD_AUX_0, 1); delayMicroseconds(10); diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/spi.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/spi.h index c5564eda04..38f0e35d5a 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/spi.h +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/spi.h @@ -22,13 +22,13 @@ #pragma once -#if !defined(CLCD_USE_SOFT_SPI) +#ifndef CLCD_USE_SOFT_SPI #include #endif namespace FTDI { namespace SPI { - #if !defined(CLCD_USE_SOFT_SPI) + #ifndef CLCD_USE_SOFT_SPI extern SPISettings spi_settings; #endif @@ -122,7 +122,7 @@ namespace FTDI { void spi_read_bulk( void *data, uint16_t len); bool spi_verify_bulk(const void *data, uint16_t len); - void ftdi_reset(void); - void test_pulse(void); + void ftdi_reset(); + void test_pulse(); } } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/compat.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/compat.h index 9ef90f7a9e..18d0a5a1a8 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/compat.h +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/compat.h @@ -29,10 +29,10 @@ #else // !__MARLIN_FIRMWARE__ - #include "Arduino.h" + #include - #if !defined(CLCD_USE_SOFT_SPI) - #include "SPI.h" + #ifndef CLCD_USE_SOFT_SPI + #include #endif namespace fast_io { @@ -208,7 +208,8 @@ #define SWITCH_ENABLED_ 1 #define ENABLED(b) _CAT(SWITCH_ENABLED_, b) #define DISABLED(b) !ENABLED(b) - #define ANY(A,B) ENABLED(A) || ENABLED(B) + #define ANY(A,B) (ENABLED(A) || ENABLED(B)) + #define BOTH(A,B) (ENABLED(A) && ENABLED(B)) // Remove compiler warning on an unused variable #ifndef UNUSED diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/command_processor.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/command_processor.h index 4ec54395b2..a770ebbd24 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/command_processor.h +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/command_processor.h @@ -28,6 +28,11 @@ typedef struct { uint32_t rgb; } btn_colors; +// Disable TOUCH_UI_FIT_TEXT on a case-by-case basis +namespace FTDI { + constexpr uint16_t OPT_NOFIT = OPT_NOTICKS; +} + /**************************** Enhanced Command Processor **************************/ /* The CommandProcessor class wraps the CommandFifo with several features to make @@ -67,14 +72,14 @@ class CommandProcessor : public CLCD::CommandFifo { } FORCEDINLINE void linear_widget_box(int16_t &x, int16_t &y, int16_t &w, int16_t &h, bool tracker = false) { - const uint16_t th = widget_thickness()/2; + const uint16_t th = widget_thickness() / 2; if (w > h) { x += tracker ? th * 2.5 : th; - y += h/2 - th/2; + y += (h - th) / 2; w -= tracker ? th * 5.0 : th * 2; h = th; } else { - x += w/2 - th/2; + x += (w - th) / 2; y += tracker ? th * 2.5 : th; w = th; h -= tracker ? th * 5.0 : th * 2; @@ -82,9 +87,9 @@ class CommandProcessor : public CLCD::CommandFifo { } FORCEDINLINE uint16_t circular_widget_box(int16_t &x, int16_t &y, int16_t &w, int16_t &h) { - const uint16_t r = min(w,h)/2; - x += w/2; - y += h/2; + const uint16_t r = min(w,h) / 2; + x += w / 2; + y += h / 2; w = 1; h = 1; return r; @@ -191,6 +196,7 @@ class CommandProcessor : public CLCD::CommandFifo { {CLCD::CommandFifo::snapshot2(fmt,ptr,x,y,w,h); return *this;} inline CommandProcessor& mediafifo (uint32_t p, uint32_t s) {CLCD::CommandFifo::mediafifo(p, s); return *this;} inline CommandProcessor& playvideo(uint32_t options) {CLCD::CommandFifo::playvideo(options); return *this;} + inline CommandProcessor& romfont(uint8_t font, uint8_t slot) {CLCD::CommandFifo::romfont(font, slot); return *this;} #endif inline CommandProcessor& gradient(int16_t x0, int16_t y0, uint32_t rgb0, int16_t x1, int16_t y1, uint32_t rgb1) @@ -199,26 +205,34 @@ class CommandProcessor : public CLCD::CommandFifo { inline CommandProcessor& rectangle(int16_t x, int16_t y, int16_t w, int16_t h) { using namespace FTDI; CLCD::CommandFifo::cmd(BEGIN(RECTS)); - CLCD::CommandFifo::cmd(VERTEX2F(x*16,y*16)); - CLCD::CommandFifo::cmd(VERTEX2F((x+w)*16,(y+h)*16)); + CLCD::CommandFifo::cmd(VERTEX2F(x * 16, y * 16)); + CLCD::CommandFifo::cmd(VERTEX2F((x + w) * 16, (y + h) * 16)); return *this; } template FORCEDINLINE CommandProcessor& toggle(int16_t x, int16_t y, int16_t w, int16_t h, T text, bool state, uint16_t options = FTDI::OPT_3D) { CLCD::FontMetrics fm(_font); - const int16_t widget_h = fm.height * 20.0/16; + const int16_t widget_h = fm.height * 20.0 / 16; //const int16_t outer_bar_r = widget_h / 2; //const int16_t knob_r = outer_bar_r - 1.5; // The y coordinate of the toggle is the baseline of the text, // so we must introduce a fudge factor based on the line height to // actually center the control. - const int16_t fudge_y = fm.height*5/16; - CLCD::CommandFifo::toggle(x + h/2, y + h/2 - widget_h/2 + fudge_y, w - h, _font, options, state); + const int16_t fudge_y = fm.height * 5 / 16; + CLCD::CommandFifo::toggle(x + h / 2, y + (h - widget_h) / 2 + fudge_y, w - h, _font, options, state); CLCD::CommandFifo::str(text); return *this; } + CommandProcessor& toggle2(int16_t x, int16_t y, int16_t w, int16_t h, progmem_str no, progmem_str yes, bool state, uint16_t options = FTDI::OPT_3D) { + char text[strlen_P((const char *)no) + strlen_P((const char *)yes) + 2]; + strcpy_P(text, (const char *)no); + strcat(text, "\xFF"); + strcat_P(text, (const char *)yes); + return toggle(x, y, w, h, text, state, options); + } + // Contrained drawing routines. These constrain the widget inside a box for easier layout. // The FORCEDINLINE ensures that the code is inlined so that all the math is done at compile time. @@ -285,23 +299,73 @@ class CommandProcessor : public CLCD::CommandFifo { return *this; } + void apply_text_alignment(int16_t &x, int16_t &y, int16_t w, int16_t h, uint16_t options) { + using namespace FTDI; + x += ((options & OPT_CENTERX) ? w/2 : ((options & OPT_RIGHTX) ? w : 0)); + y += ((options & OPT_CENTERY) ? h/2 : h); + } + + // Reduce font size until text fits the enclosing box. + template + int8_t apply_fit_text(int16_t w, int16_t h, T text) { + using namespace FTDI; + int8_t font = _font; + const bool is_utf8 = has_utf8_chars(text); + for (;font >= 26;) { + int16_t width, height; + #ifdef TOUCH_UI_USE_UTF8 + if (is_utf8) { + width = get_utf8_text_width(text, font_size_t::from_romfont(font)); + height = font_size_t::from_romfont(font).get_height(); + } else + #endif + { + CLCD::FontMetrics fm(font); + width = fm.get_text_width(text); + height = fm.height; + } + if (width < w && height < h) break; + font--; + } + return font; + } + CommandProcessor& number(int16_t x, int16_t y, int16_t w, int16_t h, int32_t n, uint16_t options = FTDI::OPT_CENTER) { using namespace FTDI; - CLCD::CommandFifo::number( - x + ((options & OPT_CENTERX) ? w/2 : ((options & OPT_RIGHTX) ? w : 0)), - y + ((options & OPT_CENTERY) ? h/2 : h), - _font, options, n); + apply_text_alignment(x, y, w, h, options); + CLCD::CommandFifo::number(x, y, _font, options, n); return *this; } - template FORCEDINLINE + template + uint16_t text_width(T text) { + using namespace FTDI; + #ifdef TOUCH_UI_USE_UTF8 + if (has_utf8_chars(text)) + return get_utf8_text_width(text, font_size_t::from_romfont(_font)); + #endif + CLCD::FontMetrics fm(_font); + return fm.get_text_width(text); + } + + template CommandProcessor& text(int16_t x, int16_t y, int16_t w, int16_t h, T text, uint16_t options = FTDI::OPT_CENTER) { using namespace FTDI; - CLCD::CommandFifo::text( - x + ((options & OPT_CENTERX) ? w/2 : ((options & OPT_RIGHTX) ? w : 0)), - y + ((options & OPT_CENTERY) ? h/2 : h), - _font, options); - CLCD::CommandFifo::str(text); + apply_text_alignment(x, y, w, h, options); + #ifdef TOUCH_UI_FIT_TEXT + const int8_t font = (options & OPT_NOFIT) ? _font : apply_fit_text(w, h, text); + #else + const int8_t font = _font; + #endif + #ifdef TOUCH_UI_USE_UTF8 + if (has_utf8_chars(text)) + draw_utf8_text(*this, x, y, text, font_size_t::from_romfont(font), options); + else + #endif + { + CLCD::CommandFifo::text(x, y, font, options); + CLCD::CommandFifo::str(text); + } return *this; } @@ -326,8 +390,29 @@ class CommandProcessor : public CLCD::CommandFifo { using namespace FTDI; bool styleModified = false; if (_btn_style_callback) styleModified = _btn_style_callback(*this, _tag, _style, options, false); - CLCD::CommandFifo::button(x, y, w, h, _font, options); - CLCD::CommandFifo::str(text); + #ifdef TOUCH_UI_FIT_TEXT + const int8_t font = (options & OPT_NOFIT) ? _font : apply_fit_text(w, h, text); + #else + const int8_t font = _font; + #endif + CLCD::CommandFifo::button(x, y, w, h, font, options); + #ifdef TOUCH_UI_USE_UTF8 + if (has_utf8_chars(text)) { + CLCD::CommandFifo::str(F("")); + apply_text_alignment(x, y, w, h, OPT_CENTER); + if (!(options & FTDI::OPT_FLAT)) { + // Reproduce the black "shadow" the FTDI adds to the button label + CLCD::CommandFifo::cmd(SAVE_CONTEXT()); + CLCD::CommandFifo::cmd(COLOR_RGB(0x00000)); + draw_utf8_text(*this, x-1, y-1, text, font_size_t::from_romfont(font), OPT_CENTER); + CLCD::CommandFifo::cmd(RESTORE_CONTEXT()); + } + // Draw the button label + draw_utf8_text(*this, x, y, text, font_size_t::from_romfont(font), OPT_CENTER); + } + else + #endif + CLCD::CommandFifo::str(text); if (_btn_style_callback && styleModified) _btn_style_callback(*this, _tag, _style, options, true); return *this; } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/dl_cache.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/dl_cache.cpp index fd6fde5f58..bf8ca61f3a 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/dl_cache.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/dl_cache.cpp @@ -78,8 +78,7 @@ bool DLCache::wait_until_idle() { const unsigned long startTime = millis(); do { if ((millis() - startTime) > 250) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Timeout on DL_Cache::Wait_Until_Idle()"); + SERIAL_ECHO_MSG("Timeout on DL_Cache::Wait_Until_Idle()"); CLCD::CommandFifo::reset(); return false; } @@ -128,17 +127,17 @@ bool DLCache::store(uint32_t num_bytes /* = 0*/) { if (dl_size > free_space) { // Not enough memory to cache the display list. - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Not enough space in GRAM to cache display list, free space: ", free_space); - SERIAL_ECHOLNPAIR(" Required: ", dl_size); + SERIAL_ECHOLNPAIR("Not enough space in GRAM to cache display list, free space: ", free_space, + " Required: ", dl_size); #endif return false; } else { - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Saving DL to RAMG cache, bytes: ", dl_size); - SERIAL_ECHOLNPAIR(" Free space: ", free_space); + SERIAL_ECHOLNPAIR("Saving DL to RAMG cache, bytes: ", dl_size, + " Free space: ", free_space); #endif cmd.memcpy(dl_addr, MAP::RAM_DL, dl_size); cmd.execute(); @@ -164,12 +163,12 @@ void DLCache::load_slot() { void DLCache::append() { CLCD::CommandFifo cmd; cmd.append(dl_addr, dl_size); - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) cmd.execute(); wait_until_idle(); SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Appending to DL from RAMG cache, bytes: ", dl_size); - SERIAL_ECHOLNPAIR(" REG_CMD_DL: ", CLCD::mem_read_32(REG::CMD_DL)); + SERIAL_ECHOLNPAIR("Appending to DL from RAMG cache, bytes: ", dl_size, + " REG_CMD_DL: ", CLCD::mem_read_32(REG::CMD_DL)); #endif } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/event_loop.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/event_loop.cpp index a9194fdaba..f0f693bfd8 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/event_loop.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/event_loop.cpp @@ -124,7 +124,7 @@ namespace FTDI { switch (pressed_tag) { case UNPRESSED: if (tag != 0) { - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("Touch start: ", tag); #endif @@ -156,9 +156,11 @@ namespace FTDI { if (!UIData::flags.bits.touch_debouncing) { if (tag == pressed_tag) { // The user is holding down a button. - if (touch_timer.elapsed(1000 / TOUCH_REPEATS_PER_SECOND) && current_screen.onTouchHeld(tag)) { - current_screen.onRefresh(); - if (UIData::flags.bits.touch_repeat_sound) sound.play(repeat_sound); + if (touch_timer.elapsed(1000 / TOUCH_REPEATS_PER_SECOND)) { + if (current_screen.onTouchHeld(tag)) { + current_screen.onRefresh(); + if (UIData::flags.bits.touch_repeat_sound) sound.play(repeat_sound); + } touch_timer.start(); } } @@ -187,7 +189,7 @@ namespace FTDI { if (UIData::flags.bits.touch_end_sound) sound.play(unpress_sound); - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("Touch end: ", tag); #endif diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/ftdi_extended.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/ftdi_extended.h index 43e390c1ad..329bea46f1 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/ftdi_extended.h +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/ftdi_extended.h @@ -25,19 +25,24 @@ #include "../compat.h" #include "../basic/ftdi_basic.h" -#if !defined(__MARLIN_FIRMWARE__) +#ifndef __MARLIN_FIRMWARE__ #define FTDI_EXTENDED #endif #ifdef FTDI_EXTENDED + #include "unicode/font_size_t.h" + #include "unicode/unicode.h" + #include "unicode/standard_char_set.h" + #include "unicode/western_char_set.h" + #include "unicode/font_bitmaps.h" #include "rgb_t.h" #include "bitmap_info.h" #include "tiny_timer.h" #include "grid_layout.h" #include "dl_cache.h" - #include "screen_types.h" #include "event_loop.h" #include "command_processor.h" + #include "screen_types.h" #include "sound_player.h" #include "sound_list.h" #include "polygon.h" diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/screen_types.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/screen_types.cpp index 7dba952a0a..ec1c0d1cbb 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/screen_types.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/screen_types.cpp @@ -31,7 +31,7 @@ uint8_t ScreenRef::lookupScreen(onRedraw_func_t onRedraw_ptr) { return type; } } - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) SERIAL_ECHO_START(); SERIAL_ECHOPAIR("Screen not found: ", (uintptr_t) onRedraw_ptr); #endif @@ -42,7 +42,7 @@ void ScreenRef::setScreen(onRedraw_func_t onRedraw_ptr) { uint8_t type = lookupScreen(onRedraw_ptr); if (type != 0xFF) { setType(type); - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("New screen: ", type); #endif diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/screen_types.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/screen_types.h index 5550314942..f1ec4fc476 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/screen_types.h +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/screen_types.h @@ -54,11 +54,11 @@ typedef enum { class ScreenRef { protected: - typedef void onStartup_func_t(void); - typedef void onEntry_func_t(void); - typedef void onExit_func_t(void); - typedef void onIdle_func_t(void); - typedef void onRefresh_func_t(void); + typedef void onStartup_func_t(); + typedef void onEntry_func_t(); + typedef void onExit_func_t(); + typedef void onIdle_func_t(); + typedef void onRefresh_func_t(); typedef void onRedraw_func_t(draw_mode_t); typedef bool onTouchStart_func_t(uint8_t); typedef bool onTouchHeld_func_t(uint8_t); @@ -156,8 +156,11 @@ class UncachedScreen { public: static void onRefresh() { using namespace FTDI; - CLCD::CommandFifo cmd; + CommandProcessor cmd; cmd.cmd(CMD_DLSTART); + #ifdef TOUCH_UI_USE_UTF8 + load_utf8_bitmaps(cmd); + #endif current_screen.onRedraw(BOTH); @@ -170,38 +173,46 @@ class UncachedScreen { template class CachedScreen { protected: - static bool storeBackground(){ + static bool storeBackground() { DLCache dlcache(DL_SLOT); if (!dlcache.store(DL_SIZE)) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("CachedScreen::storeBackground() failed: not enough DL cache space"); + SERIAL_ECHO_MSG("CachedScreen::storeBackground() failed: not enough DL cache space"); return false; } return true; } - static void repaintBackground(){ + static void repaintBackground() { using namespace FTDI; DLCache dlcache(DL_SLOT); - CLCD::CommandFifo cmd; + CommandProcessor cmd; cmd.cmd(CMD_DLSTART); + #ifdef TOUCH_UI_USE_UTF8 + load_utf8_bitmaps(cmd); + #endif current_screen.onRedraw(BACKGROUND); dlcache.store(DL_SIZE); } public: - static void onRefresh(){ + static void onRefresh() { + #if ENABLED(TOUCH_UI_DEBUG) + const uint32_t start_time = millis(); + #endif using namespace FTDI; DLCache dlcache(DL_SLOT); - CLCD::CommandFifo cmd; + CommandProcessor cmd; cmd.cmd(CMD_DLSTART); if (dlcache.has_data()) { dlcache.append(); } else { + #ifdef TOUCH_UI_USE_UTF8 + load_utf8_bitmaps(cmd); + #endif current_screen.onRedraw(BACKGROUND); dlcache.store(DL_SIZE); } @@ -211,5 +222,8 @@ class CachedScreen { cmd.cmd(DL::DL_DISPLAY); cmd.cmd(CMD_SWAP); cmd.execute(); + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHOLNPAIR("Time to draw screen (ms): ", millis() - start_time); + #endif } }; diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/sound_player.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/sound_player.cpp index e8c5e881c5..0011d69118 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/sound_player.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/sound_player.cpp @@ -36,10 +36,9 @@ namespace FTDI { void SoundPlayer::play(effect_t effect, note_t note) { - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) SERIAL_ECHO_START(); - SERIAL_ECHOPAIR("Playing note ", note); - SERIAL_ECHOLNPAIR(", instrument ", effect); + SERIAL_ECHOLNPAIR("Playing note ", int(note), ", instrument ", int(effect)); #endif // Play the note diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/text_box.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/text_box.cpp index 69b3b7d7a6..75a445a926 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/text_box.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/text_box.cpp @@ -29,41 +29,33 @@ namespace FTDI { * be broken so that the display width is less than w. The line will also * be broken after a '\n'. Returns the display width of the line. */ - static uint16_t find_line_break(const CLCD::FontMetrics &fm, uint16_t w, const char *str, const char *&end) { + static uint16_t find_line_break(const FontMetrics &fm, uint16_t w, const char *str, const char *&end) { + w -= fm.get_char_width(' '); const char *p = str; - end = str + strlen(str); - uint16_t width = fm.get_text_width(str); + end = str; + uint16_t lw = 0, result = 0; for(;;) { - // Find next tentative line break. - char delim = *(p); - while (delim && delim != ' ' && delim != '\n') { - delim = *(++p); - } - // Check to see whether to break the line. - const uint16_t margin = fm.get_text_width(" "); - const uint16_t lw = p > str ? fm.get_text_width(str, p - str) + margin : 0; - if (lw < w) { - width = lw; - switch (delim) { - case '\0': - end = p; - break; - case '\n': - end = ++p; - break; - case ' ': - end = ++p; - continue; + utf8_char_t c = get_utf8_char_and_inc(p); + if (c == ' ' || c == '\n' || c == '\0') { + if (lw < w || end == str) { + end = (c == '\0') ? p-1 : p; + result = lw; } + if (c == '\0' || c == '\n') break; } - return width; + lw += fm.get_char_width(c); } + if (end == str) { + end = p-1; + result = lw; + } + return result; } /** * This function returns a measurements of the word-wrapped text box. */ - static void measure_text_box(const CLCD::FontMetrics &fm, const char *str, uint16_t &width, uint16_t &height) { + static void measure_text_box(const FontMetrics &fm, const char *str, uint16_t &width, uint16_t &height) { const char *line_start = (const char*)str; const char *line_end; const uint16_t wrap_width = width; @@ -72,7 +64,7 @@ namespace FTDI { uint16_t line_width = find_line_break(fm, wrap_width, line_start, line_end); if (line_end == line_start) break; width = max(width, line_width); - height += fm.height; + height += fm.get_height(); line_start = line_end; } } @@ -81,10 +73,11 @@ namespace FTDI { * This function draws text inside a bounding box, doing word wrapping and using the largest font that will fit. */ void draw_text_box(CommandProcessor& cmd, int x, int y, int w, int h, const char *str, uint16_t options, uint8_t font) { - CLCD::FontMetrics fm(font); - uint16_t box_width, box_height; + FontMetrics fm(font); + + // Shrink the font until we find a font that fits for(;;) { box_width = w; measure_text_box(fm, str, box_width, box_height); @@ -110,10 +103,17 @@ namespace FTDI { if (line[line_len - 1] == '\n' || line[line_len - 1] == ' ') line[line_len - 1] = 0; - cmd.CLCD::CommandFifo::text(x + dx, y + dy, font, options & ~OPT_CENTERY); - cmd.CLCD::CommandFifo::str(line); + #ifdef TOUCH_UI_USE_UTF8 + if (has_utf8_chars(line)) { + draw_utf8_text(cmd, x + dx, y + dy, line, fm.fs, options & ~OPT_CENTERY); + } else + #endif + { + cmd.CLCD::CommandFifo::text(x + dx, y + dy, font, options & ~OPT_CENTERY); + cmd.CLCD::CommandFifo::str(line); + } } - y += fm.height; + y += fm.get_height(); line_start = line_end; } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/README.txt b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/README.txt new file mode 100644 index 0000000000..818bf08cea --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/README.txt @@ -0,0 +1,40 @@ + +FTDI EVE Unicode Rendering +-------------------------- + +The FTDI EVE chips have several fonts in ROM, but these fonts only contain a +subset of ASCII characters. Notably, this excludes diacritics and accents +used in most Western languages. + +While the FTDI EVE has the capability for user-defined fonts, such fonts only +support 127 character positions, making them as limiting as the built-in fonts. + +As a further complication, high resolution TFT displays require high resolution +fonts. It is not feasible to put a complete international font into the limited +flash memory of most microprocessors. + +To work around these limitations, this library uses a custom font renderer with +the following characteristics: + + 1) Rather than providing bitmaps for different font sizes, it uses a single + bitmap for the largest font size (romfont 31) and emulates other sizes by + scaling the bitmaps using BITMAP_TRANSFORM. + + 2) Rather than loading an entire font, it combines symbols from romfont 31 + with a limited number of symbols from a custom font. For accented letters, + the rendering code combine basic letter shapes from romfont 31 with + bitmaps containing only the accent themselves. + + 3) The custom bitmap is RLE compressed into PROGMEM. For accents, which have + a fairly small number of non-white pixels, the savings are significant. + +These characteristics enable an alphabet for Western languages to be +synthesized from only a few dozen custom symbols and modest PROGMEM use (~10k) + +The text layout is done by the code in "unicode.cpp" with the help of one of +more character renderers (e.g. "western_char_set.cpp"). Each character render +is responsible for loading the necessary bitmap data into RAMG and drawing +characters as requested. + +To add symbols for other languages, it will only be necessary to make a bitmap +and implement a corresponding character renderer. diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp new file mode 100644 index 0000000000..87baeb6d20 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_bitmaps.cpp @@ -0,0 +1,55 @@ +/******************* + * font_bitmap.cpp * + *******************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../ftdi_extended.h" + +#ifdef FTDI_EXTENDED + +namespace FTDI { + + void write_rle_data(uint16_t addr, const uint8_t *data, size_t n) { + for (; n >= 2; n -= 2) { + uint8_t count = pgm_read_byte(data++); + uint8_t value = pgm_read_byte(data++); + while (count--) CLCD::mem_write_8(addr++, value); + } + } + + void set_font_bitmap(CommandProcessor& cmd, CLCD::FontMetrics &fm, uint8_t handle) { + cmd.cmd(BITMAP_HANDLE(handle)); + cmd.cmd(BITMAP_SOURCE(fm.ptr)); + cmd.bitmap_layout(fm.format, fm.stride, fm.height); + cmd.bitmap_size(BILINEAR, BORDER, BORDER, fm.width, fm.height); + } + + void ext_vertex2ii(CommandProcessor &cmd, int x, int y, uint8_t handle, uint8_t cell) { + if (x < 0 || y < 0 || x > 511 || y > 511) { + cmd.cmd(BITMAP_HANDLE(handle)); + cmd.cmd(CELL(cell)); + cmd.cmd(VERTEX2F(x * 16, y * 16)); + } else { + cmd.cmd(VERTEX2II(x, y, handle, cell)); + } + } + +} // namespace FTDI + +#endif // FTDI_EXTENDED diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_bitmaps.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_bitmaps.h new file mode 100644 index 0000000000..85ece6b774 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_bitmaps.h @@ -0,0 +1,30 @@ +/****************** + * font_bitmaps.h * + ******************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +class CommandProcessor; + +namespace FTDI { + void write_rle_data(uint16_t addr, const uint8_t *data, size_t n); + void set_font_bitmap(CommandProcessor& cmd, CLCD::FontMetrics &fm, uint8_t handle); + void ext_vertex2ii(CommandProcessor &cmd, int x, int y, uint8_t handle, uint8_t cell); +} diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_bitmaps/romfont_31.pbm b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_bitmaps/romfont_31.pbm new file mode 100644 index 0000000000..39cb67034f Binary files /dev/null and b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_bitmaps/romfont_31.pbm differ diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.png b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.png new file mode 100644 index 0000000000..ef681923db Binary files /dev/null and b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.png differ diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.svg b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.svg new file mode 100644 index 0000000000..f803126c2b --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_bitmaps/western_char_set_bitmap_31.svg @@ -0,0 +1,443 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + ̀ ́ ̂ ̃ ̈ ̊ ̧ıߨøÆæÐðÞþ«»¡¿¢£¤¥¹²³ºª©®±×÷¼½¾µ¦§¬ + + + + + + + + diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_size_t.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_size_t.cpp new file mode 100644 index 0000000000..c449f11537 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_size_t.cpp @@ -0,0 +1,46 @@ +/******************* + * font_size_t.cpp * + *******************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../ftdi_extended.h" + +#if defined(FTDI_EXTENDED) && ENABLED(TOUCH_UI_USE_UTF8) + +namespace FTDI { + // Returns the height of a standard FTDI romfont + uint8_t font_size_t::get_romfont_height(uint8_t font) { + static const uint8_t tbl[] PROGMEM = { + 8, 8, 16, 16, 13, 17, 20, 22, 29, 38, 16, 20, 25, 28, 36, 49, 63, 83, 108 + }; + return pgm_read_byte(&tbl[font - 16]); + } + + // Sets the scaling coefficient to match a romfont size + font_size_t font_size_t::from_romfont(uint8_t font) { + return font_size_t(uint32_t(std_height) * 256 / get_romfont_height(font)); + } + + // Returns the height of the font + uint8_t font_size_t::get_height() const { + return scale(std_height); + } +} + +#endif // FTDI_EXTENDED && TOUCH_UI_USE_UTF8 diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_size_t.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_size_t.h new file mode 100644 index 0000000000..9cf6c181f5 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/font_size_t.h @@ -0,0 +1,55 @@ +/***************** + * font_size_t.h * + *****************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +class CommandProcessor; + +namespace FTDI { + + /* The unicode rendering of different font sizes happens by scaling a + * large-sized font bitmap using the FTDI bitmap transformation matrix. + * This keeps us from having to have load bitmaps for all font sizes. + * + * The font_size_t class helps manage this scaling factor. + */ + class font_size_t { + private: + // Standard height for font bitmaps + static constexpr uint8_t std_height = 49; + + // 8.8 fixed point scaling coefficient + uint16_t coefficient; + + font_size_t(uint16_t v) : coefficient(v) {} + public: + font_size_t() : coefficient(256) {} + + static uint8_t get_romfont_height(uint8_t font); + + static font_size_t from_romfont(uint8_t size); + + template T scale(T val) const {return (int32_t(val) * 256 / coefficient);} + + uint8_t get_height() const; + uint16_t get_coefficient() const {return coefficient;} + }; +} diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/standard_char_set.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/standard_char_set.cpp new file mode 100644 index 0000000000..fb049aee3b --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/standard_char_set.cpp @@ -0,0 +1,106 @@ +/************************* + * standard_char_set.cpp * + *************************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../ftdi_extended.h" + +#if defined(FTDI_EXTENDED) && ENABLED(TOUCH_UI_USE_UTF8) + + constexpr static uint8_t std_font = 31; + + /* Lookup table of the char widths for standard ROMFONT 31 */ + + uint8_t FTDI::StandardCharSet::std_char_width(char c) { + static const uint8_t tbl[] PROGMEM = { + 10, 11, 15, 26, 25, 31, 26, 10, 15, 14, 18, 24, 9, 18, 11, 17, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 10, 10, 21, 23, 22, 20, 37, 27, 27, 26, + 28, 23, 22, 28, 29, 12, 23, 26, 22, 35, 29, 28, 26, 29, 27, 26, 26, 28, + 27, 36, 27, 26, 25, 12, 18, 12, 18, 21, 13, 23, 24, 22, 24, 22, 15, 24, + 24, 10, 11, 22, 10, 36, 24, 24, 24, 24, 15, 22, 14, 24, 21, 32, 21, 21, + 22, 15, 10, 15, 29, 10 + }; + return pgm_read_byte(&tbl[c - ' ']); + } + + /** + * Load bitmap data into RAMG. This function is called once at the start + * of the program. + * + * Parameters: + * + * addr - Address in RAMG where the font data is written + */ + + void FTDI::StandardCharSet::load_data(uint32_t) { + } + + /** + * Populates the bitmap handles for the custom into the display list. + * This function is called once at the start of each display list. + * + * Parameters: + * + * cmd - Object used for writing to the FTDI chip command queue. + */ + + void FTDI::StandardCharSet::load_bitmaps(CommandProcessor& cmd) { + CLCD::FontMetrics std_fm(std_font); + set_font_bitmap(cmd, std_fm, std_font); + } + + /** + * Renders a character at location x and y. The x position is incremented + * by the width of the character. + * + * Parameters: + * + * cmd - If non-NULL the symbol is drawn to the screen. + * If NULL, only increment position for text measurement. + * + * x, y - The location at which to draw the character. On output, + * incremented to the location of the next character. + * + * fs - A scaling object used to scale the font. The display will + * already be configured to scale bitmaps, but positions + * must be scaled using fs.scale() + * + * c - The unicode code point to draw. If the renderer does not + * support the character, it should draw nothing. + */ + + bool FTDI::StandardCharSet::render_glyph(CommandProcessor* cmd, int &x, int &y, font_size_t fs, utf8_char_t c) { + uint8_t which = (c >= ' ' && c < 128) ? c : '?'; + uint8_t width = std_char_width(which); + + if (c == '\t') { + // Special handling for the tab character + which = ' '; + width = std_char_width(' '); + } + + // Draw the character + if (cmd) ext_vertex2ii(*cmd, x, y, std_font, which); + + // Increment X to the next character position + x += fs.scale(width); + return true; + } + +#endif // FTDI_EXTENDED && TOUCH_UI_USE_UTF8 diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/standard_char_set.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/standard_char_set.h new file mode 100644 index 0000000000..17ccfe6e30 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/standard_char_set.h @@ -0,0 +1,30 @@ +/*********************** + * standard_char_set.h * + ***********************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +namespace FTDI { + class StandardCharSet { + public: + static uint8_t std_char_width(char); + static void load_data(uint32_t addr); + static void load_bitmaps(CommandProcessor&); + static bool render_glyph(CommandProcessor*, int &x, int &y, font_size_t, utf8_char_t); + }; +} diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/unicode.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/unicode.cpp new file mode 100644 index 0000000000..d717f7f154 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/unicode.cpp @@ -0,0 +1,219 @@ +/*************** + * unicode.cpp * + ***************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../ftdi_extended.h" + +#if defined(FTDI_EXTENDED) && ENABLED(TOUCH_UI_USE_UTF8) + + using namespace FTDI; + + /** + * Return true if a string has UTF8 characters + * + * Parameters: + * + * c - Pointer to a string. + * + * Returns: True if the strings has UTF8 characters + */ + + bool FTDI::has_utf8_chars(const char *str) { + for (;;) { + const char c = *str++; + if (!c) break; + if ((c & 0xC0) == 0x80) return true; + } + return false; + } + + bool FTDI::has_utf8_chars(progmem_str _str) { + const char *str = (const char *) _str; + for (;;) { + const char c = pgm_read_byte(str++); + if (!c) break; + if ((c & 0xC0) == 0x80) return true; + } + return false; + } + + /** + * Return a character in a UTF8 string and increment the + * pointer to the next character + * + * Parameters: + * + * c - Pointer to a UTF8 encoded string. + * + * Returns: The packed bytes of a UTF8 encoding of a single + * character (this is not the unicode codepoint) + */ + + utf8_char_t FTDI::get_utf8_char_and_inc(const char *&c) { + utf8_char_t val = *(uint8_t*)c++; + while ((*c & 0xC0) == 0x80) + val = (val << 8) | *(uint8_t*)c++; + return val; + } + + /** + * Helper function to draw and/or measure a UTF8 string + * + * Parameters: + * + * cmd - If non-NULL the symbol is drawn to the screen. + * If NULL, only increment position for text measurement. + * + * x, y - The location at which to draw the string. + * + * str - The UTF8 string to draw or measure. + * + * fs - A scaling object used to specify the font size. + */ + + static uint16_t render_utf8_text(CommandProcessor* cmd, int x, int y, const char *str, font_size_t fs) { + const int start_x = x; + while (*str) { + const utf8_char_t c = get_utf8_char_and_inc(str); + #ifdef TOUCH_UI_UTF8_WESTERN_CHARSET + WesternCharSet::render_glyph(cmd, x, y, fs, c) || + #endif + StandardCharSet::render_glyph(cmd, x, y, fs, c); + } + return x - start_x; + } + + /** + * Load the font bitmap data into RAMG. Called once at program start. + * + * Parameters: + * + * addr - Address in RAMG where the font data is written + */ + + void FTDI::load_utf8_data(uint16_t addr) { + #ifdef TOUCH_UI_UTF8_WESTERN_CHARSET + WesternCharSet::load_data(addr); + #endif + StandardCharSet::load_data(addr); + } + + /** + * Populate the bitmap handles for the custom fonts into the display list. + * Called once at the start of each display list. + * + * Parameters: + * + * cmd - Object used for writing to the FTDI chip command queue. + */ + + void FTDI::load_utf8_bitmaps(CommandProcessor &cmd) { + #ifdef TOUCH_UI_UTF8_WESTERN_CHARSET + WesternCharSet::load_bitmaps(cmd); + #endif + StandardCharSet::load_bitmaps(cmd); + } + + /** + * Measure a UTF8 text character + * + * Parameters: + * + * c - The unicode code point to measure. + * + * fs - A scaling object used to specify the font size. + * + * Returns: A width in pixels + */ + + uint16_t FTDI::get_utf8_char_width(utf8_char_t c, font_size_t fs) { + int x = 0, y = 0; + #ifdef TOUCH_UI_UTF8_WESTERN_CHARSET + WesternCharSet::render_glyph(NULL, x, y, fs, c) || + #endif + StandardCharSet::render_glyph(NULL, x, y, fs, c); + return x; + } + + /** + * Measure a UTF8 text string + * + * Parameters: + * + * str - The UTF8 string to measure. + * + * fs - A scaling object used to specify the font size. + * + * Returns: A width in pixels + */ + + uint16_t FTDI::get_utf8_text_width(const char *str, font_size_t fs) { + return render_utf8_text(NULL, 0, 0, str, fs); + } + + uint16_t FTDI::get_utf8_text_width(progmem_str pstr, font_size_t fs) { + char str[strlen_P((const char*)pstr) + 1]; + strcpy_P(str, (const char*)pstr); + return get_utf8_text_width(str, fs); + } + + /** + * Draw a UTF8 text string + * + * Parameters: + * + * cmd - Object used for writing to the FTDI chip command queue. + * + * x, y - The location at which to draw the string. + * + * str - The UTF8 string to draw. + * + * fs - A scaling object used to specify the font size. + * + * options - Text alignment options (i.e. OPT_CENTERX, OPT_CENTERY, OPT_CENTER or OPT_RIGHTX) + * + */ + + void FTDI::draw_utf8_text(CommandProcessor& cmd, int x, int y, const char *str, font_size_t fs, uint16_t options) { + cmd.cmd(SAVE_CONTEXT()); + cmd.cmd(BITMAP_TRANSFORM_A(fs.get_coefficient())); + cmd.cmd(BITMAP_TRANSFORM_E(fs.get_coefficient())); + cmd.cmd(BEGIN(BITMAPS)); + + // Apply alignment options + if (options & OPT_CENTERX) + x -= get_utf8_text_width(str, fs) / 2; + else if (options & OPT_RIGHTX) + x -= get_utf8_text_width(str, fs); + if (options & OPT_CENTERY) + y -= fs.get_height()/2; + + // Render the text + render_utf8_text(&cmd, x, y, str, fs); + cmd.cmd(RESTORE_CONTEXT()); + } + + void FTDI::draw_utf8_text(CommandProcessor& cmd, int x, int y, progmem_str pstr, font_size_t fs, uint16_t options) { + char str[strlen_P((const char*)pstr) + 1]; + strcpy_P(str, (const char*)pstr); + draw_utf8_text(cmd, x, y, (const char*) str, fs, options); + } + +#endif // FTDI_EXTENDED && TOUCH_UI_USE_UTF8 diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/unicode.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/unicode.h new file mode 100644 index 0000000000..fedb89d172 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/unicode.h @@ -0,0 +1,111 @@ +/************* + * unicode.h * + *************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +class CommandProcessor; + +namespace FTDI { + #ifdef TOUCH_UI_USE_UTF8 + typedef uint16_t utf8_char_t; + + /** + * Converts a 32-bit codepoint into UTF-8. This compile-time function + * will be useful until the u8'a' character literal becomes more common. + */ + constexpr uint32_t utf8(const uint32_t c) { + return (c < 0x7F ) ? c : + (c < 0x7FF) ? (0x0000C080 | ((c & 0b011111000000) << 2) | (c & 0b111111)) : + (c < 0xFFFF) ? (0x00E08080 | ((c & 0b001111000000000000) << 4) | ((c & 0b111111000000) << 2) | (c & 0b111111)) : + (0xF0808080 | ((c & 0b000111000000000000000000) << 6) | ((c & 0b111111000000000000) << 4) | ((c & 0b111111000000) << 2) | (c & 0b111111)); + } + + /* Returns true if the string has UTF8 string characters */ + + bool has_utf8_chars(progmem_str str); + bool has_utf8_chars(const char *str); + + /* Returns the next character in a UTF8 string and increments the + * pointer to the next character */ + + utf8_char_t get_utf8_char_and_inc(const char *&c); + + /* Returns the next character in a UTF8 string, without incrementing */ + + inline utf8_char_t get_utf8_char(const char *c) {return get_utf8_char_and_inc(c);} + + void load_utf8_data(uint16_t addr); + #else + typedef char utf8_char_t; + + inline utf8_char_t get_utf8_char_and_inc(const char *&c) {return *c++;} + inline utf8_char_t get_utf8_char(const char *c) {return *c;} + + inline void load_utf8_data(uint16_t) {} + #endif + + void load_utf8_bitmaps(CommandProcessor& cmd); + + uint16_t get_utf8_char_width(utf8_char_t, font_size_t); + uint16_t get_utf8_text_width(progmem_str, font_size_t); + uint16_t get_utf8_text_width(const char *, font_size_t); + + void draw_utf8_text(CommandProcessor&, int x, int y, progmem_str, font_size_t, uint16_t options = 0); + void draw_utf8_text(CommandProcessor&, int x, int y, const char *, font_size_t, uint16_t options = 0); + + // Similar to CLCD::FontMetrics, but can be used with UTF8 encoded strings. + + struct FontMetrics { + #ifdef TOUCH_UI_USE_UTF8 + font_size_t fs; + #else + CLCD::FontMetrics fm; + #endif + + inline void load(uint8_t rom_font_size) { + #ifdef TOUCH_UI_USE_UTF8 + fs = font_size_t::from_romfont(rom_font_size); + #else + fm.load(rom_font_size); + #endif + } + + inline uint16_t get_char_width(utf8_char_t c) const { + #ifdef TOUCH_UI_USE_UTF8 + return get_utf8_char_width(c, fs); + #else + return fm.char_widths[(uint8_t)c]; + #endif + } + + inline uint8_t get_height() const { + #ifdef TOUCH_UI_USE_UTF8 + return fs.get_height(); + #else + return fm.height; + #endif + } + + inline FontMetrics(uint8_t rom_font_size) { + load(rom_font_size); + } + }; +} diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/western_char_set.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/western_char_set.cpp new file mode 100644 index 0000000000..688b68ae0c --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/western_char_set.cpp @@ -0,0 +1,449 @@ +/************************ + * western_char_set.cpp * + ************************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../ftdi_extended.h" + +#if defined(FTDI_EXTENDED) && BOTH(TOUCH_UI_USE_UTF8, TOUCH_UI_UTF8_WESTERN_CHARSET) + + #include "western_char_set_bitmap_31.h" + + #define NUM_ELEMENTS(a) (sizeof(a)/sizeof(a[0])) + + using namespace FTDI; + + constexpr static uint8_t std_font = 31; + constexpr static uint8_t alt_font = 1; + + static uint32_t bitmap_addr; + + /* Glyphs in the WesternCharSet bitmap */ + + enum { + GRAVE, + ACUTE, + CIRCUMFLEX, + TILDE, + DIAERESIS, + DOT_ABOVE, + CEDILLA, + NO_DOT_I, +#if ENABLED(TOUCH_UI_UTF8_GERMANIC) + SHARP_S, +#endif +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + LRG_O_STROKE, + SML_O_STROKE, + LRG_AE, + SML_AE, + LRG_ETH, + SML_ETH, + LRG_THORN, + SML_THORN, +#endif +#if ENABLED(TOUCH_UI_UTF8_PUNCTUATION) + LEFT_DBL_QUOTE, + RIGHT_DBL_QUOTE, + INV_EXCLAMATION, + INV_QUESTION, +#endif +#if ENABLED(TOUCH_UI_UTF8_CURRENCY) + CENT_SIGN, + POUND_SIGN, + CURRENCY_SIGN, + YEN_SIGN, +#endif +#if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS) + SUPERSCRIPT_ONE, + SUPERSCRIPT_TWO, + SUPERSCRIPT_THREE, +#endif +#if ENABLED(TOUCH_UI_UTF8_ORDINALS) + MASCULINE_ORDINAL, + FEMININE_ORDINAL, +#endif +#if ENABLED(TOUCH_UI_UTF8_COPYRIGHT) + COPYRIGHT_SIGN, + REGISTERED_SIGN, +#endif +#if ENABLED(TOUCH_UI_UTF8_MATHEMATICS) + PLUS_MINUS_SIGN, + MULTIPLICATION_SIGN, + DIVISION_SIGN, +#endif +#if ENABLED(TOUCH_UI_UTF8_FRACTIONS) + FRACTION_QUARTER, + FRACTION_HALF, + FRACTION_THREE_FOURTHS, +#endif +#if ENABLED(TOUCH_UI_UTF8_SYMBOLS) + MICRON_SIGN, + PILCROW_SIGN, + BROKEN_BAR, + SECTION_SIGN, + NOT_SIGN +#endif + }; + + /* Centerline of characters that can take accents */ + + constexpr int8_t mid_a = 12; + constexpr int8_t mid_e = 12; + constexpr int8_t mid_i = 5; + constexpr int8_t mid_o = 12; + constexpr int8_t mid_u = 12; + constexpr int8_t mid_y = 11; + constexpr int8_t mid_n = 12; + constexpr int8_t mid_c = 12; + constexpr int8_t mid_A = 13; + constexpr int8_t mid_E = 13; + constexpr int8_t mid_I = 6; + constexpr int8_t mid_O = 14; + constexpr int8_t mid_U = 14; + constexpr int8_t mid_Y = 13; + constexpr int8_t mid_N = 15; + constexpr int8_t mid_C = 13; + + /* Centerline of accent glyphs */ + + constexpr int8_t mid_accent = 16; + + /* When reusing the DOT_ABOVE accent glyph for the degree sign, we need to trim the leading space */ + constexpr uint8_t deg_sign_leading = 9; + + /* Look-up table for constructing characters (must be ordered by unicode) + * + * Characters are either complete symbols from the Western Char Set bitmap, + * or they are constructed using a standard letter from the romfont and + * drawing an accent from the Western Char Set bitmap over it. + */ + + #define UTF8(A) uint16_t(utf8(U##A)) + + PROGMEM constexpr struct { + uint16_t unicode; + uint8_t std_char; // Glyph from standard ROMFONT (zero if none) + uint8_t alt_char; // Glyph from Western Char Set bitmap + uint8_t alt_data; // For accented characters, the centerline; else char width + } char_recipe[] = { + {0, 0, NO_DOT_I, 10 }, +#if ENABLED(TOUCH_UI_UTF8_PUNCTUATION) + {UTF8('¡'), 0 , INV_EXCLAMATION, 13 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_CURRENCY) + {UTF8('¢'), 0 , CENT_SIGN, 23 }, + {UTF8('£'), 0 , POUND_SIGN, 24 }, + {UTF8('¤'), 0 , CURRENCY_SIGN, 26 }, + {UTF8('¥'), 0 , YEN_SIGN, 26 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_SYMBOLS) + {UTF8('¦'), 0 , BROKEN_BAR, 11 }, + {UTF8('§'), 0 , SECTION_SIGN, 21 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_COPYRIGHT) + {UTF8('©'), 0 , COPYRIGHT_SIGN, 38 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_ORDINALS) + {UTF8('ª'), 0 , FEMININE_ORDINAL, 19 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_PUNCTUATION) + {UTF8('«'), 0 , LEFT_DBL_QUOTE, 23 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_SYMBOLS) + {UTF8('¬'), 0 , NOT_SIGN, 32 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_COPYRIGHT) + {UTF8('®'), 0 , REGISTERED_SIGN, 38 }, +#endif + {UTF8('°'), 0 , DOT_ABOVE, 24 }, +#if ENABLED(TOUCH_UI_UTF8_MATHEMATICS) + {UTF8('±'), 0 , NOT_SIGN, 32 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS) + {UTF8('²'), 0 , SUPERSCRIPT_TWO, 16 }, + {UTF8('³'), 0 , SUPERSCRIPT_THREE, 16 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_SYMBOLS) + {UTF8('µ'), 0 , MICRON_SIGN, 28 }, + {UTF8('¶'), 0 , PILCROW_SIGN, 24 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS) + {UTF8('¹'), 0 , SUPERSCRIPT_ONE, 16 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_ORDINALS) + {UTF8('º'), 0 , MASCULINE_ORDINAL, 19 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_PUNCTUATION) + {UTF8('»'), 0 , RIGHT_DBL_QUOTE, 24 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_FRACTIONS) + {UTF8('¼'), 0 , FRACTION_QUARTER, 40 }, + {UTF8('½'), 0 , FRACTION_HALF, 40 }, + {UTF8('¾'), 0 , FRACTION_THREE_FOURTHS, 40 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_PUNCTUATION) + {UTF8('¿'), 0 , INV_QUESTION, 21 }, +#endif + {UTF8('À'), 'A', GRAVE, mid_A}, + {UTF8('Á'), 'A', ACUTE, mid_A}, + {UTF8('Â'), 'A', CIRCUMFLEX, mid_A}, + {UTF8('Ã'), 'A', TILDE, mid_A}, + {UTF8('Ä'), 'A', DIAERESIS, mid_A}, + {UTF8('Å'), 'A', DOT_ABOVE, mid_A}, +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + {UTF8('Æ'), 0 , LRG_AE, 40}, +#endif + {UTF8('Ç'), 'C', CEDILLA, mid_C}, + {UTF8('È'), 'E', GRAVE, mid_E}, + {UTF8('É'), 'E', ACUTE, mid_E}, + {UTF8('Ê'), 'E', CIRCUMFLEX, mid_E}, + {UTF8('Ë'), 'E', DIAERESIS, mid_E}, + {UTF8('Ì'), 'I', GRAVE, mid_I}, + {UTF8('Í'), 'I', ACUTE, mid_I}, + {UTF8('Î'), 'I', CIRCUMFLEX, mid_I}, + {UTF8('Ï'), 'I', DIAERESIS, mid_I}, +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + {UTF8('Ð'), 0, LRG_ETH, 31 }, +#endif + {UTF8('Ñ'), 'N', TILDE, mid_N}, + {UTF8('Ò'), 'O', GRAVE, mid_O}, + {UTF8('Ó'), 'O', ACUTE, mid_O}, + {UTF8('Ô'), 'O', CIRCUMFLEX, mid_O}, + {UTF8('Õ'), 'O', TILDE, mid_O}, + {UTF8('Ö'), 'O', DIAERESIS, mid_O}, +#if ENABLED(TOUCH_UI_UTF8_MATHEMATICS) + {UTF8('×'), 0 , MULTIPLICATION_SIGN, 32 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + {UTF8('Ø'), 0 , LRG_O_STROKE, 32 }, +#endif + {UTF8('Ù'), 'U', GRAVE, mid_U}, + {UTF8('Ú'), 'U', ACUTE, mid_U}, + {UTF8('Û'), 'U', CIRCUMFLEX, mid_U}, + {UTF8('Ü'), 'U', DIAERESIS, mid_U}, + {UTF8('Ý'), 'Y', ACUTE, mid_Y}, +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + {UTF8('Þ'), 0 , LRG_THORN, 25 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_GERMANIC) + {UTF8('ß'), 0 , SHARP_S, 26 }, +#endif + {UTF8('à'), 'a', GRAVE, mid_a}, + {UTF8('á'), 'a', ACUTE, mid_a}, + {UTF8('â'), 'a', CIRCUMFLEX, mid_a}, + {UTF8('ã'), 'a', TILDE, mid_a}, + {UTF8('ä'), 'a', DIAERESIS, mid_a}, + {UTF8('å'), 'a', DOT_ABOVE, mid_a}, +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + {UTF8('æ'), 0 , SML_AE, 40 }, +#endif + {UTF8('ç'), 'c', CEDILLA, mid_c}, + {UTF8('è'), 'e', GRAVE, mid_e}, + {UTF8('é'), 'e', ACUTE, mid_e}, + {UTF8('ê'), 'e', CIRCUMFLEX, mid_e}, + {UTF8('ë'), 'e', DIAERESIS, mid_e}, + {UTF8('ì'), 'i', GRAVE, mid_i}, + {UTF8('í'), 'i', ACUTE, mid_i}, + {UTF8('î'), 'i', CIRCUMFLEX, mid_i}, + {UTF8('ï'), 'i', DIAERESIS, mid_i}, +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + {UTF8('ð'), 0, SML_ETH, 24 }, +#endif + {UTF8('ñ'), 'n', TILDE, mid_n}, + {UTF8('ò'), 'o', GRAVE, mid_o}, + {UTF8('ó'), 'o', ACUTE, mid_o}, + {UTF8('ô'), 'o', CIRCUMFLEX, mid_o}, + {UTF8('õ'), 'o', TILDE, mid_o}, + {UTF8('ö'), 'o', DIAERESIS, mid_o}, +#if ENABLED(TOUCH_UI_UTF8_MATHEMATICS) + {UTF8('÷'), 0 , DIVISION_SIGN, 32 }, +#endif +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + {UTF8('ø'), 0 , SML_O_STROKE, 25 }, +#endif + {UTF8('ù'), 'u', GRAVE, mid_u}, + {UTF8('ú'), 'u', ACUTE, mid_u}, + {UTF8('û'), 'u', CIRCUMFLEX, mid_u}, + {UTF8('ü'), 'u', DIAERESIS, mid_u}, + {UTF8('ý'), 'y', ACUTE, mid_y}, +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + {UTF8('þ'), 0 , SML_THORN, 25 }, +#endif + {UTF8('ÿ'), 'y', DIAERESIS, mid_y} + }; + + static_assert(UTF8('¡') == 0xC2A1, "Incorrect encoding for character"); + + /* Compile-time check that the table is in sorted order */ + + constexpr bool is_sorted(size_t n) { + return n < 2 ? true : char_recipe[n-2].unicode < char_recipe[n-1].unicode && is_sorted(n-1); + } + + static_assert(is_sorted(NUM_ELEMENTS(char_recipe)), "The table must be sorted by unicode value"); + + /* Performs a binary search to find a unicode character in the table */ + + static int8_t find_char_data(FTDI::utf8_char_t c) { + int8_t min = 0, max = NUM_ELEMENTS(char_recipe), index; + for (;;) { + index = (min + max)/2; + const uint16_t char_at = pgm_read_word(&char_recipe[index].unicode); + if (char_at == c) break; + if (min == max) return -1; + if (c > char_at) + min = index + 1; + else + max = index; + } + return index; + } + + static void get_char_data(uint8_t index, uint8_t &std_char, uint8_t &alt_char, uint8_t &alt_data) { + std_char = pgm_read_byte(&char_recipe[index].std_char); + alt_char = pgm_read_byte(&char_recipe[index].alt_char); + alt_data = pgm_read_byte(&char_recipe[index].alt_data); + } + + /** + * Load bitmap data into RAMG. This function is called once at the start + * of the program. + * + * Parameters: + * + * addr - Address in RAMG where the font data is written + */ + + void FTDI::WesternCharSet::load_data(uint32_t addr) { + // Load the alternative font metrics + CLCD::FontMetrics alt_fm; + alt_fm.ptr = addr + 148; + alt_fm.format = L4; + alt_fm.stride = 19; + alt_fm.width = 38; + alt_fm.height = 49; + for (uint8_t i = 0; i < 127; i++) + alt_fm.char_widths[i] = 0; + + // For special characters, copy the character widths from the char tables + for (uint8_t i = 0; i < NUM_ELEMENTS(char_recipe); i++) { + uint8_t std_char, alt_char, alt_data; + get_char_data(i, std_char, alt_char, alt_data); + if (std_char == 0) + alt_fm.char_widths[alt_char] = alt_data; + } + CLCD::mem_write_bulk(addr, &alt_fm, 148); + + // Decode the RLE data and load it into RAMG as a bitmap + write_rle_data(addr + 148, font, sizeof(font)); + + bitmap_addr = addr; + } + + /** + * Populates the bitmap handles for the custom into the display list. + * This function is called once at the start of each display list. + * + * Parameters: + * + * cmd - Object used for writing to the FTDI chip command queue. + */ + + void FTDI::WesternCharSet::load_bitmaps(CommandProcessor& cmd) { + CLCD::FontMetrics alt_fm; + alt_fm.ptr = bitmap_addr + 148; + alt_fm.format = L4; + alt_fm.stride = 19; + alt_fm.width = 38; + alt_fm.height = 49; + set_font_bitmap(cmd, alt_fm, alt_font); + } + + /** + * Renders a character at location x and y. The x position is incremented + * by the width of the character. + * + * Parameters: + * + * cmd - If non-NULL the symbol is drawn to the screen. + * If NULL, only increment position for text measurement. + * + * x, y - The location at which to draw the character. On output, + * incremented to the location of the next character. + * + * fs - A scaling object used to scale the font. The display will + * already be configured to scale bitmaps, but positions + * must be scaled using fs.scale() + * + * c - The unicode code point to draw. If the renderer does not + * support the character, it should return false. + + * Returns: Whether the character was supported. + */ + + bool FTDI::WesternCharSet::render_glyph(CommandProcessor* cmd, int &x, int &y, font_size_t fs, utf8_char_t c) { + + // A supported character? + if (c < UTF8('¡') || c > UTF8('ÿ')) return false; + + int8_t index = find_char_data(c); + if (index == -1) return false; + + // Determine character characteristics + uint8_t std_char, alt_char, alt_data; + get_char_data(index, std_char, alt_char, alt_data); + + bool base_special; + uint8_t base_width; + uint8_t base_char; + uint8_t accent_char; + int8_t accent_dx, accent_dy; + + if (std_char == 0) { + // Special character, non-accented + base_width = alt_data; + base_special = true; + base_char = alt_char; + accent_char = 0; + if (c == UTF8('°')) + x -= fs.scale(deg_sign_leading); + } else { + // Regular character with accent: + accent_dx = alt_data - mid_accent; + accent_dy = isupper(std_char) ? -7 : 0; + accent_char = alt_char; + base_width = StandardCharSet::std_char_width(std_char); + base_special = std_char == 'i'; + base_char = base_special ? NO_DOT_I : std_char; + } + + // If cmd != NULL, draw the glyph to the screen + if (cmd) { + ext_vertex2ii(*cmd, x, y, base_special ? alt_font : std_font, base_char); + if (accent_char) + ext_vertex2ii(*cmd, x + fs.scale(accent_dx), y + fs.scale(accent_dy), alt_font, accent_char); + } + + // Increment X to the next character position + x += fs.scale(base_width); + return true; + } + +#endif // FTDI_EXTENDED && TOUCH_UI_USE_UTF8 && TOUCH_UI_UTF8_WESTERN_CHARSET diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/western_char_set.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/western_char_set.h new file mode 100644 index 0000000000..704de95088 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/western_char_set.h @@ -0,0 +1,29 @@ +/********************** + * western_char_set.h * + **********************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +namespace FTDI { + class WesternCharSet { + public: + static void load_data(uint32_t addr); + static void load_bitmaps(CommandProcessor&); + static bool render_glyph(CommandProcessor*, int &x, int &y, font_size_t, utf8_char_t); + }; +} diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h new file mode 100644 index 0000000000..64a14121d9 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/unicode/western_char_set_bitmap_31.h @@ -0,0 +1,1315 @@ +/******************************** + * western_european_bitmap_31.h * + ********************************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +/* This is a dump of "font_bitmaps/western_european_bitmap_31.png" + * using the tool "bitmap2cpp.py". The tool converts the image into + * 16-level grayscale and packs two pixels per byte. The resulting + * bytes are then RLE compressed to yield (count, byte) pairs. + */ + +const unsigned char font[] PROGMEM = { + + /* 0 GRAVE */ + 0x76, 0x00, 0x01, 0x08, 0x01, 0xee, 0x01, 0xe5, 0x11, 0x00, 0x01, 0xaf, + 0x01, 0xff, 0x01, 0x20, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xd0, + 0x10, 0x00, 0x01, 0x01, 0x01, 0xdf, 0x01, 0xf9, 0x11, 0x00, 0x01, 0x2e, + 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf2, + 0x11, 0x00, 0x01, 0x5f, 0x01, 0xfd, 0x11, 0x00, 0x01, 0x06, 0x01, 0x99, + 0x01, 0x40, 0xff, 0x00, 0xff, 0x00, 0xa4, 0x00, + + /* 1 ACUTE */ + 0x7b, 0x00, 0x01, 0x9e, 0x01, 0xee, 0x01, 0x50, 0x0f, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xf8, 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0xcf, 0x01, 0xfc, 0x10, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0xd1, 0x10, 0x00, 0x01, 0x4f, 0x01, 0xfe, 0x01, 0x20, 0x0f, 0x00, + 0x01, 0x01, 0x01, 0xef, 0x01, 0xf3, 0x10, 0x00, 0x01, 0x07, 0x01, 0xaa, + 0x01, 0x40, 0xff, 0x00, 0xff, 0x00, 0xa5, 0x00, + + /* 2 CIRCUMFLEX */ + 0x79, 0x00, 0x01, 0xcf, 0x01, 0xfc, 0x10, 0x00, 0x01, 0x07, 0x02, 0xff, + 0x01, 0x60, 0x0f, 0x00, 0x01, 0x2f, 0x02, 0xff, 0x01, 0xf2, 0x0f, 0x00, + 0x01, 0xcf, 0x01, 0xf6, 0x01, 0x6f, 0x01, 0xfb, 0x0e, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xa0, 0x01, 0x0a, 0x01, 0xff, 0x01, 0x60, 0x0d, 0x00, + 0x01, 0x1f, 0x01, 0xfd, 0x01, 0x00, 0x01, 0x01, 0x01, 0xdf, 0x01, 0xf1, + 0x0d, 0x00, 0x01, 0xbf, 0x01, 0xf3, 0x02, 0x00, 0x01, 0x3f, 0x01, 0xfb, + 0x0c, 0x00, 0x01, 0x02, 0x01, 0x99, 0x01, 0x50, 0x02, 0x00, 0x01, 0x05, + 0x01, 0x99, 0x01, 0x20, 0xff, 0x00, 0xff, 0x00, 0xa2, 0x00, + + /* 3 TILDE */ + 0x7c, 0x00, 0x01, 0x11, 0x0d, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xc3, + 0x02, 0x00, 0x01, 0xff, 0x01, 0x80, 0x0c, 0x00, 0x01, 0xaf, 0x02, 0xff, + 0x01, 0x50, 0x01, 0x01, 0x01, 0xff, 0x01, 0x60, 0x0b, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xd9, 0x01, 0xff, 0x01, 0xf7, 0x01, 0x07, 0x01, 0xff, + 0x01, 0x40, 0x0b, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0x20, 0x01, 0x3e, + 0x02, 0xff, 0x01, 0xfd, 0x0c, 0x00, 0x01, 0x09, 0x01, 0xfe, 0x01, 0x00, + 0x01, 0x02, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xf4, 0x0c, 0x00, 0x01, 0x07, + 0x01, 0xa8, 0x02, 0x00, 0x01, 0x06, 0x01, 0x98, 0x01, 0x20, 0xff, 0x00, + 0xff, 0x00, 0xb6, 0x00, + + /* 4 DIAERESIS */ + 0x8a, 0x00, 0x02, 0x44, 0x02, 0x00, 0x02, 0x44, 0x0d, 0x00, 0x02, 0xff, + 0x01, 0x10, 0x01, 0x01, 0x02, 0xff, 0x0d, 0x00, 0x02, 0xff, 0x01, 0x10, + 0x01, 0x01, 0x02, 0xff, 0x0d, 0x00, 0x02, 0xff, 0x01, 0x10, 0x01, 0x01, + 0x02, 0xff, 0x0d, 0x00, 0x02, 0xcc, 0x01, 0x10, 0x01, 0x01, 0x02, 0xcc, + 0xff, 0x00, 0xff, 0x00, 0xc9, 0x00, + + /* 5 DOT_ABOVE / DEGREE_SIGN */ + 0x2d, 0x00, 0x01, 0x13, 0x01, 0x30, 0x10, 0x00, 0x01, 0x2b, 0x02, 0xff, + 0x01, 0xa1, 0x0e, 0x00, 0x01, 0x02, 0x01, 0xef, 0x02, 0xff, 0x01, 0xfd, + 0x01, 0x10, 0x0d, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0x94, 0x01, 0x5a, + 0x01, 0xff, 0x01, 0xb0, 0x0d, 0x00, 0x01, 0x4f, 0x01, 0xf7, 0x02, 0x00, + 0x01, 0x9f, 0x01, 0xf2, 0x0d, 0x00, 0x01, 0x8f, 0x01, 0xf0, 0x02, 0x00, + 0x01, 0x2f, 0x01, 0xf6, 0x0d, 0x00, 0x01, 0x8f, 0x01, 0xe0, 0x02, 0x00, + 0x01, 0x0f, 0x01, 0xf7, 0x0d, 0x00, 0x01, 0x7f, 0x01, 0xf2, 0x02, 0x00, + 0x01, 0x4f, 0x01, 0xf5, 0x0d, 0x00, 0x01, 0x2f, 0x01, 0xfc, 0x01, 0x10, + 0x01, 0x02, 0x01, 0xdf, 0x01, 0xf0, 0x0d, 0x00, 0x01, 0x08, 0x01, 0xff, + 0x01, 0xfb, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x60, 0x0e, 0x00, 0x01, 0x9f, + 0x02, 0xff, 0x01, 0xf8, 0x0f, 0x00, 0x01, 0x03, 0x01, 0x9c, 0x01, 0xc9, + 0x01, 0x30, 0xff, 0x00, 0xff, 0x00, 0xa4, 0x00, + + /* 6 CEDILLA */ + 0xff, 0x00, 0xff, 0x00, 0xee, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0x20, + 0x11, 0x00, 0x01, 0xcf, 0x01, 0xc0, 0x11, 0x00, 0x01, 0x3f, 0x01, 0xf6, + 0x11, 0x00, 0x01, 0x0f, 0x01, 0xfb, 0x11, 0x00, 0x01, 0x3f, 0x01, 0xfd, + 0x0e, 0x00, 0x01, 0x07, 0x01, 0xd9, 0x01, 0x89, 0x01, 0xff, 0x01, 0xfb, + 0x0e, 0x00, 0x01, 0x07, 0x03, 0xff, 0x01, 0xf3, 0x0e, 0x00, 0x01, 0x04, + 0x01, 0xbd, 0x01, 0xee, 0x01, 0xd9, 0x01, 0x20, 0x2f, 0x00, + + /* 7 NO_DOT_I */ + 0xff, 0x00, 0x32, 0x00, 0x01, 0x01, 0x01, 0x99, 0x01, 0x96, 0x10, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xf9, 0x10, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0x10, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf9, 0xcd, 0x00, + +#if ENABLED(TOUCH_UI_UTF8_GERMANIC) + /* 8 SHARP_S */ + 0x8a, 0x00, 0x01, 0x35, 0x01, 0x66, 0x01, 0x52, 0x0e, 0x00, 0x01, 0x03, + 0x01, 0xaf, 0x03, 0xff, 0x01, 0xe7, 0x0d, 0x00, 0x01, 0x7f, 0x05, 0xff, + 0x01, 0xc1, 0x0b, 0x00, 0x01, 0x07, 0x02, 0xff, 0x01, 0xfc, 0x01, 0xaa, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0xfc, 0x0b, 0x00, 0x01, 0x2f, 0x01, 0xff, + 0x01, 0xf9, 0x01, 0x10, 0x01, 0x00, 0x01, 0x02, 0x01, 0xcf, 0x01, 0xff, + 0x01, 0x70, 0x0a, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x80, 0x03, 0x00, + 0x01, 0x0d, 0x01, 0xff, 0x01, 0xe0, 0x0a, 0x00, 0x01, 0xef, 0x01, 0xff, + 0x04, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf3, 0x09, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xfb, 0x04, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf7, + 0x09, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf9, 0x03, 0x00, 0x01, 0x03, + 0x01, 0x9e, 0x01, 0xff, 0x01, 0xf8, 0x09, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf8, 0x02, 0x00, 0x01, 0x01, 0x01, 0xaf, 0x02, 0xff, 0x01, 0xd7, + 0x09, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x02, 0x00, 0x01, 0x1d, + 0x01, 0xff, 0x01, 0xfc, 0x01, 0x50, 0x0a, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf8, 0x02, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x70, 0x0b, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x01, 0x00, 0x01, 0x01, 0x01, 0xff, + 0x01, 0xfa, 0x0c, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x01, 0x00, + 0x01, 0x05, 0x01, 0xff, 0x01, 0xf4, 0x0c, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf8, 0x01, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf4, 0x0c, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x01, 0x00, 0x01, 0x05, 0x01, 0xff, + 0x01, 0xf9, 0x0c, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x01, 0x00, + 0x01, 0x02, 0x02, 0xff, 0x01, 0x50, 0x0b, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf8, 0x02, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0xf8, 0x0b, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x02, 0x00, 0x01, 0x1d, 0x02, 0xff, + 0x01, 0xd3, 0x0a, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x02, 0x00, + 0x01, 0x01, 0x01, 0xcf, 0x02, 0xff, 0x01, 0x70, 0x09, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf8, 0x03, 0x00, 0x01, 0x07, 0x02, 0xff, 0x01, 0xfb, + 0x09, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x04, 0x00, 0x01, 0x2b, + 0x02, 0xff, 0x01, 0xb0, 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, + 0x05, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xf6, 0x08, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xfd, + 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xdf, + 0x01, 0xff, 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0x10, 0x07, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf8, 0x06, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x08, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xfd, + 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x01, 0x02, 0x01, 0x84, + 0x03, 0x00, 0x01, 0x2d, 0x01, 0xff, 0x01, 0xf8, 0x08, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf8, 0x01, 0x02, 0x01, 0xff, 0x01, 0xec, 0x01, 0xa9, + 0x01, 0xac, 0x02, 0xff, 0x01, 0xe0, 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf8, 0x01, 0x02, 0x05, 0xff, 0x01, 0xfe, 0x01, 0x20, 0x08, 0x00, + 0x01, 0x03, 0x01, 0xee, 0x01, 0xe7, 0x01, 0x01, 0x01, 0xbf, 0x03, 0xff, + 0x01, 0xfe, 0x01, 0x80, 0x0e, 0x00, 0x01, 0x35, 0x01, 0x78, 0x01, 0x76, + 0x01, 0x30, 0xb4, 0x00, +#endif + +#if ENABLED(TOUCH_UI_UTF8_SCANDINAVIAN) + /* 9 LRG_O_STROKE */ + 0x93, 0x00, 0x01, 0x40, 0x0a, 0x00, 0x01, 0x47, 0x01, 0x9a, 0x01, 0xba, + 0x01, 0x95, 0x01, 0x10, 0x02, 0x00, 0x01, 0x07, 0x01, 0xf8, 0x08, 0x00, + 0x01, 0x02, 0x01, 0xaf, 0x04, 0xff, 0x01, 0xfc, 0x01, 0x50, 0x01, 0x00, + 0x01, 0x5f, 0x01, 0xff, 0x01, 0x30, 0x07, 0x00, 0x01, 0x8f, 0x06, 0xff, + 0x01, 0xfc, 0x01, 0x23, 0x01, 0xff, 0x01, 0xf6, 0x07, 0x00, 0x01, 0x1c, + 0x03, 0xff, 0x01, 0xca, 0x01, 0x9b, 0x01, 0xdf, 0x02, 0xff, 0x01, 0xfe, + 0x01, 0xff, 0x01, 0x80, 0x07, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xfd, + 0x01, 0x50, 0x02, 0x00, 0x01, 0x02, 0x01, 0x9f, 0x02, 0xff, 0x01, 0xfa, + 0x07, 0x00, 0x01, 0x09, 0x02, 0xff, 0x01, 0x90, 0x04, 0x00, 0x01, 0x03, + 0x01, 0xef, 0x01, 0xff, 0x01, 0xf3, 0x07, 0x00, 0x01, 0x5f, 0x01, 0xff, + 0x01, 0xf9, 0x06, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0xfc, 0x07, 0x00, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x06, 0x03, 0xff, + 0x01, 0x60, 0x05, 0x00, 0x01, 0x04, 0x02, 0xff, 0x01, 0x30, 0x05, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xc0, 0x05, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0xfc, 0x05, 0x00, 0x01, 0x02, 0x01, 0xef, + 0x01, 0xf7, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0xf6, 0x05, 0x00, 0x01, 0x1d, 0x01, 0xff, 0x01, 0xa0, + 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf8, 0x05, 0x00, 0x01, 0x3f, 0x01, 0xff, + 0x01, 0xf2, 0x05, 0x00, 0x01, 0xcf, 0x01, 0xfc, 0x01, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xfb, 0x05, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xe0, + 0x04, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xd1, 0x01, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xfe, 0x05, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xc0, + 0x04, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x20, 0x01, 0x00, 0x01, 0x03, + 0x02, 0xff, 0x05, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0xb0, 0x03, 0x00, + 0x01, 0x05, 0x01, 0xff, 0x01, 0xf4, 0x02, 0x00, 0x01, 0x02, 0x02, 0xff, + 0x01, 0x10, 0x04, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xa0, 0x03, 0x00, + 0x01, 0x3f, 0x01, 0xff, 0x01, 0x60, 0x02, 0x00, 0x01, 0x01, 0x02, 0xff, + 0x01, 0x30, 0x04, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xa0, 0x02, 0x00, + 0x01, 0x01, 0x01, 0xef, 0x01, 0xf8, 0x03, 0x00, 0x01, 0x02, 0x02, 0xff, + 0x01, 0x20, 0x04, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0xb0, 0x02, 0x00, + 0x01, 0x0d, 0x01, 0xff, 0x01, 0xb0, 0x03, 0x00, 0x01, 0x03, 0x02, 0xff, + 0x01, 0x10, 0x04, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xc0, 0x02, 0x00, + 0x01, 0xbf, 0x01, 0xfd, 0x04, 0x00, 0x01, 0x04, 0x02, 0xff, 0x05, 0x00, + 0x01, 0x6f, 0x01, 0xff, 0x01, 0xe0, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, + 0x01, 0xe1, 0x04, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xfe, 0x05, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x6f, 0x01, 0xff, + 0x01, 0x30, 0x04, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xfa, 0x05, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf6, 0x01, 0x04, 0x01, 0xff, 0x01, 0xf5, + 0x05, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf7, 0x05, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xfc, 0x01, 0x2e, 0x01, 0xff, 0x01, 0x70, 0x05, 0x00, + 0x01, 0x5f, 0x01, 0xff, 0x01, 0xf2, 0x05, 0x00, 0x01, 0x03, 0x02, 0xff, + 0x01, 0xef, 0x01, 0xfa, 0x06, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xb0, + 0x06, 0x00, 0x01, 0xcf, 0x02, 0xff, 0x01, 0xc0, 0x05, 0x00, 0x01, 0x06, + 0x02, 0xff, 0x01, 0x40, 0x06, 0x00, 0x01, 0x2f, 0x02, 0xff, 0x01, 0x20, + 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xfb, 0x07, 0x00, 0x01, 0x0b, + 0x02, 0xff, 0x01, 0xd2, 0x04, 0x00, 0x01, 0x06, 0x02, 0xff, 0x01, 0xe1, + 0x07, 0x00, 0x01, 0x5f, 0x03, 0xff, 0x01, 0x93, 0x02, 0x00, 0x01, 0x05, + 0x01, 0xcf, 0x02, 0xff, 0x01, 0x30, 0x06, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xfb, 0x03, 0xff, 0x01, 0xfd, 0x01, 0xde, 0x03, 0xff, 0x01, 0xe3, + 0x07, 0x00, 0x01, 0x1e, 0x01, 0xff, 0x01, 0x80, 0x01, 0x4d, 0x06, 0xff, + 0x01, 0xfa, 0x01, 0x10, 0x07, 0x00, 0x01, 0xbf, 0x01, 0xfb, 0x02, 0x00, + 0x01, 0x5c, 0x04, 0xff, 0x01, 0xe9, 0x01, 0x30, 0x08, 0x00, 0x01, 0x1c, + 0x01, 0xd0, 0x03, 0x00, 0x01, 0x04, 0x01, 0x67, 0x01, 0x86, 0x01, 0x53, + 0x0b, 0x00, 0x01, 0x10, 0xa8, 0x00, + + /* 10 SML_O_STROKE */ + 0xff, 0x00, 0x15, 0x00, 0x01, 0x02, 0x01, 0x20, 0x0c, 0x00, 0x01, 0x02, + 0x01, 0x32, 0x01, 0x10, 0x02, 0x00, 0x01, 0x1d, 0x01, 0xe3, 0x0a, 0x00, + 0x01, 0x01, 0x01, 0x7c, 0x02, 0xff, 0x01, 0xfd, 0x01, 0x82, 0x01, 0x00, + 0x01, 0xcf, 0x01, 0xf7, 0x0a, 0x00, 0x01, 0x6e, 0x05, 0xff, 0x01, 0x89, + 0x01, 0xff, 0x01, 0xa0, 0x09, 0x00, 0x01, 0x08, 0x07, 0xff, 0x01, 0xfc, + 0x0a, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xfc, 0x01, 0x50, 0x01, 0x00, + 0x01, 0x3a, 0x02, 0xff, 0x01, 0xf1, 0x09, 0x00, 0x01, 0x01, 0x02, 0xff, + 0x01, 0x90, 0x03, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0xf5, 0x09, 0x00, + 0x01, 0x08, 0x01, 0xff, 0x01, 0xfc, 0x03, 0x00, 0x01, 0x01, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0xfd, 0x09, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf3, + 0x03, 0x00, 0x01, 0x0b, 0x03, 0xff, 0x01, 0x30, 0x08, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x9f, 0x01, 0xfa, 0x01, 0x8f, + 0x01, 0xff, 0x01, 0x80, 0x08, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x80, + 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xc0, 0x01, 0x3f, 0x01, 0xff, + 0x01, 0xb0, 0x08, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x50, 0x02, 0x00, + 0x01, 0x3f, 0x01, 0xfe, 0x01, 0x10, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xe0, + 0x08, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x40, 0x01, 0x00, 0x01, 0x02, + 0x01, 0xef, 0x01, 0xf3, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf0, + 0x08, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x30, 0x01, 0x00, 0x01, 0x0d, + 0x01, 0xff, 0x01, 0x50, 0x01, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf0, + 0x08, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x30, 0x01, 0x00, 0x01, 0xbf, + 0x01, 0xf8, 0x02, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, + 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x01, 0x08, 0x01, 0xff, 0x01, 0xb0, + 0x02, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xe0, 0x08, 0x00, 0x01, 0x7f, + 0x01, 0xff, 0x01, 0x60, 0x01, 0x5f, 0x01, 0xfd, 0x03, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0xc0, 0x08, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xa3, + 0x01, 0xff, 0x01, 0xe2, 0x03, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x90, + 0x08, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xfe, 0x01, 0xff, 0x01, 0x40, + 0x03, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x08, 0x00, 0x01, 0x0a, + 0x02, 0xff, 0x01, 0xf6, 0x03, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xfe, + 0x09, 0x00, 0x01, 0x02, 0x02, 0xff, 0x01, 0xb0, 0x03, 0x00, 0x01, 0x2e, + 0x01, 0xff, 0x01, 0xf8, 0x0a, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0xf7, + 0x02, 0x00, 0x01, 0x05, 0x01, 0xef, 0x01, 0xff, 0x01, 0xd0, 0x09, 0x00, + 0x01, 0x04, 0x03, 0xff, 0x01, 0xfc, 0x01, 0xab, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xfe, 0x01, 0x20, 0x09, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xaf, + 0x05, 0xff, 0x01, 0xd2, 0x09, 0x00, 0x01, 0x01, 0x01, 0xdf, 0x01, 0xf5, + 0x01, 0x04, 0x01, 0xbf, 0x03, 0xff, 0x01, 0xd6, 0x0a, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0x70, 0x01, 0x00, 0x01, 0x01, 0x01, 0x46, 0x01, 0x76, + 0x01, 0x52, 0x0c, 0x00, 0x01, 0x28, 0xa9, 0x00, + + /* 11 LRG_AE */ + 0x9e, 0x00, 0x01, 0x14, 0x0b, 0x44, 0x01, 0x41, 0x06, 0x00, 0x01, 0x8f, + 0x0b, 0xff, 0x01, 0xf3, 0x06, 0x00, 0x01, 0xef, 0x0b, 0xff, 0x01, 0xf3, + 0x05, 0x00, 0x01, 0x05, 0x02, 0xff, 0x01, 0xee, 0x09, 0xff, 0x01, 0xf3, + 0x05, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf5, 0x01, 0x00, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0x63, 0x06, 0x33, 0x01, 0x30, 0x05, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0xe0, 0x01, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, + 0x0c, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x80, 0x01, 0x00, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0x40, 0x0b, 0x00, 0x01, 0x01, 0x02, 0xff, 0x01, 0x10, + 0x01, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, 0x0b, 0x00, 0x01, 0x07, + 0x01, 0xff, 0x01, 0xfa, 0x02, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, + 0x0b, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf3, 0x02, 0x00, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0x40, 0x0b, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xd0, + 0x02, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, 0x0b, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x60, 0x02, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, + 0x0a, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xfe, 0x03, 0x00, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0x40, 0x0a, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf9, + 0x03, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xed, 0x06, 0xdd, 0x01, 0x80, + 0x03, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, 0x03, 0x00, 0x01, 0xdf, + 0x08, 0xff, 0x01, 0xa0, 0x03, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xb0, + 0x03, 0x00, 0x01, 0xdf, 0x08, 0xff, 0x01, 0xa0, 0x03, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x40, 0x03, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xa8, + 0x06, 0x88, 0x01, 0x50, 0x02, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfe, + 0x04, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, 0x09, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf7, 0x04, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, + 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xf4, 0x04, 0x33, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0x40, 0x09, 0x00, 0x01, 0x7f, 0x08, 0xff, 0x01, 0x40, + 0x09, 0x00, 0x01, 0xef, 0x08, 0xff, 0x01, 0x40, 0x08, 0x00, 0x01, 0x05, + 0x09, 0xff, 0x01, 0x40, 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf7, + 0x05, 0x33, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, 0x08, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xe0, 0x05, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, + 0x08, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x80, 0x05, 0x00, 0x01, 0xdf, + 0x01, 0xff, 0x01, 0x40, 0x08, 0x00, 0x02, 0xff, 0x01, 0x20, 0x05, 0x00, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xfb, 0x06, 0x00, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xa8, 0x06, 0x88, + 0x01, 0x85, 0x01, 0x0d, 0x01, 0xff, 0x01, 0xf4, 0x06, 0x00, 0x01, 0xdf, + 0x08, 0xff, 0x01, 0xf9, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xe0, 0x06, 0x00, + 0x01, 0xdf, 0x08, 0xff, 0x01, 0xf9, 0x01, 0x8d, 0x01, 0xdd, 0x01, 0x60, + 0x06, 0x00, 0x01, 0xbd, 0x08, 0xdd, 0x01, 0xd8, 0xbe, 0x00, + + /* 12 SML_AE */ + 0xff, 0x00, 0x22, 0x00, 0x01, 0x01, 0x01, 0x34, 0x01, 0x31, 0x06, 0x00, + 0x01, 0x12, 0x01, 0x42, 0x01, 0x10, 0x05, 0x00, 0x01, 0x02, 0x01, 0x7b, + 0x01, 0xef, 0x02, 0xff, 0x01, 0xfb, 0x01, 0x60, 0x02, 0x00, 0x01, 0x03, + 0x01, 0x9e, 0x02, 0xff, 0x01, 0xfd, 0x01, 0x81, 0x04, 0x00, 0x01, 0xbf, + 0x05, 0xff, 0x01, 0xfe, 0x01, 0x40, 0x01, 0x01, 0x01, 0x9f, 0x05, 0xff, + 0x01, 0x60, 0x03, 0x00, 0x01, 0xdf, 0x02, 0xff, 0x01, 0xee, 0x03, 0xff, + 0x01, 0xf5, 0x01, 0x1d, 0x03, 0xff, 0x01, 0xef, 0x02, 0xff, 0x01, 0xf8, + 0x03, 0x00, 0x01, 0xdf, 0x01, 0xb6, 0x01, 0x30, 0x01, 0x00, 0x01, 0x01, + 0x01, 0x5d, 0x02, 0xff, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xe7, 0x01, 0x20, + 0x01, 0x00, 0x01, 0x29, 0x02, 0xff, 0x01, 0x50, 0x02, 0x00, 0x01, 0x71, + 0x05, 0x00, 0x01, 0xaf, 0x02, 0xff, 0x01, 0xfb, 0x01, 0x10, 0x03, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0xe0, 0x08, 0x00, 0x01, 0x0d, 0x02, 0xff, + 0x01, 0xd0, 0x04, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf7, 0x08, 0x00, + 0x01, 0x06, 0x02, 0xff, 0x01, 0x40, 0x05, 0x00, 0x01, 0xef, 0x01, 0xfd, + 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfd, 0x06, 0x00, 0x01, 0x9f, + 0x01, 0xff, 0x04, 0x00, 0x01, 0x02, 0x01, 0x45, 0x02, 0x66, 0x01, 0x67, + 0x01, 0xff, 0x01, 0xf9, 0x06, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x03, 0x00, + 0x01, 0x4a, 0x06, 0xff, 0x01, 0xfb, 0x03, 0x66, 0x01, 0x67, 0x02, 0x77, + 0x01, 0xaf, 0x01, 0xff, 0x02, 0x00, 0x01, 0x1b, 0x10, 0xff, 0x01, 0x00, + 0x01, 0x01, 0x01, 0xdf, 0x02, 0xff, 0x01, 0xca, 0x01, 0x98, 0x01, 0x88, + 0x01, 0x89, 0x0a, 0xff, 0x01, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xfd, + 0x01, 0x40, 0x03, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xfa, 0x08, 0x77, + 0x01, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x04, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf7, 0x09, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0x70, + 0x04, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xfa, 0x09, 0x00, 0x01, 0x7f, + 0x01, 0xff, 0x01, 0x30, 0x04, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xfe, + 0x09, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x30, 0x04, 0x00, 0x01, 0x0f, + 0x02, 0xff, 0x01, 0x50, 0x08, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0x60, + 0x04, 0x00, 0x01, 0x8f, 0x02, 0xff, 0x01, 0xe1, 0x08, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0xd0, 0x03, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0xff, 0x01, 0xfc, 0x01, 0x10, 0x05, 0x00, 0x01, 0x45, 0x01, 0x00, + 0x01, 0x0d, 0x01, 0xff, 0x01, 0xfc, 0x01, 0x20, 0x01, 0x00, 0x01, 0x01, + 0x01, 0x9f, 0x01, 0xff, 0x01, 0xa2, 0x02, 0xff, 0x01, 0xe6, 0x01, 0x10, + 0x02, 0x00, 0x01, 0x02, 0x01, 0x8d, 0x01, 0xf8, 0x01, 0x00, 0x01, 0x05, + 0x02, 0xff, 0x01, 0xfd, 0x01, 0xab, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xfc, + 0x01, 0x00, 0x01, 0x3f, 0x02, 0xff, 0x01, 0xfd, 0x01, 0xba, 0x01, 0xbc, + 0x02, 0xff, 0x01, 0xf8, 0x02, 0x00, 0x01, 0x7f, 0x05, 0xff, 0x01, 0xa0, + 0x01, 0x00, 0x01, 0x02, 0x01, 0xcf, 0x06, 0xff, 0x01, 0xf7, 0x02, 0x00, + 0x01, 0x03, 0x01, 0xbf, 0x03, 0xff, 0x01, 0xb4, 0x03, 0x00, 0x01, 0x05, + 0x01, 0xbf, 0x04, 0xff, 0x01, 0xb7, 0x01, 0x10, 0x03, 0x00, 0x01, 0x01, + 0x01, 0x46, 0x01, 0x76, 0x01, 0x41, 0x06, 0x00, 0x01, 0x35, 0x01, 0x67, + 0x01, 0x64, 0x01, 0x20, 0xad, 0x00, + + /* 13 LRG_ETH */ + 0x9a, 0x00, 0x01, 0x34, 0x03, 0x44, 0x01, 0x43, 0x01, 0x21, 0x0d, 0x00, + 0x01, 0xbf, 0x05, 0xff, 0x01, 0xfe, 0x01, 0xb8, 0x01, 0x40, 0x0a, 0x00, + 0x01, 0xbf, 0x07, 0xff, 0x01, 0xfe, 0x01, 0x81, 0x09, 0x00, 0x01, 0xbf, + 0x08, 0xff, 0x01, 0xfe, 0x01, 0x60, 0x08, 0x00, 0x01, 0xbf, 0x01, 0xff, + 0x01, 0x61, 0x02, 0x11, 0x01, 0x23, 0x01, 0x58, 0x01, 0xcf, 0x02, 0xff, + 0x01, 0xf9, 0x08, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x04, 0x00, + 0x01, 0x02, 0x01, 0x9f, 0x02, 0xff, 0x01, 0x80, 0x07, 0x00, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0x50, 0x05, 0x00, 0x01, 0x04, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xf4, 0x07, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x06, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0xfd, 0x07, 0x00, 0x01, 0xbf, 0x01, 0xff, + 0x01, 0x50, 0x06, 0x00, 0x01, 0x06, 0x02, 0xff, 0x01, 0x50, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x07, 0x00, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xb0, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x07, 0x00, + 0x01, 0x7f, 0x01, 0xff, 0x01, 0xf0, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, + 0x01, 0x50, 0x07, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xf3, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x07, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xf5, 0x04, 0x00, 0x01, 0x23, 0x01, 0x33, 0x01, 0xcf, 0x01, 0xff, + 0x01, 0x73, 0x02, 0x33, 0x01, 0x30, 0x04, 0x00, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0xf6, 0x04, 0x00, 0x01, 0xcf, 0x06, 0xff, 0x01, 0xf2, 0x04, 0x00, + 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf7, 0x04, 0x00, 0x01, 0xcf, 0x06, 0xff, + 0x01, 0xf2, 0x04, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf9, 0x04, 0x00, + 0x01, 0x9b, 0x01, 0xbb, 0x01, 0xef, 0x01, 0xff, 0x01, 0xdb, 0x02, 0xbb, + 0x01, 0xb1, 0x04, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x07, 0x00, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0xf7, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x07, 0x00, + 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf6, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, + 0x01, 0x50, 0x07, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xf4, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x07, 0x00, 0x01, 0x5f, 0x01, 0xff, + 0x01, 0xf1, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x07, 0x00, + 0x01, 0xaf, 0x01, 0xff, 0x01, 0xd0, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, + 0x01, 0x50, 0x06, 0x00, 0x01, 0x01, 0x02, 0xff, 0x01, 0x80, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x06, 0x00, 0x01, 0x0b, 0x02, 0xff, + 0x01, 0x20, 0x06, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x06, 0x00, + 0x01, 0x8f, 0x01, 0xff, 0x01, 0xf9, 0x07, 0x00, 0x01, 0xbf, 0x01, 0xff, + 0x01, 0x50, 0x05, 0x00, 0x01, 0x0a, 0x02, 0xff, 0x01, 0xe1, 0x07, 0x00, + 0x01, 0xbf, 0x01, 0xff, 0x01, 0x50, 0x04, 0x00, 0x01, 0x29, 0x03, 0xff, + 0x01, 0x30, 0x07, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0xa7, 0x01, 0x77, + 0x01, 0x78, 0x01, 0x9a, 0x01, 0xbf, 0x03, 0xff, 0x01, 0xe3, 0x08, 0x00, + 0x01, 0xbf, 0x08, 0xff, 0x01, 0xf9, 0x01, 0x10, 0x08, 0x00, 0x01, 0xbf, + 0x07, 0xff, 0x01, 0xd8, 0x01, 0x10, 0x09, 0x00, 0x01, 0xad, 0x03, 0xdd, + 0x01, 0xdc, 0x01, 0xcb, 0x01, 0xa7, 0x01, 0x41, 0xc7, 0x00, + + /* 14 SML_ETH */ + 0x88, 0x00, 0x01, 0x38, 0x01, 0x88, 0x01, 0x81, 0x10, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xfc, 0x03, 0x00, 0x01, 0x5a, 0x01, 0x40, 0x0c, 0x00, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0xb0, 0x01, 0x04, 0x01, 0xaf, 0x01, 0xff, + 0x01, 0xa0, 0x0c, 0x00, 0x01, 0x1e, 0x01, 0xff, 0x01, 0xfc, 0x02, 0xff, + 0x01, 0xd8, 0x01, 0x20, 0x0c, 0x00, 0x01, 0x07, 0x02, 0xff, 0x01, 0xfd, + 0x01, 0x82, 0x0d, 0x00, 0x01, 0x5a, 0x03, 0xff, 0x01, 0xf4, 0x0d, 0x00, + 0x01, 0x7f, 0x01, 0xff, 0x01, 0xfd, 0x01, 0x87, 0x02, 0xff, 0x01, 0x30, + 0x0c, 0x00, 0x01, 0x6f, 0x01, 0xe9, 0x01, 0x30, 0x01, 0x00, 0x01, 0x8f, + 0x01, 0xff, 0x01, 0xe2, 0x0c, 0x00, 0x01, 0x03, 0x03, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xfd, 0x01, 0x10, 0x0e, 0x00, 0x01, 0x23, 0x01, 0x44, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0xb0, 0x0c, 0x00, 0x01, 0x02, 0x01, 0x9e, + 0x04, 0xff, 0x01, 0xf7, 0x0c, 0x00, 0x01, 0x7f, 0x06, 0xff, 0x01, 0x30, + 0x0a, 0x00, 0x01, 0x09, 0x02, 0xff, 0x01, 0xfe, 0x01, 0xcb, 0x01, 0xdf, + 0x02, 0xff, 0x01, 0xd0, 0x0a, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xfb, + 0x01, 0x30, 0x02, 0x00, 0x01, 0x4e, 0x01, 0xff, 0x01, 0xf5, 0x09, 0x00, + 0x01, 0x02, 0x02, 0xff, 0x01, 0x70, 0x03, 0x00, 0x01, 0x05, 0x01, 0xff, + 0x01, 0xfd, 0x09, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xfa, 0x05, 0x00, + 0x01, 0xef, 0x01, 0xff, 0x01, 0x20, 0x08, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xf1, 0x05, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0xa0, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, + 0x01, 0xb0, 0x08, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x70, 0x05, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xd0, 0x08, 0x00, 0x01, 0x9f, 0x01, 0xff, + 0x01, 0x40, 0x05, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, + 0x01, 0xaf, 0x01, 0xff, 0x01, 0x30, 0x05, 0x00, 0x01, 0x0e, 0x01, 0xff, + 0x01, 0xf0, 0x08, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x30, 0x05, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x01, 0x9f, 0x01, 0xff, + 0x01, 0x40, 0x05, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xe0, 0x08, 0x00, + 0x01, 0x8f, 0x01, 0xff, 0x01, 0x70, 0x05, 0x00, 0x01, 0x2f, 0x01, 0xff, + 0x01, 0xd0, 0x08, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xa0, 0x05, 0x00, + 0x01, 0x6f, 0x01, 0xff, 0x01, 0x90, 0x08, 0x00, 0x01, 0x0f, 0x01, 0xff, + 0x01, 0xf1, 0x05, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x08, 0x00, + 0x01, 0x09, 0x01, 0xff, 0x01, 0xf9, 0x04, 0x00, 0x01, 0x05, 0x01, 0xff, + 0x01, 0xfe, 0x09, 0x00, 0x01, 0x02, 0x02, 0xff, 0x01, 0x60, 0x03, 0x00, + 0x01, 0x3e, 0x01, 0xff, 0x01, 0xf6, 0x0a, 0x00, 0x01, 0x7f, 0x01, 0xff, + 0x01, 0xf9, 0x01, 0x20, 0x01, 0x00, 0x01, 0x07, 0x02, 0xff, 0x01, 0xb0, + 0x0a, 0x00, 0x01, 0x09, 0x02, 0xff, 0x01, 0xfd, 0x01, 0xbd, 0x02, 0xff, + 0x01, 0xfd, 0x01, 0x10, 0x0b, 0x00, 0x01, 0x7f, 0x05, 0xff, 0x01, 0xb0, + 0x0c, 0x00, 0x01, 0x02, 0x01, 0xae, 0x03, 0xff, 0x01, 0xb4, 0x0f, 0x00, + 0x01, 0x35, 0x01, 0x65, 0x01, 0x40, 0xb6, 0x00, + + /* 15 LRG_THORN */ + 0x9a, 0x00, 0x02, 0x55, 0x11, 0x00, 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, + 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, + 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, + 0x05, 0xff, 0x01, 0xed, 0x01, 0xa7, 0x01, 0x10, 0x0b, 0x00, 0x07, 0xff, + 0x01, 0xfa, 0x01, 0x10, 0x0a, 0x00, 0x08, 0xff, 0x01, 0xe2, 0x0a, 0x00, + 0x02, 0xff, 0x01, 0x65, 0x01, 0x55, 0x01, 0x56, 0x01, 0x7a, 0x02, 0xff, + 0x01, 0xfe, 0x01, 0x10, 0x09, 0x00, 0x02, 0xff, 0x01, 0x20, 0x03, 0x00, + 0x01, 0x1b, 0x02, 0xff, 0x01, 0x80, 0x09, 0x00, 0x02, 0xff, 0x01, 0x20, + 0x04, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xf0, 0x09, 0x00, 0x02, 0xff, + 0x01, 0x20, 0x04, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xf3, 0x09, 0x00, + 0x02, 0xff, 0x01, 0x20, 0x04, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf6, + 0x09, 0x00, 0x02, 0xff, 0x01, 0x20, 0x04, 0x00, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0xf7, 0x09, 0x00, 0x02, 0xff, 0x01, 0x20, 0x04, 0x00, 0x01, 0x0d, + 0x01, 0xff, 0x01, 0xf7, 0x09, 0x00, 0x02, 0xff, 0x01, 0x20, 0x04, 0x00, + 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf6, 0x09, 0x00, 0x02, 0xff, 0x01, 0x20, + 0x04, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xf3, 0x09, 0x00, 0x02, 0xff, + 0x01, 0x20, 0x04, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0xf0, 0x09, 0x00, + 0x02, 0xff, 0x01, 0x20, 0x03, 0x00, 0x01, 0x1b, 0x02, 0xff, 0x01, 0x80, + 0x09, 0x00, 0x02, 0xff, 0x01, 0x65, 0x02, 0x55, 0x01, 0x7a, 0x02, 0xff, + 0x01, 0xfe, 0x01, 0x10, 0x09, 0x00, 0x08, 0xff, 0x01, 0xe2, 0x0a, 0x00, + 0x07, 0xff, 0x01, 0xfa, 0x01, 0x10, 0x0a, 0x00, 0x05, 0xff, 0x01, 0xed, + 0x01, 0xa7, 0x01, 0x10, 0x0b, 0x00, 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, + 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, + 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, + 0x02, 0xff, 0x01, 0x20, 0x10, 0x00, 0x02, 0xcc, 0x01, 0x10, 0xcc, 0x00, + + /* 16 SML_THORN */ + 0x86, 0x00, 0x01, 0x02, 0x01, 0x99, 0x01, 0x94, 0x10, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, + 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, + 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, + 0x02, 0x00, 0x01, 0x13, 0x01, 0x54, 0x01, 0x20, 0x0b, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf7, 0x01, 0x00, 0x01, 0x5c, 0x02, 0xff, 0x01, 0xfd, + 0x01, 0x70, 0x0a, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, 0x01, 0x0b, + 0x04, 0xff, 0x01, 0xfd, 0x01, 0x20, 0x09, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf7, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xec, 0x01, 0xdf, 0x02, 0xff, + 0x01, 0xe1, 0x09, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfd, 0x01, 0xff, + 0x01, 0xc3, 0x02, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xfc, 0x09, 0x00, + 0x01, 0x03, 0x02, 0xff, 0x01, 0xfa, 0x03, 0x00, 0x01, 0x02, 0x01, 0xef, + 0x01, 0xff, 0x01, 0x60, 0x08, 0x00, 0x01, 0x03, 0x02, 0xff, 0x01, 0xe0, + 0x04, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xd0, 0x08, 0x00, 0x01, 0x03, + 0x02, 0xff, 0x01, 0x60, 0x04, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf3, + 0x08, 0x00, 0x01, 0x03, 0x02, 0xff, 0x05, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xf7, 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfc, 0x05, 0x00, + 0x01, 0x02, 0x01, 0xff, 0x01, 0xfb, 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf9, 0x06, 0x00, 0x01, 0xff, 0x01, 0xfd, 0x08, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xef, 0x01, 0xfe, 0x08, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xef, 0x01, 0xff, + 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xef, + 0x01, 0xfe, 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf9, 0x06, 0x00, + 0x01, 0xff, 0x01, 0xfd, 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfc, + 0x05, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xfb, 0x08, 0x00, 0x01, 0x03, + 0x02, 0xff, 0x05, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf8, 0x08, 0x00, + 0x01, 0x03, 0x02, 0xff, 0x01, 0x60, 0x04, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xf3, 0x08, 0x00, 0x01, 0x03, 0x02, 0xff, 0x01, 0xd0, 0x04, 0x00, + 0x01, 0x5f, 0x01, 0xff, 0x01, 0xd0, 0x08, 0x00, 0x01, 0x03, 0x02, 0xff, + 0x01, 0xfa, 0x03, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, 0x01, 0x60, + 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfd, 0x01, 0xff, 0x01, 0xb3, + 0x02, 0x00, 0x01, 0x6e, 0x01, 0xff, 0x01, 0xfc, 0x09, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf7, 0x01, 0xbf, 0x01, 0xff, 0x01, 0xec, 0x01, 0xcf, + 0x02, 0xff, 0x01, 0xe2, 0x09, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, + 0x01, 0x0b, 0x04, 0xff, 0x01, 0xfd, 0x01, 0x20, 0x09, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf7, 0x01, 0x00, 0x01, 0x6c, 0x02, 0xff, 0x01, 0xfe, + 0x01, 0x70, 0x0a, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, 0x02, 0x00, + 0x01, 0x23, 0x01, 0x54, 0x01, 0x20, 0x0b, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, 0x01, 0x03, 0x01, 0xff, + 0x01, 0xf7, 0x10, 0x00, 0x01, 0x01, 0x01, 0x66, 0x01, 0x63, 0x22, 0x00, +#endif // TOUCH_UI_UTF8_SCANDINAVIAN + +#if ENABLED(TOUCH_UI_UTF8_PUNCTUATION) + /* 17 LEFT_DBL_QUOTE */ + 0xff, 0x00, 0x4a, 0x00, 0x01, 0x30, 0x03, 0x00, 0x01, 0x02, 0x0d, 0x00, + 0x01, 0x08, 0x01, 0xa0, 0x02, 0x00, 0x01, 0x01, 0x01, 0xc6, 0x0d, 0x00, + 0x01, 0xaf, 0x01, 0xa0, 0x02, 0x00, 0x01, 0x1d, 0x01, 0xf6, 0x0c, 0x00, + 0x01, 0x1c, 0x01, 0xff, 0x01, 0xa0, 0x01, 0x00, 0x01, 0x02, 0x01, 0xef, + 0x01, 0xf6, 0x0b, 0x00, 0x01, 0x01, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x50, + 0x01, 0x00, 0x01, 0x3e, 0x01, 0xff, 0x01, 0xe2, 0x0b, 0x00, 0x01, 0x2e, + 0x01, 0xff, 0x01, 0xf4, 0x01, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xfd, + 0x01, 0x20, 0x0a, 0x00, 0x01, 0x04, 0x01, 0xef, 0x01, 0xfe, 0x01, 0x30, + 0x01, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0xd1, 0x0b, 0x00, 0x01, 0x5f, + 0x01, 0xff, 0x01, 0xd2, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xfb, + 0x0b, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xfc, 0x01, 0x10, 0x01, 0x00, + 0x01, 0xaf, 0x01, 0xff, 0x01, 0xa0, 0x0b, 0x00, 0x01, 0x0c, 0x01, 0xff, + 0x01, 0xd0, 0x02, 0x00, 0x01, 0xff, 0x01, 0xfa, 0x0c, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf8, 0x02, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0x50, + 0x0c, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xa0, 0x01, 0x00, 0x01, 0x1c, + 0x01, 0xff, 0x01, 0xf6, 0x0c, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xfb, + 0x02, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x90, 0x0c, 0x00, 0x01, 0x6f, + 0x01, 0xff, 0x01, 0xd1, 0x01, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xfa, + 0x0c, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xfd, 0x01, 0x20, 0x01, 0x00, + 0x01, 0x8f, 0x01, 0xff, 0x01, 0xb0, 0x0c, 0x00, 0x01, 0x4f, 0x01, 0xff, + 0x01, 0xa0, 0x01, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf6, 0x0c, 0x00, + 0x01, 0x02, 0x01, 0xef, 0x01, 0xa0, 0x02, 0x00, 0x01, 0x5f, 0x01, 0xf6, + 0x0d, 0x00, 0x01, 0x1d, 0x01, 0xa0, 0x02, 0x00, 0x01, 0x04, 0x01, 0xe6, + 0x0d, 0x00, 0x01, 0x01, 0x01, 0x60, 0x03, 0x00, 0x01, 0x24, 0xff, 0x00, + + /* 18 RIGHT_DBL_QUOTE */ + 0xff, 0x00, 0x46, 0x00, 0x01, 0x20, 0x03, 0x00, 0x01, 0x20, 0x0d, 0x00, + 0x01, 0x01, 0x01, 0xe3, 0x03, 0x00, 0x01, 0x5d, 0x01, 0x10, 0x0c, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0x50, 0x02, 0x00, 0x01, 0x5f, 0x01, 0xe2, + 0x0c, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf6, 0x02, 0x00, 0x01, 0x5f, + 0x01, 0xfe, 0x01, 0x30, 0x0c, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x80, + 0x01, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xf5, 0x0c, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xfa, 0x01, 0x00, 0x01, 0x01, 0x01, 0xcf, 0x01, 0xff, + 0x01, 0x60, 0x0c, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xb0, 0x01, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf9, 0x0c, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xfc, 0x01, 0x10, 0x01, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xa0, + 0x0c, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xd1, 0x01, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xfb, 0x0c, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf5, + 0x02, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x10, 0x0b, 0x00, 0x01, 0x2d, + 0x01, 0xff, 0x01, 0xf3, 0x01, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0x10, 0x0a, 0x00, 0x01, 0x03, 0x01, 0xef, 0x01, 0xff, 0x01, 0x40, + 0x01, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0xd2, 0x0b, 0x00, 0x01, 0x4f, + 0x01, 0xff, 0x01, 0xe3, 0x01, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xfc, + 0x01, 0x10, 0x0a, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xfd, 0x01, 0x10, + 0x01, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0xb0, 0x0b, 0x00, 0x01, 0x6f, + 0x01, 0xff, 0x01, 0xc1, 0x01, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf9, + 0x0b, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xfa, 0x02, 0x00, 0x01, 0x5f, + 0x01, 0xff, 0x01, 0x70, 0x0b, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0x90, + 0x02, 0x00, 0x01, 0x5f, 0x01, 0xf6, 0x0c, 0x00, 0x01, 0x01, 0x01, 0xf8, + 0x03, 0x00, 0x01, 0x5f, 0x01, 0x40, 0x0c, 0x00, 0x01, 0x01, 0x01, 0x50, + 0x03, 0x00, 0x01, 0x43, 0xff, 0x00, 0x04, 0x00, + + /* 19 INV_EXCLAMATION */ + 0xff, 0x00, 0x34, 0x00, 0x01, 0xad, 0x01, 0xdd, 0x01, 0x40, 0x10, 0x00, + 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, + 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, + 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0x34, 0x01, 0x44, + 0x01, 0x10, 0x49, 0x00, 0x01, 0x02, 0x01, 0x22, 0x11, 0x00, 0x01, 0x6f, + 0x01, 0xff, 0x11, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x11, 0x00, 0x01, 0x7f, + 0x01, 0xff, 0x01, 0x10, 0x10, 0x00, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x20, + 0x10, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x30, 0x10, 0x00, 0x01, 0xaf, + 0x01, 0xff, 0x01, 0x30, 0x10, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x40, + 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, + 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, + 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, + 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, + 0x10, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0x34, + 0x01, 0x44, 0x01, 0x10, 0x33, 0x00, + + /* 20 INV_QUESTION */ + 0xff, 0x00, 0x36, 0x00, 0x02, 0xdd, 0x11, 0x00, 0x02, 0xff, 0x11, 0x00, + 0x02, 0xff, 0x11, 0x00, 0x02, 0xff, 0x11, 0x00, 0x02, 0xff, 0x11, 0x00, + 0x02, 0x44, 0x37, 0x00, 0x01, 0xbc, 0x01, 0xcb, 0x11, 0x00, 0x01, 0xef, + 0x01, 0xfe, 0x11, 0x00, 0x01, 0xef, 0x01, 0xfe, 0x11, 0x00, 0x01, 0xef, + 0x01, 0xfe, 0x11, 0x00, 0x01, 0xff, 0x01, 0xfd, 0x10, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xfb, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xf6, + 0x10, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xd0, 0x0f, 0x00, 0x01, 0x0a, + 0x02, 0xff, 0x01, 0x30, 0x0f, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xf4, + 0x0f, 0x00, 0x01, 0x09, 0x02, 0xff, 0x01, 0x40, 0x0f, 0x00, 0x01, 0x7f, + 0x01, 0xff, 0x01, 0xf4, 0x0f, 0x00, 0x01, 0x03, 0x02, 0xff, 0x01, 0x40, + 0x0f, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf8, 0x10, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x01, 0xf2, 0x10, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0xf0, + 0x10, 0x00, 0x01, 0x0f, 0x01, 0xff, 0x01, 0xf2, 0x10, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0xf8, 0x04, 0x00, 0x01, 0x05, 0x01, 0xd0, 0x0a, 0x00, + 0x01, 0x08, 0x02, 0xff, 0x01, 0x70, 0x02, 0x00, 0x01, 0x05, 0x01, 0xcf, + 0x01, 0xf0, 0x0a, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0x98, 0x01, 0x8b, 0x02, 0xff, 0x01, 0xf0, 0x0b, 0x00, 0x01, 0x3f, + 0x06, 0xff, 0x01, 0xc0, 0x0b, 0x00, 0x01, 0x02, 0x01, 0xcf, 0x04, 0xff, + 0x01, 0xc5, 0x0d, 0x00, 0x01, 0x03, 0x01, 0x8b, 0x01, 0xcc, 0x01, 0xb9, + 0x01, 0x62, 0x31, 0x00, +#endif // TOUCH_UI_UTF8_PUNCTUATION + +#if ENABLED(TOUCH_UI_UTF8_CURRENCY) + /* 21 CENT_SIGN */ + 0xb1, 0x00, 0x01, 0x01, 0x01, 0x32, 0x11, 0x00, 0x01, 0x05, 0x01, 0xfb, + 0x11, 0x00, 0x01, 0x05, 0x01, 0xfb, 0x11, 0x00, 0x01, 0x05, 0x01, 0xfb, + 0x11, 0x00, 0x01, 0x05, 0x01, 0xfc, 0x11, 0x00, 0x01, 0x05, 0x01, 0xfc, + 0x11, 0x00, 0x01, 0x39, 0x01, 0xfd, 0x01, 0x42, 0x0e, 0x00, 0x01, 0x05, + 0x01, 0xbf, 0x03, 0xff, 0x01, 0xfb, 0x01, 0x50, 0x0b, 0x00, 0x01, 0x03, + 0x01, 0xcf, 0x05, 0xff, 0x01, 0xf6, 0x0b, 0x00, 0x01, 0x4f, 0x02, 0xff, + 0x02, 0xfe, 0x01, 0xce, 0x01, 0xff, 0x01, 0xf6, 0x0a, 0x00, 0x01, 0x02, + 0x02, 0xff, 0x01, 0xe6, 0x01, 0x05, 0x01, 0xfc, 0x01, 0x00, 0x01, 0x38, + 0x01, 0xe6, 0x0a, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xfd, 0x01, 0x10, + 0x01, 0x05, 0x01, 0xfc, 0x02, 0x00, 0x01, 0x02, 0x0a, 0x00, 0x01, 0x5f, + 0x01, 0xff, 0x01, 0xe1, 0x01, 0x00, 0x01, 0x05, 0x01, 0xfc, 0x0d, 0x00, + 0x01, 0xcf, 0x01, 0xff, 0x01, 0x60, 0x01, 0x00, 0x01, 0x05, 0x01, 0xfc, + 0x0d, 0x00, 0x02, 0xff, 0x02, 0x00, 0x01, 0x05, 0x01, 0xfc, 0x0c, 0x00, + 0x01, 0x04, 0x01, 0xff, 0x01, 0xfb, 0x02, 0x00, 0x01, 0x05, 0x01, 0xfc, + 0x0c, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf8, 0x02, 0x00, 0x01, 0x05, + 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf7, 0x02, 0x00, + 0x01, 0x05, 0x01, 0xfb, 0x0c, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf6, + 0x02, 0x00, 0x01, 0x05, 0x01, 0xfc, 0x0c, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf7, 0x02, 0x00, 0x01, 0x05, 0x01, 0xfb, 0x0c, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf9, 0x02, 0x00, 0x01, 0x05, 0x01, 0xfb, 0x0c, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xfc, 0x02, 0x00, 0x01, 0x05, 0x01, 0xfb, + 0x0d, 0x00, 0x02, 0xff, 0x01, 0x10, 0x01, 0x00, 0x01, 0x05, 0x01, 0xfb, + 0x0d, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0x80, 0x01, 0x00, 0x01, 0x05, + 0x01, 0xfb, 0x0d, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xf3, 0x01, 0x00, + 0x01, 0x05, 0x01, 0xfb, 0x0d, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0x30, 0x01, 0x05, 0x01, 0xfb, 0x02, 0x00, 0x01, 0x33, 0x0a, 0x00, + 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, 0x01, 0xf9, 0x01, 0x35, 0x01, 0xfb, + 0x01, 0x02, 0x01, 0x6c, 0x01, 0xf6, 0x0b, 0x00, 0x01, 0x2d, 0x06, 0xff, + 0x01, 0xf6, 0x0b, 0x00, 0x01, 0x01, 0x01, 0x9f, 0x05, 0xff, 0x01, 0xf5, + 0x0c, 0x00, 0x01, 0x02, 0x01, 0x8d, 0x03, 0xff, 0x01, 0xc7, 0x01, 0x20, + 0x0e, 0x00, 0x01, 0x06, 0x01, 0xfc, 0x01, 0x20, 0x10, 0x00, 0x01, 0x05, + 0x01, 0xfb, 0x11, 0x00, 0x01, 0x05, 0x01, 0xfb, 0x11, 0x00, 0x01, 0x05, + 0x01, 0xfb, 0x11, 0x00, 0x01, 0x05, 0x01, 0xfb, 0x11, 0x00, 0x01, 0x05, + 0x01, 0xfb, 0x57, 0x00, + + /* 22 POUND_SIGN */ + 0x9e, 0x00, 0x01, 0x6b, 0x01, 0xdf, 0x01, 0xfd, 0x01, 0xc9, 0x01, 0x40, + 0x0d, 0x00, 0x01, 0x6e, 0x05, 0xff, 0x01, 0x30, 0x0b, 0x00, 0x01, 0x07, + 0x06, 0xff, 0x01, 0x30, 0x0b, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0xfe, + 0x01, 0x85, 0x01, 0x34, 0x01, 0x7b, 0x01, 0xff, 0x01, 0x30, 0x0b, 0x00, + 0x01, 0xaf, 0x01, 0xff, 0x01, 0xc1, 0x03, 0x00, 0x01, 0x18, 0x01, 0x30, + 0x0a, 0x00, 0x01, 0x01, 0x02, 0xff, 0x01, 0x30, 0x0f, 0x00, 0x01, 0x04, + 0x01, 0xff, 0x01, 0xfd, 0x10, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xfa, + 0x10, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf8, 0x10, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xf7, 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, + 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, 0x10, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf6, 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, + 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, 0x0e, 0x00, 0x01, 0x0a, + 0x07, 0xff, 0x01, 0xf4, 0x0a, 0x00, 0x01, 0x0a, 0x07, 0xff, 0x01, 0xf4, + 0x0a, 0x00, 0x01, 0x08, 0x01, 0xdd, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xfe, + 0x03, 0xdd, 0x01, 0xd4, 0x0c, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, + 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, 0x10, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf6, 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, + 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, 0x10, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf6, 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, + 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf6, 0x10, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf6, 0x0e, 0x00, 0x01, 0x4b, 0x01, 0xbb, 0x01, 0xbe, + 0x01, 0xff, 0x01, 0xfd, 0x05, 0xbb, 0x01, 0x70, 0x08, 0x00, 0x01, 0x6f, + 0x09, 0xff, 0x01, 0xa0, 0x08, 0x00, 0x01, 0x6f, 0x09, 0xff, 0x01, 0xa0, + 0x08, 0x00, 0x01, 0x4a, 0x09, 0xaa, 0x01, 0x60, 0xc5, 0x00, + + /* 23 CURRENCY_SIGN */ + 0xff, 0x00, 0x0d, 0x00, 0x01, 0x30, 0x07, 0x00, 0x01, 0x01, 0x01, 0x40, + 0x08, 0x00, 0x01, 0x0b, 0x01, 0xf5, 0x07, 0x00, 0x01, 0x1d, 0x01, 0xf4, + 0x08, 0x00, 0x01, 0xbf, 0x01, 0xff, 0x01, 0x40, 0x05, 0x00, 0x01, 0x01, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0x30, 0x07, 0x00, 0x01, 0x5f, 0x01, 0xff, + 0x01, 0xf4, 0x01, 0x00, 0x01, 0x6b, 0x01, 0xdd, 0x01, 0xc8, 0x01, 0x20, + 0x01, 0x1d, 0x01, 0xff, 0x01, 0xfa, 0x08, 0x00, 0x01, 0x05, 0x02, 0xff, + 0x01, 0x8e, 0x03, 0xff, 0x01, 0xfa, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xa0, + 0x09, 0x00, 0x01, 0x5f, 0x07, 0xff, 0x01, 0xfa, 0x0a, 0x00, 0x01, 0x05, + 0x02, 0xff, 0x01, 0xe9, 0x01, 0x55, 0x01, 0x7c, 0x02, 0xff, 0x01, 0xa0, + 0x0a, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0xfb, 0x01, 0x10, 0x02, 0x00, + 0x01, 0x6f, 0x01, 0xff, 0x01, 0xa0, 0x0a, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0xc0, 0x03, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf2, 0x0a, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0x30, 0x04, 0x00, 0x01, 0xdf, 0x01, 0xf7, + 0x0a, 0x00, 0x01, 0x4f, 0x01, 0xfd, 0x05, 0x00, 0x01, 0x8f, 0x01, 0xfa, + 0x0a, 0x00, 0x01, 0x6f, 0x01, 0xfc, 0x05, 0x00, 0x01, 0x6f, 0x01, 0xfc, + 0x0a, 0x00, 0x01, 0x5f, 0x01, 0xfc, 0x05, 0x00, 0x01, 0x7f, 0x01, 0xfb, + 0x0a, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0x10, 0x04, 0x00, 0x01, 0xbf, + 0x01, 0xf8, 0x0a, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0x80, 0x03, 0x00, + 0x01, 0x03, 0x01, 0xff, 0x01, 0xf3, 0x0a, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf5, 0x03, 0x00, 0x01, 0x1d, 0x01, 0xff, 0x01, 0xc0, 0x0a, 0x00, + 0x01, 0x01, 0x02, 0xff, 0x01, 0x92, 0x01, 0x00, 0x01, 0x16, 0x01, 0xef, + 0x01, 0xff, 0x01, 0x60, 0x0a, 0x00, 0x01, 0x1d, 0x03, 0xff, 0x01, 0xfe, + 0x03, 0xff, 0x01, 0xf4, 0x09, 0x00, 0x01, 0x01, 0x01, 0xdf, 0x05, 0xff, + 0x01, 0xfe, 0x02, 0xff, 0x01, 0x40, 0x08, 0x00, 0x01, 0x1d, 0x01, 0xff, + 0x01, 0xfa, 0x01, 0x06, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x81, + 0x01, 0x5f, 0x01, 0xff, 0x01, 0xf4, 0x08, 0x00, 0x01, 0xcf, 0x01, 0xff, + 0x01, 0xa0, 0x01, 0x00, 0x01, 0x01, 0x01, 0x44, 0x01, 0x20, 0x01, 0x00, + 0x01, 0x05, 0x02, 0xff, 0x01, 0x20, 0x07, 0x00, 0x01, 0x4f, 0x01, 0xfa, + 0x07, 0x00, 0x01, 0x4f, 0x01, 0xf8, 0x08, 0x00, 0x01, 0x05, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x05, 0x01, 0x80, 0xeb, 0x00, + + /* 24 YEN_SIGN */ + 0x98, 0x00, 0x01, 0x01, 0x01, 0x88, 0x01, 0x85, 0x07, 0x00, 0x01, 0x38, + 0x01, 0x88, 0x01, 0x40, 0x07, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, + 0x06, 0x00, 0x01, 0xcf, 0x01, 0xff, 0x01, 0x10, 0x07, 0x00, 0x01, 0x3f, + 0x01, 0xff, 0x01, 0x90, 0x05, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xf8, + 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf2, 0x05, 0x00, 0x01, 0x0d, + 0x01, 0xff, 0x01, 0xe0, 0x08, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xfa, + 0x05, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0x60, 0x09, 0x00, 0x01, 0xaf, + 0x01, 0xff, 0x01, 0x30, 0x04, 0x00, 0x01, 0xef, 0x01, 0xfd, 0x0a, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x03, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf5, 0x0a, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf4, 0x03, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xc0, 0x0a, 0x00, 0x01, 0x01, 0x01, 0xef, + 0x01, 0xfd, 0x03, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x40, 0x0b, 0x00, + 0x01, 0x7f, 0x01, 0xff, 0x01, 0x50, 0x01, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0xfb, 0x0c, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xe0, 0x01, 0x00, + 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf3, 0x0c, 0x00, 0x01, 0x06, 0x01, 0xff, + 0x01, 0xf7, 0x01, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xa0, 0x0a, 0x00, + 0x01, 0x2a, 0x02, 0xaa, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x10, 0x01, 0xbf, + 0x01, 0xff, 0x01, 0xca, 0x01, 0xaa, 0x01, 0xa5, 0x08, 0x00, 0x01, 0x4f, + 0x04, 0xff, 0x01, 0x83, 0x04, 0xff, 0x01, 0xf8, 0x08, 0x00, 0x01, 0x3c, + 0x02, 0xcc, 0x01, 0xce, 0x01, 0xff, 0x01, 0xfd, 0x01, 0xff, 0x01, 0xfc, + 0x02, 0xcc, 0x01, 0xc6, 0x0b, 0x00, 0x01, 0x03, 0x03, 0xff, 0x01, 0x70, + 0x0f, 0x00, 0x01, 0xaf, 0x01, 0xff, 0x01, 0xfe, 0x10, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xf5, 0x0c, 0x00, 0x01, 0x01, 0x03, 0x11, 0x01, 0x1e, + 0x01, 0xff, 0x01, 0xf3, 0x03, 0x11, 0x01, 0x10, 0x08, 0x00, 0x01, 0x4f, + 0x09, 0xff, 0x01, 0xf8, 0x08, 0x00, 0x01, 0x4f, 0x09, 0xff, 0x01, 0xf8, + 0x08, 0x00, 0x01, 0x27, 0x03, 0x77, 0x01, 0x7e, 0x01, 0xff, 0x01, 0xf8, + 0x03, 0x77, 0x01, 0x73, 0x0c, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, + 0x10, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, 0x10, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0xf2, 0x10, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, + 0x10, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, 0x10, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x01, 0xf2, 0x10, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, + 0x10, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xf2, 0x10, 0x00, 0x01, 0x08, + 0x01, 0x99, 0x01, 0x91, 0xc9, 0x00, +#endif // TOUCH_UI_UTF8_CURRENCY + +#if ENABLED(TOUCH_UI_UTF8_SUPERSCRIPTS) + /* 25 SUPERSCRIPT_ONE */ + 0x99, 0x00, 0x01, 0x01, 0x01, 0x36, 0x01, 0x9b, 0x01, 0xbb, 0x01, 0x20, + 0x0e, 0x00, 0x01, 0x3f, 0x03, 0xff, 0x01, 0x20, 0x0e, 0x00, 0x01, 0x3f, + 0x01, 0xfe, 0x01, 0xbe, 0x01, 0xff, 0x01, 0x20, 0x0e, 0x00, 0x01, 0x14, + 0x01, 0x10, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x10, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x20, 0x10, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, + 0x10, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x10, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x20, 0x10, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, + 0x10, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x10, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x20, 0x10, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, + 0x10, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x10, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x20, 0x0f, 0x00, 0x01, 0x11, 0x01, 0x1c, 0x01, 0xff, + 0x01, 0x31, 0x01, 0x11, 0x0d, 0x00, 0x01, 0x0d, 0x05, 0xff, 0x01, 0x40, + 0x0c, 0x00, 0x01, 0x0d, 0x05, 0xff, 0x01, 0x40, 0x0c, 0x00, 0x01, 0x01, + 0x05, 0x22, 0xff, 0x00, 0xc2, 0x00, + + /* 26 SUPERSCRIPT_TWO */ + 0x88, 0x00, 0x01, 0x01, 0x10, 0x00, 0x01, 0x16, 0x01, 0xae, 0x01, 0xff, + 0x01, 0xfd, 0x01, 0x92, 0x0e, 0x00, 0x05, 0xff, 0x01, 0x60, 0x0d, 0x00, + 0x01, 0xfe, 0x01, 0x84, 0x01, 0x22, 0x01, 0x5c, 0x01, 0xff, 0x01, 0xf3, + 0x0d, 0x00, 0x01, 0x50, 0x03, 0x00, 0x01, 0xcf, 0x01, 0xfa, 0x11, 0x00, + 0x01, 0x5f, 0x01, 0xfc, 0x11, 0x00, 0x01, 0x5f, 0x01, 0xfb, 0x11, 0x00, + 0x01, 0xcf, 0x01, 0xf4, 0x10, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x6f, 0x01, 0xfe, 0x01, 0x10, 0x0f, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xe2, 0x10, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x01, 0x30, + 0x0f, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xe3, 0x10, 0x00, 0x01, 0x6f, + 0x01, 0xfe, 0x01, 0x20, 0x0f, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xd1, + 0x10, 0x00, 0x01, 0xaf, 0x01, 0xfd, 0x01, 0x43, 0x03, 0x33, 0x0c, 0x00, + 0x01, 0x01, 0x06, 0xff, 0x0c, 0x00, 0x01, 0x01, 0x06, 0xff, 0x0d, 0x00, + 0x06, 0x22, 0xff, 0x00, 0xc2, 0x00, + + /* 27 SUPERSCRIPT_THREE */ + 0x88, 0x00, 0x01, 0x01, 0x01, 0x10, 0x0f, 0x00, 0x01, 0x39, 0x01, 0xce, + 0x02, 0xff, 0x01, 0xb5, 0x0e, 0x00, 0x01, 0x7f, 0x04, 0xff, 0x01, 0xb0, + 0x0d, 0x00, 0x01, 0x6b, 0x01, 0x73, 0x01, 0x22, 0x01, 0x38, 0x01, 0xff, + 0x01, 0xf9, 0x11, 0x00, 0x01, 0x5f, 0x01, 0xff, 0x11, 0x00, 0x01, 0x0f, + 0x01, 0xff, 0x11, 0x00, 0x01, 0x4f, 0x01, 0xfc, 0x10, 0x00, 0x01, 0x27, + 0x01, 0xff, 0x01, 0xf3, 0x0e, 0x00, 0x01, 0x0c, 0x02, 0xff, 0x01, 0xfa, + 0x01, 0x20, 0x0e, 0x00, 0x01, 0x0c, 0x02, 0xff, 0x01, 0xfb, 0x01, 0x40, + 0x0e, 0x00, 0x01, 0x01, 0x01, 0x23, 0x01, 0x49, 0x01, 0xff, 0x01, 0xf6, + 0x11, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0x10, 0x10, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x50, 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0x60, + 0x10, 0x00, 0x01, 0x1e, 0x01, 0xff, 0x01, 0x40, 0x0c, 0x00, 0x01, 0xa4, + 0x02, 0x00, 0x01, 0x05, 0x01, 0xdf, 0x01, 0xfd, 0x0d, 0x00, 0x02, 0xff, + 0x01, 0xde, 0x02, 0xff, 0x01, 0xe3, 0x0d, 0x00, 0x01, 0xae, 0x03, 0xff, + 0x01, 0xe9, 0x01, 0x10, 0x0e, 0x00, 0x01, 0x24, 0x01, 0x55, 0x01, 0x52, + 0xff, 0x00, 0xc4, 0x00, +#endif // TOUCH_UI_UTF8_SUPERSCRIPTS + +#if ENABLED(TOUCH_UI_UTF8_ORDINALS) + /* 28 MASCULINE_ORDINAL */ + 0x89, 0x00, 0x01, 0x01, 0x01, 0x10, 0x0f, 0x00, 0x01, 0x01, 0x01, 0x8d, + 0x02, 0xff, 0x01, 0xb4, 0x0e, 0x00, 0x01, 0x4f, 0x04, 0xff, 0x01, 0xa0, + 0x0c, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xfc, 0x01, 0x63, 0x01, 0x48, + 0x01, 0xff, 0x01, 0xfb, 0x0c, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xa0, + 0x02, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0x60, 0x0b, 0x00, 0x01, 0x6f, + 0x01, 0xfe, 0x03, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xd0, 0x0b, 0x00, + 0x01, 0xbf, 0x01, 0xf7, 0x04, 0x00, 0x01, 0xff, 0x01, 0xf2, 0x0b, 0x00, + 0x01, 0xef, 0x01, 0xf3, 0x04, 0x00, 0x01, 0xcf, 0x01, 0xf6, 0x0b, 0x00, + 0x01, 0xff, 0x01, 0xf1, 0x04, 0x00, 0x01, 0xaf, 0x01, 0xf7, 0x0b, 0x00, + 0x01, 0xff, 0x01, 0xf1, 0x04, 0x00, 0x01, 0xaf, 0x01, 0xf7, 0x0b, 0x00, + 0x01, 0xff, 0x01, 0xf2, 0x04, 0x00, 0x01, 0xbf, 0x01, 0xf6, 0x0b, 0x00, + 0x01, 0xcf, 0x01, 0xf6, 0x04, 0x00, 0x01, 0xef, 0x01, 0xf4, 0x0b, 0x00, + 0x01, 0x8f, 0x01, 0xfc, 0x03, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xf0, + 0x0b, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x60, 0x02, 0x00, 0x01, 0x1d, + 0x01, 0xff, 0x01, 0x90, 0x0b, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xf8, + 0x01, 0x10, 0x01, 0x04, 0x01, 0xdf, 0x01, 0xfe, 0x01, 0x10, 0x0c, 0x00, + 0x01, 0xaf, 0x04, 0xff, 0x01, 0xe3, 0x0d, 0x00, 0x01, 0x05, 0x01, 0xdf, + 0x02, 0xff, 0x01, 0xfa, 0x01, 0x10, 0x0e, 0x00, 0x01, 0x02, 0x01, 0x56, + 0x01, 0x64, 0x21, 0x00, 0x01, 0x16, 0x06, 0x66, 0x01, 0x40, 0x0b, 0x00, + 0x01, 0x3f, 0x06, 0xff, 0x01, 0xb0, 0x0b, 0x00, 0x01, 0x3f, 0x06, 0xff, + 0x01, 0xb0, 0x0b, 0x00, 0x01, 0x01, 0x06, 0x11, 0xff, 0x00, 0x75, 0x00, + + /* 29 FEMININE_ORDINAL */ + 0x89, 0x00, 0x01, 0x12, 0x01, 0x10, 0x0f, 0x00, 0x01, 0x49, 0x01, 0xdf, + 0x02, 0xff, 0x01, 0xb4, 0x0d, 0x00, 0x01, 0x07, 0x05, 0xff, 0x01, 0xa0, + 0x0c, 0x00, 0x01, 0x07, 0x01, 0xfc, 0x01, 0x74, 0x01, 0x33, 0x01, 0x59, + 0x01, 0xff, 0x01, 0xf8, 0x0c, 0x00, 0x01, 0x03, 0x01, 0x20, 0x03, 0x00, + 0x01, 0x3f, 0x01, 0xff, 0x01, 0x10, 0x10, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0x50, 0x0e, 0x00, 0x01, 0x01, 0x01, 0x11, 0x01, 0x16, 0x01, 0xff, + 0x01, 0x80, 0x0c, 0x00, 0x01, 0x05, 0x01, 0xae, 0x04, 0xff, 0x01, 0x90, + 0x0b, 0x00, 0x01, 0x01, 0x01, 0xcf, 0x05, 0xff, 0x01, 0xa0, 0x0b, 0x00, + 0x01, 0x0d, 0x01, 0xff, 0x01, 0xe9, 0x01, 0x65, 0x01, 0x44, 0x01, 0x48, + 0x01, 0xff, 0x01, 0xa0, 0x0b, 0x00, 0x01, 0x5f, 0x01, 0xfd, 0x01, 0x10, + 0x02, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xa0, 0x0b, 0x00, 0x01, 0x9f, + 0x01, 0xf6, 0x03, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xa0, 0x0b, 0x00, + 0x01, 0xaf, 0x01, 0xf5, 0x03, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x01, 0xa0, + 0x0b, 0x00, 0x01, 0x9f, 0x01, 0xfa, 0x03, 0x00, 0x01, 0xaf, 0x01, 0xff, + 0x01, 0xa0, 0x0b, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0xa2, 0x01, 0x00, + 0x01, 0x3b, 0x02, 0xff, 0x01, 0xa0, 0x0b, 0x00, 0x01, 0x0a, 0x04, 0xff, + 0x01, 0xe7, 0x01, 0xff, 0x01, 0xa0, 0x0c, 0x00, 0x01, 0x8f, 0x02, 0xff, + 0x01, 0xf9, 0x01, 0x15, 0x01, 0xff, 0x01, 0xa0, 0x0d, 0x00, 0x01, 0x46, + 0x01, 0x64, 0x02, 0x00, 0x01, 0x11, 0x1f, 0x00, 0x01, 0x16, 0x06, 0x66, + 0x01, 0x40, 0x0b, 0x00, 0x01, 0x3f, 0x06, 0xff, 0x01, 0xb0, 0x0b, 0x00, + 0x01, 0x3f, 0x06, 0xff, 0x01, 0xb0, 0x0b, 0x00, 0x01, 0x01, 0x06, 0x11, + 0xff, 0x00, 0x75, 0x00, +#endif // TOUCH_UI_UTF8_ORDINALS + +#if ENABLED(TOUCH_UI_UTF8_COPYRIGHT) + /* 30 COPYRIGHT_SIGN */ + 0xa0, 0x00, 0x01, 0x01, 0x01, 0x45, 0x01, 0x76, 0x01, 0x43, 0x0e, 0x00, + 0x01, 0x28, 0x01, 0xdf, 0x03, 0xff, 0x01, 0xe9, 0x01, 0x40, 0x0b, 0x00, + 0x01, 0x19, 0x02, 0xff, 0x01, 0xdb, 0x01, 0xab, 0x01, 0xce, 0x01, 0xff, + 0x01, 0xfb, 0x01, 0x30, 0x09, 0x00, 0x01, 0x03, 0x01, 0xef, 0x01, 0xfb, + 0x01, 0x50, 0x03, 0x00, 0x01, 0x38, 0x01, 0xff, 0x01, 0xf7, 0x09, 0x00, + 0x01, 0x6f, 0x01, 0xfc, 0x01, 0x30, 0x05, 0x00, 0x01, 0x19, 0x01, 0xff, + 0x01, 0xa0, 0x07, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, + 0x01, 0x5f, 0x01, 0xfb, 0x07, 0x00, 0x01, 0x3f, 0x01, 0xf8, 0x03, 0x00, + 0x01, 0x46, 0x01, 0x88, 0x01, 0x65, 0x01, 0x10, 0x01, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0x80, 0x06, 0x00, 0x01, 0xef, 0x01, 0xa0, 0x01, 0x00, + 0x01, 0x01, 0x01, 0x9f, 0x03, 0xff, 0x01, 0xfc, 0x01, 0x60, 0x01, 0x00, + 0x01, 0x4f, 0x01, 0xf4, 0x05, 0x00, 0x01, 0x08, 0x01, 0xfd, 0x02, 0x00, + 0x01, 0x4e, 0x02, 0xff, 0x01, 0xed, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, + 0x01, 0x00, 0x01, 0x08, 0x01, 0xfd, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xf4, + 0x01, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x61, 0x01, 0x00, + 0x01, 0x01, 0x01, 0x4a, 0x01, 0xa0, 0x02, 0x00, 0x01, 0xef, 0x01, 0x60, + 0x04, 0x00, 0x01, 0x6f, 0x01, 0xc0, 0x01, 0x00, 0x01, 0x0e, 0x01, 0xff, + 0x01, 0xc1, 0x07, 0x00, 0x01, 0x7f, 0x01, 0xb0, 0x04, 0x00, 0x01, 0xbf, + 0x01, 0x60, 0x01, 0x00, 0x01, 0x7f, 0x01, 0xff, 0x01, 0x10, 0x07, 0x00, + 0x01, 0x1f, 0x01, 0xf0, 0x04, 0x00, 0x01, 0xff, 0x01, 0x20, 0x01, 0x00, + 0x01, 0xdf, 0x01, 0xf9, 0x08, 0x00, 0x01, 0x0d, 0x01, 0xf4, 0x03, 0x00, + 0x01, 0x01, 0x01, 0xfe, 0x01, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf4, + 0x08, 0x00, 0x01, 0x0a, 0x01, 0xf6, 0x03, 0x00, 0x01, 0x03, 0x01, 0xfd, + 0x01, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0x08, + 0x01, 0xf8, 0x03, 0x00, 0x01, 0x04, 0x01, 0xfc, 0x01, 0x00, 0x01, 0x03, + 0x01, 0xff, 0x01, 0xf0, 0x08, 0x00, 0x01, 0x07, 0x01, 0xf9, 0x03, 0x00, + 0x01, 0x03, 0x01, 0xfd, 0x01, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf1, + 0x08, 0x00, 0x01, 0x08, 0x01, 0xf8, 0x03, 0x00, 0x01, 0x01, 0x01, 0xfe, + 0x01, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf3, 0x08, 0x00, 0x01, 0x09, + 0x01, 0xf7, 0x04, 0x00, 0x01, 0xff, 0x01, 0x10, 0x01, 0x00, 0x01, 0xdf, + 0x01, 0xf8, 0x08, 0x00, 0x01, 0x0c, 0x01, 0xf5, 0x04, 0x00, 0x01, 0xbf, + 0x01, 0x60, 0x01, 0x00, 0x01, 0x8f, 0x01, 0xfe, 0x01, 0x10, 0x07, 0x00, + 0x01, 0x1f, 0x01, 0xf1, 0x04, 0x00, 0x01, 0x6f, 0x01, 0xb0, 0x01, 0x00, + 0x01, 0x1f, 0x01, 0xff, 0x01, 0xb0, 0x07, 0x00, 0x01, 0x6f, 0x01, 0xc0, + 0x04, 0x00, 0x01, 0x1f, 0x01, 0xf4, 0x01, 0x00, 0x01, 0x05, 0x01, 0xff, + 0x01, 0xfd, 0x01, 0x50, 0x02, 0x00, 0x01, 0x29, 0x01, 0xa0, 0x02, 0x00, + 0x01, 0xef, 0x01, 0x60, 0x04, 0x00, 0x01, 0x08, 0x01, 0xfd, 0x02, 0x00, + 0x01, 0x6f, 0x02, 0xff, 0x01, 0xdb, 0x01, 0xce, 0x01, 0xff, 0x01, 0xb0, + 0x01, 0x00, 0x01, 0x07, 0x01, 0xfd, 0x05, 0x00, 0x01, 0x01, 0x01, 0xef, + 0x01, 0x90, 0x01, 0x00, 0x01, 0x02, 0x01, 0xbf, 0x03, 0xff, 0x01, 0xfe, + 0x01, 0x70, 0x01, 0x00, 0x01, 0x4f, 0x01, 0xf4, 0x06, 0x00, 0x01, 0x4f, + 0x01, 0xf7, 0x02, 0x00, 0x01, 0x01, 0x01, 0x58, 0x01, 0x9a, 0x01, 0x86, + 0x01, 0x30, 0x01, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0x80, 0x06, 0x00, + 0x01, 0x06, 0x01, 0xff, 0x01, 0x90, 0x07, 0x00, 0x01, 0x4f, 0x01, 0xfb, + 0x08, 0x00, 0x01, 0x6f, 0x01, 0xfc, 0x01, 0x30, 0x05, 0x00, 0x01, 0x18, + 0x01, 0xff, 0x01, 0xb0, 0x08, 0x00, 0x01, 0x04, 0x01, 0xef, 0x01, 0xfa, + 0x01, 0x40, 0x03, 0x00, 0x01, 0x27, 0x01, 0xef, 0x01, 0xf8, 0x0a, 0x00, + 0x01, 0x19, 0x02, 0xff, 0x01, 0xca, 0x01, 0x9a, 0x01, 0xbe, 0x01, 0xff, + 0x01, 0xfc, 0x01, 0x30, 0x0b, 0x00, 0x01, 0x29, 0x01, 0xdf, 0x03, 0xff, + 0x01, 0xfa, 0x01, 0x40, 0x0d, 0x00, 0x01, 0x02, 0x01, 0x46, 0x01, 0x76, + 0x01, 0x53, 0xc5, 0x00, + + /* 31 REGISTERED_SIGN */ + 0xa0, 0x00, 0x01, 0x02, 0x01, 0x46, 0x01, 0x76, 0x01, 0x53, 0x0e, 0x00, + 0x01, 0x28, 0x01, 0xdf, 0x03, 0xff, 0x01, 0xea, 0x01, 0x40, 0x0b, 0x00, + 0x01, 0x19, 0x02, 0xff, 0x01, 0xcb, 0x01, 0x9a, 0x01, 0xce, 0x01, 0xff, + 0x01, 0xfc, 0x01, 0x30, 0x09, 0x00, 0x01, 0x04, 0x01, 0xef, 0x01, 0xfa, + 0x01, 0x40, 0x03, 0x00, 0x01, 0x38, 0x01, 0xff, 0x01, 0xf8, 0x09, 0x00, + 0x01, 0x6f, 0x01, 0xfc, 0x01, 0x30, 0x05, 0x00, 0x01, 0x18, 0x01, 0xff, + 0x01, 0xa0, 0x07, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0x90, 0x07, 0x00, + 0x01, 0x4f, 0x01, 0xfb, 0x07, 0x00, 0x01, 0x3f, 0x01, 0xf7, 0x01, 0x00, + 0x01, 0x13, 0x02, 0x33, 0x01, 0x32, 0x03, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0x80, 0x06, 0x00, 0x01, 0xef, 0x01, 0xa0, 0x01, 0x00, 0x01, 0x7f, + 0x03, 0xff, 0x01, 0xfd, 0x01, 0x81, 0x02, 0x00, 0x01, 0x4f, 0x01, 0xf5, + 0x05, 0x00, 0x01, 0x08, 0x01, 0xfd, 0x02, 0x00, 0x01, 0x7f, 0x01, 0xff, + 0x01, 0xdd, 0x01, 0xef, 0x01, 0xff, 0x01, 0xfe, 0x01, 0x30, 0x01, 0x00, + 0x01, 0x08, 0x01, 0xfe, 0x05, 0x00, 0x01, 0x1f, 0x01, 0xf4, 0x02, 0x00, + 0x01, 0x7f, 0x01, 0xfa, 0x02, 0x00, 0x01, 0x3c, 0x01, 0xff, 0x01, 0xd0, + 0x02, 0x00, 0x01, 0xef, 0x01, 0x60, 0x04, 0x00, 0x01, 0x6f, 0x01, 0xc0, + 0x02, 0x00, 0x01, 0x7f, 0x01, 0xfa, 0x02, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0xf3, 0x02, 0x00, 0x01, 0x7f, 0x01, 0xb0, 0x04, 0x00, 0x01, 0xbf, + 0x01, 0x60, 0x02, 0x00, 0x01, 0x7f, 0x01, 0xfa, 0x03, 0x00, 0x01, 0xff, + 0x01, 0xf4, 0x02, 0x00, 0x01, 0x1f, 0x01, 0xf0, 0x04, 0x00, 0x01, 0xff, + 0x01, 0x10, 0x02, 0x00, 0x01, 0x7f, 0x01, 0xfa, 0x03, 0x00, 0x01, 0xff, + 0x01, 0xf2, 0x02, 0x00, 0x01, 0x0c, 0x01, 0xf5, 0x03, 0x00, 0x01, 0x01, + 0x01, 0xfe, 0x03, 0x00, 0x01, 0x7f, 0x01, 0xfa, 0x02, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xe0, 0x02, 0x00, 0x01, 0x0a, 0x01, 0xf6, 0x03, 0x00, + 0x01, 0x03, 0x01, 0xfd, 0x03, 0x00, 0x01, 0x7f, 0x01, 0xfd, 0x01, 0x88, + 0x01, 0x9a, 0x01, 0xef, 0x01, 0xfe, 0x01, 0x30, 0x02, 0x00, 0x01, 0x08, + 0x01, 0xf8, 0x03, 0x00, 0x01, 0x04, 0x01, 0xfc, 0x03, 0x00, 0x01, 0x7f, + 0x03, 0xff, 0x01, 0xfe, 0x01, 0x91, 0x03, 0x00, 0x01, 0x07, 0x01, 0xf9, + 0x03, 0x00, 0x01, 0x03, 0x01, 0xfd, 0x03, 0x00, 0x01, 0x7f, 0x01, 0xfc, + 0x01, 0x78, 0x01, 0xdf, 0x01, 0xfd, 0x01, 0x20, 0x03, 0x00, 0x01, 0x08, + 0x01, 0xf8, 0x03, 0x00, 0x01, 0x01, 0x01, 0xfe, 0x03, 0x00, 0x01, 0x7f, + 0x01, 0xfa, 0x01, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xc0, 0x03, 0x00, + 0x01, 0x09, 0x01, 0xf6, 0x04, 0x00, 0x01, 0xff, 0x01, 0x10, 0x02, 0x00, + 0x01, 0x7f, 0x01, 0xfa, 0x02, 0x00, 0x01, 0xdf, 0x01, 0xf8, 0x03, 0x00, + 0x01, 0x0c, 0x01, 0xf5, 0x04, 0x00, 0x01, 0xbf, 0x01, 0x60, 0x02, 0x00, + 0x01, 0x7f, 0x01, 0xfa, 0x02, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x30, + 0x02, 0x00, 0x01, 0x1f, 0x01, 0xf1, 0x04, 0x00, 0x01, 0x6f, 0x01, 0xc0, + 0x02, 0x00, 0x01, 0x7f, 0x01, 0xfa, 0x02, 0x00, 0x01, 0x09, 0x01, 0xff, + 0x01, 0xd0, 0x02, 0x00, 0x01, 0x6f, 0x01, 0xb0, 0x04, 0x00, 0x01, 0x1f, + 0x01, 0xf4, 0x02, 0x00, 0x01, 0x7f, 0x01, 0xfa, 0x02, 0x00, 0x01, 0x01, + 0x01, 0xef, 0x01, 0xf7, 0x02, 0x00, 0x01, 0xef, 0x01, 0x60, 0x04, 0x00, + 0x01, 0x08, 0x01, 0xfd, 0x02, 0x00, 0x01, 0x7f, 0x01, 0xfa, 0x03, 0x00, + 0x01, 0x6f, 0x01, 0xff, 0x01, 0x20, 0x01, 0x08, 0x01, 0xfe, 0x06, 0x00, + 0x01, 0xef, 0x01, 0xa0, 0x01, 0x00, 0x01, 0x5a, 0x01, 0xa6, 0x03, 0x00, + 0x01, 0x09, 0x01, 0xaa, 0x01, 0x60, 0x01, 0x4f, 0x01, 0xf4, 0x06, 0x00, + 0x01, 0x3f, 0x01, 0xf8, 0x08, 0x00, 0x01, 0x03, 0x01, 0xff, 0x01, 0x80, + 0x06, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0x90, 0x07, 0x00, 0x01, 0x4f, + 0x01, 0xfb, 0x08, 0x00, 0x01, 0x6f, 0x01, 0xfc, 0x01, 0x30, 0x05, 0x00, + 0x01, 0x19, 0x01, 0xff, 0x01, 0xa0, 0x08, 0x00, 0x01, 0x04, 0x01, 0xef, + 0x01, 0xfa, 0x01, 0x40, 0x03, 0x00, 0x01, 0x38, 0x01, 0xef, 0x01, 0xf8, + 0x0a, 0x00, 0x01, 0x19, 0x02, 0xff, 0x01, 0xcb, 0x01, 0x9a, 0x01, 0xce, + 0x01, 0xff, 0x01, 0xfc, 0x01, 0x30, 0x0b, 0x00, 0x01, 0x28, 0x01, 0xdf, + 0x03, 0xff, 0x01, 0xea, 0x01, 0x40, 0x0d, 0x00, 0x01, 0x02, 0x01, 0x45, + 0x01, 0x76, 0x01, 0x43, 0xc5, 0x00, +#endif // TOUCH_UI_UTF8_COPYRIGHT + +#if ENABLED(TOUCH_UI_UTF8_MATHEMATICS) + /* 32 PLUS_MINUS_SIGN */ + 0xeb, 0x00, 0x01, 0x02, 0x01, 0x77, 0x01, 0x70, 0x10, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, + 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, + 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf0, 0x0b, 0x00, 0x01, 0x6a, 0x04, 0xaa, 0x01, 0xac, + 0x01, 0xff, 0x01, 0xfa, 0x05, 0xaa, 0x01, 0x20, 0x05, 0x00, 0x01, 0x9f, + 0x0c, 0xff, 0x01, 0x40, 0x05, 0x00, 0x01, 0x9f, 0x0c, 0xff, 0x01, 0x40, + 0x05, 0x00, 0x01, 0x7c, 0x04, 0xcc, 0x01, 0xcd, 0x01, 0xff, 0x01, 0xfc, + 0x05, 0xcc, 0x01, 0x30, 0x0a, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, + 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, + 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x06, + 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf0, + 0x10, 0x00, 0x01, 0x03, 0x01, 0x99, 0x01, 0x90, 0x44, 0x00, 0x01, 0x9f, + 0x0c, 0xff, 0x01, 0x30, 0x05, 0x00, 0x01, 0x9f, 0x0c, 0xff, 0x01, 0x40, + 0x05, 0x00, 0x01, 0x9f, 0x0c, 0xff, 0x01, 0x40, 0x05, 0x00, 0x01, 0x47, + 0x0c, 0x77, 0x01, 0x10, 0xc1, 0x00, + + /* 33 MULTIPLICATION_SIGN */ + 0xff, 0x00, 0x0e, 0x00, 0x01, 0x09, 0x01, 0xb0, 0x07, 0x00, 0x01, 0x03, + 0x01, 0xe4, 0x08, 0x00, 0x01, 0x9f, 0x01, 0xfb, 0x07, 0x00, 0x01, 0x3e, + 0x01, 0xff, 0x01, 0x40, 0x06, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xb0, 0x05, 0x00, 0x01, 0x03, 0x01, 0xef, 0x01, 0xff, 0x01, 0xa0, + 0x07, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xfb, 0x05, 0x00, 0x01, 0x3e, + 0x01, 0xff, 0x01, 0xfb, 0x08, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xb0, 0x03, 0x00, 0x01, 0x03, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, + 0x09, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xfb, 0x03, 0x00, 0x01, 0x3e, + 0x01, 0xff, 0x01, 0xfb, 0x0a, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xb0, 0x01, 0x00, 0x01, 0x03, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, + 0x0b, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xfb, 0x01, 0x00, 0x01, 0x3e, + 0x01, 0xff, 0x01, 0xfb, 0x0c, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xb3, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, 0x0d, 0x00, 0x01, 0x3e, + 0x03, 0xff, 0x01, 0xfb, 0x0e, 0x00, 0x01, 0x03, 0x01, 0xef, 0x02, 0xff, + 0x01, 0xb0, 0x0f, 0x00, 0x01, 0x5f, 0x02, 0xff, 0x01, 0x10, 0x0e, 0x00, + 0x01, 0x03, 0x01, 0xef, 0x02, 0xff, 0x01, 0xb0, 0x0e, 0x00, 0x01, 0x3e, + 0x03, 0xff, 0x01, 0xfb, 0x0d, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xb3, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, 0x0c, 0x00, 0x01, 0x2e, + 0x01, 0xff, 0x01, 0xfb, 0x01, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xfb, + 0x0b, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, 0x01, 0x00, + 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, 0x0a, 0x00, 0x01, 0x2e, + 0x01, 0xff, 0x01, 0xfb, 0x03, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xfb, + 0x09, 0x00, 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, 0x03, 0x00, + 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, 0x08, 0x00, 0x01, 0x2e, + 0x01, 0xff, 0x01, 0xfb, 0x05, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0xfb, + 0x07, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, 0x01, 0xb0, 0x05, 0x00, + 0x01, 0x02, 0x01, 0xef, 0x01, 0xff, 0x01, 0xa0, 0x07, 0x00, 0x01, 0x8f, + 0x01, 0xfb, 0x07, 0x00, 0x01, 0x2e, 0x01, 0xff, 0x01, 0x40, 0x07, 0x00, + 0x01, 0x09, 0x01, 0xb0, 0x07, 0x00, 0x01, 0x02, 0x01, 0xe4, 0xe9, 0x00, + + /* 34 DIVISION_SIGN */ + 0xff, 0x00, 0x25, 0x00, 0x01, 0x17, 0x01, 0x77, 0x01, 0x76, 0x10, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0xfc, 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, + 0x01, 0xfc, 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xfc, 0x10, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0xfc, 0x10, 0x00, 0x01, 0x17, 0x01, 0x77, + 0x01, 0x76, 0x31, 0x00, 0x01, 0x24, 0x0c, 0x44, 0x01, 0x10, 0x05, 0x00, + 0x01, 0x9f, 0x0c, 0xff, 0x01, 0x40, 0x05, 0x00, 0x01, 0x9f, 0x0c, 0xff, + 0x01, 0x40, 0x05, 0x00, 0x01, 0x9f, 0x0c, 0xff, 0x01, 0x40, 0x05, 0x00, + 0x01, 0x12, 0x0c, 0x22, 0x31, 0x00, 0x01, 0x18, 0x01, 0x88, 0x01, 0x87, + 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xfc, 0x10, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0xfc, 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xfc, + 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0xfc, 0x10, 0x00, 0x01, 0x16, + 0x01, 0x66, 0x01, 0x65, 0xff, 0x00, 0x01, 0x00, +#endif // TOUCH_UI_UTF8_MATHEMATICS + +#if ENABLED(TOUCH_UI_UTF8_FRACTIONS) + /* 35 FRACTION_QUARTER */ + 0x92, 0x00, 0x01, 0x01, 0x01, 0x44, 0x01, 0x40, 0x04, 0x00, 0x01, 0x04, + 0x01, 0x79, 0x01, 0xce, 0x01, 0xee, 0x01, 0x20, 0x07, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0x90, 0x04, 0x00, 0x01, 0x3f, 0x03, 0xff, 0x01, 0x20, + 0x07, 0x00, 0x01, 0x3f, 0x01, 0xfe, 0x01, 0x10, 0x04, 0x00, 0x01, 0x3f, + 0x01, 0xdb, 0x01, 0x8d, 0x01, 0xff, 0x01, 0x20, 0x07, 0x00, 0x01, 0xdf, + 0x01, 0xf5, 0x05, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0x20, 0x06, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x06, 0x00, 0x01, 0x1f, 0x01, 0xff, + 0x01, 0x20, 0x07, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x06, 0x00, + 0x01, 0xaf, 0x01, 0xf8, 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, + 0x05, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xe1, 0x08, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x20, 0x05, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0x50, + 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x05, 0x00, 0x01, 0x7f, + 0x01, 0xfc, 0x09, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x04, 0x00, + 0x01, 0x01, 0x01, 0xff, 0x01, 0xf2, 0x09, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0x20, 0x04, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0x80, 0x09, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x04, 0x00, 0x01, 0x4f, 0x01, 0xfe, + 0x0a, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x04, 0x00, 0x01, 0xdf, + 0x01, 0xf5, 0x0a, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x03, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xb0, 0x04, 0x00, 0x01, 0x37, 0x01, 0x77, + 0x02, 0x00, 0x01, 0x04, 0x01, 0x55, 0x01, 0x5d, 0x01, 0xff, 0x01, 0x75, + 0x01, 0x55, 0x01, 0x10, 0x01, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x20, + 0x03, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0xff, 0x02, 0x00, 0x01, 0x0d, + 0x05, 0xff, 0x01, 0x40, 0x01, 0x00, 0x01, 0xaf, 0x01, 0xf8, 0x04, 0x00, + 0x01, 0x0c, 0x02, 0xff, 0x02, 0x00, 0x01, 0x0c, 0x05, 0xee, 0x01, 0x40, + 0x01, 0x04, 0x01, 0xff, 0x01, 0xe0, 0x04, 0x00, 0x01, 0x8f, 0x01, 0xbe, + 0x01, 0xff, 0x09, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0x50, 0x03, 0x00, + 0x01, 0x04, 0x01, 0xfe, 0x01, 0x1e, 0x01, 0xff, 0x09, 0x00, 0x01, 0x7f, + 0x01, 0xfc, 0x04, 0x00, 0x01, 0x1e, 0x01, 0xf4, 0x01, 0x0e, 0x01, 0xff, + 0x08, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf2, 0x04, 0x00, 0x01, 0xbf, + 0x01, 0x80, 0x01, 0x0e, 0x01, 0xff, 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0x80, 0x03, 0x00, 0x01, 0x08, 0x01, 0xfc, 0x01, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x08, 0x00, 0x01, 0x4f, 0x01, 0xfe, 0x04, 0x00, 0x01, 0x4f, + 0x01, 0xe1, 0x01, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x08, 0x00, 0x01, 0xdf, + 0x01, 0xf5, 0x03, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0x40, 0x01, 0x00, + 0x01, 0x0e, 0x01, 0xff, 0x07, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xb0, + 0x03, 0x00, 0x01, 0x0b, 0x01, 0xf8, 0x02, 0x00, 0x01, 0x0e, 0x01, 0xff, + 0x07, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x20, 0x03, 0x00, 0x01, 0x3f, + 0x01, 0xf8, 0x02, 0x88, 0x01, 0x8f, 0x01, 0xff, 0x01, 0x88, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xf8, 0x04, 0x00, 0x01, 0x4f, 0x06, 0xff, 0x05, 0x00, + 0x01, 0x04, 0x01, 0xff, 0x01, 0xe0, 0x04, 0x00, 0x01, 0x2a, 0x03, 0xaa, + 0x01, 0xaf, 0x01, 0xff, 0x01, 0xaa, 0x05, 0x00, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0x50, 0x08, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x06, 0x00, 0x01, 0x8f, + 0x01, 0xfb, 0x09, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x05, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf2, 0x09, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x05, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0x80, 0x09, 0x00, 0x01, 0x05, 0x01, 0x66, + 0xbf, 0x00, + + /* 36 FRACTION_HALF */ + 0x92, 0x00, 0x01, 0x01, 0x01, 0x44, 0x01, 0x40, 0x04, 0x00, 0x01, 0x04, + 0x01, 0x7a, 0x01, 0xce, 0x01, 0xee, 0x01, 0x20, 0x07, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0x80, 0x04, 0x00, 0x01, 0x3f, 0x03, 0xff, 0x01, 0x20, + 0x07, 0x00, 0x01, 0x4f, 0x01, 0xfe, 0x05, 0x00, 0x01, 0x3f, 0x01, 0xda, + 0x01, 0x7d, 0x01, 0xff, 0x01, 0x20, 0x07, 0x00, 0x01, 0xdf, 0x01, 0xf5, + 0x07, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x06, 0x00, 0x01, 0x07, + 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, + 0x06, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x01, 0x20, 0x07, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x20, 0x06, 0x00, 0x01, 0xaf, 0x01, 0xf8, 0x08, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x05, 0x00, 0x01, 0x04, 0x01, 0xff, + 0x01, 0xe0, 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x05, 0x00, + 0x01, 0x0d, 0x01, 0xff, 0x01, 0x50, 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0x20, 0x05, 0x00, 0x01, 0x7f, 0x01, 0xfc, 0x09, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x20, 0x04, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf2, + 0x09, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, 0x04, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0x80, 0x09, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0x20, + 0x04, 0x00, 0x01, 0x4f, 0x01, 0xfe, 0x0a, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0x20, 0x04, 0x00, 0x01, 0xdf, 0x01, 0xf5, 0x0a, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0x20, 0x03, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xb0, + 0x01, 0x00, 0x01, 0x04, 0x01, 0x8a, 0x01, 0xcc, 0x01, 0xa7, 0x01, 0x10, + 0x02, 0x00, 0x01, 0x04, 0x01, 0x55, 0x01, 0x5d, 0x01, 0xff, 0x01, 0x75, + 0x01, 0x55, 0x01, 0x10, 0x01, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x20, + 0x01, 0x06, 0x04, 0xff, 0x01, 0xf7, 0x02, 0x00, 0x01, 0x0d, 0x05, 0xff, + 0x01, 0x40, 0x01, 0x00, 0x01, 0xbf, 0x01, 0xf8, 0x01, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xa7, 0x01, 0x68, 0x01, 0xdf, 0x01, 0xff, 0x01, 0x70, + 0x01, 0x00, 0x01, 0x0b, 0x05, 0xdd, 0x01, 0x40, 0x01, 0x04, 0x01, 0xff, + 0x01, 0xe0, 0x01, 0x00, 0x01, 0x05, 0x01, 0x60, 0x02, 0x00, 0x01, 0x08, + 0x01, 0xff, 0x01, 0xf1, 0x08, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0x50, + 0x06, 0x00, 0x01, 0xef, 0x01, 0xf4, 0x08, 0x00, 0x01, 0x7f, 0x01, 0xfb, + 0x07, 0x00, 0x01, 0xcf, 0x01, 0xf3, 0x07, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0xf2, 0x06, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xe0, 0x07, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0x80, 0x06, 0x00, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0x50, 0x07, 0x00, 0x01, 0x4f, 0x01, 0xfe, 0x07, 0x00, 0x01, 0xaf, + 0x01, 0xfa, 0x08, 0x00, 0x01, 0xdf, 0x01, 0xf5, 0x06, 0x00, 0x01, 0x09, + 0x01, 0xff, 0x01, 0xc0, 0x07, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xb0, + 0x06, 0x00, 0x01, 0x8f, 0x01, 0xfd, 0x01, 0x10, 0x07, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x20, 0x05, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xc1, + 0x08, 0x00, 0x01, 0xbf, 0x01, 0xf8, 0x06, 0x00, 0x01, 0xaf, 0x01, 0xfb, + 0x08, 0x00, 0x01, 0x05, 0x01, 0xff, 0x01, 0xe0, 0x05, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xa0, 0x08, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0x50, + 0x04, 0x00, 0x01, 0x01, 0x01, 0xcf, 0x01, 0xf9, 0x09, 0x00, 0x01, 0x8f, + 0x01, 0xfb, 0x05, 0x00, 0x01, 0x09, 0x01, 0xff, 0x01, 0xfe, 0x03, 0xee, + 0x01, 0xe6, 0x04, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf2, 0x05, 0x00, + 0x01, 0x0a, 0x05, 0xff, 0x01, 0xf7, 0x04, 0x00, 0x01, 0x0a, 0x01, 0xee, + 0x01, 0x70, 0x05, 0x00, 0x01, 0x04, 0x05, 0x66, 0x01, 0x62, 0xbe, 0x00, + + /* 37 FRACTION_THREE_FOURTHS */ + 0x87, 0x00, 0x01, 0x02, 0x01, 0x34, 0x01, 0x42, 0x08, 0x00, 0x01, 0x01, + 0x01, 0x55, 0x01, 0x50, 0x04, 0x00, 0x01, 0x4c, 0x03, 0xff, 0x01, 0xe9, + 0x01, 0x10, 0x06, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0x80, 0x04, 0x00, + 0x01, 0x7f, 0x01, 0xff, 0x01, 0xfe, 0x02, 0xff, 0x01, 0xe2, 0x06, 0x00, + 0x01, 0x4f, 0x01, 0xfe, 0x05, 0x00, 0x01, 0x47, 0x01, 0x30, 0x01, 0x00, + 0x01, 0x05, 0x01, 0xef, 0x01, 0xfb, 0x06, 0x00, 0x01, 0xdf, 0x01, 0xf5, + 0x09, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x05, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xb0, 0x09, 0x00, 0x01, 0x1f, 0x01, 0xff, 0x05, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x20, 0x09, 0x00, 0x01, 0x6f, 0x01, 0xfb, 0x05, 0x00, + 0x01, 0xbf, 0x01, 0xf8, 0x07, 0x00, 0x01, 0x03, 0x01, 0x44, 0x01, 0x5a, + 0x01, 0xff, 0x01, 0xd1, 0x04, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xe0, + 0x07, 0x00, 0x01, 0x0c, 0x02, 0xff, 0x01, 0xe7, 0x05, 0x00, 0x01, 0x0d, + 0x01, 0xff, 0x01, 0x50, 0x07, 0x00, 0x01, 0x0b, 0x01, 0xef, 0x01, 0xff, + 0x01, 0xfe, 0x01, 0x70, 0x04, 0x00, 0x01, 0x7f, 0x01, 0xfb, 0x0a, 0x00, + 0x01, 0x16, 0x01, 0xdf, 0x01, 0xf9, 0x03, 0x00, 0x01, 0x02, 0x01, 0xff, + 0x01, 0xf2, 0x0b, 0x00, 0x01, 0x1e, 0x01, 0xff, 0x01, 0x20, 0x02, 0x00, + 0x01, 0x0b, 0x01, 0xff, 0x01, 0x80, 0x0b, 0x00, 0x01, 0x0a, 0x01, 0xff, + 0x01, 0x60, 0x02, 0x00, 0x01, 0x4f, 0x01, 0xfe, 0x0c, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0x60, 0x02, 0x00, 0x01, 0xdf, 0x01, 0xf5, 0x0c, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0x30, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, + 0x01, 0xb0, 0x04, 0x00, 0x01, 0x47, 0x01, 0x77, 0x02, 0x00, 0x01, 0xd7, + 0x01, 0x42, 0x01, 0x01, 0x01, 0x38, 0x01, 0xef, 0x01, 0xfc, 0x02, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0x20, 0x03, 0x00, 0x01, 0x02, 0x02, 0xff, + 0x02, 0x00, 0x05, 0xff, 0x01, 0xc1, 0x02, 0x00, 0x01, 0xbf, 0x01, 0xf8, + 0x04, 0x00, 0x01, 0x0c, 0x02, 0xff, 0x02, 0x00, 0x01, 0x7b, 0x01, 0xef, + 0x02, 0xff, 0x01, 0xb6, 0x02, 0x00, 0x01, 0x04, 0x01, 0xff, 0x01, 0xe0, + 0x04, 0x00, 0x01, 0x9f, 0x01, 0xbe, 0x01, 0xff, 0x04, 0x00, 0x01, 0x22, + 0x01, 0x10, 0x03, 0x00, 0x01, 0x0d, 0x01, 0xff, 0x01, 0x50, 0x03, 0x00, + 0x01, 0x04, 0x01, 0xfe, 0x01, 0x1e, 0x01, 0xff, 0x09, 0x00, 0x01, 0x8f, + 0x01, 0xfb, 0x04, 0x00, 0x01, 0x1e, 0x01, 0xf3, 0x01, 0x0e, 0x01, 0xff, + 0x08, 0x00, 0x01, 0x02, 0x01, 0xff, 0x01, 0xf2, 0x04, 0x00, 0x01, 0xcf, + 0x01, 0x70, 0x01, 0x0e, 0x01, 0xff, 0x08, 0x00, 0x01, 0x0b, 0x01, 0xff, + 0x01, 0x80, 0x03, 0x00, 0x01, 0x08, 0x01, 0xfb, 0x01, 0x00, 0x01, 0x0e, + 0x01, 0xff, 0x08, 0x00, 0x01, 0x5f, 0x01, 0xfe, 0x04, 0x00, 0x01, 0x4f, + 0x01, 0xe1, 0x01, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x08, 0x00, 0x01, 0xdf, + 0x01, 0xf4, 0x03, 0x00, 0x01, 0x01, 0x01, 0xef, 0x01, 0x40, 0x01, 0x00, + 0x01, 0x0e, 0x01, 0xff, 0x07, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0xb0, + 0x03, 0x00, 0x01, 0x0b, 0x01, 0xf8, 0x02, 0x00, 0x01, 0x0e, 0x01, 0xff, + 0x07, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x20, 0x03, 0x00, 0x01, 0x3f, + 0x01, 0xf9, 0x02, 0x99, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x99, 0x06, 0x00, + 0x01, 0xbf, 0x01, 0xf8, 0x04, 0x00, 0x01, 0x4f, 0x06, 0xff, 0x05, 0x00, + 0x01, 0x05, 0x01, 0xff, 0x01, 0xd0, 0x04, 0x00, 0x01, 0x29, 0x03, 0x99, + 0x01, 0x9f, 0x01, 0xff, 0x01, 0x99, 0x05, 0x00, 0x01, 0x0d, 0x01, 0xff, + 0x01, 0x40, 0x08, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x06, 0x00, 0x01, 0x8f, + 0x01, 0xfb, 0x09, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x05, 0x00, 0x01, 0x02, + 0x01, 0xff, 0x01, 0xf2, 0x09, 0x00, 0x01, 0x0e, 0x01, 0xff, 0x05, 0x00, + 0x01, 0x0a, 0x01, 0xee, 0x01, 0x70, 0x09, 0x00, 0x01, 0x04, 0x01, 0x55, + 0xbf, 0x00, +#endif // TOUCH_UI_UTF8_FRACTIONS + +#if ENABLED(TOUCH_UI_UTF8_SYMBOLS) + /* 38 MICRON_SIGN */ + 0xff, 0x00, 0x1f, 0x00, 0x01, 0x02, 0x01, 0x44, 0x01, 0x40, 0x05, 0x00, + 0x01, 0x14, 0x01, 0x44, 0x01, 0x10, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, + 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, + 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, + 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, + 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, + 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x05, 0x00, 0x01, 0x4f, 0x01, 0xff, + 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf4, 0x05, 0x00, + 0x01, 0x6f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf6, 0x05, 0x00, 0x01, 0x9f, 0x01, 0xff, 0x01, 0x70, 0x08, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xfa, 0x05, 0x00, 0x01, 0xef, 0x01, 0xff, + 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x02, 0xff, 0x01, 0x20, 0x03, 0x00, + 0x01, 0x07, 0x02, 0xff, 0x01, 0x70, 0x08, 0x00, 0x01, 0x07, 0x02, 0xff, + 0x01, 0xd2, 0x03, 0x00, 0x01, 0x6f, 0x02, 0xff, 0x01, 0xa0, 0x08, 0x00, + 0x01, 0x07, 0x03, 0xff, 0x01, 0xa6, 0x01, 0x55, 0x01, 0x8d, 0x03, 0xff, + 0x01, 0xf9, 0x01, 0xa4, 0x07, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf7, + 0x05, 0xff, 0x01, 0x5d, 0x02, 0xff, 0x01, 0xf4, 0x07, 0x00, 0x01, 0x07, + 0x01, 0xff, 0x01, 0xf3, 0x01, 0x5f, 0x03, 0xff, 0x01, 0xf5, 0x01, 0x06, + 0x02, 0xff, 0x01, 0xf4, 0x07, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, + 0x01, 0x01, 0x01, 0x7c, 0x01, 0xdd, 0x01, 0xc7, 0x01, 0x10, 0x01, 0x00, + 0x01, 0x6c, 0x01, 0xdb, 0x01, 0x50, 0x07, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf3, 0x10, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x10, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x10, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf3, 0x10, 0x00, 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x10, 0x00, + 0x01, 0x07, 0x01, 0xff, 0x01, 0xf3, 0x10, 0x00, 0x01, 0x07, 0x01, 0xff, + 0x01, 0xf3, 0x10, 0x00, 0x01, 0x07, 0x01, 0xee, 0x01, 0xe3, 0x35, 0x00, + + /* 39 PILCROW_SIGN */ + 0x9c, 0x00, 0x01, 0x16, 0x01, 0x9b, 0x04, 0xcc, 0x01, 0xca, 0x0b, 0x00, + 0x01, 0x19, 0x06, 0xff, 0x01, 0xfd, 0x0a, 0x00, 0x01, 0x03, 0x01, 0xef, + 0x03, 0xff, 0x01, 0xfb, 0x01, 0xaa, 0x01, 0xaf, 0x01, 0xfd, 0x0a, 0x00, + 0x01, 0x2e, 0x04, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, + 0x0a, 0x00, 0x01, 0xbf, 0x04, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, + 0x01, 0xfd, 0x09, 0x00, 0x01, 0x03, 0x05, 0xff, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x09, 0x00, 0x01, 0x08, 0x05, 0xff, 0x01, 0xf2, + 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, 0x09, 0x00, 0x01, 0x0b, 0x05, 0xff, + 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, 0x09, 0x00, 0x01, 0x0c, + 0x05, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, 0x09, 0x00, + 0x01, 0x0b, 0x05, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, + 0x09, 0x00, 0x01, 0x0a, 0x05, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, + 0x01, 0xfd, 0x09, 0x00, 0x01, 0x06, 0x05, 0xff, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0a, 0x00, 0x01, 0xef, 0x04, 0xff, 0x01, 0xf2, + 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, 0x0a, 0x00, 0x01, 0x6f, 0x04, 0xff, + 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, 0x0a, 0x00, 0x01, 0x08, + 0x04, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, 0x0b, 0x00, + 0x01, 0x5e, 0x03, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, 0x01, 0xfd, + 0x0c, 0x00, 0x01, 0x6b, 0x02, 0xff, 0x01, 0xf2, 0x01, 0x00, 0x01, 0x0f, + 0x01, 0xfd, 0x0d, 0x00, 0x01, 0x01, 0x01, 0xcf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0xbf, 0x01, 0xf2, 0x01, 0x00, + 0x01, 0x0f, 0x01, 0xfd, 0x0e, 0x00, 0x01, 0x34, 0x01, 0x40, 0x01, 0x00, + 0x01, 0x04, 0x01, 0x43, 0x7a, 0x00, + + /* 40 BROKEN_BAR */ + 0xad, 0x00, 0x01, 0x07, 0x01, 0x99, 0x01, 0x60, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x08, 0x01, 0xbb, 0x01, 0x70, 0x6f, 0x00, 0x01, 0x0b, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, + 0x10, 0x00, 0x01, 0x0c, 0x01, 0xff, 0x01, 0xa0, 0x10, 0x00, 0x01, 0x04, + 0x01, 0x55, 0x01, 0x30, 0x47, 0x00, + + /* 41 SECTION_SIGN */ + 0x89, 0x00, 0x01, 0x35, 0x01, 0x64, 0x01, 0x31, 0x0e, 0x00, 0x01, 0x01, + 0x01, 0x9e, 0x03, 0xff, 0x01, 0xd9, 0x01, 0x30, 0x0c, 0x00, 0x01, 0x2e, + 0x05, 0xff, 0x01, 0xb0, 0x0c, 0x00, 0x01, 0xef, 0x01, 0xff, 0x01, 0xfb, + 0x01, 0x98, 0x01, 0xae, 0x01, 0xff, 0x01, 0xb0, 0x0b, 0x00, 0x01, 0x07, + 0x01, 0xff, 0x01, 0xfc, 0x01, 0x10, 0x02, 0x00, 0x01, 0x39, 0x01, 0xa0, + 0x0b, 0x00, 0x01, 0x0b, 0x01, 0xff, 0x01, 0xf2, 0x10, 0x00, 0x01, 0x0c, + 0x01, 0xff, 0x01, 0xf0, 0x10, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xf3, + 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xfd, 0x01, 0x20, 0x10, 0x00, + 0x01, 0xdf, 0x01, 0xff, 0x01, 0xe4, 0x10, 0x00, 0x01, 0x1d, 0x02, 0xff, + 0x01, 0xa1, 0x0f, 0x00, 0x01, 0x4e, 0x03, 0xff, 0x01, 0x70, 0x0d, 0x00, + 0x01, 0x06, 0x01, 0xff, 0x01, 0xf9, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xfd, + 0x01, 0x30, 0x0c, 0x00, 0x01, 0x3f, 0x01, 0xff, 0x01, 0x60, 0x01, 0x07, + 0x02, 0xff, 0x01, 0xf8, 0x0c, 0x00, 0x01, 0xbf, 0x01, 0xf9, 0x02, 0x00, + 0x01, 0x19, 0x02, 0xff, 0x01, 0xc0, 0x0b, 0x00, 0x01, 0xff, 0x01, 0xf3, + 0x03, 0x00, 0x01, 0x4e, 0x01, 0xff, 0x01, 0xfb, 0x0a, 0x00, 0x01, 0x01, + 0x01, 0xff, 0x01, 0xf2, 0x03, 0x00, 0x01, 0x01, 0x01, 0xdf, 0x01, 0xff, + 0x01, 0x40, 0x09, 0x00, 0x01, 0x01, 0x01, 0xff, 0x01, 0xf7, 0x04, 0x00, + 0x01, 0x2f, 0x01, 0xff, 0x01, 0x90, 0x0a, 0x00, 0x01, 0xdf, 0x01, 0xff, + 0x01, 0x20, 0x03, 0x00, 0x01, 0x0a, 0x01, 0xff, 0x01, 0xb0, 0x0a, 0x00, + 0x01, 0x6f, 0x01, 0xff, 0x01, 0xf5, 0x03, 0x00, 0x01, 0x08, 0x01, 0xff, + 0x01, 0xa0, 0x0a, 0x00, 0x01, 0x0a, 0x02, 0xff, 0x01, 0x91, 0x02, 0x00, + 0x01, 0x0c, 0x01, 0xff, 0x01, 0x70, 0x0b, 0x00, 0x01, 0x8f, 0x01, 0xff, + 0x01, 0xfe, 0x01, 0x60, 0x01, 0x00, 0x01, 0x6f, 0x01, 0xff, 0x01, 0x10, + 0x0b, 0x00, 0x01, 0x03, 0x01, 0xdf, 0x01, 0xff, 0x01, 0xfd, 0x01, 0x46, + 0x01, 0xff, 0x01, 0xf5, 0x0d, 0x00, 0x01, 0x07, 0x04, 0xff, 0x01, 0x50, + 0x0e, 0x00, 0x01, 0x2a, 0x02, 0xff, 0x01, 0xf5, 0x10, 0x00, 0x01, 0x4e, + 0x01, 0xff, 0x01, 0xfe, 0x01, 0x20, 0x0f, 0x00, 0x01, 0x01, 0x01, 0xcf, + 0x01, 0xff, 0x01, 0xc0, 0x10, 0x00, 0x01, 0x1e, 0x01, 0xff, 0x01, 0xf3, + 0x10, 0x00, 0x01, 0x06, 0x01, 0xff, 0x01, 0xf6, 0x10, 0x00, 0x01, 0x05, + 0x01, 0xff, 0x01, 0xf6, 0x0b, 0x00, 0x01, 0x01, 0x04, 0x00, 0x01, 0x0a, + 0x01, 0xff, 0x01, 0xf3, 0x0b, 0x00, 0x01, 0x08, 0x01, 0xe8, 0x01, 0x20, + 0x01, 0x00, 0x01, 0x01, 0x01, 0x8f, 0x01, 0xff, 0x01, 0xe0, 0x0b, 0x00, + 0x01, 0x08, 0x01, 0xff, 0x01, 0xfe, 0x01, 0xcb, 0x01, 0xdf, 0x02, 0xff, + 0x01, 0x40, 0x0b, 0x00, 0x01, 0x08, 0x05, 0xff, 0x01, 0xf5, 0x0d, 0x00, + 0x01, 0x49, 0x01, 0xdf, 0x02, 0xff, 0x01, 0xe8, 0x01, 0x20, 0x0f, 0x00, + 0x01, 0x12, 0x01, 0x21, 0x7f, 0x00, + + /* 42 NOT_SIGN */ + 0xff, 0x00, 0x7f, 0x00, 0x01, 0x12, 0x0c, 0x22, 0x06, 0x00, 0x01, 0x9f, + 0x0c, 0xff, 0x01, 0x40, 0x05, 0x00, 0x01, 0x9f, 0x0c, 0xff, 0x01, 0x40, + 0x05, 0x00, 0x01, 0x9f, 0x0c, 0xff, 0x01, 0x40, 0x05, 0x00, 0x01, 0x24, + 0x0a, 0x44, 0x01, 0x6f, 0x01, 0xff, 0x01, 0x40, 0x10, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x40, 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x40, + 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x40, 0x10, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x40, 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x40, + 0x10, 0x00, 0x01, 0x2f, 0x01, 0xff, 0x01, 0x40, 0x10, 0x00, 0x01, 0x2f, + 0x01, 0xff, 0x01, 0x40, 0x10, 0x00, 0x01, 0x17, 0x01, 0x77, 0x01, 0x10, + 0xff, 0x00, 0x34, 0x00 +#endif // TOUCH_UI_UTF8_SYMBOLS +}; diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extras/bitmap2cpp.py b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extras/bitmap2cpp.py new file mode 100644 index 0000000000..c295dfc5b8 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extras/bitmap2cpp.py @@ -0,0 +1,108 @@ +#!/usr/bin/python + +# Written By Marcio Teixeira 2019 - Aleph Objects, Inc. +# +# 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. +# +# To view a copy of the GNU General Public License, go to the following +# location: . + +from __future__ import print_function +from PIL import Image +import argparse +import textwrap + +def pack_rle(data): + """Use run-length encoding to pack the bytes""" + rle = [] + value = data[0] + count = 0 + for i in data: + if i != value or count == 255: + rle.append(count) + rle.append(value) + value = i + count = 1 + else: + count += 1 + rle.append(count) + rle.append(value) + return rle + +class WriteSource: + def __init__(self, lines_in_blocks): + self.blocks = [] + self.values = [] + self.block_size = lines_in_blocks + self.rows = 0 + + def add_pixel(self, value): + self.values.append(value) + + def convert_to_4bpp(self, data, chunk_size = 0): + # Invert the image + data = map(lambda i: 255 - i, data) + # Quanitize 8-bit values into 4-bits + data = map(lambda i: i >> 4, data) + # Make sure there is an even number of elements + if (len(data) & 1) == 1: + result.append(0) + # Combine each two adjacent values into one + i = iter(data) + data = map(lambda a, b: a << 4 | b, i ,i) + # Pack the data + data = pack_rle(data) + # Convert values into hex strings + return map(lambda a: "0x" + format(a, '02x'), data) + + def end_row(self, y): + # Pad each row into even number of values + if len(self.values) & 1: + self.values.append(0) + + self.rows += 1 + if self.block_size and (self.rows % self.block_size) == 0: + self.blocks.append(self.values) + self.values = [] + + def write(self): + if len(self.values): + self.blocks.append(self.values) + + block_strs = []; + for b in self.blocks: + data = self.convert_to_4bpp(b) + data = ', '.join(data) + data = textwrap.fill(data, 75, initial_indent = ' ', subsequent_indent = ' ') + block_strs.append(data) + + print("const unsigned char font[] PROGMEM = {") + for i, b in enumerate(block_strs): + if i: + print(',') + print('\n /* {} */'.format(i)) + print(b, end='') + print("\n};") + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='Converts a grayscale bitmap into a 16-level RLE packed C array for use as font data') + parser.add_argument("input") + parser.add_argument('--char_height', help='Adds a separator every so many lines', type=int) + args = parser.parse_args() + + writer = WriteSource(args.char_height) + + img = Image.open(args.input).convert('L') + for y in range(img.height): + for x in range(img.width): + writer.add_pixel(img.getpixel((x,y))) + writer.end_row(y) + writer.write() diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/language.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/language.cpp new file mode 100644 index 0000000000..5d33fc850f --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/language.cpp @@ -0,0 +1,27 @@ +/**************** + * language.cpp * + ****************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + + +#include "../../../../../Marlin.h" + +#include "language.h" + +uint8_t lang = 0; diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/language.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/language.h new file mode 100644 index 0000000000..a8a700864b --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/language.h @@ -0,0 +1,89 @@ +/************** + * language.h * + **************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ +#pragma once + +typedef const char Language_Str[]; + +// Count how many languages are defined. + +#if defined(LCD_LANGUAGE_5) + #define NUM_LANGUAGES 5 +#elif defined(LCD_LANGUAGE_4) + #define NUM_LANGUAGES 4 +#elif defined(LCD_LANGUAGE_3) + #define NUM_LANGUAGES 3 +#elif defined(LCD_LANGUAGE_2) + #define NUM_LANGUAGES 2 +#else + #define NUM_LANGUAGES 1 +#endif + +// Set undefined languages equal to the last and +// let the compiler optimize out the duplicates + +#ifndef LCD_LANGUAGE_1 + #define LCD_LANGUAGE_1 LCD_LANGUAGE +#endif + +#ifndef LCD_LANGUAGE_2 + #define LCD_LANGUAGE_2 LCD_LANGUAGE_1 +#endif + +#ifndef LCD_LANGUAGE_3 + #define LCD_LANGUAGE_3 LCD_LANGUAGE_2 +#endif + +#ifndef LCD_LANGUAGE_4 + #define LCD_LANGUAGE_4 LCD_LANGUAGE_3 +#endif + +#ifndef LCD_LANGUAGE_5 + #define LCD_LANGUAGE_5 LCD_LANGUAGE_4 +#endif + +// Indirection required to paste together the namespace name + +#define _GET_LANG(LANG) Language_##LANG +#define GET_LANG(LANG) _GET_LANG(LANG) + +#if NUM_LANGUAGES > 1 + extern uint8_t lang; + // The compiler does a good job of "flattening" out this + // if statement when there are fewer than five languages. + #define GET_TEXT(MSG) ( \ + lang == 0 ? GET_LANG(LCD_LANGUAGE_1)::MSG : \ + lang == 1 ? GET_LANG(LCD_LANGUAGE_2)::MSG : \ + lang == 2 ? GET_LANG(LCD_LANGUAGE_3)::MSG : \ + lang == 3 ? GET_LANG(LCD_LANGUAGE_4)::MSG : \ + GET_LANG(LCD_LANGUAGE_5)::MSG \ + ) +#else + #define GET_TEXT(MSG) GET_LANG(LCD_LANGUAGE_1)::MSG +#endif +#define GET_TEXTF(MSG) reinterpret_cast(GET_TEXT(MSG)) + +#define GET_LANGUAGE_NAME(N) GET_LANG(LCD_LANGUAGE_##N)::LANGUAGE + +// All the language tables go here + +#include "language_en.h" +#include "language_de.h" +#include "language_fr.h" diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/language_de.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/language_de.h new file mode 100644 index 0000000000..3c26bfb3d8 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/language_de.h @@ -0,0 +1,80 @@ +/***************** + * language_de.h * + *****************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +namespace Language_de { + using namespace Language_en; // Inherit undefined strings from English + + PROGMEM Language_Str LANGUAGE = u8"Deutsche"; + + PROGMEM Language_Str YES = u8"JA"; + PROGMEM Language_Str NO = u8"NEIN"; + PROGMEM Language_Str BACK = u8"Zurück"; + + PROGMEM Language_Str MOVE_AXIS = u8"Achsen bewegen"; + PROGMEM Language_Str MOTORS_OFF = u8"Motoren deaktivieren"; + PROGMEM Language_Str TEMPERATURE = u8"Temperatur"; + PROGMEM Language_Str CHANGE_FILAMENT = u8"Filament wechseln"; + PROGMEM Language_Str ADVANCED_SETTINGS = u8"Erw. Einstellungen"; + PROGMEM Language_Str ABOUT_PRINTER = u8"Über den Drucker"; + PROGMEM Language_Str PRINTER_STATISTICS = u8"Drucker-Statistik"; + + PROGMEM Language_Str ZPROBE_ZOFFSET = u8"Sondenversatz Z"; + PROGMEM Language_Str TOOL_OFFSETS = u8"Werkzeugversätze"; + PROGMEM Language_Str VELOCITY = u8"Geschwindigkeit"; + PROGMEM Language_Str ACCELERATION = u8"Beschleunigung"; + PROGMEM Language_Str ACCEL_PRINTING = u8"Beschleunigung"; + PROGMEM Language_Str ACCEL_TRAVEL = u8"A Einzug"; + PROGMEM Language_Str ACCEL_RETRACT = u8"A Leerfahrt"; + PROGMEM Language_Str BACKLASH = u8"Spiel"; + PROGMEM Language_Str SMOOTHING = u8"Glätten"; + PROGMEM Language_Str CORRECTION = u8"Korrektur"; + PROGMEM Language_Str ENDSTOPS = u8"Endstopp"; + PROGMEM Language_Str SOFT_ENDSTOPS = u8"Software-Endstopp"; + PROGMEM Language_Str RESTORE_DEFAULTS = u8"Standardwerte laden"; + + + PROGMEM Language_Str HOTEND = u8"Düse"; + PROGMEM Language_Str HOTEND1 = u8"Düse 1"; + PROGMEM Language_Str HOTEND2 = u8"Düse 2"; + PROGMEM Language_Str HOTEND3 = u8"Düse 3"; + PROGMEM Language_Str HOTEND4 = u8"Düse 4"; + PROGMEM Language_Str BED = u8"Bett"; + PROGMEM Language_Str AXIS_ALL = u8"Alle"; + + PROGMEM Language_Str FAN_SPEED = u8"Lüfter"; + + PROGMEM Language_Str PRINT_FILE = u8"Drucken"; + + PROGMEM Language_Str RESUME_PRINT = u8"SD-Druck fortsetzen"; + PROGMEM Language_Str PAUSE_PRINT = u8"SD-Druck pausieren"; + PROGMEM Language_Str STOP_PRINT = u8"SD-Druck abbrechen"; + + PROGMEM Language_Str INFO_PRINT_COUNT = u8"Gesamte Drucke"; + PROGMEM Language_Str INFO_COMPLETED_PRINTS = u8"Komplette Drucke"; + PROGMEM Language_Str INFO_PRINT_TIME = u8"Gesamte Druckzeit"; + PROGMEM Language_Str INFO_PRINT_LONGEST = u8"Längste Druckzeit"; + PROGMEM Language_Str INFO_PRINT_FILAMENT = u8"Gesamt Extrudiert"; + + PROGMEM Language_Str PRINTER_HALTED = u8"DRUCKER GESTOPPT"; + PROGMEM Language_Str PLEASE_RESET = u8"Bitte neustarten"; +}; // namespace Language_de diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/language_en.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/language_en.h new file mode 100644 index 0000000000..67904ceaef --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/language_en.h @@ -0,0 +1,231 @@ +/***************** + * language_en.h * + *****************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#include "language.h" + +namespace Language_en { + PROGMEM Language_Str LANGUAGE = u8"English"; + + PROGMEM Language_Str YES = u8"Yes"; + PROGMEM Language_Str NO = u8"No"; + PROGMEM Language_Str BACK = u8"Back"; + PROGMEM Language_Str OKAY = u8"Okay"; + PROGMEM Language_Str MENU = u8"Menu"; + PROGMEM Language_Str MEDIA = u8"Media"; + + PROGMEM Language_Str AUTO_HOME = u8"Auto Home"; + PROGMEM Language_Str CLEAN_NOZZLE = u8"Clean Nozzle"; + PROGMEM Language_Str MOVE_AXIS = u8"Move Axis"; + PROGMEM Language_Str MOTORS_OFF = u8"Motors Off"; + PROGMEM Language_Str TEMPERATURE = u8"Temperature"; + PROGMEM Language_Str CHANGE_FILAMENT = u8"Change Filament"; + PROGMEM Language_Str ADVANCED_SETTINGS = u8"Advanced Settings"; + PROGMEM Language_Str ABOUT_PRINTER = u8"About Printer"; + PROGMEM Language_Str PRINTER_STATISTICS = u8"Printer Statistics"; + + PROGMEM Language_Str ZPROBE_ZOFFSET = u8"Z Offset"; + PROGMEM Language_Str STEPS_PER_MM = u8"Steps/mm"; + PROGMEM Language_Str TOOL_OFFSETS = u8"Tool Offsets"; + PROGMEM Language_Str VELOCITY = u8"Velocity"; + PROGMEM Language_Str VMAX_X = u8"Vmax X"; + PROGMEM Language_Str VMAX_Y = u8"Vmax Y"; + PROGMEM Language_Str VMAX_Z = u8"Vmax Z"; + PROGMEM Language_Str VMAX_E1 = u8"Vmax E1"; + PROGMEM Language_Str VMAX_E2 = u8"Vmax E2"; + PROGMEM Language_Str VMAX_E3 = u8"Vmax E3"; + PROGMEM Language_Str VMAX_E4 = u8"Vmax E4"; + PROGMEM Language_Str ACCELERATION = u8"Acceleration"; + PROGMEM Language_Str ACCEL_PRINTING = u8"Printing"; + PROGMEM Language_Str ACCEL_TRAVEL = u8"Travel"; + PROGMEM Language_Str ACCEL_RETRACT = u8"Retraction"; + PROGMEM Language_Str AMAX_X = u8"Amax X"; + PROGMEM Language_Str AMAX_Y = u8"Amax Y"; + PROGMEM Language_Str AMAX_Z = u8"Amax Z"; + PROGMEM Language_Str AMAX_E1 = u8"Amax E1"; + PROGMEM Language_Str AMAX_E2 = u8"Amax E2"; + PROGMEM Language_Str AMAX_E3 = u8"Amax E3"; + PROGMEM Language_Str AMAX_E4 = u8"Amax E4"; + PROGMEM Language_Str JERK = u8"Jerk"; + PROGMEM Language_Str JUNC_DEVIATION = u8"Junc Dev"; + PROGMEM Language_Str BACKLASH = u8"Backlash"; + PROGMEM Language_Str SMOOTHING = u8"Smoothing"; + PROGMEM Language_Str CORRECTION = u8"Correction"; + PROGMEM Language_Str MOTOR_CURRENT = u8"Currents"; + PROGMEM Language_Str FILAMENT = u8"Filament"; + PROGMEM Language_Str ENDSTOPS = u8"Endstops"; + PROGMEM Language_Str SOFT_ENDSTOPS = u8"Soft Endstops"; + PROGMEM Language_Str RESTORE_DEFAULTS = u8"Restore Defaults"; + + PROGMEM Language_Str HOTEND = u8"Hot End"; + PROGMEM Language_Str HOTEND1 = u8"Hot End 1"; + PROGMEM Language_Str HOTEND2 = u8"Hot End 2"; + PROGMEM Language_Str HOTEND3 = u8"Hot End 3"; + PROGMEM Language_Str HOTEND4 = u8"Hot End 4"; + PROGMEM Language_Str BED = u8"Bed"; + PROGMEM Language_Str AXIS_X = u8"X"; + PROGMEM Language_Str AXIS_Y = u8"Y"; + PROGMEM Language_Str AXIS_Z = u8"Z"; + PROGMEM Language_Str AXIS_E = u8"E"; + PROGMEM Language_Str AXIS_E1 = u8"E1"; + PROGMEM Language_Str AXIS_E2 = u8"E2"; + PROGMEM Language_Str AXIS_E3 = u8"E3"; + PROGMEM Language_Str AXIS_E4 = u8"E4"; + PROGMEM Language_Str AXIS_ALL = u8"All"; + PROGMEM Language_Str HOME = u8"Home"; + + PROGMEM Language_Str FAN_SPEED = u8"Fan Speed"; + PROGMEM Language_Str RUNOUT_SENSOR = u8"Runout Sensor"; + + PROGMEM Language_Str OPEN_DIR = u8"Open"; + PROGMEM Language_Str PRINT_FILE = u8"Print"; + + PROGMEM Language_Str RESUME_PRINT = u8"Resume Print"; + PROGMEM Language_Str PAUSE_PRINT = u8"Pause Print"; + PROGMEM Language_Str STOP_PRINT = u8"Stop Print"; + + PROGMEM Language_Str PRINT_STARTING = u8"Print starting"; + PROGMEM Language_Str PRINT_FINISHED = u8"Print finished"; + PROGMEM Language_Str PRINT_ERROR = u8"Print error"; + + PROGMEM Language_Str INFO_PRINT_COUNT = u8"Print Count"; + PROGMEM Language_Str INFO_COMPLETED_PRINTS = u8"Total Prints"; + PROGMEM Language_Str INFO_PRINT_TIME = u8"Total Print Time"; + PROGMEM Language_Str INFO_PRINT_LONGEST = u8"Longest Print"; + PROGMEM Language_Str INFO_PRINT_FILAMENT = u8"Filament Used"; + + PROGMEM Language_Str PRINTER_HALTED = u8"PRINTER HALTED"; + PROGMEM Language_Str PLEASE_RESET = u8"Please reset"; + + PROGMEM Language_Str COLOR_TOUCH_PANEL = u8"Color Touch Panel"; + #if ENABLED(TOUCH_UI_UTF8_COPYRIGHT) + PROGMEM Language_Str ABOUT_ALEPH_OBJECTS = u8"© 2019 Aleph Objects, Inc.\n\nwww.lulzbot.com"; + #else + PROGMEM Language_Str ABOUT_ALEPH_OBJECTS = u8"(C) 2019 Aleph Objects, Inc.\n\nwww.lulzbot.com"; + #endif + + PROGMEM Language_Str FIRMWARE_FOR_TOOLHEAD = u8"Firmware for toolhead:\n%s\n\n"; + + PROGMEM Language_Str HOME_SENSE = u8"Home Sense"; + PROGMEM Language_Str X_MAX = u8"X Max"; + PROGMEM Language_Str X_MIN = u8"X Min"; + PROGMEM Language_Str Y_MAX = u8"Y Max"; + PROGMEM Language_Str Y_MIN = u8"Y Min"; + PROGMEM Language_Str Z_MAX = u8"Z Max"; + PROGMEM Language_Str Z_MIN = u8"Z Min"; + PROGMEM Language_Str Z_PROBE = u8"Z Probe"; + PROGMEM Language_Str RUNOUT_1 = u8"Runout 1"; + PROGMEM Language_Str RUNOUT_2 = u8"Runout 2"; + PROGMEM Language_Str DISPLAY_MENU = u8"Display"; + PROGMEM Language_Str INTERFACE_SETTINGS = u8"Interface Settings"; + PROGMEM Language_Str MEASURE_AUTOMATICALLY = u8"Measure automatically"; + PROGMEM Language_Str H_OFFSET = u8"H Offset"; + PROGMEM Language_Str V_OFFSET = u8"V Offset"; + PROGMEM Language_Str TOUCH_SCREEN = u8"Touch Screen"; + PROGMEM Language_Str CALIBRATE = u8"Calibrate"; + + PROGMEM Language_Str UNITS_MILLIAMP = u8"mA"; + PROGMEM Language_Str UNITS_MM = u8"mm"; + PROGMEM Language_Str UNITS_MM_S = u8"mm/s"; + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + PROGMEM Language_Str UNITS_MM_S2 = u8"mm/s²"; + #else + PROGMEM Language_Str UNITS_MM_S2 = u8"mm/s^2"; + #endif + PROGMEM Language_Str UNITS_STEP_MM = u8"st/mm"; + PROGMEM Language_Str UNITS_PERCENT = u8"%"; + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + PROGMEM Language_Str UNITS_C = u8"°C"; + #else + PROGMEM Language_Str UNITS_C = u8" C"; + #endif + PROGMEM Language_Str MATERIAL_PLA = u8"PLA"; + PROGMEM Language_Str MATERIAL_ABS = u8"ABS"; + PROGMEM Language_Str MATERIAL_HIGH_TEMP = u8"High"; + PROGMEM Language_Str TEMP_IDLE = u8"idle"; + + PROGMEM Language_Str PRINTING = u8"Printing"; + PROGMEM Language_Str SET_MAXIMUM = u8"Set Maximum"; + PROGMEM Language_Str DETECTION_THRESHOLD = u8"Detection Threshold"; + PROGMEM Language_Str DISTANCE = u8"Distance"; + PROGMEM Language_Str COOLDOWN = u8"Cooldown (All Off)"; + PROGMEM Language_Str PRINT_SPEED = u8"Print Speed"; + PROGMEM Language_Str SPEED = u8"Speed"; + PROGMEM Language_Str LINEAR_ADVANCE = u8"Linear Advance"; + PROGMEM Language_Str LINEAR_ADVANCE_K = u8"K"; + PROGMEM Language_Str LINEAR_ADVANCE_K1 = u8"K E1"; + PROGMEM Language_Str LINEAR_ADVANCE_K2 = u8"K E2"; + PROGMEM Language_Str LINEAR_ADVANCE_K3 = u8"K E3"; + PROGMEM Language_Str LINEAR_ADVANCE_K4 = u8"K E4"; + PROGMEM Language_Str NUDGE_NOZZLE = u8"Nudge Nozzle"; + PROGMEM Language_Str ADJUST_BOTH_NOZZLES = u8"Adjust Both Nozzles"; + PROGMEM Language_Str SHOW_OFFSETS = u8"Show Offsets"; + PROGMEM Language_Str INCREMENT = u8"Increment"; + PROGMEM Language_Str ERASE_FLASH_WARNING = u8"Are you sure? SPI flash will be erased."; + PROGMEM Language_Str ERASING = u8"Erasing..."; + PROGMEM Language_Str ERASED = u8"SPI flash erased"; + PROGMEM Language_Str CALIBRATION_WARNING = u8"For best results, unload the filament and clean the hotend prior to starting calibration. Continue?"; + PROGMEM Language_Str ABORT_WARNING = u8"Are you sure you want to cancel the print?"; + PROGMEM Language_Str EXTRUDER_SELECTION = u8"Extruder Selection"; + PROGMEM Language_Str CURRENT_TEMPERATURE = u8"Current Temp"; + PROGMEM Language_Str REMOVAL_TEMPERATURE = u8"Removal Temp"; + PROGMEM Language_Str HEATING = u8"Heating"; + PROGMEM Language_Str CAUTION = u8"Caution:"; + PROGMEM Language_Str HOT = u8"Hot!"; + PROGMEM Language_Str UNLOAD_FILAMENT = u8"Unload"; + PROGMEM Language_Str LOAD_FILAMENT = u8"Load/Extruder"; + PROGMEM Language_Str MOMENTARY = u8"Momentary"; + PROGMEM Language_Str CONTINUOUS = u8"Continuous"; + PROGMEM Language_Str PLEASE_WAIT = u8"Please wait..."; + PROGMEM Language_Str PRINT_MENU = u8"Print Menu"; + PROGMEM Language_Str FINE_MOTION = u8"Fine motion"; + PROGMEM Language_Str ENABLE_MEDIA = u8"Enable Media"; + PROGMEM Language_Str INSERT_MEDIA = u8"Insert Media..."; + PROGMEM Language_Str LCD_BRIGHTNESS = u8"LCD brightness"; + PROGMEM Language_Str SOUND_VOLUME = u8"Sound volume"; + PROGMEM Language_Str SCREEN_LOCK = u8"Screen lock"; + PROGMEM Language_Str BOOT_SCREEN = u8"Boot screen"; + PROGMEM Language_Str INTERFACE_SOUNDS = u8"Interface Sounds"; + PROGMEM Language_Str CLICK_SOUNDS = u8"Click sounds"; + PROGMEM Language_Str EEPROM_RESTORED = u8"Settings restored from backup"; + PROGMEM Language_Str EEPROM_RESET = u8"Settings restored to default"; + PROGMEM Language_Str EEPROM_SAVED = u8"Settings saved!"; + PROGMEM Language_Str EEPROM_SAVE_PROMPT = u8"Do you wish to save these settings as defaults?"; + PROGMEM Language_Str EEPROM_RESET_WARNING = u8"Are you sure? Customizations will be lost."; + + PROGMEM Language_Str PASSCODE_REJECTED = u8"Wrong passcode!"; + PROGMEM Language_Str PASSCODE_ACCEPTED = u8"Passcode accepted!"; + PROGMEM Language_Str PASSCODE_SELECT = u8"Select Passcode:"; + PROGMEM Language_Str PASSCODE_REQUEST = u8"Enter Passcode:"; + + PROGMEM Language_Str TOUCH_CALIBRATION_START = u8"Release to begin screen calibration"; + PROGMEM Language_Str TOUCH_CALIBRATION_PROMPT = u8"Touch the dots to calibrate"; + + #ifdef LULZBOT_USE_BIOPRINTER_UI + PROGMEM Language_Str MAIN_MENU = u8"Main Menu"; + PROGMEM Language_Str RELEASE_XY_AXIS = u8"Release XY Axis"; + PROGMEM Language_Str LOAD_SYRINGE = u8"Load Syringe"; + PROGMEM Language_Str BED_TEMPERATURE = u8"Bed Temperature"; + PROGMEM Language_Str LOADING_WARNING = u8"About to home to loading position. Ensure the top and the bed of the printer are clear.\n\nContinue?"; + PROGMEM Language_Str HOMING_WARNING = u8"About to re-home plunger and auto-level. Remove syringe prior to proceeding.\n\nContinue?"; + #endif +}; // namespace Language_en diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/language_fr.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/language_fr.h new file mode 100644 index 0000000000..a9ad20d320 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/language_fr.h @@ -0,0 +1,86 @@ +/***************** + * language_fr.h * + *****************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +namespace Language_fr { + using namespace Language_en; // Inherit undefined strings from English + + PROGMEM Language_Str LANGUAGE = u8"Français"; + + PROGMEM Language_Str YES = u8"oui"; + PROGMEM Language_Str NO = u8"non"; + PROGMEM Language_Str BACK = u8"Retour"; + + PROGMEM Language_Str AUTO_HOME = u8"Origine auto"; + //PROGMEM Language_Str CLEAN_NOZZLE = u8"Clean Nozzle"; + PROGMEM Language_Str MOVE_AXIS = u8"Déplacer un axe"; + PROGMEM Language_Str MOTORS_OFF = u8"Arrêter moteurs"; + PROGMEM Language_Str TEMPERATURE = u8"Température"; + PROGMEM Language_Str CHANGE_FILAMENT = u8"Changer filament"; + PROGMEM Language_Str ADVANCED_SETTINGS = u8"Config. avancée"; + PROGMEM Language_Str ABOUT_PRINTER = u8"Infos imprimante"; + PROGMEM Language_Str PRINTER_STATISTICS = u8"Stats. imprimante"; + + PROGMEM Language_Str ZPROBE_ZOFFSET = u8"Décalage Z"; + PROGMEM Language_Str STEPS_PER_MM = u8"Pas/mm"; + PROGMEM Language_Str TOOL_OFFSETS = u8"Offsets Outil"; + PROGMEM Language_Str VELOCITY = u8"Vélocité"; + PROGMEM Language_Str ACCELERATION = u8"Accélération"; + PROGMEM Language_Str ACCEL_PRINTING = u8"A impr."; + PROGMEM Language_Str ACCEL_TRAVEL = u8"A dépl."; + PROGMEM Language_Str ACCEL_RETRACT = u8"A retrait"; + PROGMEM Language_Str JUNC_DEVIATION = u8"Déviat. jonct."; + //PROGMEM Language_Str BACKLASH = u8"Backlash"; + PROGMEM Language_Str SMOOTHING = u8"Lissage"; + PROGMEM Language_Str MOTOR_CURRENT = u8"Courant"; + PROGMEM Language_Str ENDSTOPS = u8"Butées"; + PROGMEM Language_Str SOFT_ENDSTOPS = u8"Butées SW"; + PROGMEM Language_Str RESTORE_DEFAULTS = u8"Restaurer défauts"; + + + PROGMEM Language_Str HOTEND = u8"Buse"; + PROGMEM Language_Str HOTEND1 = u8"Buse 1"; + PROGMEM Language_Str HOTEND2 = u8"Buse 2"; + PROGMEM Language_Str HOTEND3 = u8"Buse 3"; + PROGMEM Language_Str HOTEND4 = u8"Buse 4"; + PROGMEM Language_Str BED = u8"Lit"; + PROGMEM Language_Str AXIS_ALL = u8"Tous"; + PROGMEM Language_Str HOME = u8"Origine"; + + PROGMEM Language_Str FAN_SPEED = u8"Vitesse ventil."; + PROGMEM Language_Str RUNOUT_SENSOR = u8"Capteur fil."; + + PROGMEM Language_Str PRINT_FILE = u8"Imprimer"; + + PROGMEM Language_Str RESUME_PRINT = u8"Reprendre impr."; + PROGMEM Language_Str PAUSE_PRINT = u8"Pause impression"; + PROGMEM Language_Str STOP_PRINT = u8"Arrêter impr."; + + PROGMEM Language_Str INFO_PRINT_COUNT = u8"Nbre impressions"; + PROGMEM Language_Str INFO_COMPLETED_PRINTS = u8"Terminées"; + PROGMEM Language_Str INFO_PRINT_TIME = u8"Tps impr. total"; + PROGMEM Language_Str INFO_PRINT_LONGEST = u8"Impr. la + longue"; + PROGMEM Language_Str INFO_PRINT_FILAMENT = u8"Total filament"; + + PROGMEM Language_Str PRINTER_HALTED = u8"IMPR. STOPPÉE"; + PROGMEM Language_Str PLEASE_RESET = u8"Redémarrer SVP"; +}; // namespace Language_fr diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/languages.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/languages.h new file mode 100644 index 0000000000..03edc55157 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/language/languages.h @@ -0,0 +1,26 @@ +/*************** + * languages.h * + ***************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2019 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#include "language_en.h" +#include "language_de.h" +#include "language_fr.h" diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/about_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/about_screen.cpp index f27d1401fc..b062446cab 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/about_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/about_screen.cpp @@ -49,22 +49,33 @@ void AboutScreen::onRedraw(draw_mode_t) { #ifdef LULZBOT_LCD_MACHINE_NAME LULZBOT_LCD_MACHINE_NAME #else - "Color Touch Panel" + GET_TEXTF(COLOR_TOUCH_PANEL) #endif ), OPT_CENTER, font_xlarge); + #ifdef LULZBOT_LCD_TOOLHEAD_NAME + char about_str[ + strlen_P(GET_TEXT(FIRMWARE_FOR_TOOLHEAD)) + + strlen_P(LULZBOT_LCD_TOOLHEAD_NAME) + + strlen_P(GET_TEXT(ABOUT_ALEPH_OBJECTS)) + 1]; + + sprintf_P(about_str, GET_TEXT(FIRMWARE_FOR_TOOLHEAD), LULZBOT_LCD_TOOLHEAD_NAME); + strcat_P(about_str, GET_TEXT(ABOUT_ALEPH_OBJECTS)); + #endif + cmd.tag(2); - draw_text_box(cmd, BTN_POS(1,3), BTN_SIZE(4,3), F( + draw_text_box(cmd, BTN_POS(1,3), BTN_SIZE(4,3), #ifdef LULZBOT_LCD_TOOLHEAD_NAME - "Firmware for toolhead:\n" LULZBOT_LCD_TOOLHEAD_NAME "\n\n" + about_str + #else + GET_TEXTF(ABOUT_ALEPH_OBJECTS) #endif - "(C) 2019 Aleph Objects, Inc.\n\nwww.lulzbot.com" - ), OPT_CENTER, font_medium); + , OPT_CENTER, font_medium); cmd.tag(0); draw_text_box(cmd, BTN_POS(1,6), BTN_SIZE(4,2), progmem_str(getFirmwareName_str()), OPT_CENTER, font_medium); - cmd.font(font_medium).colors(action_btn).tag(1).button(BTN_POS(2,8), BTN_SIZE(2,1), F("Okay")); + cmd.font(font_medium).colors(action_btn).tag(1).button(BTN_POS(2,8), BTN_SIZE(2,1), GET_TEXTF(OKAY)); } bool AboutScreen::onTouchEnd(uint8_t tag) { diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/advanced_settings_menu.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/advanced_settings_menu.cpp index 18159a5bdb..f4aad3b593 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/advanced_settings_menu.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/advanced_settings_menu.cpp @@ -49,52 +49,52 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { #else .enabled(0) #endif - .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), F("Z Offset ")) + .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXTF(ZPROBE_ZOFFSET)) .enabled(1) - .tag(3) .button( BTN_POS(2,1), BTN_SIZE(1,1), F("Steps/mm")) + .tag(3) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXTF(STEPS_PER_MM)) #if HAS_TRINAMIC .enabled(1) #else .enabled(0) #endif - .tag(13).button( BTN_POS(1,5), BTN_SIZE(1,1), F("Motor mA")) + .tag(13).button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXTF(MOTOR_CURRENT)) #if HAS_TRINAMIC .enabled(1) #else .enabled(0) #endif - .tag(14).button( BTN_POS(1,4), BTN_SIZE(1,1), F("Bump Sense")) + .tag(14).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXTF(HOME_SENSE)) #if HOTENDS > 1 .enabled(1) #else .enabled(0) #endif - .tag(4) .button( BTN_POS(1,2), BTN_SIZE(1,1), F("Nozzle Offset")) - #if ENABLED(LIN_ADVANCE) || ENABLED(FILAMENT_RUNOUT_SENSOR) + .tag(4) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXTF(TOOL_OFFSETS)) + #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) .enabled(1) #else .enabled(0) #endif - .tag(11).button( BTN_POS(1,3), BTN_SIZE(1,1), F("Filament")) - .tag(12).button( BTN_POS(1,6), BTN_SIZE(1,1), F("Endstops")) - .tag(15).button( BTN_POS(2,6), BTN_SIZE(1,1), F("Display")) - .tag(9) .button( BTN_POS(1,7), BTN_SIZE(2,1), F("Interface Settings")) - .tag(10).button( BTN_POS(1,8), BTN_SIZE(2,1), F("Restore Factory Defaults")) - .tag(5) .button( BTN_POS(2,2), BTN_SIZE(1,1), F("Velocity ")) - .tag(6) .button( BTN_POS(2,3), BTN_SIZE(1,1), F("Acceleration")) + .tag(11).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXTF(FILAMENT)) + .tag(12).button( BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXTF(ENDSTOPS)) + .tag(15).button( BTN_POS(2,6), BTN_SIZE(1,1), GET_TEXTF(DISPLAY_MENU)) + .tag(9) .button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXTF(INTERFACE_SETTINGS)) + .tag(10).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXTF(RESTORE_DEFAULTS)) + .tag(5) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXTF(VELOCITY)) + .tag(6) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXTF(ACCELERATION)) #if ENABLED(JUNCTION_DEVIATION) - .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), F("Junc Dev")) + .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXTF(JUNC_DEVIATION)) #else - .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), F("Jerk")) + .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXTF(JERK)) #endif #if ENABLED(BACKLASH_GCODE) .enabled(1) #else .enabled(0) #endif - .tag(8).button( BTN_POS(2,5), BTN_SIZE(1,1), F("Backlash")) + .tag(8).button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXTF(BACKLASH)) .colors(action_btn) - .tag(1) .button( BTN_POS(1,9), BTN_SIZE(2,1), F("Back")); + .tag(1) .button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXTF(BACK)); #undef GRID_COLS #undef GRID_ROWS #else @@ -105,47 +105,47 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { #else .enabled(0) #endif - .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,2), F("Z Offset ")) + .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,2), GET_TEXTF(ZPROBE_ZOFFSET)) .enabled(1) - .tag(3) .button( BTN_POS(2,1), BTN_SIZE(1,1), F("Steps/mm")) + .tag(3) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXTF(STEPS_PER_MM)) #if HAS_TRINAMIC .enabled(1) #else .enabled(0) #endif - .tag(13).button( BTN_POS(3,1), BTN_SIZE(1,1), F("Motor mA")) + .tag(13).button( BTN_POS(3,1), BTN_SIZE(1,1), GET_TEXTF(MOTOR_CURRENT)) #if HAS_TRINAMIC .enabled(1) #else .enabled(0) #endif - .tag(14).button( BTN_POS(3,2), BTN_SIZE(1,1), F("Bump Sense")) + .tag(14).button( BTN_POS(3,2), BTN_SIZE(1,1), GET_TEXTF(HOME_SENSE)) #if ENABLED(BACKLASH_GCODE) .enabled(1) #else .enabled(0) #endif - .tag(8).button( BTN_POS(3,3), BTN_SIZE(1,1), F("Backlash")) + .tag(8).button( BTN_POS(3,3), BTN_SIZE(1,1), GET_TEXTF(BACKLASH)) #if HOTENDS > 1 .enabled(1) #else .enabled(0) #endif - .tag(4) .button( BTN_POS(1,3), BTN_SIZE(1,1), F("Nozzle Offsets")) - .tag(12).button( BTN_POS(3,4), BTN_SIZE(1,1), F("Endstops")) - .tag(5) .button( BTN_POS(2,2), BTN_SIZE(1,1), F("Velocity ")) - .tag(6) .button( BTN_POS(2,3), BTN_SIZE(1,1), F("Acceleration")) + .tag(4) .button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXTF(TOOL_OFFSETS)) + .tag(12).button( BTN_POS(3,4), BTN_SIZE(1,1), GET_TEXTF(ENDSTOPS)) + .tag(5) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXTF(VELOCITY)) + .tag(6) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXTF(ACCELERATION)) #if ENABLED(JUNCTION_DEVIATION) - .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), F("Junc Dev")) + .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXTF(JUNC_DEVIATION)) #else - .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), F("Jerk")) + .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXTF(JERK)) #endif - .tag(11).button( BTN_POS(1,4), BTN_SIZE(1,1), F("Filament")) - .tag(15).button( BTN_POS(3,5), BTN_SIZE(1,1), F("Display")) - .tag(9) .button( BTN_POS(1,5), BTN_SIZE(2,1), F("Interface Settings")) - .tag(10).button( BTN_POS(1,6), BTN_SIZE(2,1), F("Restore Defaults")) + .tag(11).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXTF(FILAMENT)) + .tag(15).button( BTN_POS(3,5), BTN_SIZE(1,1), GET_TEXTF(DISPLAY_MENU)) + .tag(9) .button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXTF(INTERFACE_SETTINGS)) + .tag(10).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXTF(RESTORE_DEFAULTS)) .colors(action_btn) - .tag(1) .button( BTN_POS(3,6), BTN_SIZE(1,1), F("Back")); + .tag(1) .button( BTN_POS(3,6), BTN_SIZE(1,1), GET_TEXTF(BACK)); #endif } } @@ -174,7 +174,7 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) { #endif case 9: GOTO_SCREEN(InterfaceSettingsScreen); LockScreen::check_passcode(); break; case 10: GOTO_SCREEN(RestoreFailsafeDialogBox); LockScreen::check_passcode(); break; - #if ENABLED(LIN_ADVANCE) || ENABLED(FILAMENT_RUNOUT_SENSOR) + #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) case 11: GOTO_SCREEN(FilamentMenu); break; #endif case 12: GOTO_SCREEN(EndstopStatesScreen); break; diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/backlash_compensation_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/backlash_compensation_screen.cpp index a09b84b1b0..925a0f2f5a 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/backlash_compensation_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/backlash_compensation_screen.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(LULZBOT_TOUCH_UI) && ENABLED(BACKLASH_GCODE) +#if BOTH(LULZBOT_TOUCH_UI, BACKLASH_GCODE) #include "screens.h" @@ -32,17 +32,17 @@ using namespace Theme; void BacklashCompensationScreen::onRedraw(draw_mode_t what) { widgets_t w(what); - w.precision(2).units(PSTR("mm")); - w.heading( PSTR("Axis Backlash")); - w.color(x_axis).adjuster(2, PSTR("X:"), getAxisBacklash_mm(X)); - w.color(y_axis).adjuster(4, PSTR("Y:"), getAxisBacklash_mm(Y)); - w.color(z_axis).adjuster(6, PSTR("Z:"), getAxisBacklash_mm(Z)); + w.precision(2).units( GET_TEXTF(UNITS_MM)); + w.heading( GET_TEXTF(BACKLASH)); + w.color(x_axis).adjuster(2, GET_TEXTF(AXIS_X), getAxisBacklash_mm(X)); + w.color(y_axis).adjuster(4, GET_TEXTF(AXIS_Y), getAxisBacklash_mm(Y)); + w.color(z_axis).adjuster(6, GET_TEXTF(AXIS_Z), getAxisBacklash_mm(Z)); #if ENABLED(CALIBRATION_GCODE) - w.button(12, PSTR("Measure automatically")); + w.button(12, GET_TEXTF(MEASURE_AUTOMATICALLY)); #endif - w.color(other).adjuster(8, PSTR("Smoothing:"), getBacklashSmoothing_mm()); - w.precision(0).units(PSTR("%")) - .adjuster(10, PSTR("Correction:"), getBacklashCorrection_percent()); + w.color(other).adjuster(8, GET_TEXTF(SMOOTHING), getBacklashSmoothing_mm()); + w.precision(0).units(GET_TEXTF(UNITS_PERCENT)) + .adjuster(10, GET_TEXTF(CORRECTION), getBacklashCorrection_percent()); w.precision(2).increments(); } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/base_numeric_adjustment_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/base_numeric_adjustment_screen.cpp index 2fb5c98cba..480315620c 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/base_numeric_adjustment_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/base_numeric_adjustment_screen.cpp @@ -33,32 +33,82 @@ using namespace Theme; #ifdef TOUCH_UI_PORTRAIT #define GRID_COLS 13 #define GRID_ROWS 10 + #define LAYOUT_FONT font_small #else #define GRID_COLS 18 #define GRID_ROWS 7 + #define LAYOUT_FONT font_medium #endif BaseNumericAdjustmentScreen::widgets_t::widgets_t(draw_mode_t what) : _what(what) { + CommandProcessor cmd; + if (what & BACKGROUND) { - CommandProcessor cmd; cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)); + .cmd(CLEAR(true,true,true)) + .colors(normal_btn) + .cmd(COLOR_RGB(bg_text_enabled)); } - if (what & FOREGROUND) { - CommandProcessor cmd; - cmd.font(font_medium) - .colors(action_btn) + cmd.font(font_medium); + _button(cmd, 1, #ifdef TOUCH_UI_PORTRAIT - .tag(1).button( BTN_POS(1,10), BTN_SIZE(13,1), F("Back")) + BTN_POS(1,10), BTN_SIZE(13,1), #else - .tag(1).button( BTN_POS(15,7), BTN_SIZE(4,1), F("Back")) + BTN_POS(15,7), BTN_SIZE(4,1), #endif - .colors(normal_btn); - } + GET_TEXTF(BACK), true, true + ); _line = 1; - _units = PSTR(""); + _units = F(""); +} + +/** + * Speed optimization for changing button style. + */ +void BaseNumericAdjustmentScreen::widgets_t::_button_style(CommandProcessor &cmd, BaseNumericAdjustmentScreen::widgets_t::style_t style) { + if (_style != style) { + const btn_colors *old_colors = &normal_btn; + const btn_colors *new_colors = &normal_btn; + + switch(_style) { + case BTN_ACTION: old_colors = &action_btn; break; + case BTN_TOGGLE: old_colors = &ui_toggle; break; + case BTN_DISABLED: old_colors = &disabled_btn; break; + default: break; + } + switch(style) { + case BTN_ACTION: new_colors = &action_btn; break; + case BTN_TOGGLE: new_colors = &ui_toggle; break; + case BTN_DISABLED: new_colors = &disabled_btn; break; + default: break; + } + + const bool rgb_changed = old_colors->rgb != new_colors->rgb; + const bool grad_changed = old_colors->grad != new_colors->grad; + const bool fg_changed = (old_colors->fg != new_colors->fg) || (_style == TEXT_AREA); + const bool bg_changed = old_colors->bg != new_colors->bg; + + if (rgb_changed) cmd.cmd(COLOR_RGB(new_colors->rgb)); + if (grad_changed) cmd.gradcolor(new_colors->grad); + if (fg_changed) cmd.fgcolor(new_colors->fg); + if (bg_changed) cmd.bgcolor(new_colors->bg); + + _style = style; + } +} + +/** + * Speed optimization for drawing buttons. Draw all unpressed buttons in the + * background layer and draw only the pressed button in the foreground layer. + */ +void BaseNumericAdjustmentScreen::widgets_t::_button(CommandProcessor &cmd, uint8_t tag, int16_t x, int16_t y, int16_t w, int16_t h, progmem_str text, bool enabled, bool highlight) { + if (_what & BACKGROUND) enabled = true; + if ((_what & BACKGROUND) || buttonIsPressed(tag) || highlight || !enabled) { + _button_style(cmd, (!enabled) ? BTN_DISABLED : (highlight ? BTN_ACTION : BTN_NORMAL)); + cmd.tag(enabled ? tag : 0).button(x, y, w, h, text); + } } BaseNumericAdjustmentScreen::widgets_t &BaseNumericAdjustmentScreen::widgets_t::precision(uint8_t decimals, precision_default_t initial) { @@ -69,15 +119,18 @@ BaseNumericAdjustmentScreen::widgets_t &BaseNumericAdjustmentScreen::widgets_t:: return *this; } -void BaseNumericAdjustmentScreen::widgets_t::heading(const char *label) { - CommandProcessor cmd; - cmd.font(font_medium).cmd(COLOR_RGB(bg_text_enabled)); +void BaseNumericAdjustmentScreen::widgets_t::heading(progmem_str label) { if (_what & BACKGROUND) { - #ifdef TOUCH_UI_PORTRAIT - cmd.tag(0).fgcolor(bg_color).button( BTN_POS(1, _line), BTN_SIZE(12,1), progmem_str(label), OPT_FLAT); - #else - cmd.tag(0).fgcolor(bg_color).button( BTN_POS(5, _line), BTN_SIZE(8,1), progmem_str(label), OPT_FLAT); - #endif + CommandProcessor cmd; + cmd.font(font_medium) + .text( + #ifdef TOUCH_UI_PORTRAIT + BTN_POS(1, _line), BTN_SIZE(12,1), + #else + BTN_POS(5, _line), BTN_SIZE(8,1), + #endif + label + ); } _line++; @@ -93,8 +146,7 @@ void BaseNumericAdjustmentScreen::widgets_t::heading(const char *label) { #endif #endif -void BaseNumericAdjustmentScreen::widgets_t::_draw_increment_btn(uint8_t, const uint8_t tag) { - CommandProcessor cmd; +void BaseNumericAdjustmentScreen::widgets_t::_draw_increment_btn(CommandProcessor &cmd, uint8_t, const uint8_t tag) { const char *label = PSTR("?"); uint8_t pos; uint8_t & increment = screen_data.BaseNumericAdjustmentScreen.increment; @@ -112,74 +164,72 @@ void BaseNumericAdjustmentScreen::widgets_t::_draw_increment_btn(uint8_t, const default: label = PSTR("100" ); pos = _decimals + 2; break; } - cmd.tag(tag) - .colors(increment == tag ? action_btn : normal_btn) - #ifdef TOUCH_UI_PORTRAIT - .font(font_small); - #else - .font(font_medium); - #endif + const bool highlight = (_what & FOREGROUND) && (increment == tag); + switch (pos) { #ifdef TOUCH_UI_PORTRAIT - case 0: cmd.button( BTN_POS(5,_line), BTN_SIZE(2,1), progmem_str(label)); break; - case 1: cmd.button( BTN_POS(7,_line), BTN_SIZE(2,1), progmem_str(label)); break; - case 2: cmd.button( BTN_POS(9,_line), BTN_SIZE(2,1), progmem_str(label)); break; + case 0: _button(cmd, tag, BTN_POS(5,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break; + case 1: _button(cmd, tag, BTN_POS(7,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break; + case 2: _button(cmd, tag, BTN_POS(9,_line), BTN_SIZE(2,1), progmem_str(label), true, highlight); break; #else - case 0: cmd.button( BTN_POS(15,2), BTN_SIZE(4,1), progmem_str(label)); break; - case 1: cmd.button( BTN_POS(15,3), BTN_SIZE(4,1), progmem_str(label)); break; - case 2: cmd.button( BTN_POS(15,4), BTN_SIZE(4,1), progmem_str(label)); break; + case 0: _button(cmd, tag, BTN_POS(15,2), BTN_SIZE(4,1), progmem_str(label), true, highlight); break; + case 1: _button(cmd, tag, BTN_POS(15,3), BTN_SIZE(4,1), progmem_str(label), true, highlight); break; + case 2: _button(cmd, tag, BTN_POS(15,4), BTN_SIZE(4,1), progmem_str(label), true, highlight); break; #endif } - cmd.colors(normal_btn); } - void BaseNumericAdjustmentScreen::widgets_t::increments() { + CommandProcessor cmd; + + cmd.font(LAYOUT_FONT); + if (_what & BACKGROUND) { - CommandProcessor cmd; - cmd.fgcolor(bg_color) - .tag(0) - #ifdef TOUCH_UI_PORTRAIT - .font(font_small).button( BTN_POS(1, _line), BTN_SIZE(4,1), F("Increment:"), OPT_FLAT); - #else - .font(font_medium).button( BTN_POS(15,1), BTN_SIZE(4,1), F("Increment:"), OPT_FLAT); - #endif + cmd.text( + #ifdef TOUCH_UI_PORTRAIT + BTN_POS(1, _line), BTN_SIZE(4,1), + #else + BTN_POS(15, 1), BTN_SIZE(4,1), + #endif + GET_TEXTF(INCREMENT) + ); } - if (_what & FOREGROUND) { - _draw_increment_btn(_line+1, 245 - _decimals); - _draw_increment_btn(_line+1, 244 - _decimals); - _draw_increment_btn(_line+1, 243 - _decimals); - } + _draw_increment_btn(cmd, _line+1, 245 - _decimals); + _draw_increment_btn(cmd, _line+1, 244 - _decimals); + _draw_increment_btn(cmd, _line+1, 243 - _decimals); #ifdef TOUCH_UI_PORTRAIT - _line++; + _line++; #endif } -void BaseNumericAdjustmentScreen::widgets_t::adjuster_sram_val(uint8_t tag, const char *label, const char *value, bool is_enabled) { +void BaseNumericAdjustmentScreen::widgets_t::adjuster_sram_val(uint8_t tag, progmem_str label, const char *value, bool is_enabled) { CommandProcessor cmd; if (_what & BACKGROUND) { - cmd.enabled(1) + _button_style(cmd, TEXT_AREA); + cmd.tag(0) .font(font_small) - .fgcolor(_color) .tag(0).button( BTN_POS(5,_line), BTN_SIZE(5,1), F(""), OPT_FLAT) - .cmd(COLOR_RGB(bg_text_enabled)) - .fgcolor(bg_color) .tag(0).button( BTN_POS(1,_line), BTN_SIZE(4,1), (progmem_str) label, OPT_FLAT); + .text( BTN_POS(1,_line), BTN_SIZE(4,1), label) + .fgcolor(_color).button( BTN_POS(5,_line), BTN_SIZE(5,1), F(""), OPT_FLAT); } - if (_what & FOREGROUND) { - cmd.colors(normal_btn) - .font(font_medium) - .tag(is_enabled ? tag : 0).enabled(is_enabled).button( BTN_POS(10,_line), BTN_SIZE(2,1), F("-")) - .tag(is_enabled ? tag+1 : 0).enabled(is_enabled).button( BTN_POS(12,_line), BTN_SIZE(2,1), F("+")) - .tag(0).font(font_small) .text ( BTN_POS(5,_line), BTN_SIZE(5,1), is_enabled ? value : "-"); + cmd.font(font_medium); + _button(cmd, tag, BTN_POS(10,_line), BTN_SIZE(2,1), F("-"), is_enabled); + _button(cmd, tag + 1, BTN_POS(12,_line), BTN_SIZE(2,1), F("+"), is_enabled); + + if ((_what & FOREGROUND) && is_enabled) { + _button_style(cmd, BTN_NORMAL); + cmd.tag(0) + .font(font_small) + .text(BTN_POS(5,_line), BTN_SIZE(5,1), value); } _line++; } -void BaseNumericAdjustmentScreen::widgets_t::adjuster(uint8_t tag, const char *label, const char *value, bool is_enabled) { +void BaseNumericAdjustmentScreen::widgets_t::adjuster(uint8_t tag, progmem_str label, const char *value, bool is_enabled) { if (_what & BACKGROUND) { adjuster_sram_val(tag, label, nullptr); } @@ -191,7 +241,7 @@ void BaseNumericAdjustmentScreen::widgets_t::adjuster(uint8_t tag, const char *l } } -void BaseNumericAdjustmentScreen::widgets_t::adjuster(uint8_t tag, const char *label, float value, bool is_enabled) { +void BaseNumericAdjustmentScreen::widgets_t::adjuster(uint8_t tag, progmem_str label, float value, bool is_enabled) { if (_what & BACKGROUND) { adjuster_sram_val(tag, label, nullptr); } @@ -205,110 +255,90 @@ void BaseNumericAdjustmentScreen::widgets_t::adjuster(uint8_t tag, const char *l } } -void BaseNumericAdjustmentScreen::widgets_t::button(uint8_t tag, const char *label, bool is_enabled) { - if (_what & FOREGROUND) { - CommandProcessor cmd; - cmd.colors(normal_btn) - .tag(is_enabled ? tag : 0) - .enabled(is_enabled) - #ifdef TOUCH_UI_PORTRAIT - .font(font_small) - #else - .font(font_medium) - #endif - .button(BTN_POS(5,_line), BTN_SIZE(9,1), progmem_str(label)); - } +void BaseNumericAdjustmentScreen::widgets_t::button(uint8_t tag, progmem_str label, bool is_enabled) { + CommandProcessor cmd; + cmd.font(LAYOUT_FONT); + _button(cmd, tag, BTN_POS(5,_line), BTN_SIZE(9,1), label, is_enabled); _line++; } -void BaseNumericAdjustmentScreen::widgets_t::text_field(uint8_t tag, const char *label, const char *value, bool is_enabled) { +void BaseNumericAdjustmentScreen::widgets_t::text_field(uint8_t tag, progmem_str label, const char *value, bool is_enabled) { CommandProcessor cmd; if (_what & BACKGROUND) { + _button_style(cmd, TEXT_AREA); cmd.enabled(1) - .font(font_small) - .cmd(COLOR_RGB(bg_text_enabled)) - .fgcolor(_color).tag(0).button( BTN_POS(5,_line), BTN_SIZE(9,1), F(""), OPT_FLAT) - .fgcolor(bg_color) .tag(0).button( BTN_POS(1,_line), BTN_SIZE(4,1), (progmem_str) label, OPT_FLAT); - } - - if (_what & FOREGROUND) { - cmd.colors(normal_btn) - .font(font_medium) - .tag(tag).font(font_small).text ( BTN_POS(5,_line), BTN_SIZE(9,1), is_enabled ? value : "-"); - } - - _line++; -} - -void BaseNumericAdjustmentScreen::widgets_t::two_buttons(uint8_t tag1, const char *label1, uint8_t tag2, const char *label2, bool is_enabled) { - if (_what & FOREGROUND) { - CommandProcessor cmd; - cmd.enabled(is_enabled) - #ifdef TOUCH_UI_PORTRAIT - .font(font_small) - #else - .font(font_medium) - #endif - .tag(is_enabled ? tag1: 0).button(BTN_POS(5,_line), BTN_SIZE(4.5,1), progmem_str(label1)) - .tag(is_enabled ? tag2: 0).button(BTN_POS(9.5,_line), BTN_SIZE(4.5,1), progmem_str(label2)); - } - - _line++; -} - -void BaseNumericAdjustmentScreen::widgets_t::toggle(uint8_t tag, const char *label, const char *text, bool value, bool is_enabled) { - if (_what & BACKGROUND) { - CommandProcessor cmd; - cmd.fgcolor(bg_color) .tag(0) .font(font_small) - #ifdef TOUCH_UI_PORTRAIT - .button( BTN_POS(1, _line), BTN_SIZE( 8,1), progmem_str(label), OPT_FLAT); - #else - .button( BTN_POS(1, _line), BTN_SIZE(10,1), progmem_str(label), OPT_FLAT); - #endif + .text( BTN_POS(1,_line), BTN_SIZE(4,1), label) + .fgcolor(_color) + .tag(tag) + .button( BTN_POS(5,_line), BTN_SIZE(9,1), F(""), OPT_FLAT); } if (_what & FOREGROUND) { - CommandProcessor cmd; + cmd.font(font_small).text( BTN_POS(5,_line), BTN_SIZE(9,1), is_enabled ? value : "-"); + } + + _line++; +} + +void BaseNumericAdjustmentScreen::widgets_t::two_buttons(uint8_t tag1, progmem_str label1, uint8_t tag2, progmem_str label2, bool is_enabled) { + CommandProcessor cmd; + cmd.font(LAYOUT_FONT); + _button(cmd, tag1, BTN_POS(5,_line), BTN_SIZE(4.5,1), label1, is_enabled); + _button(cmd, tag2, BTN_POS(9.5,_line), BTN_SIZE(4.5,1), label2, is_enabled); + + _line++; +} + +void BaseNumericAdjustmentScreen::widgets_t::toggle(uint8_t tag, progmem_str label, bool value, bool is_enabled) { + CommandProcessor cmd; + + if (_what & BACKGROUND) { + cmd.font(font_small) + .text( + #ifdef TOUCH_UI_PORTRAIT + BTN_POS(1, _line), BTN_SIZE( 8,1), + #else + BTN_POS(1, _line), BTN_SIZE(10,1), + #endif + label + ); + } + + if (_what & FOREGROUND) { + _button_style(cmd, BTN_TOGGLE); cmd.tag(is_enabled ? tag : 0) .enabled(is_enabled) .font(font_small) - .colors(ui_toggle) - #ifdef TOUCH_UI_PORTRAIT - .toggle(BTN_POS( 9,_line), BTN_SIZE(5,1), progmem_str(text), value); - #else - .toggle(BTN_POS(10,_line), BTN_SIZE(4,1), progmem_str(text), value); - #endif + .toggle2( + #ifdef TOUCH_UI_PORTRAIT + BTN_POS( 9,_line), BTN_SIZE(5,1), + #else + BTN_POS(10,_line), BTN_SIZE(4,1), + #endif + GET_TEXTF(NO), GET_TEXTF(YES), value + ); } _line++; } void BaseNumericAdjustmentScreen::widgets_t::home_buttons(uint8_t tag) { + CommandProcessor cmd; + if (_what & BACKGROUND) { - CommandProcessor cmd; - cmd.fgcolor(bg_color) - .tag(0) - .font(font_small) - .button( BTN_POS(1, _line), BTN_SIZE(4,1), F("Home:"), OPT_FLAT); + cmd.font(font_small) + .text(BTN_POS(1, _line), BTN_SIZE(4,1), GET_TEXTF(HOME)); } - if (_what & FOREGROUND) { - CommandProcessor cmd; - cmd - #ifdef TOUCH_UI_PORTRAIT - .font(font_small) - #else - .font(font_medium) - #endif - .tag(tag+0).button(BTN_POS(5,_line), BTN_SIZE(2,1), F("X")) - .tag(tag+1).button(BTN_POS(7,_line), BTN_SIZE(2,1), F("Y")) - .tag(tag+2).button(BTN_POS(9,_line), BTN_SIZE(2,1), F("Z")) - .tag(tag+3).button(BTN_POS(11,_line), BTN_SIZE(3,1), F("All")); - } + cmd.font(LAYOUT_FONT); + _button(cmd, tag+0, BTN_POS(5,_line), BTN_SIZE(2,1), GET_TEXTF(AXIS_X)); + _button(cmd, tag+1, BTN_POS(7,_line), BTN_SIZE(2,1), GET_TEXTF(AXIS_Y)); + _button(cmd, tag+2, BTN_POS(9,_line), BTN_SIZE(2,1), GET_TEXTF(AXIS_Z)); + _button(cmd, tag+3, BTN_POS(11,_line), BTN_SIZE(3,1), GET_TEXTF(AXIS_ALL)); _line++; } @@ -316,11 +346,13 @@ void BaseNumericAdjustmentScreen::widgets_t::home_buttons(uint8_t tag) { void BaseNumericAdjustmentScreen::onEntry() { screen_data.BaseNumericAdjustmentScreen.increment = 0; // This will force the increment to be picked while drawing. BaseScreen::onEntry(); + CommandProcessor cmd; + cmd.set_button_style_callback(nullptr); } bool BaseNumericAdjustmentScreen::onTouchEnd(uint8_t tag) { switch (tag) { - case 1: GOTO_PREVIOUS(); return true; + case 1: GOTO_PREVIOUS(); return true; case 240 ... 245: screen_data.BaseNumericAdjustmentScreen.increment = tag; break; default: return current_screen.onTouchHeld(tag); } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/base_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/base_screen.cpp index 3dc356c530..c0c7212a22 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/base_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/base_screen.cpp @@ -32,9 +32,14 @@ using namespace Theme; void BaseScreen::onEntry() { CommandProcessor cmd; cmd.set_button_style_callback(buttonStyleCallback); + reset_menu_timeout(); UIScreen::onEntry(); } +bool BaseScreen::buttonIsPressed(uint8_t tag) { + return tag != 0 && EventLoop::get_pressed_tag() == tag; +} + bool BaseScreen::buttonStyleCallback(CommandProcessor &cmd, uint8_t tag, uint8_t &style, uint16_t &options, bool post) { if (post) { cmd.colors(normal_btn); @@ -47,7 +52,7 @@ bool BaseScreen::buttonStyleCallback(CommandProcessor &cmd, uint8_t tag, uint8_t } #endif - if (tag != 0 && EventLoop::get_pressed_tag() == tag) { + if (buttonIsPressed(tag)) { options = OPT_FLAT; } @@ -62,9 +67,11 @@ bool BaseScreen::buttonStyleCallback(CommandProcessor &cmd, uint8_t tag, uint8_t void BaseScreen::onIdle() { #ifdef LCD_TIMEOUT_TO_STATUS - const uint32_t elapsed = millis() - last_interaction; - if (elapsed > uint32_t(LCD_TIMEOUT_TO_STATUS)) { + if ((millis() - last_interaction) > LCD_TIMEOUT_TO_STATUS) { reset_menu_timeout(); + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_MSG("Returning to status due to menu timeout"); + #endif GOTO_SCREEN(StatusScreen); } #endif diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_advanced_settings.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_advanced_settings.cpp index 1fddbd6541..1355010c0b 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_advanced_settings.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_advanced_settings.cpp @@ -43,52 +43,52 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { #define GRID_ROWS 9 #define GRID_COLS 2 - .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), F("Display")) + .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXTF(DISPLAY_MENU)) #if HAS_TRINAMIC .enabled(1) #else .enabled(0) #endif - .tag(3) .button( BTN_POS(1,2), BTN_SIZE(1,1), F("Motor mA")) + .tag(3) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXTF(MOTOR_CURRENT)) #if HAS_TRINAMIC .enabled(1) #else .enabled(0) #endif - .tag(4) .button( BTN_POS(1,3), BTN_SIZE(1,1), F("Bump Sense")) - .tag(5) .button( BTN_POS(1,4), BTN_SIZE(1,1), F("Endstops")) + .tag(4) .button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXTF(HOME_SENSE)) + .tag(5) .button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXTF(ENDSTOPS)) #if HOTENDS > 1 .enabled(1) #else .enabled(0) #endif - .tag(6) .button( BTN_POS(1,5), BTN_SIZE(1,1), F("Nozzle Offset")) + .tag(6) .button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXTF(TOOL_OFFSETS)) - .tag(7) .button( BTN_POS(2,1), BTN_SIZE(1,1), F("Steps/mm")) - .tag(8) .button( BTN_POS(2,2), BTN_SIZE(1,1), F("Velocity ")) - .tag(9) .button( BTN_POS(2,3), BTN_SIZE(1,1), F("Acceleration")) + .tag(7) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXTF(STEPS_PER_MM)) + .tag(8) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXTF(VELOCITY)) + .tag(9) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXTF(ACCELERATION)) #if ENABLED(JUNCTION_DEVIATION) - .tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), F("Junc Dev")) + .tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXTF(JUNC_DEVIATION)) #else - .tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), F("Jerk")) + .tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXTF(JERK)) #endif #if ENABLED(BACKLASH_GCODE) .enabled(1) #else .enabled(0) #endif - .tag(11) .button( BTN_POS(2,5), BTN_SIZE(1,1), F("Backlash")) + .tag(11) .button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXTF(BACKLASH)) #if ENABLED(LIN_ADVANCE) .enabled(1) #else .enabled(0) #endif - .tag(12) .button( BTN_POS(1,6), BTN_SIZE(2,1), F("Linear Advance")) - .tag(13) .button( BTN_POS(1,7), BTN_SIZE(2,1), F("Interface Settings")) - .tag(14) .button( BTN_POS(1,8), BTN_SIZE(2,1), F("Restore Factory Defaults")) + .tag(12) .button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXTF(LINEAR_ADVANCE)) + .tag(13) .button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXTF(INTERFACE_SETTINGS)) + .tag(14) .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXTF(RESTORE_DEFAULTS)) .colors(action_btn) - .tag(1). button( BTN_POS(1,9), BTN_SIZE(2,1), F("Back")); + .tag(1). button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXTF(BACK)); #undef GRID_COLS #undef GRID_ROWS } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_confirm_home_e.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_confirm_home_e.cpp index c106db2422..ec6b6045e7 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_confirm_home_e.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_confirm_home_e.cpp @@ -29,20 +29,14 @@ using namespace FTDI; void BioConfirmHomeE::onRedraw(draw_mode_t) { - drawMessage(F("About to re-home plunger and auto-level. Remove syringe prior to proceeding.\n\nContinue?")); + drawMessage(GET_TEXTF(HOMING_WARNING)); drawYesNoButtons(1); } bool BioConfirmHomeE::onTouchEnd(uint8_t tag) { switch (tag) { case 1: - SpinnerDialogBox::enqueueAndWait_P(F( - "G112\n" /* Home extruder */ - LULZBOT_AXIS_LEVELING_COMMANDS /* Level X axis */ - "G0 X115 Z50 F6000\n" /* Goto loading position */ - "M400\n" /* Wait for moves to finish */ - "M18 X Y" /* Unlock motors */ - )); + SpinnerDialogBox::enqueueAndWait_P(F(LULZBOT_HOME_E_COMMANDS)); current_screen.forget(); break; case 2: diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_confirm_home_xyz.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_confirm_home_xyz.cpp index dbd04fc359..71fc02bd14 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_confirm_home_xyz.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_confirm_home_xyz.cpp @@ -29,17 +29,14 @@ using namespace FTDI; void BioConfirmHomeXYZ::onRedraw(draw_mode_t) { - drawMessage(F("About to home to loading position.\nEnsure the top and the bed of the printer are clear.\n\nContinue?")); + drawMessage(GET_TEXTF(LOADING_WARNING)); drawYesNoButtons(1); } bool BioConfirmHomeXYZ::onTouchEnd(uint8_t tag) { switch (tag) { case 1: - SpinnerDialogBox::enqueueAndWait_P(F( - "G28 X Y Z\n" /* Home all axis */ - "G0 X115 Z50 F6000" /* Move to park position */ - )); + SpinnerDialogBox::enqueueAndWait_P(F(LULZBOT_HOME_XYZ_COMMANDS)); current_screen.forget(); break; case 2: diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_main_menu.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_main_menu.cpp index 0a42bc5804..403376a180 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_main_menu.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_main_menu.cpp @@ -42,17 +42,17 @@ void MainMenu::onRedraw(draw_mode_t what) { if (what & FOREGROUND) { CommandProcessor cmd; cmd.cmd(COLOR_RGB(bg_text_enabled)) - .font(font_large).text( BTN_POS(1,1), BTN_SIZE(2,1), F("Main Menu")) + .font(font_large).text( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXTF(MAIN_MENU)) .colors(normal_btn) .font(font_medium) - .tag(2).button( BTN_POS(1,2), BTN_SIZE(2,1), F("Load Syringe")) - .tag(3).button( BTN_POS(1,3), BTN_SIZE(2,1), F("Unlock XY Axis")) - .tag(4).button( BTN_POS(1,4), BTN_SIZE(2,1), F("Bed Temperature")) - .tag(5).button( BTN_POS(1,5), BTN_SIZE(2,1), F("Interface Settings")) - .tag(6).button( BTN_POS(1,6), BTN_SIZE(2,1), F("Advanced Settings")) - .tag(7).button( BTN_POS(1,7), BTN_SIZE(2,1), F("About Printer")) + .tag(2).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXTF(LOAD_SYRINGE)) + .tag(3).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXTF(RELEASE_XY_AXIS)) + .tag(4).button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXTF(BED_TEMPERATURE)) + .tag(5).button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXTF(INTERFACE_SETTINGS)) + .tag(6).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXTF(ADVANCED_SETTINGS)) + .tag(7).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXTF(ABOUT_PRINTER)) .colors(action_btn) - .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), F("Back")); + .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXTF(BACK)); } #undef GRID_COLS diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_printing_dialog_box.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_printing_dialog_box.cpp index e77f047848..bcf9fb8550 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_printing_dialog_box.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_printing_dialog_box.cpp @@ -113,8 +113,8 @@ bool BioPrintingDialogBox::onTouchEnd(uint8_t tag) { } void BioPrintingDialogBox::setStatusMessage(progmem_str message) { - char buff[strlen_P((const char * const)message)+1]; - strcpy_P(buff, (const char * const) message); + char buff[strlen_P((const char*)message)+1]; + strcpy_P(buff, (const char*) message); setStatusMessage(buff); } @@ -130,7 +130,7 @@ void BioPrintingDialogBox::setStatusMessage(const char* message) { draw_interaction_buttons(BACKGROUND); storeBackground(); - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("New status message: ", message); #endif @@ -141,6 +141,7 @@ void BioPrintingDialogBox::setStatusMessage(const char* message) { } void BioPrintingDialogBox::onIdle() { + reset_menu_timeout(); if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { onRefresh(); refresh_timer.start(); diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_status_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_status_screen.cpp index 7e119a5e17..17d9eefbca 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_status_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_status_screen.cpp @@ -36,11 +36,11 @@ #define POLY(A) PolyUI::poly_reader_t(A, sizeof(A)/sizeof(A[0])) -#if ENABLED(SDSUPPORT) && defined(LULZBOT_MANUAL_USB_STARTUP) - #include "../../../../sd/cardreader.h" -#endif - const uint8_t shadow_depth = 5; +const float max_speed = 1.00; +const float min_speed = 0.02; +const float emax_speed = 2.00; +const float emin_speed = 0.70; using namespace FTDI; using namespace Theme; @@ -82,6 +82,10 @@ void StatusScreen::draw_temperature(draw_mode_t what) { .icon (x + 2, y + 2, h, v, Bed_Heat_Icon_Info, icon_scale * 2) .cmd(COLOR_RGB(bg_text_enabled)) .icon (x, y, h, v, Bed_Heat_Icon_Info, icon_scale * 2); + + #ifdef TOUCH_UI_USE_UTF8 + load_utf8_bitmaps(cmd); // Restore font bitmap handles + #endif } if (what & FOREGROUND) { @@ -91,12 +95,12 @@ void StatusScreen::draw_temperature(draw_mode_t what) { .cmd(COLOR_RGB(bg_text_enabled)); if (!isHeaterIdle(BED) && getTargetTemp_celsius(BED) > 0) { - sprintf_P(bed_str, PSTR("%-3d C"), ROUND(getTargetTemp_celsius(BED))); + format_temp(bed_str, getTargetTemp_celsius(BED)); ui.bounds(POLY(target_temp), x, y, h, v); cmd.text(x, y, h, v, bed_str); } - sprintf_P(bed_str, PSTR("%-3d C"), ROUND(getActualTemp_celsius(BED))); + format_temp(bed_str, getActualTemp_celsius(BED)); ui.bounds(POLY(actual_temp), x, y, h, v); cmd.text(x, y, h, v, bed_str); } @@ -175,13 +179,13 @@ void StatusScreen::draw_fine_motion(draw_mode_t what) { ui.bounds(POLY(fine_label), x, y, h, v); cmd.cmd(COLOR_RGB(bg_text_enabled)) - .text(x, y, h, v, F("Fine motion:")); + .text(x, y, h, v, GET_TEXTF(FINE_MOTION)); } if (what & FOREGROUND) { ui.bounds(POLY(fine_toggle), x, y, h, v); cmd.colors(ui_toggle) - .toggle(x, y, h, v, F("no\xFFyes"), fine_motion); + .toggle2(x, y, h, v, GET_TEXTF(NO), GET_TEXTF(YES), fine_motion); } } @@ -197,17 +201,9 @@ void StatusScreen::draw_overlay_icons(draw_mode_t what) { ui.button_stroke(stroke_rgb, 28); ui.button_shadow(shadow_rgb, shadow_depth); - if (!jog_xy) { - ui.button(12, POLY(padlock)); - } - - if (!e_homed) { - ui.button(13, POLY(home_e)); - } - - if (!z_homed) { - ui.button(14, POLY(home_z)); - } + if (!jog_xy) ui.button(12, POLY(padlock)); + if (!e_homed) ui.button(13, POLY(home_e)); + if (!z_homed) ui.button(14, POLY(home_z)); } } @@ -218,33 +214,26 @@ void StatusScreen::draw_buttons(draw_mode_t) { cmd.font(font_medium) .colors(normal_btn) - #if ENABLED(USB_FLASH_DRIVE_SUPPORT) && defined(LULZBOT_MANUAL_USB_STARTUP) - .enabled(!Sd2Card::ready() || has_media) - #else - .enabled(has_media) - #endif + .enabled(has_media) .colors(has_media ? action_btn : normal_btn) .tag(9).button(BTN_POS(1,9), BTN_SIZE(1,1), isPrintingFromMedia() ? - F("Printing") : - #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #ifdef LULZBOT_MANUAL_USB_STARTUP - (Sd2Card::ready() ? F("USB Drive") : F("Enable USB")) - #else - F("USB Drive") - #endif - #else - F("SD Card") - #endif + GET_TEXTF(PRINTING) : + GET_TEXTF(MEDIA) ); - cmd.colors(!has_media ? action_btn : normal_btn).tag(10).button(BTN_POS(2,9), BTN_SIZE(1,1), F("Menu")); + cmd.colors(!has_media ? action_btn : normal_btn).tag(10).button(BTN_POS(2,9), BTN_SIZE(1,1), GET_TEXTF(MENU)); } -void StatusScreen::onStartup() { +void StatusScreen::loadBitmaps() { // Load the bitmaps for the status screen constexpr uint32_t base = ftdi_memory_map::RAM_G; CLCD::mem_write_pgm(base + Bed_Heat_Icon_Info.RAMG_offset, Bed_Heat_Icon, sizeof(Bed_Heat_Icon)); + + // Load fonts for internationalization + #ifdef TOUCH_UI_USE_UTF8 + load_utf8_data(base + UTF8_FONT_OFFSET); + #endif } void StatusScreen::onRedraw(draw_mode_t what) { @@ -263,7 +252,7 @@ void StatusScreen::onRedraw(draw_mode_t what) { } bool StatusScreen::onTouchStart(uint8_t) { - increment = fine_motion ? 0.25 : 1; + increment = 0; return true; } @@ -278,19 +267,13 @@ bool StatusScreen::onTouchEnd(uint8_t tag) { jog_xy = true; injectCommands_P(PSTR("M17")); } + jog(0, 0, 0); break; - case 9: - #if ENABLED(USB_FLASH_DRIVE_SUPPORT) && defined(LULZBOT_MANUAL_USB_STARTUP) - if (!Sd2Card::ready()) { - StatusScreen::setStatusMessage(F("Insert USB drive...")); - Sd2Card::usbStartup(); - } else { - GOTO_SCREEN(FilesScreen); - } - #else - GOTO_SCREEN(FilesScreen); - #endif + case 5: + case 6: + jog(0, 0, 0); break; + case 9: GOTO_SCREEN(FilesScreen); break; case 10: GOTO_SCREEN(MainMenu); break; case 13: SpinnerDialogBox::enqueueAndWait_P(F("G112")); break; case 14: SpinnerDialogBox::enqueueAndWait_P(F("G28 Z")); break; @@ -306,25 +289,29 @@ bool StatusScreen::onTouchEnd(uint8_t tag) { bool StatusScreen::onTouchHeld(uint8_t tag) { if (tag >= 1 && tag <= 4 && !jog_xy) return false; - if (ExtUI::isMoving()) return false; // Don't allow moves to accumulate - #define UI_INCREMENT_AXIS(axis) MoveAxisScreen::setManualFeedrate(axis, increment); UI_INCREMENT(AxisPosition_mm, axis); - #define UI_DECREMENT_AXIS(axis) MoveAxisScreen::setManualFeedrate(axis, increment); UI_DECREMENT(AxisPosition_mm, axis); + const float s = min_speed + (fine_motion ? 0 : (max_speed - min_speed) * sq(increment)); switch (tag) { - case 1: UI_DECREMENT_AXIS(X); break; - case 2: UI_INCREMENT_AXIS(X); break; - case 4: UI_DECREMENT_AXIS(Y); break; // NOTE: Y directions inverted because bed rather than needle moves - case 3: UI_INCREMENT_AXIS(Y); break; - case 5: UI_DECREMENT_AXIS(Z); break; - case 6: UI_INCREMENT_AXIS(Z); break; - case 7: UI_DECREMENT_AXIS(E0); break; - case 8: UI_INCREMENT_AXIS(E0); break; - default: return false; + case 1: jog(-s, 0, 0); break; + case 2: jog( s, 0, 0); break; + case 4: jog( 0, -s, 0); break; // NOTE: Y directions inverted because bed rather than needle moves + case 3: jog( 0, s, 0); break; + case 5: jog( 0, 0, -s); break; + case 6: jog( 0, 0, s); break; + case 7: + case 8: + { + if (ExtUI::isMoving()) return false; + const feedRate_t feedrate = emin_speed + (fine_motion ? 0 : (emax_speed - emin_speed) * sq(increment)); + const float increment = 0.25 * feedrate * (tag == 7 ? -1 : 1); + MoveAxisScreen::setManualFeedrate(E0, feedrate); + UI_INCREMENT(AxisPosition_mm, E0); + current_screen.onRefresh(); + break; + } + default: + return false; } - #undef UI_DECREMENT_AXIS - #undef UI_INCREMENT_AXIS - if (increment < 10 && !fine_motion) - increment += 0.5; - current_screen.onRefresh(); + increment = min(1.0f, increment + 0.1f); return false; } @@ -337,11 +324,11 @@ void StatusScreen::setStatusMessage(const char * const str) { } void StatusScreen::onIdle() { - if (isPrintingFromMedia()) - BioPrintingDialogBox::show(); - if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { - onRefresh(); + if (!EventLoop::is_touch_held()) + onRefresh(); + if (isPrintingFromMedia()) + BioPrintingDialogBox::show(); refresh_timer.start(); } } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_tune_menu.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_tune_menu.cpp index 09aedbd337..2b22876970 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_tune_menu.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/bio_tune_menu.cpp @@ -38,27 +38,26 @@ void TuneMenu::onRedraw(draw_mode_t what) { .font(font_medium); } - #define GRID_ROWS 8 + #define GRID_ROWS 7 #define GRID_COLS 2 if (what & FOREGROUND) { CommandProcessor cmd; cmd.cmd(COLOR_RGB(bg_text_enabled)) - .font(font_large).text ( BTN_POS(1,1), BTN_SIZE(2,1), F("Print Menu")) + .font(font_large).text ( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXTF(PRINT_MENU)) .colors(normal_btn) .font(font_medium) - .enabled(!isPrinting()).tag(2).button( BTN_POS(1,2), BTN_SIZE(2,1), isPrinting() ? F("Printing...") : F("Print Again")) - .enabled( isPrinting()).tag(3).button( BTN_POS(1,3), BTN_SIZE(2,1), F("Print Speed")) - .tag(4).button( BTN_POS(1,4), BTN_SIZE(2,1), F("Bed Temperature")) + .enabled( isPrinting()).tag(2).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXTF(PRINT_SPEED)) + .tag(3).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXTF(BED_TEMPERATURE)) #if ENABLED(BABYSTEPPING) .enabled(true) #else .enabled(false) #endif - .tag(5).button( BTN_POS(1,5), BTN_SIZE(2,1), F("Nudge Nozzle")) - .enabled(!isPrinting()).tag(6).button( BTN_POS(1,6), BTN_SIZE(2,1), F("Load Syringe")) - .enabled(!isPrinting()).tag(7).button( BTN_POS(1,7), BTN_SIZE(2,1), F("Unlock XY Axis")) - .colors(action_btn) .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), F("Back")); + .tag(4).button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXTF(NUDGE_NOZZLE)) + .enabled(!isPrinting()).tag(5).button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXTF(LOAD_SYRINGE)) + .enabled(!isPrinting()).tag(6).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXTF(RELEASE_XY_AXIS)) + .colors(action_btn) .tag(1).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXTF(BACK)); } #undef GRID_COLS #undef GRID_ROWS @@ -66,18 +65,12 @@ void TuneMenu::onRedraw(draw_mode_t what) { bool TuneMenu::onTouchEnd(uint8_t tag) { switch (tag) { - case 1: GOTO_PREVIOUS(); break; - case 2: { - FileList files; - printFile(files.shortFilename()); - GOTO_PREVIOUS(); - break; - } - case 3: GOTO_SCREEN(FeedratePercentScreen); break; - case 4: GOTO_SCREEN(TemperatureScreen); break; - case 5: GOTO_SCREEN(NudgeNozzleScreen); break; - case 6: GOTO_SCREEN(BioConfirmHomeXYZ); break; - case 7: StatusScreen::unlockMotors(); break; + case 1: GOTO_PREVIOUS(); break; + case 2: GOTO_SCREEN(FeedratePercentScreen); break; + case 3: GOTO_SCREEN(TemperatureScreen); break; + case 4: GOTO_SCREEN(NudgeNozzleScreen); break; + case 5: GOTO_SCREEN(BioConfirmHomeXYZ); break; + case 6: StatusScreen::unlockMotors(); break; default: return false; } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/boot_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/boot_screen.cpp index b2f65848d1..32c43d654a 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/boot_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/boot_screen.cpp @@ -57,12 +57,14 @@ void BootScreen::onIdle() { // in case the display is borked. InterfaceSettingsScreen::failSafeSettings(); + StatusScreen::loadBitmaps(); GOTO_SCREEN(TouchCalibrationScreen); current_screen.forget(); PUSH_SCREEN(StatusScreen); } else { if (!UIFlashStorage::is_valid()) { - SpinnerDialogBox::show(F("Please wait...")); + StatusScreen::loadBitmaps(); + SpinnerDialogBox::show(GET_TEXTF(PLEASE_WAIT)); UIFlashStorage::format_flash(); SpinnerDialogBox::hide(); } @@ -73,12 +75,19 @@ void BootScreen::onIdle() { if (!MediaPlayerScreen::playBootMedia()) showSplashScreen(); } + + StatusScreen::loadBitmaps(); + #ifdef LULZBOT_USE_BIOPRINTER_UI GOTO_SCREEN(BioConfirmHomeXYZ); current_screen.forget(); PUSH_SCREEN(StatusScreen); PUSH_SCREEN(BioConfirmHomeE); + #elif NUM_LANGUAGES > 1 + StatusScreen::setStatusMessage(F(WELCOME_MSG)); + GOTO_SCREEN(LanguageMenu); #else + StatusScreen::setStatusMessage(F(WELCOME_MSG)); GOTO_SCREEN(StatusScreen); #endif } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/change_filament_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/change_filament_screen.cpp index 8945aeb43d..de63824f0c 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/change_filament_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/change_filament_screen.cpp @@ -114,31 +114,27 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) { #else .font(font_medium) #endif - .text(BTN_POS(1,1), BTN_SIZE(2,1), F("Extruder Selection:")) + .text(BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXTF(EXTRUDER_SELECTION)) #ifdef TOUCH_UI_PORTRAIT - .text(BTN_POS(1,7), BTN_SIZE(1,1), F("Current Temp:")) + .text(BTN_POS(1,7), BTN_SIZE(1,1), F("")) #else - .text(BTN_POS(3,1), BTN_SIZE(2,1), F("Current Temp:")) + .text(BTN_POS(3,1), BTN_SIZE(2,1), GET_TEXTF(CURRENT_TEMPERATURE)) .font(font_small) #endif - .text(BTN_POS(1,3), BTN_SIZE(2,1), F("Removal Temp:")); + .text(BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXTF(REMOVAL_TEMPERATURE)); drawTempGradient(BTN_POS(1,4), BTN_SIZE(1,3)); } if (what & FOREGROUND) { + const extruder_t e = getExtruder(); + char e_str[15]; + if (isHeaterIdle(e)) + format_temp_and_idle(e_str, getActualTemp_celsius(e)); + else + format_temp_and_temp(e_str, getActualTemp_celsius(e), getTargetTemp_celsius(e)); - const char *idle = PSTR("%-3d C / idle"); - const char *not_idle = PSTR("%-3d / %-3d C"); - - sprintf_P( - e_str, - isHeaterIdle(getExtruder()) ? idle : not_idle, - ROUND(getActualTemp_celsius(getExtruder())), - ROUND(getTargetTemp_celsius(getExtruder())) - ); - - const rgb_t tcol = getWarmColor(getActualTemp_celsius(getExtruder()), COOL_TEMP, LOW_TEMP, MED_TEMP, HIGH_TEMP); + const rgb_t tcol = getWarmColor(getActualTemp_celsius(e), COOL_TEMP, LOW_TEMP, MED_TEMP, HIGH_TEMP); cmd.cmd(COLOR_RGB(tcol)) .tag(15) #ifdef TOUCH_UI_PORTRAIT @@ -155,15 +151,15 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) { #endif .colors(normal_btn); - const bool t_ok = getActualTemp_celsius(getExtruder()) > getSoftenTemp() - 10; + const bool t_ok = getActualTemp_celsius(e) > getSoftenTemp() - 10; if (screen_data.ChangeFilamentScreen.t_tag && !t_ok) { - cmd.text(BTN_POS(1,6), BTN_SIZE(1,1), F("Heating...")); - } else if (getActualTemp_celsius(getExtruder()) > 100) { + cmd.text(BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXTF(HEATING)); + } else if (getActualTemp_celsius(e) > 100) { cmd.cmd(COLOR_RGB(0xFF0000)) - .text(BTN_POS(1,4), BTN_SIZE(1,1), F("Caution:")) + .text(BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXTF(CAUTION)) .colors(normal_btn) - .text(BTN_POS(1,6), BTN_SIZE(1,1), F("Hot!")); + .text(BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXTF(HOT)); } #define TOG_STYLE(A) colors(A ? action_btn : normal_btn) @@ -195,15 +191,25 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) { const bool tog7 = screen_data.ChangeFilamentScreen.repeat_tag == 7; const bool tog8 = screen_data.ChangeFilamentScreen.repeat_tag == 8; + #ifdef TOUCH_UI_PORTRAIT - cmd.font(font_large) + cmd.font(font_large); #else - cmd.font(font_small) + cmd.font(font_small); #endif - .tag(2) .TOG_STYLE(tog2) .button (BTN_POS(2,6), BTN_SIZE(1,1), F( STRINGIFY(LOW_TEMP) "C (PLA)")) - .tag(3) .TOG_STYLE(tog3) .button (BTN_POS(2,5), BTN_SIZE(1,1), F( STRINGIFY(MED_TEMP) "C (ABS)")) - .tag(4) .TOG_STYLE(tog4) .button (BTN_POS(2,4), BTN_SIZE(1,1), F( STRINGIFY(HIGH_TEMP) "C (High)")) - .colors(normal_btn) + { + char str[30]; + + format_temp_and_material(str, LOW_TEMP, GET_TEXT(MATERIAL_PLA)); + cmd.tag(2) .TOG_STYLE(tog2) .button (BTN_POS(2,6), BTN_SIZE(1,1), str); + + format_temp_and_material(str, MED_TEMP, GET_TEXT(MATERIAL_ABS)); + cmd.tag(3) .TOG_STYLE(tog3) .button (BTN_POS(2,5), BTN_SIZE(1,1), str); + + format_temp_and_material(str, HIGH_TEMP, GET_TEXT(MATERIAL_HIGH_TEMP)); + cmd.tag(4) .TOG_STYLE(tog4) .button (BTN_POS(2,4), BTN_SIZE(1,1), str); + } + cmd.colors(normal_btn) // Add tags to color gradient .cmd(COLOR_MASK(0,0,0,0)) @@ -215,23 +221,23 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) { .cmd(COLOR_RGB(t_ok ? bg_text_enabled : bg_text_disabled)) #ifdef TOUCH_UI_PORTRAIT .font(font_large) - .tag(0) .text (BTN_POS(1,8), BTN_SIZE(1,1), F("Unload")) - .text (BTN_POS(2,8), BTN_SIZE(1,1), F("Load/Extrude")) - .tag(5) .enabled(t_ok).button (BTN_POS(1,9), BTN_SIZE(1,1), F("Momentary")) - .tag(6) .enabled(t_ok).button (BTN_POS(2,9), BTN_SIZE(1,1), F("Momentary")) - .tag(7).TOG_STYLE(tog7).enabled(t_ok).button (BTN_POS(1,10), BTN_SIZE(1,1), F("Continuous")) - .tag(8).TOG_STYLE(tog8).enabled(t_ok).button (BTN_POS(2,10), BTN_SIZE(1,1), F("Continuous")) - .tag(1).colors(action_btn) .button (BTN_POS(1,11), BTN_SIZE(2,1), F("Back")); + .tag(0) .text (BTN_POS(1,8), BTN_SIZE(1,1), GET_TEXTF(UNLOAD_FILAMENT)) + .text (BTN_POS(2,8), BTN_SIZE(1,1), GET_TEXTF(LOAD_FILAMENT)) + .tag(5) .enabled(t_ok).button (BTN_POS(1,9), BTN_SIZE(1,1), GET_TEXTF(MOMENTARY)) + .tag(6) .enabled(t_ok).button (BTN_POS(2,9), BTN_SIZE(1,1), GET_TEXTF(MOMENTARY)) + .tag(7).TOG_STYLE(tog7).enabled(t_ok).button (BTN_POS(1,10), BTN_SIZE(1,1), GET_TEXTF(CONTINUOUS)) + .tag(8).TOG_STYLE(tog8).enabled(t_ok).button (BTN_POS(2,10), BTN_SIZE(1,1), GET_TEXTF(CONTINUOUS)) + .tag(1).colors(action_btn) .button (BTN_POS(1,11), BTN_SIZE(2,1), GET_TEXTF(BACK)); #else .font(font_small) - .tag(0) .text (BTN_POS(3,3), BTN_SIZE(1,1), F("Unload")) - .text (BTN_POS(4,3), BTN_SIZE(1,1), F("Load/Extrude")) - .tag(5) .enabled(t_ok).button (BTN_POS(3,4), BTN_SIZE(1,1), F("Momentary")) - .tag(6) .enabled(t_ok).button (BTN_POS(4,4), BTN_SIZE(1,1), F("Momentary")) - .tag(7).TOG_STYLE(tog7).enabled(t_ok).button (BTN_POS(3,5), BTN_SIZE(1,1), F("Continuous")) - .tag(8).TOG_STYLE(tog8).enabled(t_ok).button (BTN_POS(4,5), BTN_SIZE(1,1), F("Continuous")) + .tag(0) .text (BTN_POS(3,3), BTN_SIZE(1,1), GET_TEXTF(UNLOAD_FILAMENT)) + .text (BTN_POS(4,3), BTN_SIZE(1,1), GET_TEXTF(LOAD_FILAMENT)) + .tag(5) .enabled(t_ok).button (BTN_POS(3,4), BTN_SIZE(1,1), GET_TEXTF(MOMENTARY)) + .tag(6) .enabled(t_ok).button (BTN_POS(4,4), BTN_SIZE(1,1), GET_TEXTF(MOMENTARY)) + .tag(7).TOG_STYLE(tog7).enabled(t_ok).button (BTN_POS(3,5), BTN_SIZE(1,1), GET_TEXTF(CONTINUOUS)) + .tag(8).TOG_STYLE(tog8).enabled(t_ok).button (BTN_POS(4,5), BTN_SIZE(1,1), GET_TEXTF(CONTINUOUS)) .font(font_medium) - .tag(1).colors(action_btn) .button (BTN_POS(3,6), BTN_SIZE(2,1), F("Back")); + .tag(1).colors(action_btn) .button (BTN_POS(3,6), BTN_SIZE(2,1), GET_TEXTF(BACK)); #endif } #undef GRID_COLS diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/confirm_abort_print_dialog_box.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/confirm_abort_print_dialog_box.cpp index 77d4fcfaca..32dba3df0f 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/confirm_abort_print_dialog_box.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/confirm_abort_print_dialog_box.cpp @@ -29,7 +29,7 @@ using namespace ExtUI; void ConfirmAbortPrintDialogBox::onRedraw(draw_mode_t) { - drawMessage(F("Are you sure you want to cancel the print?")); + drawMessage(GET_TEXTF(ABORT_WARNING)); drawYesNoButtons(); } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/confirm_auto_calibration_dialog_box.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/confirm_auto_calibration_dialog_box.cpp index f367918f50..161828595f 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/confirm_auto_calibration_dialog_box.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/confirm_auto_calibration_dialog_box.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(LULZBOT_TOUCH_UI) && ENABLED(CALIBRATION_GCODE) +#if BOTH(LULZBOT_TOUCH_UI, CALIBRATION_GCODE) #include "screens.h" @@ -30,7 +30,7 @@ using namespace ExtUI; using namespace Theme; void ConfirmAutoCalibrationDialogBox::onRedraw(draw_mode_t) { - drawMessage(F("For best results, unload the filament and clean the hotend prior to starting calibration. Continue?")); + drawMessage(GET_TEXTF(CALIBRATION_WARNING)); drawYesNoButtons(); } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/confirm_erase_flash_dialog_box.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/confirm_erase_flash_dialog_box.cpp index 2da592fe3f..610d97b118 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/confirm_erase_flash_dialog_box.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/confirm_erase_flash_dialog_box.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(LULZBOT_TOUCH_UI) && ENABLED(DEVELOPER_SCREENS) +#if BOTH(LULZBOT_TOUCH_UI, DEVELOPER_SCREENS) #include "screens.h" @@ -31,17 +31,17 @@ using namespace FTDI; void ConfirmEraseFlashDialogBox::onRedraw(draw_mode_t) { - drawMessage(F("Are you sure? SPI flash will be erased.")); + drawMessage(GET_TEXTF(ERASE_FLASH_WARNING)); drawYesNoButtons(); } bool ConfirmEraseFlashDialogBox::onTouchEnd(uint8_t tag) { switch (tag) { case 1: - SpinnerDialogBox::show(F("Erasing...")); + SpinnerDialogBox::show(GET_TEXTF(ERASING)); UIFlashStorage::format_flash(); SpinnerDialogBox::hide(); - AlertDialogBox::show(F("SPI flash erased")); + AlertDialogBox::show(GET_TEXTF(ERASED)); // Remove ConfirmEraseFlashDialogBox from the stack // so the alert box doesn't return to me. current_screen.forget(); diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/default_acceleration_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/default_acceleration_screen.cpp index 1e1cb8457a..fdfacd58ce 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/default_acceleration_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/default_acceleration_screen.cpp @@ -33,14 +33,14 @@ using namespace Theme; void DefaultAccelerationScreen::onRedraw(draw_mode_t what) { widgets_t w(what); w.precision(0); - w.units(PSTR("mm/s^2")); - w.heading( PSTR("Default Acceleration")); + w.units(GET_TEXTF(UNITS_MM_S2)); + w.heading( GET_TEXTF(ACCELERATION)); w.color(other); - w.adjuster( 2, PSTR("Printing:"), getPrintingAcceleration_mm_s2() ); - w.adjuster( 4, PSTR("Travel:"), getTravelAcceleration_mm_s2() ); - w.adjuster( 6, PSTR("Retraction:"), getRetractAcceleration_mm_s2() ); + w.adjuster( 2, GET_TEXTF(ACCEL_PRINTING), getPrintingAcceleration_mm_s2() ); + w.adjuster( 4, GET_TEXTF(ACCEL_TRAVEL), getTravelAcceleration_mm_s2() ); + w.adjuster( 6, GET_TEXTF(ACCEL_RETRACT), getRetractAcceleration_mm_s2() ); w.increments(); - w.button( 8, PSTR("Set Axis Maximum")); + w.button( 8, GET_TEXTF(SET_MAXIMUM)); } bool DefaultAccelerationScreen::onTouchHeld(uint8_t tag) { diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/developer_menu.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/developer_menu.cpp index 9bec9bf55f..1743a1f796 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/developer_menu.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/developer_menu.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(LULZBOT_TOUCH_UI) && ENABLED(DEVELOPER_SCREENS) +#if BOTH(LULZBOT_TOUCH_UI, DEVELOPER_SCREENS) #include "screens.h" diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/dialog_box_base_class.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/dialog_box_base_class.cpp index 6178a71e94..7d2d2e51ea 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/dialog_box_base_class.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/dialog_box_base_class.cpp @@ -45,19 +45,19 @@ void DialogBoxBaseClass::drawMessage(const T message, int16_t font) { } template void DialogBoxBaseClass::drawMessage(const char *, int16_t font); -template void DialogBoxBaseClass::drawMessage(const progmem_str, int16_t font); +template void DialogBoxBaseClass::drawMessage(progmem_str, int16_t font); void DialogBoxBaseClass::drawYesNoButtons(uint8_t default_btn) { CommandProcessor cmd; cmd.font(font_medium) - .colors(default_btn == 1 ? action_btn : normal_btn).tag(1).button( BTN_POS(1,8), BTN_SIZE(1,1), F("Yes")) - .colors(default_btn == 2 ? action_btn : normal_btn).tag(2).button( BTN_POS(2,8), BTN_SIZE(1,1), F("No")); + .colors(default_btn == 1 ? action_btn : normal_btn).tag(1).button( BTN_POS(1,8), BTN_SIZE(1,1), GET_TEXTF(YES)) + .colors(default_btn == 2 ? action_btn : normal_btn).tag(2).button( BTN_POS(2,8), BTN_SIZE(1,1), GET_TEXTF(NO)); } void DialogBoxBaseClass::drawOkayButton() { CommandProcessor cmd; cmd.font(font_medium) - .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), F("Okay")); + .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXTF(OKAY)); } void DialogBoxBaseClass::drawButton(const progmem_str label) { @@ -80,4 +80,8 @@ bool DialogBoxBaseClass::onTouchEnd(uint8_t tag) { } } +void DialogBoxBaseClass::onIdle() { + reset_menu_timeout(); +} + #endif // LULZBOT_TOUCH_UI diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/display_tuning_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/display_tuning_screen.cpp index 7af436a5c7..eedc3d22c8 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/display_tuning_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/display_tuning_screen.cpp @@ -32,14 +32,14 @@ using namespace Theme; void DisplayTuningScreen::onRedraw(draw_mode_t what) { widgets_t w(what); w.precision(0, BaseNumericAdjustmentScreen::DEFAULT_LOWEST); - w.units(PSTR("")); - w.heading( PSTR("Display Tuning")); + w.units(F("")); + w.heading(GET_TEXTF(DISPLAY_MENU)); w.color(other); - w.adjuster( 2, PSTR("H Offset:"), CLCD::mem_read_16(CLCD::REG::HOFFSET) ); - w.adjuster( 4, PSTR("V Offset:"), CLCD::mem_read_16(CLCD::REG::VOFFSET) ); + w.adjuster( 2, GET_TEXTF(H_OFFSET), CLCD::mem_read_16(CLCD::REG::HOFFSET) ); + w.adjuster( 4, GET_TEXTF(V_OFFSET), CLCD::mem_read_16(CLCD::REG::VOFFSET) ); w.increments(); - w.heading( PSTR("Touch Screen")); - w.button(6, PSTR("Calibrate")); + w.heading( GET_TEXTF(TOUCH_SCREEN)); + w.button(6, GET_TEXTF(CALIBRATE)); } bool DisplayTuningScreen::onTouchHeld(uint8_t tag) { diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/endstop_state_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/endstop_state_screen.cpp index f1e13d3a9a..ce5cd0b4d5 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/endstop_state_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/endstop_state_screen.cpp @@ -48,7 +48,7 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) { #define GRID_ROWS 7 #define GRID_COLS 6 - #define PIN_BTN(X,Y,PIN,LABEL) button(BTN_POS(X,Y), BTN_SIZE(2,1), F(LABEL)) + #define PIN_BTN(X,Y,PIN,LABEL) button(BTN_POS(X,Y), BTN_SIZE(2,1), LABEL) #define PIN_ENABLED(LABEL,PIN,INV,X,Y) cmd.enabled(1).colors(READ(PIN##_PIN) != INV ? action_btn : normal_btn).PIN_BTN(X,Y,PIN,LABEL); #define PIN_DISABLED(LABEL,PIN,INV,X,Y) cmd.enabled(0).PIN_BTN(X,Y,PIN,LABEL); @@ -57,68 +57,69 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) { #else cmd.font(font_medium) #endif - .text(BTN_POS(1,1), BTN_SIZE(6,1), F("Endstop States:")) + .text(BTN_POS(1,1), BTN_SIZE(6,1), GET_TEXTF(ENDSTOPS)) .font(font_tiny); #if PIN_EXISTS(X_MAX) - PIN_ENABLED ("X Max", X_MAX,X_MAX_ENDSTOP_INVERTING,1,2) + PIN_ENABLED (GET_TEXTF(X_MAX), X_MAX,X_MAX_ENDSTOP_INVERTING,1,2) #else - PIN_DISABLED("X Max",X_MAX,X_MAX_ENDSTOP_INVERTING,1,2) + PIN_DISABLED(GET_TEXTF(X_MAX),X_MAX,X_MAX_ENDSTOP_INVERTING,1,2) #endif #if PIN_EXISTS(Y_MAX) - PIN_ENABLED ("Y Max",Y_MAX,Y_MAX_ENDSTOP_INVERTING,3,2) + PIN_ENABLED (GET_TEXTF(Y_MAX),Y_MAX,Y_MAX_ENDSTOP_INVERTING,3,2) #else - PIN_DISABLED("Y Max",Y_MAX,Y_MAX_ENDSTOP_INVERTING,3,2) + PIN_DISABLED(GET_TEXTF(Y_MAX),Y_MAX,Y_MAX_ENDSTOP_INVERTING,3,2) #endif #if PIN_EXISTS(Z_MAX) - PIN_ENABLED ("Z Max",Z_MAX,Z_MAX_ENDSTOP_INVERTING,5,2) + PIN_ENABLED (GET_TEXTF(Z_MAX),Z_MAX,Z_MAX_ENDSTOP_INVERTING,5,2) #else - PIN_DISABLED("Z Max",Z_MAX,Z_MAX_ENDSTOP_INVERTING,5,2) + PIN_DISABLED(GET_TEXTF(Z_MAX),Z_MAX,Z_MAX_ENDSTOP_INVERTING,5,2) #endif #if PIN_EXISTS(X_MIN) - PIN_ENABLED ("X Min",X_MIN,X_MIN_ENDSTOP_INVERTING,1,3) + PIN_ENABLED (GET_TEXTF(X_MIN),X_MIN,X_MIN_ENDSTOP_INVERTING,1,3) #else - PIN_DISABLED("X Min",X_MIN,X_MIN_ENDSTOP_INVERTING,1,3) + PIN_DISABLED(GET_TEXTF(X_MIN),X_MIN,X_MIN_ENDSTOP_INVERTING,1,3) #endif #if PIN_EXISTS(Y_MIN) - PIN_ENABLED ("Y Min",Y_MIN,Y_MIN_ENDSTOP_INVERTING,3,3) + PIN_ENABLED (GET_TEXTF(Y_MIN),Y_MIN,Y_MIN_ENDSTOP_INVERTING,3,3) #else - PIN_DISABLED("Y Min",Y_MIN,Y_MIN_ENDSTOP_INVERTING,3,3) + PIN_DISABLED(GET_TEXTF(Y_MIN),Y_MIN,Y_MIN_ENDSTOP_INVERTING,3,3) #endif #if PIN_EXISTS(Z_MIN) - PIN_ENABLED ("Z Min",Z_MIN,Z_MIN_ENDSTOP_INVERTING,5,3) + PIN_ENABLED (GET_TEXTF(Z_MIN),Z_MIN,Z_MIN_ENDSTOP_INVERTING,5,3) #else - PIN_DISABLED("Z Min",Z_MIN,Z_MIN_ENDSTOP_INVERTING,5,3) + PIN_DISABLED(GET_TEXTF(Z_MIN),Z_MIN,Z_MIN_ENDSTOP_INVERTING,5,3) #endif #if ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT) - PIN_ENABLED ("Runout 1",FIL_RUNOUT, FIL_RUNOUT_INVERTING,1,4) + PIN_ENABLED (GET_TEXTF(RUNOUT_1),FIL_RUNOUT, FIL_RUNOUT_INVERTING,1,4) #else - PIN_DISABLED("Runout 1",FIL_RUNOUT, FIL_RUNOUT_INVERTING,1,4) + PIN_DISABLED(GET_TEXTF(RUNOUT_1),FIL_RUNOUT, FIL_RUNOUT_INVERTING,1,4) #endif #if ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT2) - PIN_ENABLED ("Runout 2",FIL_RUNOUT2,FIL_RUNOUT_INVERTING,3,4) + PIN_ENABLED (GET_TEXTF(RUNOUT_2),FIL_RUNOUT2,FIL_RUNOUT_INVERTING,3,4) #else - PIN_DISABLED("Runout 2",FIL_RUNOUT2,FIL_RUNOUT_INVERTING,3,4) + PIN_DISABLED(GET_TEXTF(RUNOUT_2),FIL_RUNOUT2,FIL_RUNOUT_INVERTING,3,4) #endif #if PIN_EXISTS(Z_MIN_PROBE) - PIN_ENABLED ("Z Probe",Z_MIN_PROBE,Z_MIN_PROBE_ENDSTOP_INVERTING,5,4) + PIN_ENABLED (GET_TEXTF(Z_PROBE),Z_MIN_PROBE,Z_MIN_PROBE_ENDSTOP_INVERTING,5,4) #else - PIN_DISABLED("Z Probe",Z_MIN_PROBE,Z_MIN_PROBE_ENDSTOP_INVERTING,5,4) + PIN_DISABLED(GET_TEXTF(Z_PROBE),Z_MIN_PROBE,Z_MIN_PROBE_ENDSTOP_INVERTING,5,4) #endif #if HAS_SOFTWARE_ENDSTOPS #undef EDGE_R #define EDGE_R 30 - cmd.font(font_small) - .text (BTN_POS(1,5), BTN_SIZE(3,1), F("Soft Limits:"), OPT_RIGHTX | OPT_CENTERY) + cmd.cmd(COLOR_RGB(bg_text_enabled)) + .font(font_small) + .text (BTN_POS(1,5), BTN_SIZE(3,1), GET_TEXTF(SOFT_ENDSTOPS), OPT_RIGHTX | OPT_CENTERY) .colors(ui_toggle) - .tag(2).toggle(BTN_POS(4,5), BTN_SIZE(3,1), F("off\xFFon"), getSoftEndstopState()); + .tag(2).toggle2(BTN_POS(4,5), BTN_SIZE(3,1), GET_TEXTF(NO), GET_TEXTF(YES), getSoftEndstopState()); #undef EDGE_R #define EDGE_R 0 #endif cmd.font(font_medium) .colors(action_btn) - .tag(1).button( BTN_POS(1,7), BTN_SIZE(6,1), F("Back")); + .tag(1).button( BTN_POS(1,7), BTN_SIZE(6,1), GET_TEXTF(BACK)); #undef GRID_COLS #undef GRID_ROWS } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/feedrate_percent_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/feedrate_percent_screen.cpp index e9f527ef96..c42296f79c 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/feedrate_percent_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/feedrate_percent_screen.cpp @@ -31,10 +31,10 @@ using namespace ExtUI; void FeedratePercentScreen::onRedraw(draw_mode_t what) { widgets_t w(what); - w.precision(0).units(PSTR("%")); + w.precision(0).units(GET_TEXTF(UNITS_PERCENT)); - w.heading(PSTR("Print Speed")); - w.adjuster(4, PSTR("Speed"), getFeedrate_percent()); + w.heading(GET_TEXTF(PRINT_SPEED)); + w.adjuster(4, GET_TEXTF(SPEED), getFeedrate_percent()); w.increments(); } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/filament_menu.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/filament_menu.cpp index 55280859af..a0213d5edc 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/filament_menu.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/filament_menu.cpp @@ -43,43 +43,43 @@ void FilamentMenu::onRedraw(draw_mode_t what) { #ifdef TOUCH_UI_PORTRAIT #define GRID_ROWS 9 #define GRID_COLS 2 - .text ( BTN_POS(1,1), BTN_SIZE(2,1), F("Filament Options:")) + .text ( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXTF(FILAMENT)) .font(font_medium).colors(normal_btn) #if ENABLED(FILAMENT_RUNOUT_SENSOR) .enabled(1) #else .enabled(0) #endif - .tag(2).button( BTN_POS(1,2), BTN_SIZE(2,1), F("Runout Sensor")) + .tag(2).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXTF(RUNOUT_SENSOR)) #if ENABLED(LIN_ADVANCE) .enabled(1) #else .enabled(0) #endif - .tag(3).button( BTN_POS(1,3), BTN_SIZE(2,1), F("Linear Advance")) + .tag(3).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXTF(LINEAR_ADVANCE)) .colors(action_btn) - .tag(1) .button( BTN_POS(1,9), BTN_SIZE(2,1), F("Back")); + .tag(1) .button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXTF(BACK)); #undef GRID_COLS #undef GRID_ROWS #else #define GRID_ROWS 6 #define GRID_COLS 3 - .text ( BTN_POS(1,1), BTN_SIZE(3,1), F("Filament Options:")) + .text ( BTN_POS(1,1), BTN_SIZE(3,1), GET_TEXTF(FILAMENT)) .font(font_medium).colors(normal_btn) #if ENABLED(FILAMENT_RUNOUT_SENSOR) .enabled(1) #else .enabled(0) #endif - .tag(2).button( BTN_POS(1,2), BTN_SIZE(3,1), F("Filament Runout")) + .tag(2).button( BTN_POS(1,2), BTN_SIZE(3,1), GET_TEXTF(RUNOUT_SENSOR)) #if ENABLED(LIN_ADVANCE) .enabled(1) #else .enabled(0) #endif - .tag(3).button( BTN_POS(1,3), BTN_SIZE(3,1), F("Linear Advance")) + .tag(3).button( BTN_POS(1,3), BTN_SIZE(3,1), GET_TEXTF(LINEAR_ADVANCE)) .colors(action_btn) - .tag(1) .button( BTN_POS(1,6), BTN_SIZE(3,1), F("Back")); + .tag(1) .button( BTN_POS(1,6), BTN_SIZE(3,1), GET_TEXTF(BACK)); #endif } } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/filament_runout_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/filament_runout_screen.cpp index 570f83835f..12bf61d68b 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/filament_runout_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/filament_runout_screen.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(LULZBOT_TOUCH_UI) && ENABLED(FILAMENT_RUNOUT_SENSOR) +#if BOTH(LULZBOT_TOUCH_UI, FILAMENT_RUNOUT_SENSOR) #include "screens.h" @@ -32,15 +32,15 @@ using namespace Theme; void FilamentRunoutScreen::onRedraw(draw_mode_t what) { widgets_t w(what); - w.heading( PSTR("Runout Detection:")); - w.toggle( 2, PSTR("Filament Sensor:"), PSTR("off\xFFon"), getFilamentRunoutEnabled()); + w.heading( GET_TEXTF(FILAMENT)); + w.toggle( 2, GET_TEXTF(RUNOUT_SENSOR), getFilamentRunoutEnabled()); #ifdef FILAMENT_RUNOUT_DISTANCE_MM - w.heading(PSTR("Detection Threshold:")); - w.units(PSTR("mm")); + w.heading(GET_TEXTF(DETECTION_THRESHOLD)); + w.units(GET_TEXTF(UNITS_MM)); w.precision(0); w.color(e_axis); - w.adjuster( 10, PSTR("Distance:"), getFilamentRunoutDistance_mm(), getFilamentRunoutEnabled()); + w.adjuster( 10, GET_TEXTF(DISTANCE), getFilamentRunoutDistance_mm(), getFilamentRunoutEnabled()); w.increments(); #endif } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/files_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/files_screen.cpp index e8aaf36ff7..f562573bfd 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/files_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/files_screen.cpp @@ -91,7 +91,11 @@ void FilesScreen::drawFileButton(const char* filename, uint8_t tag, bool is_dir, cmd.cmd(MACRO(0)); } #endif - cmd.text (BTN_POS(1,header_h+line), BTN_SIZE(6,1), filename, OPT_CENTERY); + cmd.text (BTN_POS(1,header_h+line), BTN_SIZE(6,1), filename, OPT_CENTERY + #if ENABLED(SCROLL_LONG_FILENAMES) + | OPT_NOFIT + #endif + ); if (is_dir) { cmd.text(BTN_POS(1,header_h+line), BTN_SIZE(6,1), F("> "), OPT_CENTERY | OPT_RIGHTX); } @@ -165,13 +169,13 @@ void FilesScreen::drawFooter() { cmd.colors(normal_btn) .font(font_medium) .colors(has_selection ? normal_btn : action_btn) - .tag(back_tag).button( BTN_POS(4,y), BTN_SIZE(3,h), F("Back")) + .tag(back_tag).button( BTN_POS(4,y), BTN_SIZE(3,h), GET_TEXTF(BACK)) .enabled(has_selection) .colors(has_selection ? action_btn : normal_btn); if (screen_data.FilesScreen.flags.is_dir) { - cmd.tag(244).button( BTN_POS(1, y), BTN_SIZE(3,h), F("Open")); + cmd.tag(244).button( BTN_POS(1, y), BTN_SIZE(3,h), GET_TEXTF(OPEN_DIR)); } else { - cmd.tag(243).button( BTN_POS(1, y), BTN_SIZE(3,h), F("Print")); + cmd.tag(243).button( BTN_POS(1, y), BTN_SIZE(3,h), GET_TEXTF(PRINT_FILE)); } } @@ -210,7 +214,7 @@ bool FilesScreen::onTouchEnd(uint8_t tag) { break; case 243: printFile(getSelectedShortFilename()); - StatusScreen::setStatusMessage(F("Print Starting")); + StatusScreen::setStatusMessage(GET_TEXTF(PRINT_STARTING)); GOTO_SCREEN(StatusScreen); return true; case 244: @@ -234,8 +238,8 @@ bool FilesScreen::onTouchEnd(uint8_t tag) { if (FTDI::ftdi_chip >= 810) { const char *longFilename = getSelectedLongFilename(); if (longFilename[0]) { - CLCD::FontMetrics fm(font_medium); - uint16_t text_width = fm.get_text_width(longFilename); + CommandProcessor cmd; + uint16_t text_width = cmd.font(font_medium).text_width(longFilename); screen_data.FilesScreen.scroll_pos = 0; if (text_width > display_width) screen_data.FilesScreen.scroll_max = text_width - display_width + MARGIN_L + MARGIN_R; diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/interface_settings_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/interface_settings_screen.cpp index 265d0e103a..e1b27c79ae 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/interface_settings_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/interface_settings_screen.cpp @@ -69,15 +69,15 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) { .cmd(COLOR_RGB(bg_text_enabled)) .tag(0) .font(font_medium) - .text(BTN_POS(1,1), BTN_SIZE(4,1), F("Interface Settings")) + .text(BTN_POS(1,1), BTN_SIZE(4,1), GET_TEXTF(INTERFACE_SETTINGS)) #undef EDGE_R #define EDGE_R 30 .font(font_small) .tag(0) - .text(BTN_POS(1,2), BTN_SIZE(2,1), F("LCD brightness:"), OPT_RIGHTX | OPT_CENTERY) - .text(BTN_POS(1,3), BTN_SIZE(2,1), F("Sound volume:"), OPT_RIGHTX | OPT_CENTERY) - .text(BTN_POS(1,4), BTN_SIZE(2,1), F("Screen lock:"), OPT_RIGHTX | OPT_CENTERY); - cmd.text(BTN_POS(1,5), BTN_SIZE(2,1), F("Boot screen:"), OPT_RIGHTX | OPT_CENTERY); + .text(BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXTF(LCD_BRIGHTNESS), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXTF(SOUND_VOLUME), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXTF(SCREEN_LOCK), OPT_RIGHTX | OPT_CENTERY); + cmd.text(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXTF(BOOT_SCREEN), OPT_RIGHTX | OPT_CENTERY); #undef EDGE_R } @@ -94,19 +94,19 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) { .tag(2).slider(BTN_POS(3,2), BTN_SIZE(2,1), screen_data.InterfaceSettingsScreen.brightness, 128) .tag(3).slider(BTN_POS(3,3), BTN_SIZE(2,1), screen_data.InterfaceSettingsScreen.volume, 0xFF) .colors(ui_toggle) - .tag(4).toggle(BTN_POS(3,4), BTN_SIZE(w,1), F("off\xFFon"), LockScreen::is_enabled()) - .tag(5).toggle(BTN_POS(3,5), BTN_SIZE(w,1), F("off\xFFon"), UIData::animations_enabled()) + .tag(4).toggle2(BTN_POS(3,4), BTN_SIZE(w,1), GET_TEXTF(NO), GET_TEXTF(YES), LockScreen::is_enabled()) + .tag(5).toggle2(BTN_POS(3,5), BTN_SIZE(w,1), GET_TEXTF(NO), GET_TEXTF(YES), UIData::animations_enabled()) #undef EDGE_R #define EDGE_R 0 #ifdef TOUCH_UI_PORTRAIT .colors(normal_btn) - .tag(6).button (BTN_POS(1,6), BTN_SIZE(4,1), F("Customize Sounds")) + .tag(6).button (BTN_POS(1,6), BTN_SIZE(4,1), GET_TEXTF(INTERFACE_SOUNDS)) .colors(action_btn) - .tag(1).button (BTN_POS(1,7), BTN_SIZE(4,1), F("Back")); + .tag(1).button (BTN_POS(1,7), BTN_SIZE(4,1), GET_TEXTF(BACK)); #else - .tag(6).button (BTN_POS(1,6), BTN_SIZE(2,1), F("Customize Sounds")) + .tag(6).button (BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXTF(INTERFACE_SOUNDS)) .colors(action_btn) - .tag(1).button (BTN_POS(3,6), BTN_SIZE(2,1), F("Back")); + .tag(1).button (BTN_POS(3,6), BTN_SIZE(2,1), GET_TEXTF(BACK)); #endif } } @@ -263,9 +263,9 @@ void InterfaceSettingsScreen::loadSettings(const char *buff) { success = persistentStore.write_data(0, data, LULZBOT_EEPROM_BACKUP_SIZE) == PERSISTENT_STORE_SUCCESS; if (success) - StatusScreen::setStatusMessage(F("Settings restored from backup")); + StatusScreen::setStatusMessage(GET_TEXTF(EEPROM_RESTORED)); else - StatusScreen::setStatusMessage(F("Settings restored to default")); + StatusScreen::setStatusMessage(GET_TEXTF(EEPROM_RESET)); return success; } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/interface_sounds_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/interface_sounds_screen.cpp index a1a05d0806..a116ae29fe 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/interface_sounds_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/interface_sounds_screen.cpp @@ -71,15 +71,15 @@ void InterfaceSoundsScreen::onRedraw(draw_mode_t what) { #define GRID_ROWS 9 .font(font_medium) - .text(BTN_POS(1,1), BTN_SIZE(4,1), F("Interface Sounds")) + .text(BTN_POS(1,1), BTN_SIZE(4,1), GET_TEXTF(INTERFACE_SOUNDS)) #undef EDGE_R #define EDGE_R 30 .font(font_small) - .tag(0).text (BTN_POS(1,2), BTN_SIZE(2,1), F("Sound volume:"), OPT_RIGHTX | OPT_CENTERY) - .text (BTN_POS(1,3), BTN_SIZE(2,1), F("Click sounds:"), OPT_RIGHTX | OPT_CENTERY) - .text (BTN_POS(1,5), BTN_SIZE(2,1), F("Print starting:"), OPT_RIGHTX | OPT_CENTERY) - .text (BTN_POS(1,6), BTN_SIZE(2,1), F("Print finished:"), OPT_RIGHTX | OPT_CENTERY) - .text (BTN_POS(1,7), BTN_SIZE(2,1), F("Print error:"), OPT_RIGHTX | OPT_CENTERY); + .tag(0).text (BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXTF(SOUND_VOLUME), OPT_RIGHTX | OPT_CENTERY) + .text (BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXTF(CLICK_SOUNDS), OPT_RIGHTX | OPT_CENTERY) + .text (BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXTF(PRINT_STARTING), OPT_RIGHTX | OPT_CENTERY) + .text (BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXTF(PRINT_FINISHED), OPT_RIGHTX | OPT_CENTERY) + .text (BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXTF(PRINT_ERROR), OPT_RIGHTX | OPT_CENTERY); #undef EDGE_R } @@ -95,7 +95,7 @@ void InterfaceSoundsScreen::onRedraw(draw_mode_t what) { #define EDGE_R 30 .tag(2).slider (BTN_POS(3,2), BTN_SIZE(2,1), screen_data.InterfaceSettingsScreen.volume, 0xFF) .colors(ui_toggle) - .tag(3).toggle (BTN_POS(3,3), BTN_SIZE(w,1), F("off\xFFon"), UIData::touch_sounds_enabled()) + .tag(3).toggle2 (BTN_POS(3,3), BTN_SIZE(w,1), GET_TEXTF(NO), GET_TEXTF(YES), UIData::touch_sounds_enabled()) #undef EDGE_R .colors(normal_btn) #define EDGE_R 0 @@ -103,7 +103,7 @@ void InterfaceSoundsScreen::onRedraw(draw_mode_t what) { .tag(5).button (BTN_POS(3,6), BTN_SIZE(2,1), getSoundSelection(PRINTING_FINISHED)) .tag(6).button (BTN_POS(3,7), BTN_SIZE(2,1), getSoundSelection(PRINTING_FAILED)) .colors(action_btn) - .tag(1).button (BTN_POS(1,9), BTN_SIZE(4,1), F("Back")); + .tag(1).button (BTN_POS(1,9), BTN_SIZE(4,1), GET_TEXTF(BACK)); } } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/jerk_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/jerk_screen.cpp index 7ffb4c5ddf..7053314757 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/jerk_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/jerk_screen.cpp @@ -34,12 +34,12 @@ void JerkScreen::onRedraw(draw_mode_t what) { widgets_t w(what); w.precision(1); - w.units(PSTR("mm/s")); - w.heading( PSTR("Maximum Jerk")); - w.color(x_axis) .adjuster( 2, PSTR("X:"), getAxisMaxJerk_mm_s(X) ); - w.color(y_axis) .adjuster( 4, PSTR("Y:"), getAxisMaxJerk_mm_s(Y) ); - w.color(z_axis) .adjuster( 6, PSTR("Z:"), getAxisMaxJerk_mm_s(Z) ); - w.color(e_axis) .adjuster( 8, PSTR("E:"), getAxisMaxJerk_mm_s(E0) ); + w.units(GET_TEXTF(UNITS_MM_S)); + w.heading(GET_TEXTF(JERK)); + w.color(x_axis) .adjuster( 2, GET_TEXTF(AXIS_X), getAxisMaxJerk_mm_s(X) ); + w.color(y_axis) .adjuster( 4, GET_TEXTF(AXIS_Y), getAxisMaxJerk_mm_s(Y) ); + w.color(z_axis) .adjuster( 6, GET_TEXTF(AXIS_Z), getAxisMaxJerk_mm_s(Z) ); + w.color(e_axis) .adjuster( 8, GET_TEXTF(AXIS_E), getAxisMaxJerk_mm_s(E0) ); w.increments(); } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/junction_deviation_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/junction_deviation_screen.cpp index 806055ded5..56a3b13365 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/junction_deviation_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/junction_deviation_screen.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(LULZBOT_TOUCH_UI) && ENABLED(JUNCTION_DEVIATION) +#if BOTH(LULZBOT_TOUCH_UI, JUNCTION_DEVIATION) #include "screens.h" @@ -33,8 +33,8 @@ using namespace Theme; void JunctionDeviationScreen::onRedraw(draw_mode_t what) { widgets_t w(what); w.precision(2); - w.units(PSTR("mm")); - w.heading( PSTR("Junction Deviation")); + w.units(GET_TEXTF(UNITS_MM)); + w.heading(GET_TEXTF(JUNC_DEVIATION)); w.color(other) .adjuster( 2, PSTR(""), getJunctionDeviation_mm() ); w.increments(); } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/kill_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/kill_screen.cpp index 84cbd583cd..7fa8506734 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/kill_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/kill_screen.cpp @@ -46,8 +46,8 @@ void KillScreen::show(progmem_str message) { cmd.font(Theme::font_large) .cmd(COLOR_RGB(Theme::bg_text_enabled)) .text(BTN_POS(1,2), BTN_SIZE(4,1), message) - .text(BTN_POS(1,3), BTN_SIZE(4,1), F("PRINTER HALTED")) - .text(BTN_POS(1,6), BTN_SIZE(4,1), F("Please reset")); + .text(BTN_POS(1,3), BTN_SIZE(4,1), GET_TEXTF(PRINTER_HALTED)) + .text(BTN_POS(1,6), BTN_SIZE(4,1), GET_TEXTF(PLEASE_RESET)); #undef GRID_COLS #undef GRID_ROWS diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/language_menu.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/language_menu.cpp new file mode 100644 index 0000000000..d077ae19fe --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/language_menu.cpp @@ -0,0 +1,66 @@ +/********************* + * language_menu.cpp * + *********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" +#include "../language/language.h" + +#if ENABLED(LULZBOT_TOUCH_UI) && NUM_LANGUAGES > 1 + +#include "screens.h" + +using namespace FTDI; +using namespace Theme; + +void LanguageMenu::onRedraw(draw_mode_t) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) + .cmd(CLEAR(true,true,true)) + .colors(normal_btn) + .font(Theme::font_medium); + + #define GRID_ROWS 8 + #define GRID_COLS 1 + + cmd.tag(1).button(BTN_POS(1,1), BTN_SIZE(1,1), GET_LANGUAGE_NAME(1)); + cmd.tag(2).button(BTN_POS(1,2), BTN_SIZE(1,1), GET_LANGUAGE_NAME(2)); + #if NUM_LANGUAGES > 2 + cmd.tag(3).button(BTN_POS(1,3), BTN_SIZE(1,1), GET_LANGUAGE_NAME(3)); + #if NUM_LANGUAGES > 3 + cmd.tag(4).button(BTN_POS(1,4), BTN_SIZE(1,1), GET_LANGUAGE_NAME(4)); + #if NUM_LANGUAGES > 5 + cmd.tag(5).button(BTN_POS(1,5), BTN_SIZE(1,1), GET_LANGUAGE_NAME(5)); + #endif + #endif + #endif +} + +bool LanguageMenu::onTouchEnd(uint8_t tag) { + + if (tag > 0 && tag <= NUM_LANGUAGES) { + lang = tag - 1; + GOTO_SCREEN(StatusScreen); + return true; + } + return false; +} + +#endif // LULZBOT_TOUCH_UI diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/linear_advance_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/linear_advance_screen.cpp index 499b9db595..2c08fb24c8 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/linear_advance_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/linear_advance_screen.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(LULZBOT_TOUCH_UI) && ENABLED(LIN_ADVANCE) +#if BOTH(LULZBOT_TOUCH_UI, LIN_ADVANCE) #include "screens.h" @@ -33,16 +33,16 @@ using namespace Theme; void LinearAdvanceScreen::onRedraw(draw_mode_t what) { widgets_t w(what); w.precision(2, DEFAULT_LOWEST).color(e_axis); - w.heading( PSTR("Linear Advance:")); + w.heading( GET_TEXTF(LINEAR_ADVANCE)); #if EXTRUDERS == 1 - w.adjuster( 2, PSTR("K:"), getLinearAdvance_mm_mm_s(E0) ); + w.adjuster( 2, GET_TEXTF(LINEAR_ADVANCE_K), getLinearAdvance_mm_mm_s(E0) ); #else - w.adjuster( 2, PSTR("K E1:"), getLinearAdvance_mm_mm_s(E0) ); - w.adjuster( 4, PSTR("K E2:"), getLinearAdvance_mm_mm_s(E1) ); + w.adjuster( 2, GET_TEXTF(LINEAR_ADVANCE_K1), getLinearAdvance_mm_mm_s(E0) ); + w.adjuster( 4, GET_TEXTF(LINEAR_ADVANCE_K2), getLinearAdvance_mm_mm_s(E1) ); #if EXTRUDERS > 2 - w.adjuster( 6, PSTR("K E3:"), getLinearAdvance_mm_mm_s(E2) ); + w.adjuster( 6, GET_TEXTF(LINEAR_ADVANCE_K3), getLinearAdvance_mm_mm_s(E2) ); #if EXTRUDERS > 3 - w.adjuster( 8, PSTR("K E4:"), getLinearAdvance_mm_mm_s(E3) ); + w.adjuster( 8, GET_TEXTF(LINEAR_ADVANCE_K4), getLinearAdvance_mm_mm_s(E3) ); #endif #endif #endif diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/lock_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/lock_screen.cpp index 99b78933ac..ae683ced54 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/lock_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/lock_screen.cpp @@ -65,16 +65,16 @@ void LockScreen::onRedraw(draw_mode_t what) { progmem_str message; switch (message_style()) { case 'w': - message = F("Wrong passcode!"); + message = GET_TEXTF(PASSCODE_REJECTED); break; case 'g': - message = F("Passcode accepted!"); + message = GET_TEXTF(PASSCODE_ACCEPTED); break; default: if (passcode == 0) { - message = F("Select Passcode:"); + message = GET_TEXTF(PASSCODE_SELECT); } else { - message = F("Enter Passcode:"); + message = GET_TEXTF(PASSCODE_REQUEST); } } message_style() = '\0'; // Terminate the string. diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/main_menu.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/main_menu.cpp index 9c6a3f4c2d..ae6dd58c24 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/main_menu.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/main_menu.cpp @@ -43,53 +43,53 @@ void MainMenu::onRedraw(draw_mode_t what) { #ifdef TOUCH_UI_PORTRAIT #define GRID_ROWS 8 #define GRID_COLS 2 - .tag(2).button( BTN_POS(1,1), BTN_SIZE(1,1), F("Auto Home")) + .tag(2).button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXTF(AUTO_HOME)) #ifdef NOZZLE_CLEAN_FEATURE .enabled(1) #else .enabled(0) #endif - .tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), F("Clean Nozzle")) - .tag(4).button( BTN_POS(1,2), BTN_SIZE(1,1), F("Move Axis")) - .tag(5).button( BTN_POS(2,2), BTN_SIZE(1,1), F("Motors Off")) - .tag(6).button( BTN_POS(1,3), BTN_SIZE(2,1), F("Temperature")) - .tag(7).button( BTN_POS(1,4), BTN_SIZE(2,1), F("Change Filament")) - .tag(8).button( BTN_POS(1,5), BTN_SIZE(2,1), F("Advanced Settings")) + .tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXTF(CLEAN_NOZZLE)) + .tag(4).button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXTF(MOVE_AXIS)) + .tag(5).button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXTF(MOTORS_OFF)) + .tag(6).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXTF(TEMPERATURE)) + .tag(7).button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXTF(CHANGE_FILAMENT)) + .tag(8).button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXTF(ADVANCED_SETTINGS)) #ifdef PRINTCOUNTER .enabled(1) #else .enabled(0) #endif - .tag(9).button( BTN_POS(1,7), BTN_SIZE(2,1), F("Printer Statistics")) - .tag(10).button( BTN_POS(1,6), BTN_SIZE(2,1), F("About Printer")) + .tag(9).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXTF(PRINTER_STATISTICS)) + .tag(10).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXTF(ABOUT_PRINTER)) .colors(action_btn) - .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), F("Back")); + .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXTF(BACK)); #undef GRID_COLS #undef GRID_ROWS #else #define GRID_ROWS 5 #define GRID_COLS 2 - .tag(2).button( BTN_POS(1,1), BTN_SIZE(1,1), F("Auto Home")) + .tag(2).button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXTF(AUTO_HOME)) #if ENABLED(NOZZLE_CLEAN_FEATURE) .enabled(1) #else .enabled(0) #endif - .tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), F("Clean Nozzle")) - .tag(4).button( BTN_POS(1,2), BTN_SIZE(1,1), F("Move Axis")) - .tag(5).button( BTN_POS(2,2), BTN_SIZE(1,1), F("Motors Off")) - .tag(6).button( BTN_POS(1,3), BTN_SIZE(1,1), F("Temperature")) - .tag(7).button( BTN_POS(2,3), BTN_SIZE(1,1), F("Change Filament")) - .tag(8).button( BTN_POS(1,4), BTN_SIZE(1,1), F("Advanced Settings")) + .tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXTF(CLEAN_NOZZLE)) + .tag(4).button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXTF(MOVE_AXIS)) + .tag(5).button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXTF(MOTORS_OFF)) + .tag(6).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXTF(TEMPERATURE)) + .tag(7).button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXTF(CHANGE_FILAMENT)) + .tag(8).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXTF(ADVANCED_SETTINGS)) #ifdef PRINTCOUNTER .enabled(1) #else .enabled(0) #endif - .tag(9).button( BTN_POS(2,4), BTN_SIZE(1,1), F("Printer Statistics")) - .tag(10).button( BTN_POS(1,5), BTN_SIZE(1,1), F("About Printer")) + .tag(9).button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXTF(PRINTER_STATISTICS)) + .tag(10).button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXTF(ABOUT_PRINTER)) .colors(action_btn) - .tag(1).button( BTN_POS(2,5), BTN_SIZE(1,1), F("Back")); + .tag(1).button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXTF(BACK)); #undef GRID_COLS #undef GRID_ROWS #endif diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/max_acceleration_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/max_acceleration_screen.cpp index ccc58b5a3c..80e7f59cde 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/max_acceleration_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/max_acceleration_screen.cpp @@ -33,21 +33,21 @@ using namespace Theme; void MaxAccelerationScreen::onRedraw(draw_mode_t what) { widgets_t w(what); w.precision(0); - w.units(PSTR("mm/s^2")); - w.heading( PSTR("Maximum Acceleration")); - w.color(x_axis) .adjuster( 2, PSTR("X:"), getAxisMaxAcceleration_mm_s2(X) ); - w.color(y_axis) .adjuster( 4, PSTR("Y:"), getAxisMaxAcceleration_mm_s2(Y) ); - w.color(z_axis) .adjuster( 6, PSTR("Z:"), getAxisMaxAcceleration_mm_s2(Z) ); + w.units(GET_TEXTF(UNITS_MM_S2)); + w.heading(GET_TEXTF(ACCELERATION)); + w.color(x_axis) .adjuster( 2, GET_TEXTF(AMAX_X), getAxisMaxAcceleration_mm_s2(X) ); + w.color(y_axis) .adjuster( 4, GET_TEXTF(AMAX_Y), getAxisMaxAcceleration_mm_s2(Y) ); + w.color(z_axis) .adjuster( 6, GET_TEXTF(AMAX_Z), getAxisMaxAcceleration_mm_s2(Z) ); #if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS) - w.color(e_axis).adjuster( 8, PSTR("E:"), getAxisMaxAcceleration_mm_s2(E0) ); + w.color(e_axis).adjuster( 8, GET_TEXTF(AMAX_E1), getAxisMaxAcceleration_mm_s2(E0) ); #elif EXTRUDERS > 1 - w.color(e_axis).adjuster( 8, PSTR("E1:"), getAxisMaxAcceleration_mm_s2(E0) ); - w.color(e_axis).adjuster(10, PSTR("E2:"), getAxisMaxAcceleration_mm_s2(E1) ); + w.color(e_axis).adjuster( 8, GET_TEXTF(AMAX_E1), getAxisMaxAcceleration_mm_s2(E0) ); + w.color(e_axis).adjuster(10, GET_TEXTF(AMAX_E2), getAxisMaxAcceleration_mm_s2(E1) ); #if EXTRUDERS > 2 - w.color(e_axis).adjuster(12, PSTR("E3:"), getAxisMaxAcceleration_mm_s2(E2) ); + w.color(e_axis).adjuster(12, GET_TEXTF(AMAX_E3), getAxisMaxAcceleration_mm_s2(E2) ); #endif #if EXTRUDERS > 3 - w.color(e_axis).adjuster(14, PSTR("E4:"), getAxisMaxAcceleration_mm_s2(E3) ); + w.color(e_axis).adjuster(14, GET_TEXTF(AMAX_E4), getAxisMaxAcceleration_mm_s2(E3) ); #endif #endif w.increments(); diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/max_velocity_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/max_velocity_screen.cpp index e147bfe4e1..719e5a308e 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/max_velocity_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/max_velocity_screen.cpp @@ -34,21 +34,21 @@ void MaxVelocityScreen::onRedraw(draw_mode_t what) { using namespace ExtUI; widgets_t w(what); w.precision(0); - w.units(PSTR("mm/s")); - w.heading( PSTR("Maximum Velocity")); - w.color(x_axis) .adjuster( 2, PSTR("X:"), getAxisMaxFeedrate_mm_s(X) ); - w.color(y_axis) .adjuster( 4, PSTR("Y:"), getAxisMaxFeedrate_mm_s(Y) ); - w.color(z_axis) .adjuster( 6, PSTR("Z:"), getAxisMaxFeedrate_mm_s(Z) ); + w.units(GET_TEXTF(UNITS_MM_S)); + w.heading( GET_TEXTF(VELOCITY)); + w.color(x_axis) .adjuster( 2, GET_TEXTF(VMAX_X), getAxisMaxFeedrate_mm_s(X) ); + w.color(y_axis) .adjuster( 4, GET_TEXTF(VMAX_Y), getAxisMaxFeedrate_mm_s(Y) ); + w.color(z_axis) .adjuster( 6, GET_TEXTF(VMAX_Z), getAxisMaxFeedrate_mm_s(Z) ); #if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS) - w.color(e_axis) .adjuster( 8, PSTR("E:"), getAxisMaxFeedrate_mm_s(E0) ); + w.color(e_axis) .adjuster( 8, GET_TEXTF(VMAX_E1), getAxisMaxFeedrate_mm_s(E0) ); #elif EXTRUDERS > 1 - w.color(e_axis) .adjuster( 8, PSTR("E1:"), getAxisMaxFeedrate_mm_s(E0) ); - w.color(e_axis) .adjuster( 10, PSTR("E2:"), getAxisMaxFeedrate_mm_s(E1) ); + w.color(e_axis) .adjuster( 8, GET_TEXTF(VMAX_E1), getAxisMaxFeedrate_mm_s(E0) ); + w.color(e_axis) .adjuster( 10, GET_TEXTF(VMAX_E2), getAxisMaxFeedrate_mm_s(E1) ); #if EXTRUDERS > 2 - w.color(e_axis).adjuster( 12, PSTR("E3:"), getAxisMaxFeedrate_mm_s(E2) ); + w.color(e_axis).adjuster( 12, GET_TEXTF(VMAX_E3), getAxisMaxFeedrate_mm_s(E2) ); #endif #if EXTRUDERS > 3 - w.color(e_axis).adjuster( 14, PSTR("E4:"), getAxisMaxFeedrate_mm_s(E3) ); + w.color(e_axis).adjuster( 14, GET_TEXTF(VMAX_E4), getAxisMaxFeedrate_mm_s(E3) ); #endif #endif w.increments(); diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/media_player_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/media_player_screen.cpp index 5db38bec09..1043dde9c7 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/media_player_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/media_player_screen.cpp @@ -66,8 +66,7 @@ bool MediaPlayerScreen::playCardMedia() { if (!reader.open(fname)) return false; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Starting to play STARTUP.AVI"); + SERIAL_ECHO_MSG("Starting to play STARTUP.AVI"); playStream(&reader, MediaFileReader::read); reader.close(); #endif @@ -79,8 +78,7 @@ bool MediaPlayerScreen::playBootMedia() { UIFlashStorage::BootMediaReader reader; if (!reader.isAvailable()) return false; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Starting to play boot video"); + SERIAL_ECHO_MSG("Starting to play boot video"); playStream(&reader, UIFlashStorage::BootMediaReader::read); return true; } @@ -138,8 +136,7 @@ void MediaPlayerScreen::playStream(void *obj, media_streamer_func_t *data_stream t = millis(); timeouts--; if (timeouts == 0) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Timeout playing video"); + SERIAL_ECHO_MSG("Timeout playing video"); cmd.reset(); goto exit; } @@ -151,8 +148,7 @@ void MediaPlayerScreen::playStream(void *obj, media_streamer_func_t *data_stream CLCD::mem_write_32(CLCD::REG::MEDIAFIFO_WRITE, writePtr); } while (nBytes == block_size); - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Done playing video"); + SERIAL_ECHO_MSG("Done playing video"); exit: spiInit(SPI_SPEED); // Restore default speed @@ -161,8 +157,11 @@ void MediaPlayerScreen::playStream(void *obj, media_streamer_func_t *data_stream // everything that is stored in RAMG. cmd.cmd(CMD_DLSTART).execute(); DLCache::init(); - StatusScreen::onStartup(); + StatusScreen::loadBitmaps(); } + #else + UNUSED(obj); + UNUSED(data_stream); #endif // FTDI_API_LEVEL >= 810 } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/move_axis_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/move_axis_screen.cpp index 60229907b9..86032e8562 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/move_axis_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/move_axis_screen.cpp @@ -36,7 +36,7 @@ void MoveAxisScreen::onEntry() { // ourselves. The relative distances are reset to zero whenever this // screen is entered. - for(uint8_t i = 0; i < ExtUI::extruderCount; i++) { + for (uint8_t i = 0; i < ExtUI::extruderCount; i++) { screen_data.MoveAxisScreen.e_rel[i] = 0; } BaseNumericAdjustmentScreen::onEntry(); @@ -45,31 +45,32 @@ void MoveAxisScreen::onEntry() { void MoveAxisScreen::onRedraw(draw_mode_t what) { widgets_t w(what); w.precision(1); - w.units(PSTR("mm")); - w.heading( PSTR("Move Axis")); + w.units(GET_TEXTF(UNITS_MM)); + w.heading( GET_TEXTF(MOVE_AXIS)); w.home_buttons(20); - w.color(Theme::x_axis ) .adjuster( 2, PSTR("X:"), getAxisPosition_mm(X), canMove(X)); - w.color(Theme::y_axis ) .adjuster( 4, PSTR("Y:"), getAxisPosition_mm(Y), canMove(Y)); - w.color(Theme::z_axis ) .adjuster( 6, PSTR("Z:"), getAxisPosition_mm(Z), canMove(Z)); + w.color(Theme::x_axis).adjuster( 2, GET_TEXTF(AXIS_X), getAxisPosition_mm(X), canMove(X)); + w.color(Theme::y_axis).adjuster( 4, GET_TEXTF(AXIS_Y), getAxisPosition_mm(Y), canMove(Y)); + w.color(Theme::z_axis).adjuster( 6, GET_TEXTF(AXIS_Z), getAxisPosition_mm(Z), canMove(Z)); + w.color(Theme::e_axis); #if EXTRUDERS == 1 - w.color(Theme::e_axis) .adjuster( 8, PSTR("E:"), screen_data.MoveAxisScreen.e_rel[0], canMove(E0)); + w.adjuster( 8, GET_TEXTF(AXIS_E), screen_data.MoveAxisScreen.e_rel[0], canMove(E0)); #elif EXTRUDERS > 1 - w.color(Theme::e_axis) .adjuster( 8, PSTR("E1:"), screen_data.MoveAxisScreen.e_rel[0], canMove(E0)); - w.color(Theme::e_axis) .adjuster( 10, PSTR("E2:"), screen_data.MoveAxisScreen.e_rel[1], canMove(E1)); + w.adjuster( 8, GET_TEXTF(AXIS_E1), screen_data.MoveAxisScreen.e_rel[0], canMove(E0)); + w.adjuster( 10, GET_TEXTF(AXIS_E2), screen_data.MoveAxisScreen.e_rel[1], canMove(E1)); #if EXTRUDERS > 2 - w.color(Theme::e_axis) .adjuster( 12, PSTR("E3:"), screen_data.MoveAxisScreen.e_rel[2], canMove(E2)); + w.adjuster( 12, GET_TEXTF(AXIS_E3), screen_data.MoveAxisScreen.e_rel[2], canMove(E2)); #endif #if EXTRUDERS > 3 - w.color(Theme::e_axis) .adjuster( 14, PSTR("E4:"), screen_data.MoveAxisScreen.e_rel[3], canMove(E3)); + w.adjuster( 14, GET_TEXTF(AXIS_E4), screen_data.MoveAxisScreen.e_rel[3], canMove(E3)); #endif #endif w.increments(); } bool MoveAxisScreen::onTouchHeld(uint8_t tag) { - #define UI_INCREMENT_AXIS(axis) setManualFeedrate(axis, increment); UI_INCREMENT(AxisPosition_mm, axis); - #define UI_DECREMENT_AXIS(axis) setManualFeedrate(axis, increment); UI_DECREMENT(AxisPosition_mm, axis); + #define UI_INCREMENT_AXIS(axis) UI_INCREMENT(AxisPosition_mm, axis); + #define UI_DECREMENT_AXIS(axis) UI_DECREMENT(AxisPosition_mm, axis); const float increment = getIncrement(); switch (tag) { case 2: UI_DECREMENT_AXIS(X); break; @@ -93,10 +94,10 @@ bool MoveAxisScreen::onTouchHeld(uint8_t tag) { case 14: UI_DECREMENT_AXIS(E3); screen_data.MoveAxisScreen.e_rel[3] -= increment; break; case 15: UI_INCREMENT_AXIS(E3); screen_data.MoveAxisScreen.e_rel[3] += increment; break; #endif - case 20: injectCommands_P(PSTR("G28 X")); break; - case 21: injectCommands_P(PSTR("G28 Y")); break; - case 22: injectCommands_P(PSTR("G28 Z")); break; - case 23: injectCommands_P(PSTR("G28")); break; + case 20: SpinnerDialogBox::enqueueAndWait_P(F("G28 X")); break; + case 21: SpinnerDialogBox::enqueueAndWait_P(F("G28 Y")); break; + case 22: SpinnerDialogBox::enqueueAndWait_P(F("G28 Z")); break; + case 23: SpinnerDialogBox::enqueueAndWait_P(F("G28")); break; default: return false; } @@ -109,8 +110,8 @@ float MoveAxisScreen::getManualFeedrate(uint8_t axis, float increment_mm) { // Compute feedrate so that the tool lags the adjuster when it is // being held down, this allows enough margin for the planner to // connect segments and even out the motion. - constexpr float max_manual_feedrate[XYZE] = MAX_MANUAL_FEEDRATE; - return min(max_manual_feedrate[axis]/60, abs(increment_mm * TOUCH_REPEATS_PER_SECOND * 0.80)); + constexpr float manual_feedrate[XYZE] = MANUAL_FEEDRATE; + return min(manual_feedrate[axis] / 60.0f, abs(increment_mm * (TOUCH_REPEATS_PER_SECOND) * 0.80f)); } void MoveAxisScreen::setManualFeedrate(ExtUI::axis_t axis, float increment_mm) { diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/nozzle_offsets_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/nozzle_offsets_screen.cpp index 558c1acfce..e8835ba858 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/nozzle_offsets_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/nozzle_offsets_screen.cpp @@ -39,14 +39,14 @@ void NozzleOffsetScreen::onEntry() { void NozzleOffsetScreen::onRedraw(draw_mode_t what) { widgets_t w(what); - w.precision(2).units(PSTR("mm")); + w.precision(2).units(GET_TEXTF(UNITS_MM)); - w.heading( PSTR("Nozzle Offset")); - w.color(Theme::x_axis).adjuster(2, PSTR("X:"), ExtUI::getNozzleOffset_mm(X, E1)); - w.color(Theme::y_axis).adjuster(4, PSTR("Y:"), ExtUI::getNozzleOffset_mm(Y, E1)); - w.color(Theme::z_axis).adjuster(6, PSTR("Z:"), ExtUI::getNozzleOffset_mm(Z, E1)); + w.heading( GET_TEXTF(TOOL_OFFSETS)); + w.color(Theme::x_axis).adjuster(2, GET_TEXTF(AXIS_X), ExtUI::getNozzleOffset_mm(X, E1)); + w.color(Theme::y_axis).adjuster(4, GET_TEXTF(AXIS_Y), ExtUI::getNozzleOffset_mm(Y, E1)); + w.color(Theme::z_axis).adjuster(6, GET_TEXTF(AXIS_Z), ExtUI::getNozzleOffset_mm(Z, E1)); #if ENABLED(CALIBRATION_GCODE) - w.button(8, PSTR("Measure automatically"), !isPrinting()); + w.button(8, GET_TEXTF(MEASURE_AUTOMATICALLY), !isPrinting()); #endif w.increments(); } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/nudge_nozzle_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/nudge_nozzle_screen.cpp index 99badde0b4..74e7c45040 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/nudge_nozzle_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/nudge_nozzle_screen.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(LULZBOT_TOUCH_UI) && ENABLED(BABYSTEPPING) +#if BOTH(LULZBOT_TOUCH_UI, BABYSTEPPING) #include "screens.h" #include "screen_data.h" @@ -44,41 +44,38 @@ void NudgeNozzleScreen::onEntry() { void NudgeNozzleScreen::onRedraw(draw_mode_t what) { widgets_t w(what); - w.precision(2, BaseNumericAdjustmentScreen::DEFAULT_MIDRANGE).units(PSTR("mm")); + w.precision(2, BaseNumericAdjustmentScreen::DEFAULT_MIDRANGE).units(GET_TEXTF(UNITS_MM)); - w.heading( PSTR("Nudge Nozzle")); + w.heading( GET_TEXTF(NUDGE_NOZZLE)); #if ENABLED(BABYSTEP_XY) - w.color(x_axis).adjuster(2, PSTR("X:"), screen_data.NudgeNozzleScreen.rel[0] / getAxisSteps_per_mm(X)); - w.color(y_axis).adjuster(4, PSTR("Y:"), screen_data.NudgeNozzleScreen.rel[1] / getAxisSteps_per_mm(Y)); + w.color(x_axis).adjuster(2, GET_TEXTF(AXIS_X), screen_data.NudgeNozzleScreen.rel[0] / getAxisSteps_per_mm(X)); + w.color(y_axis).adjuster(4, GET_TEXTF(AXIS_Y), screen_data.NudgeNozzleScreen.rel[1] / getAxisSteps_per_mm(Y)); #endif - w.color(z_axis).adjuster(6, PSTR("Z:"), screen_data.NudgeNozzleScreen.rel[2] / getAxisSteps_per_mm(Z)); + w.color(z_axis).adjuster(6, GET_TEXTF(AXIS_Z), screen_data.NudgeNozzleScreen.rel[2] / getAxisSteps_per_mm(Z)); w.increments(); #if EXTRUDERS > 1 - w.toggle (8, PSTR("Adjust Both Nozzles:"), PSTR("no\xFFyes"), screen_data.NudgeNozzleScreen.link_nozzles, PSTR("Yes\nNo")); + w.toggle (8, GET_TEXTF(ADJUST_BOTH_NOZZLES), screen_data.NudgeNozzleScreen.link_nozzles); #endif #if EXTRUDERS > 1 || HAS_BED_PROBE - w.toggle (9, PSTR("Show Offsets:"), PSTR("no\xFFyes"), screen_data.NudgeNozzleScreen.show_offsets, PSTR("Yes\nNo")); + w.toggle (9, GET_TEXTF(SHOW_OFFSETS), screen_data.NudgeNozzleScreen.show_offsets); if (screen_data.NudgeNozzleScreen.show_offsets) { - char str[19], num1[7]; + char str[19]; w.draw_mode(BOTH); w.color(other); #if HAS_BED_PROBE - dtostrf(getZOffset_mm(), 4, 2, num1); - sprintf_P(str, PSTR("%s mm"), num1); - w.text_field (0, PSTR("Z Offset"), str); + dtostrf(getZOffset_mm(), 4, 2, str); + strcat(str, " "); + strcat_P(str, GET_TEXT(UNITS_MM)); + w.text_field (0, GET_TEXTF(ZPROBE_ZOFFSET), str); #endif #if EXTRUDERS > 1 - char num2[7], num3[7]; - dtostrf(getNozzleOffset_mm(X, E1), 4, 2, num1); - dtostrf(getNozzleOffset_mm(Y, E1), 4, 2, num2); - dtostrf(getNozzleOffset_mm(Z, E1), 4, 2, num3); - sprintf_P(str, PSTR("%s; %s; %s mm"), num1, num2, num3); - w.text_field (0, PSTR("Noz. Offset"), str); + format_position(str, getNozzleOffset_mm(X, E1), getNozzleOffset_mm(Y, E1), getNozzleOffset_mm(Z, E1)); + w.text_field (0, GET_TEXTF(TOOL_OFFSETS), str); #endif } #endif diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/restore_failsafe_dialog_box.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/restore_failsafe_dialog_box.cpp index a93727cd8d..717fea9cac 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/restore_failsafe_dialog_box.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/restore_failsafe_dialog_box.cpp @@ -29,15 +29,15 @@ using namespace ExtUI; void RestoreFailsafeDialogBox::onRedraw(draw_mode_t) { - drawMessage(F("Are you sure? Customizations will be lost.")); + drawMessage(GET_TEXTF(EEPROM_RESET_WARNING)); drawYesNoButtons(); } bool RestoreFailsafeDialogBox::onTouchEnd(uint8_t tag) { switch (tag) { case 1: - ExtUI::injectCommands_P(PSTR("M502\nM117 Factory settings restored.")); - AlertDialogBox::show(F("Factory settings restored.")); + ExtUI::injectCommands_P(PSTR("M502")); + AlertDialogBox::show(GET_TEXTF(EEPROM_RESET)); // Remove RestoreFailsafeDialogBox from the stack // so the alert box doesn't return to it. current_screen.forget(); diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/save_settings_dialog_box.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/save_settings_dialog_box.cpp index 8a58af119c..b29c171cf7 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/save_settings_dialog_box.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/save_settings_dialog_box.cpp @@ -31,7 +31,7 @@ using namespace ExtUI; bool SaveSettingsDialogBox::needs_save = false; void SaveSettingsDialogBox::onRedraw(draw_mode_t) { - drawMessage(F("Do you wish to save these settings as defaults?")); + drawMessage(GET_TEXTF(EEPROM_SAVE_PROMPT)); drawYesNoButtons(); } @@ -40,7 +40,7 @@ bool SaveSettingsDialogBox::onTouchEnd(uint8_t tag) { switch (tag) { case 1: injectCommands_P(PSTR("M500")); - AlertDialogBox::show(F("Settings saved!")); + AlertDialogBox::show(GET_TEXTF(EEPROM_SAVED)); // Remove SaveSettingsDialogBox from the stack // so the alert box doesn't return to me. current_screen.forget(); diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/screen_data.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/screen_data.h index ed50a8bc3f..65cb6e85d7 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/screen_data.h +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/screen_data.h @@ -67,7 +67,7 @@ union screen_data_t { struct base_numeric_adjustment_t placeholder; int16_t rel[XYZ]; #if EXTRUDERS > 1 - bool link_nozzles; + bool link_nozzles; #endif bool show_offsets; } NudgeNozzleScreen; diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/screens.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/screens.cpp index fa53a0130b..59d4069d6c 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/screens.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/screens.cpp @@ -31,6 +31,9 @@ screen_data_t screen_data; SCREEN_TABLE { DECL_SCREEN(BootScreen), + #if NUM_LANGUAGES > 1 + DECL_SCREEN(LanguageMenu), + #endif DECL_SCREEN(TouchCalibrationScreen), DECL_SCREEN(StatusScreen), DECL_SCREEN(MainMenu), @@ -76,7 +79,7 @@ SCREEN_TABLE { #else DECL_SCREEN(JerkScreen), #endif -#if ENABLED(LIN_ADVANCE) || ENABLED(FILAMENT_RUNOUT_SENSOR) +#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) DECL_SCREEN(FilamentMenu), #endif #if ENABLED(FILAMENT_RUNOUT_SENSOR) diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/screens.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/screens.h index d8c48de9ed..20a1809014 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/screens.h +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/screens.h @@ -23,9 +23,9 @@ #pragma once #include "../ftdi_eve_lib/ftdi_eve_lib.h" +#include "../language/language.h" #include "../theme/theme.h" - -#define ROUND(val) uint16_t((val)+0.5) +#include "string_format.h" extern tiny_timer_t refresh_timer; @@ -60,7 +60,7 @@ enum { #else JERK_SCREEN_CACHE, #endif -#if ENABLED(LIN_ADVANCE) || ENABLED(FILAMENT_RUNOUT_SENSOR) +#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) FILAMENT_MENU_CACHE, #endif #if ENABLED(LIN_ADVANCE) @@ -97,6 +97,8 @@ class BaseScreen : public UIScreen { static uint32_t last_interaction; #endif + static bool buttonIsPressed(uint8_t tag); + public: static bool buttonStyleCallback(CommandProcessor &, uint8_t, uint8_t &, uint16_t &, bool); @@ -147,6 +149,7 @@ class DialogBoxBaseClass : public BaseScreen { static void onRedraw(draw_mode_t) {}; public: static bool onTouchEnd(uint8_t tag); + static void onIdle(); }; class AlertDialogBox : public DialogBoxBaseClass, public CachedScreen { @@ -209,7 +212,7 @@ class SpinnerDialogBox : public DialogBoxBaseClass, public CachedScreen { private: static void draw_axis_position(draw_mode_t); @@ -219,6 +222,7 @@ class StatusScreen : public BaseScreen, public CachedScreen { public: static void onRedraw(draw_mode_t); @@ -710,3 +722,11 @@ class MediaPlayerScreen : public BaseScreen, public UncachedScreen { static void playStream(void *obj, media_streamer_func_t*); }; + +#if NUM_LANGUAGES > 1 + class LanguageMenu : public BaseScreen, public UncachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); + }; +#endif diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/spinner_dialog_box.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/spinner_dialog_box.cpp index 971bd5e5ba..985a217e78 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/spinner_dialog_box.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/spinner_dialog_box.cpp @@ -46,7 +46,7 @@ void SpinnerDialogBox::hide() { } void SpinnerDialogBox::enqueueAndWait_P(const progmem_str commands) { - enqueueAndWait_P(F("Please wait..."), commands); + enqueueAndWait_P(GET_TEXTF(PLEASE_WAIT), commands); } void SpinnerDialogBox::enqueueAndWait_P(const progmem_str message, const progmem_str commands) { @@ -57,6 +57,7 @@ void SpinnerDialogBox::enqueueAndWait_P(const progmem_str message, const progmem } void SpinnerDialogBox::onIdle() { + reset_menu_timeout(); if (screen_data.SpinnerDialogBox.auto_hide && !commandsInQueue()) { screen_data.SpinnerDialogBox.auto_hide = false; hide(); diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/statistics_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/statistics_screen.cpp index efc1cc38f3..e468159d2c 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/statistics_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/statistics_screen.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(LULZBOT_TOUCH_UI) && ENABLED(PRINTCOUNTER) +#if BOTH(LULZBOT_TOUCH_UI, PRINTCOUNTER) #include "screens.h" @@ -44,14 +44,14 @@ void StatisticsScreen::onRedraw(draw_mode_t what) { .tag(0) .font(Theme::font_medium) - .text(BTN_POS(1,1), BTN_SIZE(4,1), F("Printer Statistics")) + .text(BTN_POS(1,1), BTN_SIZE(4,1), GET_TEXTF(PRINTER_STATISTICS)) .font(Theme::font_small) .tag(0) - .text(BTN_POS(1,2), BTN_SIZE(2,1), F("Total Prints:"), OPT_RIGHTX | OPT_CENTERY) - .text(BTN_POS(1,3), BTN_SIZE(2,1), F("Finished Prints:"), OPT_RIGHTX | OPT_CENTERY) - .text(BTN_POS(1,4), BTN_SIZE(2,1), F("Total Print Time:"), OPT_RIGHTX | OPT_CENTERY) - .text(BTN_POS(1,5), BTN_SIZE(2,1), F("Longest Print:"), OPT_RIGHTX | OPT_CENTERY) - .text(BTN_POS(1,6), BTN_SIZE(2,1), F("Filament Used:"), OPT_RIGHTX | OPT_CENTERY); + .text(BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXTF(INFO_PRINT_COUNT), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXTF(INFO_COMPLETED_PRINTS), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXTF(INFO_PRINT_TIME), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXTF(INFO_PRINT_LONGEST), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXTF(INFO_PRINT_FILAMENT), OPT_RIGHTX | OPT_CENTERY); // Don't chain the following, it causes strange issues with evaluation ordering! cmd.text(BTN_POS(3,2), BTN_SIZE(2,1), getTotalPrints_str(buffer)); cmd.text(BTN_POS(3,3), BTN_SIZE(2,1), getFinishedPrints_str(buffer)); @@ -63,7 +63,7 @@ void StatisticsScreen::onRedraw(draw_mode_t what) { if (what & FOREGROUND) { cmd.font(Theme::font_medium) .colors(action_btn) - .tag(1).button(BTN_POS(1,7), BTN_SIZE(4,1), F("Back")); + .tag(1).button(BTN_POS(1,7), BTN_SIZE(4,1), GET_TEXTF(BACK)); } } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/status_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/status_screen.cpp index 420ac2b430..81fc86d5a4 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/status_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/status_screen.cpp @@ -22,17 +22,13 @@ #include "../config.h" -#if ENABLED(LULZBOT_TOUCH_UI) && !defined(LULZBOT_USE_BIOPRINTER_UI) +#if ENABLED(LULZBOT_TOUCH_UI) && DISABLED(LULZBOT_USE_BIOPRINTER_UI) #include "screens.h" #include "screen_data.h" #include "../archim2-flash/flash_storage.h" -#if ENABLED(SDSUPPORT) && defined(LULZBOT_MANUAL_USB_STARTUP) - #include "../../../../../sd/cardreader.h" -#endif - using namespace FTDI; using namespace Theme; @@ -57,9 +53,9 @@ void StatusScreen::draw_axis_position(draw_mode_t what) { .button( BTN_POS(1,7), BTN_SIZE(2,1), F(""), OPT_FLAT) .font(Theme::font_small) - .text ( BTN_POS(1,5), BTN_SIZE(1,1), F("X")) - .text ( BTN_POS(1,6), BTN_SIZE(1,1), F("Y")) - .text ( BTN_POS(1,7), BTN_SIZE(1,1), F("Z")) + .text ( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXTF(AXIS_X)) + .text ( BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXTF(AXIS_Y)) + .text ( BTN_POS(1,7), BTN_SIZE(1,1), GET_TEXTF(AXIS_Z)) .font(Theme::font_medium) .fgcolor(Theme::x_axis) .button( BTN_POS(2,5), BTN_SIZE(2,1), F(""), OPT_FLAT) @@ -73,9 +69,9 @@ void StatusScreen::draw_axis_position(draw_mode_t what) { .button( BTN_POS(3,5), BTN_SIZE(1,2), F(""), OPT_FLAT) .font(Theme::font_small) - .text ( BTN_POS(1,5), BTN_SIZE(1,1), F("X")) - .text ( BTN_POS(2,5), BTN_SIZE(1,1), F("Y")) - .text ( BTN_POS(3,5), BTN_SIZE(1,1), F("Z")) + .text ( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXTF(AXIS_X)) + .text ( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXTF(AXIS_Y)) + .text ( BTN_POS(3,5), BTN_SIZE(1,1), GET_TEXTF(AXIS_Z)) .font(Theme::font_medium) .fgcolor(Theme::x_axis) .button( BTN_POS(1,6), BTN_SIZE(1,1), F(""), OPT_FLAT) @@ -90,26 +86,20 @@ void StatusScreen::draw_axis_position(draw_mode_t what) { char y_str[15]; char z_str[15]; - if (isAxisPositionKnown(X)) { - dtostrf(getAxisPosition_mm(X), 5, 1, x_str); - strcat_P(x_str, PSTR(" mm")); - } else { + if (isAxisPositionKnown(X)) + format_position(x_str, getAxisPosition_mm(X)); + else strcpy_P(x_str, PSTR("?")); - } - if (isAxisPositionKnown(Y)) { - dtostrf(getAxisPosition_mm(Y), 5, 1, y_str); - strcat_P(y_str, PSTR(" mm")); - } else { + if (isAxisPositionKnown(Y)) + format_position(y_str, getAxisPosition_mm(Y)); + else strcpy_P(y_str, PSTR("?")); - } - if (isAxisPositionKnown(Z)) { - dtostrf(getAxisPosition_mm(Z), 5, 1, z_str); - strcat_P(z_str, PSTR(" mm")); - } else { + if (isAxisPositionKnown(Z)) + format_position(z_str, getAxisPosition_mm(Z)); + else strcpy_P(z_str, PSTR("?")); - } cmd.tag(6).font(Theme::font_medium) #ifdef TOUCH_UI_PORTRAIT @@ -178,14 +168,18 @@ void StatusScreen::draw_temperature(draw_mode_t what) { .cmd(BITMAP_LAYOUT(Fan_Icon_Info)) .cmd(BITMAP_SIZE (Fan_Icon_Info)) .icon (BTN_POS(5,2), BTN_SIZE(1,1), Fan_Icon_Info, icon_scale); + + #ifdef TOUCH_UI_USE_UTF8 + load_utf8_bitmaps(cmd); // Restore font bitmap handles + #endif } if (what & FOREGROUND) { using namespace ExtUI; - char e0_str[15]; - char e1_str[15]; - char bed_str[15]; - char fan_str[15]; + char e0_str[20]; + char e1_str[20]; + char bed_str[20]; + char fan_str[20]; sprintf_P( fan_str, @@ -193,30 +187,22 @@ void StatusScreen::draw_temperature(draw_mode_t what) { int8_t(getActualFan_percent(FAN0)) ); - const char *idle = PSTR("%-3d C / idle"); - const char *not_idle = PSTR("%-3d / %-3d C"); + if (isHeaterIdle(BED)) + format_temp_and_idle(bed_str, getActualTemp_celsius(BED)); + else + format_temp_and_temp(bed_str, getActualTemp_celsius(BED), getTargetTemp_celsius(BED)); - sprintf_P( - bed_str, - isHeaterIdle(BED) ? idle : not_idle, - ROUND(getActualTemp_celsius(BED)), - ROUND(getTargetTemp_celsius(BED)) - ); + if (isHeaterIdle(H0)) + format_temp_and_idle(e0_str, getActualTemp_celsius(H0)); + else + format_temp_and_temp(e0_str, getActualTemp_celsius(H0), getTargetTemp_celsius(H0)); - sprintf_P( - e0_str, - isHeaterIdle(H0) ? idle : not_idle, - ROUND(getActualTemp_celsius(H0)), - ROUND(getTargetTemp_celsius(H0)) - ); #if EXTRUDERS == 2 - sprintf_P( - e1_str, - isHeaterIdle(H1) ? idle : not_idle, - ROUND(getActualTemp_celsius(H1)), - ROUND(getTargetTemp_celsius(H1)) - ); + if (isHeaterIdle(H1)) + format_temp_and_idle(e1_str, getActualTemp_celsius(H1)); + else + format_temp_and_temp(e1_str, getActualTemp_celsius(H1), getTargetTemp_celsius(H1)); #else strcpy_P( e1_str, @@ -285,33 +271,20 @@ void StatusScreen::draw_interaction_buttons(draw_mode_t what) { CommandProcessor cmd; cmd.colors(normal_btn) .font(Theme::font_medium) - #if ENABLED(USB_FLASH_DRIVE_SUPPORT) && defined(LULZBOT_MANUAL_USB_STARTUP) - .enabled(!Sd2Card::ready() || has_media) - #else - .enabled(has_media) - #endif + .enabled(has_media) .colors(has_media ? action_btn : normal_btn) + .tag(3).button( + #ifdef TOUCH_UI_PORTRAIT + BTN_POS(1,8), BTN_SIZE(2,1), + #else + BTN_POS(1,7), BTN_SIZE(2,2), + #endif + isPrintingFromMedia() ? GET_TEXTF(PRINTING) : GET_TEXTF(MEDIA) + ).colors(!has_media ? action_btn : normal_btn) #ifdef TOUCH_UI_PORTRAIT - .tag(3).button( BTN_POS(1,8), BTN_SIZE(2,1), + .tag(4).button( BTN_POS(3,8), BTN_SIZE(2,1), GET_TEXTF(MENU)); #else - .tag(3).button( BTN_POS(1,7), BTN_SIZE(2,2), - #endif - isPrintingFromMedia() ? F("Printing") : - #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #ifdef LULZBOT_MANUAL_USB_STARTUP - (Sd2Card::ready() ? F("USB Drive") : F("Enable USB")) - #else - F("USB Drive") - #endif - ) - #else - F("SD Card")) - #endif - .colors(!has_media ? action_btn : normal_btn) - #ifdef TOUCH_UI_PORTRAIT - .tag(4).button( BTN_POS(3,8), BTN_SIZE(2,1), F("MENU")); - #else - .tag(4).button( BTN_POS(3,7), BTN_SIZE(2,2), F("MENU")); + .tag(4).button( BTN_POS(3,7), BTN_SIZE(2,2), GET_TEXTF(MENU)); #endif } #undef GRID_COLS @@ -357,9 +330,10 @@ void StatusScreen::setStatusMessage(const char* message) { draw_axis_position(BACKGROUND); draw_status_message(BACKGROUND, message); draw_interaction_buttons(BACKGROUND); + storeBackground(); - #ifdef UI_FRAMEWORK_DEBUG + #if ENABLED(TOUCH_UI_DEBUG) SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("New status message: ", message); #endif @@ -369,9 +343,8 @@ void StatusScreen::setStatusMessage(const char* message) { } } -void StatusScreen::onStartup() { +void StatusScreen::loadBitmaps() { // Load the bitmaps for the status screen - using namespace Theme; constexpr uint32_t base = ftdi_memory_map::RAM_G; CLCD::mem_write_pgm(base + TD_Icon_Info.RAMG_offset, TD_Icon, sizeof(TD_Icon)); @@ -379,8 +352,13 @@ void StatusScreen::onStartup() { CLCD::mem_write_pgm(base + Bed_Heat_Icon_Info.RAMG_offset, Bed_Heat_Icon, sizeof(Bed_Heat_Icon)); CLCD::mem_write_pgm(base + Fan_Icon_Info.RAMG_offset, Fan_Icon, sizeof(Fan_Icon)); - setStatusMessage(F(WELCOME_MSG)); + // Load fonts for internationalization + #ifdef TOUCH_UI_USE_UTF8 + load_utf8_data(base + UTF8_FONT_OFFSET); + #endif +} +void StatusScreen::onStartup() { UIFlashStorage::initialize(); } @@ -409,18 +387,7 @@ bool StatusScreen::onTouchEnd(uint8_t tag) { using namespace ExtUI; switch (tag) { - case 3: - #if ENABLED(USB_FLASH_DRIVE_SUPPORT) && defined(LULZBOT_MANUAL_USB_STARTUP) - if (!Sd2Card::ready()) { - StatusScreen::setStatusMessage(F("Insert USB drive...")); - Sd2Card::usbStartup(); - } else { - GOTO_SCREEN(FilesScreen); - } - #else - GOTO_SCREEN(FilesScreen); - #endif - break; + case 3: GOTO_SCREEN(FilesScreen); break; case 4: if (isPrinting()) { GOTO_SCREEN(TuneMenu); diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/stepper_bump_sensitivity_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/stepper_bump_sensitivity_screen.cpp index 651bfa8d5c..2a7a79baec 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/stepper_bump_sensitivity_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/stepper_bump_sensitivity_screen.cpp @@ -33,22 +33,22 @@ using namespace Theme; void StepperBumpSensitivityScreen::onRedraw(draw_mode_t what) { widgets_t w(what); w.precision(0, BaseNumericAdjustmentScreen::DEFAULT_LOWEST); - w.heading( PSTR("TMC Bump Sensitivity")); - w.color(x_axis) .adjuster( 2, PSTR("X:"), getTMCBumpSensitivity(X), + w.heading( GET_TEXTF(HOME_SENSE)); + w.color(x_axis) .adjuster( 2, GET_TEXTF(AXIS_X), getTMCBumpSensitivity(X), #if X_SENSORLESS && AXIS_HAS_STALLGUARD(X) true #else false #endif ); - w.color(y_axis) .adjuster( 4, PSTR("Y:"), getTMCBumpSensitivity(Y), + w.color(y_axis) .adjuster( 4, GET_TEXTF(AXIS_Y), getTMCBumpSensitivity(Y), #if Y_SENSORLESS && AXIS_HAS_STALLGUARD(Y) true #else false #endif ); - w.color(z_axis) .adjuster( 6, PSTR("Z:"), getTMCBumpSensitivity(Z), + w.color(z_axis) .adjuster( 6, GET_TEXTF(AXIS_Z), getTMCBumpSensitivity(Z), #if Z_SENSORLESS && AXIS_HAS_STALLGUARD(Z) true #else diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/stepper_current_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/stepper_current_screen.cpp index edeed68251..48d542bb59 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/stepper_current_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/stepper_current_screen.cpp @@ -33,21 +33,21 @@ using namespace Theme; void StepperCurrentScreen::onRedraw(draw_mode_t what) { widgets_t w(what); w.precision(0); - w.units(PSTR("mA")); - w.heading( PSTR("Stepper Current")); - w.color(x_axis) .adjuster( 2, PSTR("X:"), getAxisCurrent_mA(X) ); - w.color(y_axis) .adjuster( 4, PSTR("Y:"), getAxisCurrent_mA(Y) ); - w.color(z_axis) .adjuster( 6, PSTR("Z:"), getAxisCurrent_mA(Z) ); + w.units(GET_TEXTF(UNITS_MILLIAMP)); + w.heading( GET_TEXTF(MOTOR_CURRENT)); + w.color(x_axis) .adjuster( 2, GET_TEXTF(AXIS_X), getAxisCurrent_mA(X) ); + w.color(y_axis) .adjuster( 4, GET_TEXTF(AXIS_Y), getAxisCurrent_mA(Y) ); + w.color(z_axis) .adjuster( 6, GET_TEXTF(AXIS_Z), getAxisCurrent_mA(Z) ); #if EXTRUDERS == 1 - w.color(e_axis).adjuster( 8, PSTR("E:"), getAxisCurrent_mA(E0) ); + w.color(e_axis).adjuster( 8, GET_TEXTF(AXIS_E), getAxisCurrent_mA(E0) ); #elif EXTRUDERS > 1 - w.color(e_axis).adjuster( 8, PSTR("E1:"), getAxisCurrent_mA(E0) ); - w.color(e_axis).adjuster(10, PSTR("E2:"), getAxisCurrent_mA(E1) ); + w.color(e_axis).adjuster( 8, GET_TEXTF(AXIS_E1), getAxisCurrent_mA(E0) ); + w.color(e_axis).adjuster(10, GET_TEXTF(AXIS_E2), getAxisCurrent_mA(E1) ); #if EXTRUDERS > 2 - w.color(e_axis).adjuster(12, PSTR("E3:"), getAxisCurrent_mA(E2) ); + w.color(e_axis).adjuster(12, GET_TEXTF(AXIS_E3), getAxisCurrent_mA(E2) ); #endif #if EXTRUDERS > 3 - w.color(e_axis).adjuster(14, PSTR("E4:"), getAxisCurrent_mA(E3) ); + w.color(e_axis).adjuster(14, GET_TEXTF(AXIS_E4), getAxisCurrent_mA(E3) ); #endif #endif w.increments(); diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/steps_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/steps_screen.cpp index f368b3b425..3f69e25559 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/steps_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/steps_screen.cpp @@ -33,21 +33,21 @@ using namespace Theme; void StepsScreen::onRedraw(draw_mode_t what) { widgets_t w(what); w.precision(0); - w.units(PSTR("st/mm")); - w.heading( PSTR("Steps/mm")); - w.color(x_axis) .adjuster( 2, PSTR("X:"), getAxisSteps_per_mm(X) ); - w.color(y_axis) .adjuster( 4, PSTR("Y:"), getAxisSteps_per_mm(Y) ); - w.color(z_axis) .adjuster( 6, PSTR("Z:"), getAxisSteps_per_mm(Z) ); + w.units(GET_TEXTF(UNITS_STEP_MM)); + w.heading( GET_TEXTF(STEPS_PER_MM)); + w.color(x_axis) .adjuster( 2, GET_TEXTF(AXIS_X), getAxisSteps_per_mm(X) ); + w.color(y_axis) .adjuster( 4, GET_TEXTF(AXIS_Y), getAxisSteps_per_mm(Y) ); + w.color(z_axis) .adjuster( 6, GET_TEXTF(AXIS_Z), getAxisSteps_per_mm(Z) ); #if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS) - w.color(e_axis) .adjuster( 8, PSTR("E:"), getAxisSteps_per_mm(E0) ); + w.color(e_axis) .adjuster( 8, GET_TEXTF(AXIS_E), getAxisSteps_per_mm(E0) ); #elif EXTRUDERS > 1 - w.color(e_axis) .adjuster( 8, PSTR("E1:"), getAxisSteps_per_mm(E0) ); - w.color(e_axis) .adjuster(10, PSTR("E2:"), getAxisSteps_per_mm(E1) ); + w.color(e_axis) .adjuster( 8, GET_TEXTF(AXIS_E1), getAxisSteps_per_mm(E0) ); + w.color(e_axis) .adjuster(10, GET_TEXTF(AXIS_E2), getAxisSteps_per_mm(E1) ); #if EXTRUDERS > 2 - w.color(e_axis) .adjuster(12, PSTR("E3:"), getAxisSteps_per_mm(E2) ); + w.color(e_axis) .adjuster(12, GET_TEXTF(AXIS_E3), getAxisSteps_per_mm(E2) ); #endif #if EXTRUDERS > 3 - w.color(e_axis) .adjuster(14, PSTR("E4:"), getAxisSteps_per_mm(E3) ); + w.color(e_axis) .adjuster(14, GET_TEXTF(AXIS_E4), getAxisSteps_per_mm(E3) ); #endif #endif w.increments(); diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/stress_test_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/stress_test_screen.cpp index 5ef8331473..76d9fb2a9c 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/stress_test_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/stress_test_screen.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(LULZBOT_TOUCH_UI) && ENABLED(DEVELOPER_SCREENS) +#if BOTH(LULZBOT_TOUCH_UI, DEVELOPER_SCREENS) #include "screens.h" #include "screen_data.h" diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/string_format.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/string_format.cpp new file mode 100644 index 0000000000..17a4a73cf2 --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/string_format.cpp @@ -0,0 +1,89 @@ +/********************* + * string_format.cpp * + *********************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" + +#if ENABLED(LULZBOT_TOUCH_UI) + +#include "screens.h" + +#define ROUND(val) uint16_t((val)+0.5) + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wno-format" + +#ifdef __AVR__ + #define S_FMT "%S" +#else + #define S_FMT "%s" +#endif + +/** + * Formats a temperature string (e.g. "100°C") + */ +void format_temp(char *str, float t1) { + sprintf_P(str, PSTR("%3d" S_FMT), ROUND(t1), GET_TEXT(UNITS_C)); +} + +/** + * Formats a temperature string for an idle heater (e.g. "100 °C / idle") + */ +void format_temp_and_idle(char *str, float t1) { + sprintf_P(str, PSTR("%3d" S_FMT " / " S_FMT), ROUND(t1), GET_TEXT(UNITS_C), GET_TEXT(TEMP_IDLE)); +} + +/** + * Formats a temperature string for an active heater (e.g. "100 / 200°C") + */ +void format_temp_and_temp(char *str, float t1, float t2) { + sprintf_P(str, PSTR("%3d / %3d" S_FMT), ROUND(t1), ROUND(t2), GET_TEXT(UNITS_C)); +} + +/** + * Formats a temperature string for a material (e.g. "100°C (PLA)") + */ +void format_temp_and_material(char *str, float t1, const char *material) { + sprintf_P(str, PSTR("%3d" S_FMT " (" S_FMT ")"), ROUND(t1), GET_TEXT(UNITS_C), material); +} + +/** + * Formats a position value (e.g. "10 mm") + */ +void format_position(char *str, float p) { + dtostrf(p, 5, 1, str); + strcat_P(str, PSTR(" ")); + strcat_P(str, GET_TEXT(UNITS_MM)); +} + +/** + * Formats a position vector (e.g. "10; 20; 30 mm") + */ +void format_position(char *str, float x, float y, float z) { + char num1[7], num2[7], num3[7]; + dtostrf(x, 4, 2, num1); + dtostrf(y, 4, 2, num2); + dtostrf(z, 4, 2, num3); + sprintf_P(str, PSTR("%s; %s; %s " S_FMT), num1, num2, num3, GET_TEXT(UNITS_MM)); +} + +#pragma GCC diagnostic pop + +#endif // LULZBOT_TOUCH_UI diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/string_format.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/string_format.h new file mode 100644 index 0000000000..d6e26fb5cb --- /dev/null +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/string_format.h @@ -0,0 +1,29 @@ +/******************* + * string_format.h * + *******************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * 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. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +void format_temp(char *str, float t1); +void format_temp_and_idle(char *str, float t1); +void format_temp_and_temp(char *str, float t1, float t2); +void format_temp_and_material(char *str, float t1, const char *material); +void format_position(char *str, float p); +void format_position(char *str, float x, float y, float z); diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/temperature_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/temperature_screen.cpp index 126562d018..aeaecb4096 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/temperature_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/temperature_screen.cpp @@ -32,29 +32,29 @@ using namespace ExtUI; void TemperatureScreen::onRedraw(draw_mode_t what) { widgets_t w(what); - w.precision(0).color(temp).units(PSTR("C")); - w.heading( PSTR("Temperature:")); - w.button(30, PSTR("Cooldown (All Off)")); + w.precision(0).color(temp).units(GET_TEXTF(UNITS_C)); + w.heading(GET_TEXTF(TEMPERATURE)); + w.button(30, GET_TEXTF(COOLDOWN)); #ifndef LULZBOT_DISABLE_TOOLHEAD_HEATER #if HOTENDS == 1 - w.adjuster( 2, PSTR("Hot End:"), getTargetTemp_celsius(E0)); + w.adjuster( 2, GET_TEXTF(HOTEND), getTargetTemp_celsius(E0)); #else - w.adjuster( 2, PSTR("Hot End 1:"), getTargetTemp_celsius(E0)); - w.adjuster( 4, PSTR("Hot End 2:"), getTargetTemp_celsius(E1)); + w.adjuster( 2, GET_TEXTF(HOTEND1), getTargetTemp_celsius(E0)); + w.adjuster( 4, GET_TEXTF(HOTEND2), getTargetTemp_celsius(E1)); #if HOTENDS > 2 - w.adjuster( 6, PSTR("Hot End 3:"), getTargetTemp_celsius(E2)); + w.adjuster( 6, GET_TEXTF(HOTEND3), getTargetTemp_celsius(E2)); #endif #if HOTENDS > 3 - w.adjuster( 8, PSTR("Hot End 4:"), getTargetTemp_celsius(E3)); + w.adjuster( 8, GET_TEXTF(HOTEND4), getTargetTemp_celsius(E3)); #endif #endif #endif #if HAS_HEATED_BED - w.adjuster( 20, PSTR("Bed:"), getTargetTemp_celsius(BED)); + w.adjuster( 20, GET_TEXTF(BED), getTargetTemp_celsius(BED)); #endif #if FAN_COUNT > 0 - w.color(fan_speed).units(PSTR("%")); - w.adjuster( 10, PSTR("Fan Speed:"), getTargetFan_percent(FAN0)); + w.color(fan_speed).units(GET_TEXTF(UNITS_PERCENT)); + w.adjuster( 10, GET_TEXTF(FAN_SPEED), getTargetFan_percent(FAN0)); #endif w.increments(); } @@ -81,8 +81,8 @@ bool TemperatureScreen::onTouchHeld(uint8_t tag) { case 9: UI_INCREMENT(TargetTemp_celsius, E3); break; #endif #if FAN_COUNT > 0 - case 10: UI_DECREMENT(TargetFan_percent, FAN0); break; - case 11: UI_INCREMENT(TargetFan_percent, FAN0); break; + case 10: UI_DECREMENT(TargetFan_percent, FAN0); break; + case 11: UI_INCREMENT(TargetFan_percent, FAN0); break; #endif case 30: setTargetTemp_celsius(0,E0); diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/touch_calibration_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/touch_calibration_screen.cpp index 0adf2885b0..0779bb6fb2 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/touch_calibration_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/touch_calibration_screen.cpp @@ -44,29 +44,15 @@ void TouchCalibrationScreen::onEntry() { cmd.cmd(CMD_DLSTART) .cmd(CLEAR_COLOR_RGB(bg_color)) .cmd(CLEAR(true,true,true)) - .cmd(COLOR_RGB(bg_text_enabled)) - #ifdef TOUCH_UI_PORTRAIT - .font(font_large) - .text ( BTN_POS(1,8), BTN_SIZE(4,1), F("Release to begin")) - .text ( BTN_POS(1,9), BTN_SIZE(4,1), F("screen calibration")) - #else - .font( - #ifdef TOUCH_UI_800x480 - font_large - #else - font_medium - #endif - ) - .text ( BTN_POS(1,1), BTN_SIZE(4,16), F("Release to calibrate")) - #endif - .cmd(DL::DL_DISPLAY) + .cmd(COLOR_RGB(bg_text_enabled)); + draw_text_box(cmd, BTN_POS(1,1), BTN_SIZE(4,16), GET_TEXTF(TOUCH_CALIBRATION_START), OPT_CENTER, font_large); + cmd.cmd(DL::DL_DISPLAY) .cmd(CMD_SWAP) .execute(); while (CLCD::is_touching()) { - #ifdef UI_FRAMEWORK_DEBUG - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Waiting for touch release"); + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_MSG("Waiting for touch release"); #endif } } @@ -88,23 +74,10 @@ void TouchCalibrationScreen::onRedraw(draw_mode_t) { CommandProcessor cmd; cmd.cmd(CLEAR_COLOR_RGB(bg_color)) .cmd(CLEAR(true,true,true)) - .cmd(COLOR_RGB(bg_text_enabled)) + .cmd(COLOR_RGB(bg_text_enabled)); - #ifdef TOUCH_UI_PORTRAIT - .font(font_large) - .text ( BTN_POS(1,8), BTN_SIZE(4,1), F("Touch the dots")) - .text ( BTN_POS(1,9), BTN_SIZE(4,1), F("to calibrate")) - #else - .font( - #ifdef TOUCH_UI_800x480 - font_large - #else - font_medium - #endif - ) - .text ( BTN_POS(1,1), BTN_SIZE(4,16), F("Touch the dots to calibrate")) - #endif - .cmd(CMD_CALIBRATE); + draw_text_box(cmd, BTN_POS(1,1), BTN_SIZE(4,16), GET_TEXTF(TOUCH_CALIBRATION_PROMPT), OPT_CENTER, font_large); + cmd.cmd(CMD_CALIBRATE); } void TouchCalibrationScreen::onIdle() { diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/touch_registers_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/touch_registers_screen.cpp index 4cb63077d8..c5d3b5f4b3 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/touch_registers_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/touch_registers_screen.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(LULZBOT_TOUCH_UI) && ENABLED(DEVELOPER_SCREENS) +#if BOTH(LULZBOT_TOUCH_UI, DEVELOPER_SCREENS) #include "screens.h" diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/tune_menu.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/tune_menu.cpp index 37b60ed88c..416a0146fe 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/tune_menu.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/tune_menu.cpp @@ -52,79 +52,79 @@ void TuneMenu::onRedraw(draw_mode_t what) { cmd.colors(normal_btn) .font(font_medium) #ifdef TOUCH_UI_PORTRAIT - .tag(2).enabled(1) .button( BTN_POS(1,1), BTN_SIZE(2,1), F("Temperature")) - .tag(3).enabled(!isPrinting()).button( BTN_POS(1,2), BTN_SIZE(2,1), F("Change Filament")) - #if ENABLED(LIN_ADVANCE) || ENABLED(FILAMENT_RUNOUT_SENSOR) + .tag(2).enabled(1) .button( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXTF(TEMPERATURE)) + .tag(3).enabled(!isPrinting()).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXTF(CHANGE_FILAMENT)) + #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) .enabled(1) #else .enabled(0) #endif - .tag(9).button( BTN_POS(1,3), BTN_SIZE(2,1), F("Filament Options")) + .tag(9).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXTF(FILAMENT)) #if ENABLED(BABYSTEPPING) - .tag(4).enabled(1) .button( BTN_POS(1,4), BTN_SIZE(2,1), F("Nudge Nozzle")) + .tag(4).enabled(1) .button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXTF(NUDGE_NOZZLE)) #else #if HAS_BED_PROBE .enabled(1) #else .enabled(0) #endif - .tag(4) .button( BTN_POS(1,4), BTN_SIZE(2,1), F("Adjust Z-Offset")) + .tag(4) .button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXTF(ZPROBE_ZOFFSET)) #endif - .tag(5).enabled(1) .button( BTN_POS(1,5), BTN_SIZE(2,1), F("Print Speed")) + .tag(5).enabled(1) .button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXTF(PRINT_SPEED)) .tag(isPrintingFromMediaPaused() ? 7 : 6) #if ENABLED(SDSUPPORT) .enabled(isPrintingFromMedia()) #else .enabled(0) #endif - .button( BTN_POS(1,6), BTN_SIZE(2,1), isPrintingFromMediaPaused() ? F("Resume Print") : F("Pause Print")) + .button( BTN_POS(1,6), BTN_SIZE(2,1), isPrintingFromMediaPaused() ? GET_TEXTF(RESUME_PRINT) : GET_TEXTF(PAUSE_PRINT)) #if ENABLED(SDSUPPORT) .enabled(isPrintingFromMedia()) #else .enabled(0) #endif - .tag(8) .button( BTN_POS(1,7), BTN_SIZE(2,1), F("Cancel Print")) + .tag(8) .button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXTF(STOP_PRINT)) .tag(1).colors(action_btn) - .button( BTN_POS(1,8), BTN_SIZE(2,1), F("Back")); + .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXTF(BACK)); #else // TOUCH_UI_PORTRAIT - .tag(2).enabled(1) .button( BTN_POS(1,1), BTN_SIZE(1,1), F("Temperature")) - .tag(3).enabled(!isPrinting()).button( BTN_POS(1,2), BTN_SIZE(1,1), F("Change Filament")) + .tag(2).enabled(1) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXTF(TEMPERATURE)) + .tag(3).enabled(!isPrinting()).button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXTF(CHANGE_FILAMENT)) #if ENABLED(BABYSTEPPING) .enabled(1) #else .enabled(0) #endif #if ENABLED(BABYSTEPPING) - .tag(4) .button( BTN_POS(2,1), BTN_SIZE(1,1), F("Nudge Nozzle")) + .tag(4) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXTF(NUDGE_NOZZLE)) #else #if HAS_BED_PROBE .enabled(1) #else .enabled(0) #endif - .tag(4) .button( BTN_POS(1,4), BTN_SIZE(2,1), F("Adjust Z-Offset")) + .tag(4) .button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXTF(ZPROBE_ZOFFSET)) #endif - .tag(5).enabled(1) .button( BTN_POS(2,2), BTN_SIZE(1,1), F("Print Speed")) + .tag(5).enabled(1) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXTF(PRINT_SPEED)) .tag(isPrintingFromMediaPaused() ? 7 : 6) #if ENABLED(SDSUPPORT) .enabled(isPrintingFromMedia()) #else .enabled(0) #endif - .button( BTN_POS(1,3), BTN_SIZE(1,1), isPrintingFromMediaPaused() ? F("Resume Print") : F("Pause Print")) + .button( BTN_POS(1,3), BTN_SIZE(1,1), isPrintingFromMediaPaused() ? GET_TEXTF(RESUME_PRINT) : GET_TEXTF(PAUSE_PRINT)) #if ENABLED(SDSUPPORT) .enabled(isPrintingFromMedia()) #else .enabled(0) #endif - .tag(8). button( BTN_POS(2,3), BTN_SIZE(1,1), F("Cancel Print")) + .tag(8). button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXTF(STOP_PRINT)) #if ENABLED(LIN_ADVANCE) || ENABLED(FILAMENT_RUNOUT_SENSOR) .enabled(1) #else .enabled(0) #endif - .tag(9).button( BTN_POS(1,4), BTN_SIZE(1,1), F("Filament Options")) - .tag(1).colors(action_btn) .button( BTN_POS(2,4), BTN_SIZE(1,1), F("Back")); + .tag(9).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXTF(FILAMENT)) + .tag(1).colors(action_btn) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXTF(BACK)); #endif } #undef GRID_COLS @@ -141,10 +141,8 @@ bool TuneMenu::onTouchEnd(uint8_t tag) { case 4: #if ENABLED(BABYSTEPPING) GOTO_SCREEN(NudgeNozzleScreen); - #else - #if HAS_BED_PROBE - GOTO_SCREEN(ZOffsetScreen); - #endif + #elif HAS_BED_PROBE + GOTO_SCREEN(ZOffsetScreen); #endif break; case 5: GOTO_SCREEN(FeedratePercentScreen); break; @@ -155,7 +153,7 @@ bool TuneMenu::onTouchEnd(uint8_t tag) { current_screen.forget(); PUSH_SCREEN(StatusScreen); break; - #if ENABLED(LIN_ADVANCE) || ENABLED(FILAMENT_RUNOUT_SENSOR) + #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) case 9: GOTO_SCREEN(FilamentMenu); break; #endif default: diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/widget_demo_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/widget_demo_screen.cpp index a3988ed532..a3244bfe85 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/widget_demo_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/widget_demo_screen.cpp @@ -22,7 +22,7 @@ #include "../config.h" -#if ENABLED(LULZBOT_TOUCH_UI) && ENABLED(DEVELOPER_SCREENS) +#if BOTH(LULZBOT_TOUCH_UI, DEVELOPER_SCREENS) #include "screens.h" diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/z_offset_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/z_offset_screen.cpp index 5b26bb5394..32a54c09bf 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/z_offset_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/z_offset_screen.cpp @@ -32,10 +32,10 @@ using namespace Theme; void ZOffsetScreen::onRedraw(draw_mode_t what) { widgets_t w(what); - w.precision(2, BaseNumericAdjustmentScreen::DEFAULT_MIDRANGE).units(PSTR("mm")); + w.precision(2, BaseNumericAdjustmentScreen::DEFAULT_MIDRANGE).units(GET_TEXTF(UNITS_MM)); - w.heading( PSTR("Z Offset")); - w.color(z_axis).adjuster(4, PSTR("Z Offset:"), getZOffset_mm()); + w.heading( GET_TEXTF(ZPROBE_ZOFFSET)); + w.color(z_axis).adjuster(4, GET_TEXTF(ZPROBE_ZOFFSET), getZOffset_mm()); w.increments(); } diff --git a/Marlin/src/lcd/extensible_ui/lib/lulzbot/theme/bitmaps.h b/Marlin/src/lcd/extensible_ui/lib/lulzbot/theme/bitmaps.h index da6188ab9d..00952cfc5b 100644 --- a/Marlin/src/lcd/extensible_ui/lib/lulzbot/theme/bitmaps.h +++ b/Marlin/src/lcd/extensible_ui/lib/lulzbot/theme/bitmaps.h @@ -178,4 +178,6 @@ namespace Theme { 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFC, 0x00 }; + + constexpr PROGMEM uint32_t UTF8_FONT_OFFSET = 10000; }; // namespace Theme diff --git a/Marlin/src/lcd/extensible_ui/ui_api.cpp b/Marlin/src/lcd/extensible_ui/ui_api.cpp index 535556777e..5035e0cebd 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.cpp +++ b/Marlin/src/lcd/extensible_ui/ui_api.cpp @@ -77,7 +77,7 @@ #if HAS_TRINAMIC #include "../../feature/tmc_util.h" - #include "../../module/stepper_indirection.h" + #include "../../module/stepper/indirection.h" #endif #include "ui_api.h" @@ -102,16 +102,14 @@ #include "../../feature/host_actions.h" #endif -inline float clamp(const float value, const float minimum, const float maximum) { - return _MAX(_MIN(value, maximum), minimum); -} - -static struct { - uint8_t printer_killed : 1; - uint8_t manual_motion : 1; -} flags; - namespace ExtUI { + static struct { + uint8_t printer_killed : 1; + #if ENABLED(JOYSTICK) + uint8_t jogging : 1; + #endif + } flags; + #ifdef __SAM3X8E__ /** * Implement a special millis() to allow time measurement @@ -168,8 +166,10 @@ namespace ExtUI { } void enableHeater(const extruder_t extruder) { - #if HEATER_IDLE_HANDLER + #if HOTENDS && HEATER_IDLE_HANDLER thermalManager.reset_heater_idle_timer(extruder - E0); + #else + UNUSED(extruder); #endif } @@ -184,15 +184,63 @@ namespace ExtUI { #if HAS_HEATED_CHAMBER case CHAMBER: return; // Chamber has no idle timer #endif - default: thermalManager.reset_heater_idle_timer(heater - H0); + default: + #if HOTENDS + thermalManager.reset_heater_idle_timer(heater - H0); + #endif + break; } + #else + UNUSED(heater); #endif } + #if ENABLED(JOYSTICK) + /** + * Jogs in the direction given by the vector (dx, dy, dz). + * The values range from -1 to 1 mapping to the maximum + * feedrate for an axis. + * + * The axis will continue to jog until this function is + * called with all zeros. + */ + void jog(float dx, float dy, float dz) { + // The "destination" variable is used as a scratchpad in + // Marlin by GCODE routines, but should remain untouched + // during manual jogging, allowing us to reuse the space + // for our direction vector. + destination[X] = dx; + destination[Y] = dy; + destination[Z] = dz; + flags.jogging = !NEAR_ZERO(dx) || !NEAR_ZERO(dy) || !NEAR_ZERO(dz); + } + + // Called by the polling routine in "joystick.cpp" + void _joystick_update(float (&norm_jog)[XYZ]) { + if (flags.jogging) { + #define OUT_OF_RANGE(VALUE) (VALUE < -1.0f || VALUE > 1.0f) + + if (OUT_OF_RANGE(destination[X_AXIS]) || OUT_OF_RANGE(destination[Y_AXIS]) || OUT_OF_RANGE(destination[Z_AXIS])) { + // If destination[] on any axis is out of range, it + // probably means the UI forgot to stop jogging and + // ran GCODE that wrote a position to destination[]. + // To prevent a disaster, stop jogging. + flags.jogging = false; + return; + } + norm_jog[X_AXIS] = destination[X_AXIS]; + norm_jog[Y_AXIS] = destination[Y_AXIS]; + norm_jog[Z_AXIS] = destination[Z_AXIS]; + } + } + #endif + bool isHeaterIdle(const extruder_t extruder) { return false - #if HEATER_IDLE_HANDLER + #if HOTENDS && HEATER_IDLE_HANDLER || thermalManager.hotend_idle[extruder - E0].timed_out + #else + ; UNUSED(extruder) #endif ; } @@ -206,9 +254,15 @@ namespace ExtUI { #if HAS_HEATED_CHAMBER case CHAMBER: return false; // Chamber has no idle timer #endif - default: return thermalManager.hotend_idle[heater - H0].timed_out; + default: + #if HOTENDS + return thermalManager.hotend_idle[heater - H0].timed_out; + #else + return false; + #endif } #else + UNUSED(heater); return false; #endif } @@ -264,17 +318,28 @@ namespace ExtUI { } float getAxisPosition_mm(const axis_t axis) { - return flags.manual_motion ? destination[axis] : current_position[axis]; + return + #if ENABLED(JOYSTICK) + flags.jogging ? destination[axis] : + #endif + current_position[axis]; } float getAxisPosition_mm(const extruder_t extruder) { const extruder_t old_tool = getActiveTool(); setActiveTool(extruder, true); - const float pos = flags.manual_motion ? destination[E_AXIS] : current_position[E_AXIS]; + const float pos = ( + #if ENABLED(JOYSTICK) + flags.jogging ? destination[E_AXIS] : + #endif + current_position[E_AXIS] + ); setActiveTool(old_tool, true); return pos; } + constexpr feedRate_t manual_feedrate_mm_m[XYZE] = MANUAL_FEEDRATE; + void setAxisPosition_mm(const float position, const axis_t axis) { // Start with no limits to movement float min = current_position[axis] - 1000, @@ -319,54 +384,15 @@ namespace ExtUI { } #endif - constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE; - setFeedrate_mm_s(MMM_MMS(max_manual_feedrate[axis])); - - if (!flags.manual_motion) set_destination_from_current(); - destination[axis] = clamp(position, min, max); - flags.manual_motion = true; + current_position[axis] = constrain(position, min, max); + line_to_current_position(MMM_TO_MMS(manual_feedrate_mm_m[axis])); } void setAxisPosition_mm(const float position, const extruder_t extruder) { setActiveTool(extruder, true); - constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE; - setFeedrate_mm_s(MMM_MMS(max_manual_feedrate[E_AXIS])); - if (!flags.manual_motion) set_destination_from_current(); - destination[E_AXIS] = position; - flags.manual_motion = true; - } - - void _processManualMoveToDestination() { - // Lower max_response_lag makes controls more responsive, but makes CPU work harder - constexpr float max_response_lag = 0.1; // seconds - constexpr uint8_t segments_to_buffer = 4; // keep planner filled with this many segments - - if (flags.manual_motion && planner.movesplanned() < segments_to_buffer) { - float saved_destination[XYZ]; - COPY(saved_destination, destination); - // Compute direction vector from current_position towards destination. - destination[X_AXIS] -= current_position[X_AXIS]; - destination[Y_AXIS] -= current_position[Y_AXIS]; - destination[Z_AXIS] -= current_position[Z_AXIS]; - const float inv_length = RSQRT(sq(destination[X_AXIS]) + sq(destination[Y_AXIS]) + sq(destination[Z_AXIS])); - // Find move segment length so that all segments can execute in less time than max_response_lag - const float scale = inv_length * feedrate_mm_s * max_response_lag / segments_to_buffer; - if (scale < 1) { - // Move a small bit towards the destination. - destination[X_AXIS] = scale * destination[X_AXIS] + current_position[X_AXIS]; - destination[Y_AXIS] = scale * destination[Y_AXIS] + current_position[Y_AXIS]; - destination[Z_AXIS] = scale * destination[Z_AXIS] + current_position[Z_AXIS]; - prepare_move_to_destination(); - COPY(destination, saved_destination); - } - else { - // We are close enough to finish off the move. - COPY(destination, saved_destination); - prepare_move_to_destination(); - flags.manual_motion = false; - } - } + current_position[E_AXIS] = position; + line_to_current_position(MMM_TO_MMS(manual_feedrate_mm_m[E_AXIS])); } void setActiveTool(const extruder_t extruder, bool no_move) { @@ -458,13 +484,13 @@ namespace ExtUI { void setAxisCurrent_mA(const float mA, const axis_t axis) { switch (axis) { #if AXIS_IS_TMC(X) - case X: stepperX.rms_current(clamp(mA, 500, 1500)); break; + case X: stepperX.rms_current(constrain(mA, 500, 1500)); break; #endif #if AXIS_IS_TMC(Y) - case Y: stepperY.rms_current(clamp(mA, 500, 1500)); break; + case Y: stepperY.rms_current(constrain(mA, 500, 1500)); break; #endif #if AXIS_IS_TMC(Z) - case Z: stepperZ.rms_current(clamp(mA, 500, 1500)); break; + case Z: stepperZ.rms_current(constrain(mA, 500, 1500)); break; #endif default: break; }; @@ -473,22 +499,22 @@ namespace ExtUI { void setAxisCurrent_mA(const float mA, const extruder_t extruder) { switch (extruder) { #if AXIS_IS_TMC(E0) - case E0: stepperE0.rms_current(clamp(mA, 500, 1500)); break; + case E0: stepperE0.rms_current(constrain(mA, 500, 1500)); break; #endif #if AXIS_IS_TMC(E1) - case E1: stepperE1.rms_current(clamp(mA, 500, 1500)); break; + case E1: stepperE1.rms_current(constrain(mA, 500, 1500)); break; #endif #if AXIS_IS_TMC(E2) - case E2: stepperE2.rms_current(clamp(mA, 500, 1500)); break; + case E2: stepperE2.rms_current(constrain(mA, 500, 1500)); break; #endif #if AXIS_IS_TMC(E3) - case E3: stepperE3.rms_current(clamp(mA, 500, 1500)); break; + case E3: stepperE3.rms_current(constrain(mA, 500, 1500)); break; #endif #if AXIS_IS_TMC(E4) - case E4: stepperE4.rms_current(clamp(mA, 500, 1500)); break; + case E4: stepperE4.rms_current(constrain(mA, 500, 1500)); break; #endif #if AXIS_IS_TMC(E5) - case E5: stepperE5.rms_current(clamp(mA, 500, 1500)); break; + case E5: stepperE5.rms_current(constrain(mA, 500, 1500)); break; #endif default: break; }; @@ -513,12 +539,18 @@ namespace ExtUI { switch (axis) { #if X_SENSORLESS && AXIS_HAS_STALLGUARD(X) case X: stepperX.homing_threshold(value); break; + #else + UNUSED(value); #endif #if Y_SENSORLESS && AXIS_HAS_STALLGUARD(Y) case Y: stepperY.homing_threshold(value); break; + #else + UNUSED(value); #endif #if Z_SENSORLESS && AXIS_HAS_STALLGUARD(Z) case Z: stepperZ.homing_threshold(value); break; + #else + UNUSED(value); #endif default: break; } @@ -543,20 +575,20 @@ namespace ExtUI { planner.settings.axis_steps_per_mm[E_AXIS_N(axis - E0)] = value; } - float getAxisMaxFeedrate_mm_s(const axis_t axis) { + feedRate_t getAxisMaxFeedrate_mm_s(const axis_t axis) { return planner.settings.max_feedrate_mm_s[axis]; } - float getAxisMaxFeedrate_mm_s(const extruder_t extruder) { + feedRate_t getAxisMaxFeedrate_mm_s(const extruder_t extruder) { UNUSED_E(extruder); return planner.settings.max_feedrate_mm_s[E_AXIS_N(axis - E0)]; } - void setAxisMaxFeedrate_mm_s(const float value, const axis_t axis) { + void setAxisMaxFeedrate_mm_s(const feedRate_t value, const axis_t axis) { planner.settings.max_feedrate_mm_s[axis] = value; } - void setAxisMaxFeedrate_mm_s(const float value, const extruder_t extruder) { + void setAxisMaxFeedrate_mm_s(const feedRate_t value, const extruder_t extruder) { UNUSED_E(extruder); planner.settings.max_feedrate_mm_s[E_AXIS_N(axis - E0)] = value; } @@ -585,7 +617,7 @@ namespace ExtUI { #ifdef FILAMENT_RUNOUT_DISTANCE_MM float getFilamentRunoutDistance_mm() { return runout.runout_distance(); } - void setFilamentRunoutDistance_mm(const float value) { runout.set_runout_distance(clamp(value, 0, 999)); } + void setFilamentRunoutDistance_mm(const float value) { runout.set_runout_distance(constrain(value, 0, 999)); } #endif #endif @@ -596,7 +628,7 @@ namespace ExtUI { void setLinearAdvance_mm_mm_s(const float value, const extruder_t extruder) { if (extruder < EXTRUDERS) - planner.extruder_advance_K[extruder - E0] = clamp(value, 0, 999); + planner.extruder_advance_K[extruder - E0] = constrain(value, 0, 999); } #endif @@ -607,7 +639,7 @@ namespace ExtUI { } void setJunctionDeviation_mm(const float value) { - planner.junction_deviation_mm = clamp(value, 0.01, 0.3); + planner.junction_deviation_mm = constrain(value, 0.01, 0.3); #if ENABLED(LIN_ADVANCE) planner.recalculate_max_e_jerk(); #endif @@ -632,15 +664,15 @@ namespace ExtUI { } #endif - float getFeedrate_mm_s() { return feedrate_mm_s; } - float getMinFeedrate_mm_s() { return planner.settings.min_feedrate_mm_s; } - float getMinTravelFeedrate_mm_s() { return planner.settings.min_travel_feedrate_mm_s; } + feedRate_t getFeedrate_mm_s() { return feedrate_mm_s; } + feedRate_t getMinFeedrate_mm_s() { return planner.settings.min_feedrate_mm_s; } + feedRate_t getMinTravelFeedrate_mm_s() { return planner.settings.min_travel_feedrate_mm_s; } float getPrintingAcceleration_mm_s2() { return planner.settings.acceleration; } float getRetractAcceleration_mm_s2() { return planner.settings.retract_acceleration; } float getTravelAcceleration_mm_s2() { return planner.settings.travel_acceleration; } - void setFeedrate_mm_s(const float fr) { feedrate_mm_s = fr; } - void setMinFeedrate_mm_s(const float fr) { planner.settings.min_feedrate_mm_s = fr; } - void setMinTravelFeedrate_mm_s(const float fr) { planner.settings.min_travel_feedrate_mm_s = fr; } + void setFeedrate_mm_s(const feedRate_t fr) { feedrate_mm_s = fr; } + void setMinFeedrate_mm_s(const feedRate_t fr) { planner.settings.min_feedrate_mm_s = fr; } + void setMinTravelFeedrate_mm_s(const feedRate_t fr) { planner.settings.min_travel_feedrate_mm_s = fr; } void setPrintingAcceleration_mm_s2(const float acc) { planner.settings.acceleration = acc; } void setRetractAcceleration_mm_s2(const float acc) { planner.settings.retract_acceleration = acc; } void setTravelAcceleration_mm_s2(const float acc) { planner.settings.travel_acceleration = acc; } @@ -678,7 +710,7 @@ namespace ExtUI { #if EXTRUDERS > 1 && (linked_nozzles || active_extruder == 0) #endif - ) zprobe_zoffset += mm; + ) probe_offset[Z_AXIS] += mm; #else UNUSED(mm); #endif @@ -716,7 +748,7 @@ namespace ExtUI { float getZOffset_mm() { #if HAS_BED_PROBE - return zprobe_zoffset; + return probe_offset[Z_AXIS]; #elif ENABLED(BABYSTEP_DISPLAY_TOTAL) return babystep.axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]; #else @@ -727,7 +759,7 @@ namespace ExtUI { void setZOffset_mm(const float value) { #if HAS_BED_PROBE if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) - zprobe_zoffset = value; + probe_offset[Z_AXIS] = value; #elif ENABLED(BABYSTEP_DISPLAY_TOTAL) babystep.add_mm(Z_AXIS, (value - babystep.axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1])); #else @@ -762,14 +794,14 @@ namespace ExtUI { #if ENABLED(BACKLASH_GCODE) float getAxisBacklash_mm(const axis_t axis) { return backlash.distance_mm[axis]; } void setAxisBacklash_mm(const float value, const axis_t axis) - { backlash.distance_mm[axis] = clamp(value,0,5); } + { backlash.distance_mm[axis] = constrain(value,0,5); } float getBacklashCorrection_percent() { return ui8_to_percent(backlash.correction); } - void setBacklashCorrection_percent(const float value) { backlash.correction = map(clamp(value, 0, 100), 0, 100, 0, 255); } + void setBacklashCorrection_percent(const float value) { backlash.correction = map(constrain(value, 0, 100), 0, 100, 0, 255); } #ifdef BACKLASH_SMOOTHING_MM float getBacklashSmoothing_mm() { return backlash.smoothing_mm; } - void setBacklashSmoothing_mm(const float value) { backlash.smoothing_mm = clamp(value, 0, 999); } + void setBacklashSmoothing_mm(const float value) { backlash.smoothing_mm = constrain(value, 0, 999); } #endif #endif @@ -787,7 +819,7 @@ namespace ExtUI { void setLevelingActive(const bool state) { set_bed_leveling_enabled(state); } bool getMeshValid() { return leveling_is_valid(); } #if HAS_MESH - bed_mesh_t getMeshArray() { return Z_VALUES_ARR; } + bed_mesh_t& getMeshArray() { return Z_VALUES_ARR; } float getMeshPoint(const uint8_t xpos, const uint8_t ypos) { return Z_VALUES(xpos,ypos); } void setMeshPoint(const uint8_t xpos, const uint8_t ypos, const float zoff) { if (WITHIN(xpos, 0, GRID_MAX_POINTS_X) && WITHIN(ypos, 0, GRID_MAX_POINTS_Y)) { @@ -797,6 +829,9 @@ namespace ExtUI { #endif } } + void onMeshUpdate(const uint8_t xpos, const uint8_t ypos, const float zval) { + UNUSED(xpos); UNUSED(ypos); UNUSED(zval); + } #endif #endif @@ -807,8 +842,8 @@ namespace ExtUI { #if ENABLED(PRINTCOUNTER) char* getTotalPrints_str(char buffer[21]) { strcpy(buffer,i16tostr3left(print_job_timer.getStats().totalPrints)); return buffer; } char* getFinishedPrints_str(char buffer[21]) { strcpy(buffer,i16tostr3left(print_job_timer.getStats().finishedPrints)); return buffer; } - char* getTotalPrintTime_str(char buffer[21]) { duration_t(print_job_timer.getStats().printTime).toString(buffer); return buffer; } - char* getLongestPrint_str(char buffer[21]) { duration_t(print_job_timer.getStats().longestPrint).toString(buffer); return buffer; } + char* getTotalPrintTime_str(char buffer[21]) { return duration_t(print_job_timer.getStats().printTime).toString(buffer); } + char* getLongestPrint_str(char buffer[21]) { return duration_t(print_job_timer.getStats().longestPrint).toString(buffer); } char* getFilamentUsed_str(char buffer[21]) { printStatistics stats = print_job_timer.getStats(); sprintf_P(buffer, PSTR("%ld.%im"), long(stats.filamentUsed / 1000), int16_t(stats.filamentUsed / 100) % 10); @@ -841,28 +876,34 @@ namespace ExtUI { } void setTargetTemp_celsius(float value, const heater_t heater) { - constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP); - const int16_t e = heater - H0; enableHeater(heater); #if HAS_HEATED_BED if (heater == BED) - thermalManager.setTargetBed(clamp(value, 0, BED_MAXTEMP - 10)); + thermalManager.setTargetBed(constrain(value, 0, BED_MAXTEMP - 10)); else #endif - thermalManager.setTargetHotend(clamp(value, 0, heater_maxtemp[e] - 15), e); + { + #if HOTENDS + static constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP); + const int16_t e = heater - H0; + thermalManager.setTargetHotend(constrain(value, 0, heater_maxtemp[e] - 15), e); + #endif + } } void setTargetTemp_celsius(float value, const extruder_t extruder) { - constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP); - const int16_t e = extruder - E0; - enableHeater(extruder); - thermalManager.setTargetHotend(clamp(value, 0, heater_maxtemp[e] - 15), e); + #if HOTENDS + constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP); + const int16_t e = extruder - E0; + enableHeater(extruder); + thermalManager.setTargetHotend(constrain(value, 0, heater_maxtemp[e] - 15), e); + #endif } void setTargetFan_percent(const float value, const fan_t fan) { #if FAN_COUNT > 0 if (fan < FAN_COUNT) - thermalManager.set_fan_speed(fan - FAN0, map(clamp(value, 0, 100), 0, 100, 0, 255)); + thermalManager.set_fan_speed(fan - FAN0, map(constrain(value, 0, 100), 0, 100, 0, 255)); #else UNUSED(value); UNUSED(fan); @@ -870,10 +911,10 @@ namespace ExtUI { } void setFeedrate_percent(const float value) { - feedrate_percentage = clamp(value, 10, 500); + feedrate_percentage = constrain(value, 10, 500); } - void setUserConfirmed(void) { + void setUserConfirmed() { #if HAS_RESUME_CONTINUE wait_for_user = false; #endif @@ -896,7 +937,7 @@ namespace ExtUI { } bool isMediaInserted() { - return IFSD(IS_SD_INSERTED() && card.isDetected(), false); + return IFSD(IS_SD_INSERTED() && card.isMounted(), false); } void pausePrint() { @@ -952,12 +993,11 @@ namespace ExtUI { } bool FileList::isAtRootDir() { - #if ENABLED(SDSUPPORT) - card.getWorkDirName(); - return card.filename[0] == '/'; - #else - return true; - #endif + return (true + #if ENABLED(SDSUPPORT) + && card.flag.workDirIsRoot + #endif + ); } void FileList::upDir() { @@ -993,27 +1033,27 @@ void MarlinUI::update() { if (sd_status != last_sd_status) { last_sd_status = sd_status; if (sd_status) { - card.initsd(); - if (card.isDetected()) + card.mount(); + if (card.isMounted()) ExtUI::onMediaInserted(); else ExtUI::onMediaError(); } else { - const bool ok = card.isDetected(); + const bool ok = card.isMounted(); card.release(); if (ok) ExtUI::onMediaRemoved(); } } #endif // SDSUPPORT - ExtUI::_processManualMoveToDestination(); ExtUI::onIdle(); } void MarlinUI::kill_screen(PGM_P const msg) { + using namespace ExtUI; if (!flags.printer_killed) { flags.printer_killed = true; - ExtUI::onPrinterKilled(msg); + onPrinterKilled(msg); } } diff --git a/Marlin/src/lcd/extensible_ui/ui_api.h b/Marlin/src/lcd/extensible_ui/ui_api.h index 11a60a28a5..38cd19b579 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.h +++ b/Marlin/src/lcd/extensible_ui/ui_api.h @@ -45,6 +45,7 @@ #include "../../inc/MarlinConfig.h" namespace ExtUI { + // The ExtUI implementation can store up to this many bytes // in the EEPROM when the methods onStoreSettings and // onLoadSettings are called. @@ -61,7 +62,7 @@ namespace ExtUI { constexpr uint8_t fanCount = FAN_COUNT; #if HAS_MESH - typedef float (&bed_mesh_t)[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; + typedef float bed_mesh_t[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; #endif bool isMoving(); @@ -79,6 +80,11 @@ namespace ExtUI { void enableHeater(const heater_t); void enableHeater(const extruder_t); + #if ENABLED(JOYSTICK) + void jog(float dx, float dy, float dz); + void _joystick_update(float (&norm_jog)[XYZ]); + #endif + /** * Getters and setters * Should be used by the EXTENSIBLE_UI to query or change Marlin's state. @@ -96,7 +102,7 @@ namespace ExtUI { void setAxisCurrent_mA(const float, const axis_t); void setAxisCurrent_mA(const float, const extruder_t); - int getTMCBumpSensitivity(const axis_t); + int getTMCBumpSensitivity(const axis_t); void setTMCBumpSensitivity(const float, const axis_t); #endif @@ -110,12 +116,12 @@ namespace ExtUI { float getAxisPosition_mm(const extruder_t); float getAxisSteps_per_mm(const axis_t); float getAxisSteps_per_mm(const extruder_t); - float getAxisMaxFeedrate_mm_s(const axis_t); - float getAxisMaxFeedrate_mm_s(const extruder_t); + feedRate_t getAxisMaxFeedrate_mm_s(const axis_t); + feedRate_t getAxisMaxFeedrate_mm_s(const extruder_t); float getAxisMaxAcceleration_mm_s2(const axis_t); float getAxisMaxAcceleration_mm_s2(const extruder_t); - float getMinFeedrate_mm_s(); - float getMinTravelFeedrate_mm_s(); + feedRate_t getMinFeedrate_mm_s(); + feedRate_t getMinTravelFeedrate_mm_s(); float getPrintingAcceleration_mm_s2(); float getRetractAcceleration_mm_s2(); float getTravelAcceleration_mm_s2(); @@ -128,7 +134,7 @@ namespace ExtUI { void setLevelingActive(const bool); bool getMeshValid(); #if HAS_MESH - bed_mesh_t getMeshArray(); + bed_mesh_t& getMeshArray(); float getMeshPoint(const uint8_t xpos, const uint8_t ypos); void setMeshPoint(const uint8_t xpos, const uint8_t ypos, const float zval); void onMeshUpdate(const uint8_t xpos, const uint8_t ypos, const float zval); @@ -154,18 +160,18 @@ namespace ExtUI { void setAxisPosition_mm(const float, const extruder_t); void setAxisSteps_per_mm(const float, const axis_t); void setAxisSteps_per_mm(const float, const extruder_t); - void setAxisMaxFeedrate_mm_s(const float, const axis_t); - void setAxisMaxFeedrate_mm_s(const float, const extruder_t); + void setAxisMaxFeedrate_mm_s(const feedRate_t, const axis_t); + void setAxisMaxFeedrate_mm_s(const feedRate_t, const extruder_t); void setAxisMaxAcceleration_mm_s2(const float, const axis_t); void setAxisMaxAcceleration_mm_s2(const float, const extruder_t); - void setFeedrate_mm_s(const float); - void setMinFeedrate_mm_s(const float); - void setMinTravelFeedrate_mm_s(const float); + void setFeedrate_mm_s(const feedRate_t); + void setMinFeedrate_mm_s(const feedRate_t); + void setMinTravelFeedrate_mm_s(const feedRate_t); void setPrintingAcceleration_mm_s2(const float); void setRetractAcceleration_mm_s2(const float); void setTravelAcceleration_mm_s2(const float); void setFeedrate_percent(const float); - void setUserConfirmed(void); + void setUserConfirmed(); #if ENABLED(LIN_ADVANCE) float getLinearAdvance_mm_mm_s(const extruder_t); @@ -272,7 +278,7 @@ namespace ExtUI { void changeDir(const char * const dirname); void upDir(); bool isAtRootDir(); - uint16_t count(); + uint16_t count(); }; /** diff --git a/Marlin/src/lcd/extui_dgus_lcd.cpp b/Marlin/src/lcd/extui_dgus_lcd.cpp index b48fb9c82d..484a333095 100644 --- a/Marlin/src/lcd/extui_dgus_lcd.cpp +++ b/Marlin/src/lcd/extui_dgus_lcd.cpp @@ -57,7 +57,7 @@ namespace ExtUI { void onPrintTimerStarted() {} void onPrintTimerPaused() {} void onPrintTimerStopped() {} - void onFilamentRunout() {} + void onFilamentRunout(const extruder_t extruder) {} void onUserConfirmRequired(const char *msg) { if (msg) { diff --git a/Marlin/src/lcd/extui_malyan_lcd.cpp b/Marlin/src/lcd/extui_malyan_lcd.cpp index d6fb84ac72..3954a1a521 100644 --- a/Marlin/src/lcd/extui_malyan_lcd.cpp +++ b/Marlin/src/lcd/extui_malyan_lcd.cpp @@ -298,7 +298,7 @@ void process_lcd_s_command(const char* command) { case 'L': { #if ENABLED(SDSUPPORT) - if (!card.isDetected()) card.initsd(); + if (!card.isMounted()) card.mount(); // A more efficient way to do this would be to // implement a callback in the ls_SerialPrint code, but @@ -447,7 +447,7 @@ namespace ExtUI { void onPrintTimerStarted() {} void onPrintTimerPaused() {} void onPrintTimerStopped() {} - void onFilamentRunout() {} + void onFilamentRunout(const extruder_t extruder) {} void onUserConfirmRequired(const char * const msg) { UNUSED(msg); } void onFactoryReset() {} void onStoreSettings(char *buff) { UNUSED(buff); } diff --git a/Marlin/src/lcd/fontutils.h b/Marlin/src/lcd/fontutils.h index 28921aef25..8839e36a2b 100644 --- a/Marlin/src/lcd/fontutils.h +++ b/Marlin/src/lcd/fontutils.h @@ -8,13 +8,13 @@ */ #pragma once -#include "../HAL/shared/Marduino.h" -#include "../core/macros.h" - #include #include // wchar_t #include // uint32_t +#include "../HAL/shared/Marduino.h" +#include "../core/macros.h" + // read a byte from ROM or RAM typedef uint8_t (*read_byte_cb_t)(uint8_t * str); diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index 2fd13d67ef..f3c4372ba7 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -168,8 +168,7 @@ #define MSG_ZPROBE_OUT _UxGT("Sonda Z fuera") #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Auto-Test") #define MSG_BLTOUCH_RESET _UxGT("Reset BLTouch") -#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("first") +#define MSG_HOME_FIRST _UxGT("Home %s%s%s first") #define MSG_ZPROBE_ZOFFSET _UxGT("Desfase Z") #define MSG_BABYSTEP_X _UxGT("Micropaso X") #define MSG_BABYSTEP_Y _UxGT("Micropaso Y") @@ -182,7 +181,7 @@ #define MSG_ERR_MINTEMP _UxGT("Error: Temp Menima") #define MSG_ERR_MAXTEMP_BED _UxGT("Error: Temp Max base") #define MSG_ERR_MINTEMP_BED _UxGT("Error: Temp Min base") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("Home XY first") #define MSG_HALTED _UxGT("IMPRESORA ATURADA") #define MSG_PLEASE_RESET _UxGT("Per favor reinic.") #define MSG_SHORT_DAY _UxGT("d") diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index 3a81909cbf..cf7278851e 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -170,8 +170,7 @@ #define MSG_CHANGE_MEDIA _UxGT("Canvia SD") #define MSG_ZPROBE_OUT _UxGT("Sonda Z fora") #define MSG_BLTOUCH_RESET _UxGT("Reinicia BLTouch") -#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("primer") +#define MSG_HOME_FIRST _UxGT("Home %s%s%s primer") #define MSG_ZPROBE_ZOFFSET _UxGT("Decalatge Z") #define MSG_BABYSTEP_X _UxGT("Micropas X") #define MSG_BABYSTEP_Y _UxGT("Micropas Y") @@ -184,7 +183,7 @@ #define MSG_ERR_MINTEMP _UxGT("Err: TEMP MINIMA") #define MSG_ERR_MAXTEMP_BED _UxGT("Err: TEMPMAX LLIT") #define MSG_ERR_MINTEMP_BED _UxGT("Err: TEMPMIN LLIT") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("Home XY primer") #define MSG_HALTED _UxGT("IMPRESSORA PARADA") #define MSG_PLEASE_RESET _UxGT("Reinicieu") #define MSG_SHORT_DAY _UxGT("d") // One character only diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index 4aec9f9a1a..92a9e0ca83 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -116,7 +116,6 @@ #define MSG_Z_OFFSET _UxGT("2. tryska Z") #define MSG_UBL_DOING_G29 _UxGT("Provádím G29") -#define MSG_UBL_UNHOMED _UxGT("Přejeďte domů") #define MSG_UBL_TOOLS _UxGT("UBL nástroje") #define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") #define MSG_UBL_MANUAL_MESH _UxGT("Manuální síť bodů") @@ -335,8 +334,7 @@ #define MSG_BLTOUCH_STOW _UxGT("BLTouch zasunout") #define MSG_MANUAL_DEPLOY _UxGT("Vysunout Z-sondu") #define MSG_MANUAL_STOW _UxGT("Zasunout Z-sondu") -#define MSG_HOME _UxGT("Domů") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("první") +#define MSG_HOME_FIRST _UxGT("Domů %s%s%s první") #define MSG_ZPROBE_ZOFFSET _UxGT("Z ofset") #define MSG_BABYSTEP_X _UxGT("Babystep X") #define MSG_BABYSTEP_Y _UxGT("Babystep Y") @@ -354,7 +352,7 @@ #define MSG_ERR_MINTEMP_BED _UxGT("NÍZ. TEPL. PODL.") #define MSG_ERR_MAXTEMP_CHAMBER _UxGT("Err: MAXTEMP KOMORA") #define MSG_ERR_MINTEMP_CHAMBER _UxGT("Err: MINTEMP KOMORA") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("Domů XY první") #define MSG_HALTED _UxGT("TISK. ZASTAVENA") #define MSG_PLEASE_RESET _UxGT("Proveďte reset") #define MSG_SHORT_DAY _UxGT("d") diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index 6ecc4c6ea4..6a8d48175d 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -168,8 +168,7 @@ #define MSG_ZPROBE_OUT _UxGT("Probe udenfor plade") #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Selv-Test") #define MSG_BLTOUCH_RESET _UxGT("Reset BLTouch") -#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("først") +#define MSG_HOME_FIRST _UxGT("Home %s%s%s først") #define MSG_ZPROBE_ZOFFSET _UxGT("Z Offset") #define MSG_BABYSTEP_X _UxGT("Babystep X") #define MSG_BABYSTEP_Y _UxGT("Babystep Y") @@ -182,7 +181,7 @@ #define MSG_ERR_MINTEMP _UxGT("Fejl: Min temp") #define MSG_ERR_MAXTEMP_BED _UxGT("Fejl: Maks Plade temp") #define MSG_ERR_MINTEMP_BED _UxGT("Fejl: Min Plade temp") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("Home XY først") #define MSG_HALTED _UxGT("PRINTER STOPPET") #define MSG_PLEASE_RESET _UxGT("Reset Venligst") #define MSG_SHORT_DAY _UxGT("d") // Kun et bogstav diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index b18e4c1591..76acb55e80 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -37,9 +37,14 @@ #define MSG_YES _UxGT("JA") #define MSG_NO _UxGT("NEIN") #define MSG_BACK _UxGT("Zurück") -#define MSG_MEDIA_INSERTED _UxGT("SD-Karte erkannt") -#define MSG_MEDIA_REMOVED _UxGT("SD-Karte entfernt") -#define MSG_MEDIA_RELEASED _UxGT("SD-Karte freigeg.") +#define MSG_MEDIA_ABORTING _UxGT("Abbruch...") +#define MSG_MEDIA_INSERTED _UxGT("Medium erkannt") +#define MSG_MEDIA_REMOVED _UxGT("Medium entfernt") +#define MSG_MEDIA_RELEASED _UxGT("Medium freigegeben") +#define MSG_MEDIA_WAITING _UxGT("Warten auf Medium") +#define MSG_MEDIA_READ_ERROR _UxGT("Medium Lesefehler") +#define MSG_MEDIA_USB_REMOVED _UxGT("USB Gerät entfernt") +#define MSG_MEDIA_USB_FAILED _UxGT("USB Start fehlge.") #define MSG_LCD_ENDSTOPS _UxGT("Endstopp") // Max length 8 characters #define MSG_LCD_SOFT_ENDSTOPS _UxGT("Software-Endstopp") #define MSG_MAIN _UxGT("Hauptmenü") @@ -94,6 +99,7 @@ #define MSG_LEVEL_BED _UxGT("Bett nivellieren") #define MSG_LEVEL_CORNERS _UxGT("Ecken nivellieren") #define MSG_NEXT_CORNER _UxGT("Nächste Ecke") +#define MSG_MESH_EDITOR _UxGT("Netz Editor") #define MSG_EDIT_MESH _UxGT("Netz bearbeiten") #define MSG_EDITING_STOPPED _UxGT("Netzbearb. angeh.") #define MSG_PROBING_MESH _UxGT("Messpunkt") @@ -103,6 +109,7 @@ #define MSG_USER_MENU _UxGT("Benutzer-Menü") #define MSG_LCD_TILTING_MESH _UxGT("Berührungspunkt") #define MSG_M48_TEST _UxGT("M48 Sondentest") +#define MSG_M48_POINT _UxGT("M48 Punkt") #define MSG_M48_DEVIATION _UxGT("Abweichung") #define MSG_IDEX_MENU _UxGT("IDEX-Modus") #define MSG_OFFSETS_MENU _UxGT("Werkzeugversätze") @@ -114,7 +121,6 @@ #define MSG_Y_OFFSET _UxGT("2. Düse Y") #define MSG_Z_OFFSET _UxGT("2. Düse Z") #define MSG_UBL_DOING_G29 _UxGT("G29 ausführen") -#define MSG_UBL_UNHOMED _UxGT("Home XYZ zuerst") #define MSG_UBL_TOOLS _UxGT("UBL-Werkzeuge") #define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") #define MSG_UBL_MANUAL_MESH _UxGT("Netz manuell erst.") @@ -143,6 +149,12 @@ #define MSG_UBL_VALIDATE_MESH_M1 _UxGT(PREHEAT_1_LABEL " Netz validieren") #define MSG_UBL_VALIDATE_MESH_M2 _UxGT(PREHEAT_2_LABEL " Netz validieren") #define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Eig. Netz validieren") +#define MSG_G26_HEATING_NOZZLE _UxGT("G26 Heating Nozzle") +#define MSG_G26_HEATING_BED _UxGT("G26 heizt Bett") +#define MSG_G26_FIXED_LENGTH _UxGT("Feste Länge Prime") +#define MSG_G26_PRIME_DONE _UxGT("Priming fertig") +#define MSG_G26_CANCELED _UxGT("G26 abgebrochen") +#define MSG_G26_LEAVING _UxGT("G26 verlassen") #define MSG_UBL_CONTINUE_MESH _UxGT("Netzerst. forts.") #define MSG_UBL_MESH_LEVELING _UxGT("Netz-Nivellierung") #define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3-Punkt-Nivell.") @@ -172,6 +184,7 @@ #define MSG_UBL_NO_STORAGE _UxGT("Kein Speicher") #define MSG_UBL_SAVE_ERROR _UxGT("Err:UBL speichern") #define MSG_UBL_RESTORE_ERROR _UxGT("Err:UBL wiederherst.") +#define MSG_UBL_Z_OFFSET _UxGT("Z-Versatz: ") #define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Versatz angehalten") #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Schrittweises UBL") @@ -276,7 +289,7 @@ #define MSG_LOAD_EEPROM _UxGT("Konfig. laden") #define MSG_RESTORE_FAILSAFE _UxGT("Standardwerte laden") #define MSG_INIT_EEPROM _UxGT("Werkseinstellungen") -#define MSG_MEDIA_UPDATE _UxGT("SD-Firmware-Update") +#define MSG_MEDIA_UPDATE _UxGT("FW Update vom Medium") #define MSG_RESET_PRINTER _UxGT("Drucker neustarten") #define MSG_REFRESH _UxGT("Aktualisieren") #define MSG_WATCH _UxGT("Info") @@ -294,8 +307,8 @@ #define MSG_RESUME_PRINT _UxGT("SD-Druck fortsetzen") #define MSG_STOP_PRINT _UxGT("SD-Druck abbrechen") #define MSG_OUTAGE_RECOVERY _UxGT("Wiederh. n. Stroma.") -#define MSG_MEDIA_MENU _UxGT("Druck v. SD-Karte") -#define MSG_NO_MEDIA _UxGT("Keine SD-Karte") +#define MSG_MEDIA_MENU _UxGT("Druck vom Medium") +#define MSG_NO_MEDIA _UxGT("Kein Medium") #define MSG_DWELL _UxGT("Warten...") #define MSG_USERWAIT _UxGT("Klick zum Fortsetzen") #define MSG_PRINT_PAUSED _UxGT("Druck pausiert...") @@ -314,6 +327,7 @@ #define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") #define MSG_AUTORETRACT _UxGT("Autom. Einzug") #define MSG_FILAMENT_SWAP_LENGTH _UxGT("Einzugslänge") +#define MSG_FILAMENT_PURGE_LENGTH _UxGT("Entladelänge") #define MSG_TOOL_CHANGE _UxGT("Werkzeugwechsel") #define MSG_TOOL_CHANGE_ZLIFT _UxGT("Z anheben") #define MSG_SINGLENOZZLE_PRIME_SPD _UxGT("Prime-Geschwin.") @@ -323,9 +337,9 @@ #define MSG_FILAMENTLOAD _UxGT("Filament laden") #define MSG_FILAMENTUNLOAD _UxGT("Filament entladen") #define MSG_FILAMENTUNLOAD_ALL _UxGT("Alles entladen") -#define MSG_INIT_MEDIA _UxGT("SD-Karte initial.") // Manually initialize the SD-card via user interface -#define MSG_CHANGE_MEDIA _UxGT("SD-Karte getauscht") // SD-card changed by user. For machines with no autocarddetect. Both send "M21" -#define MSG_RELEASE_MEDIA _UxGT("SD-Karte freigeben") // if Marlin gets confused - M22 +#define MSG_INIT_MEDIA _UxGT("Medium initial.") // Manually initialize the SD-card via user interface +#define MSG_CHANGE_MEDIA _UxGT("Medium getauscht") // SD-card changed by user. For machines with no autocarddetect. Both send "M21" +#define MSG_RELEASE_MEDIA _UxGT("Medium freigeben") // if Marlin gets confused - M22 #define MSG_ZPROBE_OUT _UxGT("Z-Sonde außerhalb") #define MSG_SKEW_FACTOR _UxGT("Korrekturfaktor") #define MSG_BLTOUCH _UxGT("BLTouch") @@ -348,8 +362,7 @@ #define MSG_MANUAL_DEPLOY_TOUCHMI _UxGT("TouchMI ausfahren") #define MSG_MANUAL_DEPLOY _UxGT("Z-Sonde ausfahren") #define MSG_MANUAL_STOW _UxGT("Z-Sonde einfahren") -#define MSG_HOME _UxGT("Vorher") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("homen") +#define MSG_HOME_FIRST _UxGT("Vorher %s%s%s homen") #define MSG_ZPROBE_ZOFFSET _UxGT("Sondenversatz Z") #define MSG_BABYSTEP_X _UxGT("Babystep X") #define MSG_BABYSTEP_Y _UxGT("Babystep Y") @@ -369,14 +382,14 @@ #define MSG_ERR_MINTEMP_BED _UxGT("BETT ") LCD_STR_THERMOMETER _UxGT(" UNTERSCHRITTEN") #define MSG_ERR_MAXTEMP_CHAMBER _UxGT("Err:Gehäuse max Temp") #define MSG_ERR_MINTEMP_CHAMBER _UxGT("Err:Gehäuse min Temp") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("Vorher XY vorher") #define MSG_HALTED _UxGT("DRUCKER GESTOPPT") #define MSG_PLEASE_RESET _UxGT("Bitte neustarten") #define MSG_SHORT_DAY _UxGT("t") // One character only #define MSG_SHORT_HOUR _UxGT("h") // One character only #define MSG_SHORT_MINUTE _UxGT("m") // One character only -#define MSG_HEATING _UxGT("Extr. heizt...") -#define MSG_COOLING _UxGT("Extr. kühlt...") +#define MSG_HEATING _UxGT("heizt...") +#define MSG_COOLING _UxGT("kühlt...") #define MSG_BED_HEATING _UxGT("Bett heizt...") #define MSG_BED_COOLING _UxGT("Bett kühlt...") #define MSG_CHAMBER_HEATING _UxGT("Gehäuse heizt...") @@ -430,6 +443,7 @@ #define MSG_INFO_PSU _UxGT("Netzteil") #define MSG_DRIVE_STRENGTH _UxGT("Motorleistung") #define MSG_DAC_PERCENT _UxGT("Treiber %") +#define MSG_ERROR_TMC _UxGT("TMC Verbindungsfehler") #define MSG_DAC_EEPROM_WRITE _UxGT("Werte speichern") #define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("DRUCK PAUSIERT") #define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("FILAMENT LADEN") diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index fc9b9c33d3..225a83e8d4 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -61,6 +61,9 @@ #ifndef MSG_BACK #define MSG_BACK _UxGT("Back") #endif +#ifndef MSG_MEDIA_ABORTING + #define MSG_MEDIA_ABORTING _UxGT("Aborting...") +#endif #ifndef MSG_MEDIA_INSERTED #define MSG_MEDIA_INSERTED _UxGT("Media Inserted") #endif @@ -70,6 +73,18 @@ #ifndef MSG_MEDIA_RELEASED #define MSG_MEDIA_RELEASED _UxGT("Media Released") #endif +#ifndef MSG_MEDIA_WAITING + #define MSG_MEDIA_WAITING _UxGT("Waiting for media") +#endif +#ifndef MSG_MEDIA_READ_ERROR + #define MSG_MEDIA_READ_ERROR _UxGT("Media read error") +#endif +#ifndef MSG_MEDIA_USB_REMOVED + #define MSG_MEDIA_USB_REMOVED _UxGT("USB device removed") +#endif +#ifndef MSG_MEDIA_USB_FAILED + #define MSG_MEDIA_USB_FAILED _UxGT("USB start failed") +#endif #ifndef MSG_LCD_ENDSTOPS #define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters #endif @@ -232,6 +247,9 @@ #ifndef MSG_NEXT_CORNER #define MSG_NEXT_CORNER _UxGT("Next Corner") #endif +#ifndef MSG_MESH_EDITOR + #define MSG_MESH_EDITOR _UxGT("Mesh Editor") +#endif #ifndef MSG_EDIT_MESH #define MSG_EDIT_MESH _UxGT("Edit Mesh") #endif @@ -292,9 +310,6 @@ #ifndef MSG_UBL_DOING_G29 #define MSG_UBL_DOING_G29 _UxGT("Doing G29") #endif -#ifndef MSG_UBL_UNHOMED - #define MSG_UBL_UNHOMED _UxGT("Home XYZ First") -#endif #ifndef MSG_UBL_TOOLS #define MSG_UBL_TOOLS _UxGT("UBL Tools") #endif @@ -382,6 +397,27 @@ #ifndef MSG_UBL_VALIDATE_CUSTOM_MESH #define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Validate Custom Mesh") #endif +#ifndef MSG_G26_HEATING_BED + #define MSG_G26_HEATING_BED _UxGT("G26 Heating Bed") +#endif +#ifndef MSG_G26_HEATING_NOZZLE + #define MSG_G26_HEATING_NOZZLE _UxGT("G26 Heating Nozzle") +#endif +#ifndef MSG_G26_MANUAL_PRIME + #define MSG_G26_MANUAL_PRIME _UxGT("Manual priming...") +#endif +#ifndef MSG_G26_FIXED_LENGTH + #define MSG_G26_FIXED_LENGTH _UxGT("Fixed Length Prime") +#endif +#ifndef MSG_G26_PRIME_DONE + #define MSG_G26_PRIME_DONE _UxGT("Done Priming") +#endif +#ifndef MSG_G26_CANCELED + #define MSG_G26_CANCELED _UxGT("G26 Canceled") +#endif +#ifndef MSG_G26_LEAVING + #define MSG_G26_LEAVING _UxGT("Leaving G26") +#endif #ifndef MSG_UBL_CONTINUE_MESH #define MSG_UBL_CONTINUE_MESH _UxGT("Continue Bed Mesh") #endif @@ -469,6 +505,9 @@ #ifndef MSG_UBL_RESTORE_ERROR #define MSG_UBL_RESTORE_ERROR _UxGT("Err: UBL Restore") #endif +#ifndef MSG_UBL_Z_OFFSET + #define MSG_UBL_Z_OFFSET _UxGT("Z-Offset: ") +#endif #ifndef MSG_UBL_Z_OFFSET_STOPPED #define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Offset Stopped") #endif @@ -984,11 +1023,8 @@ #ifndef MSG_MANUAL_STOW #define MSG_MANUAL_STOW _UxGT("Stow Z-Probe") #endif -#ifndef MSG_HOME - #define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#endif -#ifndef MSG_FIRST - #define MSG_FIRST _UxGT("First") +#ifndef MSG_HOME_FIRST + #define MSG_HOME_FIRST _UxGT("Home %s%s%s First") #endif #ifndef MSG_ZPROBE_ZOFFSET #define MSG_ZPROBE_ZOFFSET _UxGT("Probe Z Offset") @@ -1048,7 +1084,7 @@ #define MSG_ERR_MINTEMP_CHAMBER _UxGT("Err: MINTEMP CHAMBER") #endif #ifndef MSG_ERR_Z_HOMING - #define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST + #define MSG_ERR_Z_HOMING _UxGT("Home XY First") #endif #ifndef MSG_HALTED #define MSG_HALTED _UxGT("PRINTER HALTED") @@ -1217,6 +1253,9 @@ #ifndef MSG_DAC_PERCENT #define MSG_DAC_PERCENT _UxGT("Driver %") #endif +#ifndef MSG_ERROR_TMC + #define MSG_ERROR_TMC _UxGT("TMC CONNECTION ERROR") +#endif #ifndef MSG_DAC_EEPROM_WRITE #define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM Write") #endif diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index be4c1e3205..e38390b3f9 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -29,50 +29,184 @@ * */ +#define THIS_LANGUAGES_SPECIAL_SYMBOLS _UxGT ("¡¿ªáéíóúÁÉÍÓÚ") #define DISPLAY_CHARSET_ISO10646_1 #define CHARSIZE 2 -#define WELCOME_MSG MACHINE_NAME _UxGT(" lista.") +#define WELCOME_MSG MACHINE_NAME _UxGT(" lista") +#define MSG_YES _UxGT("SI") +#define MSG_NO _UxGT("NO") #define MSG_BACK _UxGT("Atrás") -#define MSG_MEDIA_INSERTED _UxGT("Tarjeta colocada") -#define MSG_MEDIA_REMOVED _UxGT("Tarjeta retirada") +#define MSG_MEDIA_ABORTING _UxGT("Cancelando...") +#define MSG_MEDIA_INSERTED _UxGT("SD/USB insertado") +#define MSG_MEDIA_REMOVED _UxGT("SD/USB retirado") +#define MSG_MEDIA_RELEASED _UxGT("SD/USB lanzado") +#define MSG_MEDIA_WAITING _UxGT("Esperando al SD/USB") +#define MSG_MEDIA_READ_ERROR _UxGT("Error lectura SD/USB") +#define MSG_MEDIA_USB_REMOVED _UxGT("Disp. USB retirado") +#define MSG_MEDIA_USB_FAILED _UxGT("Inicio USB fallido") #define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters +#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Soft Endstops") #define MSG_MAIN _UxGT("Menú principal") +#define MSG_ADVANCED_SETTINGS _UxGT("Ajustes avanzados") +#define MSG_CONFIGURATION _UxGT("Configuración") #define MSG_AUTOSTART _UxGT("Inicio automático") #define MSG_DISABLE_STEPPERS _UxGT("Apagar motores") -#define MSG_DEBUG_MENU _UxGT("Menú depurar") -#define MSG_PROGRESS_BAR_TEST _UxGT("Prueba barra avance") +#define MSG_DEBUG_MENU _UxGT("Menú depuración") +#define MSG_PROGRESS_BAR_TEST _UxGT("Prob. barra progreso") #define MSG_AUTO_HOME _UxGT("Llevar al origen") #define MSG_AUTO_HOME_X _UxGT("Origen X") #define MSG_AUTO_HOME_Y _UxGT("Origen Y") #define MSG_AUTO_HOME_Z _UxGT("Origen Z") +#define MSG_AUTO_Z_ALIGN _UxGT("Auto alineado Z") #define MSG_LEVEL_BED_HOMING _UxGT("Origen XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Iniciar (Presione)") +#define MSG_LEVEL_BED_WAITING _UxGT("Pulsar para comenzar") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Siguiente punto") -#define MSG_LEVEL_BED_DONE _UxGT("Nivelación lista!") +#define MSG_LEVEL_BED_DONE _UxGT("¡Nivelación lista!") +#define MSG_Z_FADE_HEIGHT _UxGT("Compensación Altura") #define MSG_SET_HOME_OFFSETS _UxGT("Ajustar desfases") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Desfase aplicado") +#define MSG_HOME_OFFSETS_APPLIED _UxGT("Desfase aplicada") #define MSG_SET_ORIGIN _UxGT("Establecer origen") #define MSG_PREHEAT_1 _UxGT("Precalentar " PREHEAT_1_LABEL) #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Todo") -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" End") +#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" Fin") #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Cama") -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Config") -#define MSG_PREHEAT_2 _UxGT("Precalentar " PREHEAT_2_LABEL) +#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Ajuste") +#define MSG_PREHEAT_2 _UxGT("Precalentar" PREHEAT_2_LABEL) #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Todo") -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" End") +#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" Fin") #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Cama") -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" Config") +#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" Ajuste") +#define MSG_PREHEAT_CUSTOM _UxGT("Precalen. Personali.") #define MSG_COOLDOWN _UxGT("Enfriar") -#define MSG_SWITCH_PS_ON _UxGT("Encender") -#define MSG_SWITCH_PS_OFF _UxGT("Apagar") +#define MSG_LASER_MENU _UxGT("Control Láser") +#define MSG_LASER_OFF _UxGT("Láser Apagado") +#define MSG_LASER_ON _UxGT("Láser Encendido") +#define MSG_LASER_POWER _UxGT("Potencia Láser") +#define MSG_SPINDLE_MENU _UxGT("Control Mandrino") +#define MSG_SPINDLE_OFF _UxGT("Mandrino Apagado") +#define MSG_SPINDLE_ON _UxGT("Mandrino Encendido") +#define MSG_SPINDLE_POWER _UxGT("Potencia Mandrino") +#define MSG_SPINDLE_REVERSE _UxGT("Invertir giro") +#define MSG_SWITCH_PS_ON _UxGT("Encender Fuente") +#define MSG_SWITCH_PS_OFF _UxGT("Apagar Fuente") #define MSG_EXTRUDE _UxGT("Extruir") #define MSG_RETRACT _UxGT("Retraer") #define MSG_MOVE_AXIS _UxGT("Mover ejes") -#define MSG_BED_LEVELING _UxGT("Nivelar cama") -#define MSG_LEVEL_BED _UxGT("Nivelar cama") +#define MSG_BED_LEVELING _UxGT("Nivelando Cama") +#define MSG_LEVEL_BED _UxGT("Nivelar Cama") +#define MSG_LEVEL_CORNERS _UxGT("Nivelar Esquinas") +#define MSG_NEXT_CORNER _UxGT("Siguente Esquina") +#define MSG_MESH_EDITOR _UxGT("Editor Mallado") +#define MSG_EDIT_MESH _UxGT("Editar Mallado") +#define MSG_EDITING_STOPPED _UxGT("Ed. Mallado parada") +#define MSG_PROBING_MESH _UxGT("Sondear Punto") +#define MSG_MESH_X _UxGT("Índice X") +#define MSG_MESH_Y _UxGT("Índice Y") +#define MSG_MESH_EDIT_Z _UxGT("Valor Z") +#define MSG_USER_MENU _UxGT("Comandos Personaliz.") +#define MSG_M48_TEST _UxGT("M48 Probar Sonda") +#define MSG_M48_POINT _UxGT("M48 Punto") +#define MSG_M48_DEVIATION _UxGT("Desviación") +#define MSG_IDEX_MENU _UxGT("Modo IDEX") +#define MSG_OFFSETS_MENU _UxGT("Desfase Boquillas") +#define MSG_IDEX_MODE_AUTOPARK _UxGT("Auto-Aparcado") +#define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplicar") +#define MSG_IDEX_MODE_MIRRORED_COPY _UxGT("Copia Reflejada") +#define MSG_IDEX_MODE_FULL_CTRL _UxGT("Control Total") +#define MSG_X_OFFSET _UxGT("2ª Boquilla X") +#define MSG_Y_OFFSET _UxGT("2ª Boquilla Y") +#define MSG_Z_OFFSET _UxGT("2ª Boquilla Z") +#define MSG_UBL_DOING_G29 _UxGT("Hacer G29") +#define MSG_UBL_TOOLS _UxGT("Herramientas UBL") +#define MSG_UBL_LEVEL_BED _UxGT("Nivel.Cama.Uni.(UBL)") +#define MSG_LCD_TILTING_MESH _UxGT("Punto de inclinación") +#define MSG_UBL_MANUAL_MESH _UxGT("Crear Mallado man.") +#define MSG_UBL_BC_INSERT _UxGT("Colocar cuña y Medir") +#define MSG_UBL_BC_INSERT2 _UxGT("Medir") +#define MSG_UBL_BC_REMOVE _UxGT("Retirar y Medir Cama") +#define MSG_UBL_MOVING_TO_NEXT _UxGT("Mover al Siguente") +#define MSG_UBL_ACTIVATE_MESH _UxGT("Activar UBL") +#define MSG_UBL_DEACTIVATE_MESH _UxGT("Desactivar UBL") +#define MSG_UBL_SET_TEMP_BED _UxGT("Temp. Cama") +#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED +#define MSG_UBL_SET_TEMP_HOTEND _UxGT ("Hotend Temp") +#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND +#define MSG_UBL_MESH_EDIT _UxGT("Editar Mallado") +#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Edit. Mallado perso.") +#define MSG_UBL_FINE_TUNE_MESH _UxGT("Ajuste fino Mallado") +#define MSG_UBL_DONE_EDITING_MESH _UxGT("Term. edici. Mallado") +#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Crear Mallado Perso.") +#define MSG_UBL_BUILD_MESH_MENU _UxGT("Crear Mallado") +#define MSG_UBL_BUILD_MESH_M1 _UxGT("Crear Mallado (" PREHEAT_1_LABEL ")") +#define MSG_UBL_BUILD_MESH_M2 _UxGT("Crear Mallado (" PREHEAT_2_LABEL ")") +#define MSG_UBL_BUILD_COLD_MESH _UxGT("Crear Mallado Frío") +#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Ajustar alt. Mallado") +#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Cantidad de altura") +#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Validar Mallado") +#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Validar Mallado (" PREHEAT_1_LABEL ")") +#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Validar Mallado (" PREHEAT_2_LABEL ")") +#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Vali. Mallado perso.") +#define MSG_G26_HEATING_BED _UxGT("G26 Calentando Cama") +#define MSG_G26_HEATING_NOZZLE _UxGT("G26 Calent. Boquilla") +#define MSG_G26_MANUAL_PRIME _UxGT("Imprimado manual...") +#define MSG_G26_FIXED_LENGTH _UxGT("Impri. longit. fija") +#define MSG_G26_PRIME_DONE _UxGT("Imprimación Lista") +#define MSG_G26_CANCELED _UxGT("G26 Cancelado") +#define MSG_G26_LEAVING _UxGT("Dejando G26") +#define MSG_UBL_CONTINUE_MESH _UxGT("Contin. Mallado cama") +#define MSG_UBL_MESH_LEVELING _UxGT("Nivelando Mallado") +#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("Nivelando 3Puntos") +#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Nivel. Mallado cuad.") +#define MSG_UBL_MESH_LEVEL _UxGT("Nivel de Mallado") +#define MSG_UBL_SIDE_POINTS _UxGT("Puntos Laterales") +#define MSG_UBL_MAP_TYPE _UxGT("Tipo de mapa ") +#define MSG_UBL_OUTPUT_MAP _UxGT("Salida Mapa mallado") +#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Salida para el host") +#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Salida para CSV") +#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Off Printer Backup") +#define MSG_UBL_INFO_UBL _UxGT("Salida Info. UBL") +#define MSG_UBL_FILLIN_AMOUNT _UxGT("Cantidad de relleno") +#define MSG_UBL_MANUAL_FILLIN _UxGT("Relleno manual") +#define MSG_UBL_SMART_FILLIN _UxGT("Relleno inteligente") +#define MSG_UBL_FILLIN_MESH _UxGT("Mallado de relleno") +#define MSG_UBL_INVALIDATE_ALL _UxGT("Invalidar todo") +#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Invalidar proximos") +#define MSG_UBL_FINE_TUNE_ALL _UxGT("Ajustar Fino Todo") +#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Ajustar Fino proxi.") +#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Almacen de Mallado") +#define MSG_UBL_STORAGE_SLOT _UxGT("Huecos de memoria") +#define MSG_UBL_LOAD_MESH _UxGT("Cargar Mallado cama") +#define MSG_UBL_SAVE_MESH _UxGT("Guardar Mallado cama") +#define MSG_MESH_LOADED _UxGT("Mallado %i Cargado") +#define MSG_MESH_SAVED _UxGT("Mallado %i Guardado") +#define MSG_UBL_NO_STORAGE _UxGT("Sin guardar") +#define MSG_UBL_SAVE_ERROR _UxGT("Error: Guardar UBL") +#define MSG_UBL_RESTORE_ERROR _UxGT("Error: Restaurar UBL") +#define MSG_UBL_Z_OFFSET _UxGT("Desfase de Z: ") +#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Desfase de Z Parado") +#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Paso a Paso") + +#define MSG_LED_CONTROL _UxGT("Control LED") +#define MSG_LEDS _UxGT("Luzes") +#define MSG_LED_PRESETS _UxGT("Luz predefinida") +#define MSG_SET_LEDS_RED _UxGT("Rojo") +#define MSG_SET_LEDS_ORANGE _UxGT("Naranja") +#define MSG_SET_LEDS_YELLOW _UxGT("Amarillo") +#define MSG_SET_LEDS_GREEN _UxGT("Verde") +#define MSG_SET_LEDS_BLUE _UxGT("Azul") +#define MSG_SET_LEDS_INDIGO _UxGT("Índigo") +#define MSG_SET_LEDS_VIOLET _UxGT("Violeta") +#define MSG_SET_LEDS_WHITE _UxGT("Blanco") +#define MSG_SET_LEDS_DEFAULT _UxGT("Por defecto") +#define MSG_CUSTOM_LEDS _UxGT("Luces personalizadas") +#define MSG_INTENSITY_R _UxGT("Intensidad Rojo") +#define MSG_INTENSITY_G _UxGT("Intensidad Verde") +#define MSG_INTENSITY_B _UxGT("Intensidad Azul") +#define MSG_INTENSITY_W _UxGT("Intensidad Blanco") +#define MSG_LED_BRIGHTNESS _UxGT("Brillo") #define MSG_MOVING _UxGT("Moviendo...") #define MSG_FREE_XY _UxGT("Libre XY") @@ -80,6 +214,7 @@ #define MSG_MOVE_Y _UxGT("Mover Y") #define MSG_MOVE_Z _UxGT("Mover Z") #define MSG_MOVE_E _UxGT("Extrusor") +#define MSG_HOTEND_TOO_COLD _UxGT("Hotend muy frio") #define MSG_MOVE_Z_DIST _UxGT("Mover %smm") #define MSG_MOVE_01MM _UxGT("Mover 0.1mm") #define MSG_MOVE_1MM _UxGT("Mover 1mm") @@ -88,7 +223,9 @@ #define MSG_BED_Z _UxGT("Cama Z") #define MSG_NOZZLE _UxGT("Boquilla") #define MSG_BED _UxGT("Cama") +#define MSG_CHAMBER _UxGT("Recinto") #define MSG_FAN_SPEED _UxGT("Ventilador") +#define MSG_EXTRA_FAN_SPEED _UxGT("Vel. Ext. ventilador") #define MSG_FLOW _UxGT("Flujo") #define MSG_CONTROL _UxGT("Control") #define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") @@ -104,10 +241,18 @@ #define MSG_SELECT _UxGT("Seleccionar") #define MSG_ACC _UxGT("Aceleración") #define MSG_JERK _UxGT("Jerk") -#define MSG_VX_JERK _UxGT("Vx-jerk") -#define MSG_VY_JERK _UxGT("Vy-jerk") -#define MSG_VZ_JERK _UxGT("Vz-jerk") -#define MSG_VE_JERK _UxGT("Ve-jerk") +#if IS_KINEMATIC + #define MSG_VA_JERK _UxGT("Va-Jerk") + #define MSG_VB_JERK _UxGT("Vb-Jerk") + #define MSG_VC_JERK _UxGT("Vc-Jerk") +#else + #define MSG_VA_JERK _UxGT("Vx-Jerk") + #define MSG_VB_JERK _UxGT("Vy-Jerk") + #define MSG_VC_JERK _UxGT("Vz-Jerk") +#endif +#define MSG_VE_JERK _UxGT("Ve-Jerk") +#define MSG_JUNCTION_DEVIATION _UxGT("Junction Dev") +#define MSG_VELOCITY _UxGT("Velocidad") #define MSG_VMAX _UxGT("Vmax") #define MSG_VMIN _UxGT("Vmin") #define MSG_VTRAV_MIN _UxGT("Vel. viaje min") @@ -116,9 +261,15 @@ #define MSG_A_RETRACT _UxGT("Acel. retrac.") #define MSG_A_TRAVEL _UxGT("Acel. Viaje") #define MSG_STEPS_PER_MM _UxGT("Pasos/mm") -#define MSG_XSTEPS _UxGT("X pasos/mm") -#define MSG_YSTEPS _UxGT("Y pasos/mm") -#define MSG_ZSTEPS _UxGT("Z pasos/mm") +#if IS_KINEMATIC + #define MSG_ASTEPS _UxGT("A pasos/mm") + #define MSG_BSTEPS _UxGT("B pasos/mm") + #define MSG_CSTEPS _UxGT("C pasos/mm") +#else + #define MSG_ASTEPS _UxGT("X pasos/mm") + #define MSG_BSTEPS _UxGT("Y pasos/mm") + #define MSG_CSTEPS _UxGT("Z pasos/mm") +#endif #define MSG_ESTEPS _UxGT("E pasos/mm") #define MSG_E1STEPS _UxGT("E1 pasos/mm") #define MSG_E2STEPS _UxGT("E2 pasos/mm") @@ -129,28 +280,44 @@ #define MSG_TEMPERATURE _UxGT("Temperatura") #define MSG_MOTION _UxGT("Movimiento") #define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") +#define MSG_VOLUMETRIC_ENABLED _UxGT("E en mm") MSG_CUBED #define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") +#define MSG_FILAMENT_UNLOAD _UxGT("Descarga mm") +#define MSG_FILAMENT_LOAD _UxGT("Carga mm") #define MSG_ADVANCE_K _UxGT("Avance K") -#define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EEPROM _UxGT("Guardar memoria") -#define MSG_LOAD_EEPROM _UxGT("Cargar memoria") -#define MSG_RESTORE_FAILSAFE _UxGT("Restaurar memoria") -#define MSG_REFRESH _UxGT("Volver a cargar") -#define MSG_WATCH _UxGT("Información") +#define MSG_CONTRAST _UxGT("Contraste LCD") +#define MSG_STORE_EEPROM _UxGT("Guardar EEPROM") +#define MSG_LOAD_EEPROM _UxGT("Cargar EEPROM") +#define MSG_RESTORE_FAILSAFE _UxGT("Rest. fábrica") +#define MSG_INIT_EEPROM _UxGT("Inicializar EEPROM") +#define MSG_MEDIA_UPDATE _UxGT("Actualizar SD/USB") +#define MSG_RESET_PRINTER _UxGT("Resetear Impresora") +#define MSG_REFRESH _UxGT("Recargar") +#define MSG_WATCH _UxGT("Pantalla de Inf.") #define MSG_PREPARE _UxGT("Preparar") #define MSG_TUNE _UxGT("Ajustar") +#define MSG_START_PRINT _UxGT("Iniciar impresión") +#define MSG_BUTTON_NEXT _UxGT("Siguinte") +#define MSG_BUTTON_INIT _UxGT("Iniciar") +#define MSG_BUTTON_STOP _UxGT("Parar") +#define MSG_BUTTON_PRINT _UxGT("Imprimir") +#define MSG_BUTTON_RESET _UxGT("Reiniciar") +#define MSG_BUTTON_CANCEL _UxGT("Cancelar") +#define MSG_BUTTON_DONE _UxGT("Listo") #define MSG_PAUSE_PRINT _UxGT("Pausar impresión") #define MSG_RESUME_PRINT _UxGT("Reanudar impresión") #define MSG_STOP_PRINT _UxGT("Detener impresión") -#define MSG_MEDIA_MENU _UxGT("Menú de SD") -#define MSG_NO_MEDIA _UxGT("No hay tarjeta SD") +#define MSG_OUTAGE_RECOVERY _UxGT("Recuper. por interr.") +#define MSG_MEDIA_MENU _UxGT("Imprim. desde SD/USB") +#define MSG_NO_MEDIA _UxGT("SD/USB no presente") #define MSG_DWELL _UxGT("Reposo...") -#define MSG_USERWAIT _UxGT("Esperando órdenes") +#define MSG_USERWAIT _UxGT("Pulsar para Reanudar") +#define MSG_PRINT_PAUSED _UxGT("Impresión Pausada") +#define MSG_PRINTING _UxGT("Imprimiendo...") #define MSG_PRINT_ABORTED _UxGT("Impresión cancelada") #define MSG_NO_MOVE _UxGT("Sin movimiento") -#define MSG_KILLED _UxGT("Parada de emergencia") -#define MSG_STOPPED _UxGT("Detenida") +#define MSG_KILLED _UxGT("MUERTA") +#define MSG_STOPPED _UxGT("DETENIDA") #define MSG_CONTROL_RETRACT _UxGT("Retraer mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Interc. Retraer mm") #define MSG_CONTROL_RETRACTF _UxGT("Retraer V") @@ -158,105 +325,240 @@ #define MSG_CONTROL_RETRACT_RECOVER _UxGT("DesRet mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Interc. DesRet mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("DesRet V") +#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") #define MSG_AUTORETRACT _UxGT("Retracción Auto.") +#define MSG_FILAMENT_SWAP_LENGTH _UxGT("Inter. longitud") +#define MSG_FILAMENT_PURGE_LENGTH _UxGT("Purgar longitud") +#define MSG_TOOL_CHANGE _UxGT("Cambiar Herramienta") +#define MSG_TOOL_CHANGE_ZLIFT _UxGT("Aumentar Z") +#define MSG_SINGLENOZZLE_PRIME_SPD _UxGT("Prime Speed") +#define MSG_SINGLENOZZLE_RETRACT_SPD _UxGT("Vel. de retracción") +#define MSG_NOZZLE_STANDBY _UxGT("Colocar boquilla") #define MSG_FILAMENTCHANGE _UxGT("Cambiar filamento") -#define MSG_INIT_MEDIA _UxGT("Iniciando tarjeta") -#define MSG_CHANGE_MEDIA _UxGT("Cambiar tarjeta") -#define MSG_ZPROBE_OUT _UxGT("Sonda Z fuera") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Auto-Prueba") -#define MSG_BLTOUCH_RESET _UxGT("Reiniciar BLTouch") -#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("primero") +#define MSG_FILAMENTLOAD _UxGT("Cargar filamento") +#define MSG_FILAMENTUNLOAD _UxGT("Descargar filamento") +#define MSG_FILAMENTUNLOAD_ALL _UxGT("Descargar todo") +#define MSG_INIT_MEDIA _UxGT("Iniciar SD/USB") +#define MSG_CHANGE_MEDIA _UxGT("Cambiar SD/USB") +#define MSG_RELEASE_MEDIA _UxGT("Lanzar SD/USB") +#define MSG_ZPROBE_OUT _UxGT("Sonda Z fuera cama") +#define MSG_SKEW_FACTOR _UxGT("Factor de desviación") +#define MSG_BLTOUCH _UxGT("BLTouch") +#define MSG_BLTOUCH_SELFTEST _UxGT("Cmd: Auto-Prueba") +#define MSG_BLTOUCH_RESET _UxGT("Cmd: Reiniciar") +#define MSG_BLTOUCH_STOW _UxGT("Cmd: Bajar pistón") +#define MSG_BLTOUCH_DEPLOY _UxGT("Cmd: Subir pistón") +#define MSG_BLTOUCH_SW_MODE _UxGT("Cmd: Modo Software") +#define MSG_BLTOUCH_5V_MODE _UxGT("Cmd: Modo 5V") +#define MSG_BLTOUCH_OD_MODE _UxGT("Cmd: Modo OD") +#define MSG_BLTOUCH_MODE_STORE _UxGT("Cmd: Modo almacenar") +#define MSG_BLTOUCH_MODE_STORE_5V _UxGT("Poner BLTouch a 5V") +#define MSG_BLTOUCH_MODE_STORE_OD _UxGT("Poner BLTouch a OD") +#define MSG_BLTOUCH_MODE_ECHO _UxGT("Informe de drenaje") +#define MSG_BLTOUCH_MODE_CHANGE _UxGT("PELIGRO: ¡Una mala configuración puede producir daños! ¿Proceder igualmente?") +#define MSG_TOUCHMI_PROBE _UxGT("TouchMI") +#define MSG_TOUCHMI_INIT _UxGT("Iniciar TouchMI") +#define MSG_TOUCHMI_ZTEST _UxGT("Test de desfase Z") +#define MSG_TOUCHMI_SAVE _UxGT("Guardar") +#define MSG_MANUAL_DEPLOY_TOUCHMI _UxGT("Subir TouchMI") +#define MSG_MANUAL_DEPLOY _UxGT("Subir Sonda Z") +#define MSG_MANUAL_STOW _UxGT("Bajar Sonda Z") +#define MSG_HOME_FIRST _UxGT("Origen %s%s%s Primero") #define MSG_ZPROBE_ZOFFSET _UxGT("Desfase Z") #define MSG_BABYSTEP_X _UxGT("Micropaso X") #define MSG_BABYSTEP_Y _UxGT("Micropaso Y") #define MSG_BABYSTEP_Z _UxGT("Micropaso Z") +#define MSG_BABYSTEP_TOTAL _UxGT("Total") #define MSG_ENDSTOP_ABORT _UxGT("Cancelado - Endstop") -#define MSG_HEATING_FAILED_LCD _UxGT("Error: al calentar") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Error: temperatura") -#define MSG_THERMAL_RUNAWAY _UxGT("Error: temperatura") -#define MSG_ERR_MAXTEMP _UxGT("Error: Temp Máxima") -#define MSG_ERR_MINTEMP _UxGT("Error: Temp Mínima") -#define MSG_ERR_MAXTEMP_BED _UxGT("Error: Temp Max Cama") -#define MSG_ERR_MINTEMP_BED _UxGT("Error: Temp Min Cama") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("IMPRESORA PARADA") +#define MSG_HEATING_FAILED_LCD _UxGT("Calent. fallido") +#define MSG_HEATING_FAILED_LCD_BED _UxGT("Calent. cama fallido") +#define MSG_HEATING_FAILED_LCD_CHAMBER _UxGT("Calent. Cám. fallido") +#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: TEMP. REDUN.") +#define MSG_THERMAL_RUNAWAY _UxGT("ESCAPE TERMICO") +#define MSG_THERMAL_RUNAWAY_BED _UxGT("ESC. TERMICO CAMA") +#define MSG_THERMAL_RUNAWAY_CHAMBER _UxGT("ESC. TERMICO CAMARA") +#define MSG_ERR_MAXTEMP _UxGT("Err:TEMP. MÁX") +#define MSG_ERR_MINTEMP _UxGT("Err:TEMP. MIN") +#define MSG_ERR_MAXTEMP_BED _UxGT("Err:TEMP. MÁX CAMA") +#define MSG_ERR_MINTEMP_BED _UxGT("Err:TEMP. MIN CAMA") +#define MSG_ERR_MAXTEMP_CHAMBER _UxGT("Err:TEMP. MÁX CÁMARA") +#define MSG_ERR_MINTEMP_CHAMBER _UxGT("Err:TEMP. MIN CÁMARA") +#define MSG_ERR_Z_HOMING _UxGT("Origen XY Primero") +#define MSG_HALTED _UxGT("IMPRESORA DETENIDA") #define MSG_PLEASE_RESET _UxGT("Por favor, reinicie") #define MSG_SHORT_DAY _UxGT("d") // One character only #define MSG_SHORT_HOUR _UxGT("h") // One character only #define MSG_SHORT_MINUTE _UxGT("m") // One character only #define MSG_HEATING _UxGT("Calentando...") +#define MSG_COOLING _UxGT("Enfriando...") #define MSG_BED_HEATING _UxGT("Calentando Cama...") +#define MSG_BED_COOLING _UxGT("Enfriando Cama...") +#define MSG_CHAMBER_HEATING _UxGT("Calentando Cámara...") +#define MSG_CHAMBER_COOLING _UxGT("Enfriando Cámara...") #define MSG_DELTA_CALIBRATE _UxGT("Calibración Delta") #define MSG_DELTA_CALIBRATE_X _UxGT("Calibrar X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrar Y") #define MSG_DELTA_CALIBRATE_Z _UxGT("Calibrar Z") #define MSG_DELTA_CALIBRATE_CENTER _UxGT("Calibrar Centro") +#define MSG_DELTA_SETTINGS _UxGT("Configuración Delta") #define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto Calibración") #define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Est. Altura Delta") -#define MSG_INFO_MENU _UxGT("Inf. Impresora") -#define MSG_INFO_PRINTER_MENU _UxGT("Inf. Impresora") +#define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Ajustar Sonda Z") +#define MSG_DELTA_DIAG_ROD _UxGT("Barra Diagonal") +#define MSG_DELTA_HEIGHT _UxGT("Altura") +#define MSG_DELTA_RADIUS _UxGT("Radio") +#define MSG_INFO_MENU _UxGT("Acerca de Impresora") +#define MSG_INFO_PRINTER_MENU _UxGT("Info. Impresora") +#define MSG_3POINT_LEVELING _UxGT("Nivelando 3puntos") +#define MSG_LINEAR_LEVELING _UxGT("Nivelando Lineal") +#define MSG_BILINEAR_LEVELING _UxGT("Nivelando Bilineal") +#define MSG_UBL_LEVELING _UxGT("Nivelando UBL") +#define MSG_MESH_LEVELING _UxGT("Nivelando en Mallado") #define MSG_INFO_STATS_MENU _UxGT("Estadísticas Imp.") -#define MSG_INFO_BOARD_MENU _UxGT("Inf. Controlador") +#define MSG_INFO_BOARD_MENU _UxGT("Info. Controlador") #define MSG_INFO_THERMISTOR_MENU _UxGT("Termistores") #define MSG_INFO_EXTRUDERS _UxGT("Extrusores") #define MSG_INFO_BAUDRATE _UxGT("Baudios") #define MSG_INFO_PROTOCOL _UxGT("Protocolo") #define MSG_CASE_LIGHT _UxGT("Luz cabina") +#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Brillo cabina") #define MSG_EXPECTED_PRINTER _UxGT("Impresora incorrecta") #if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Conteo de impresión") + #define MSG_INFO_PRINT_COUNT _UxGT("Cont. de impresión") #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completadas") #define MSG_INFO_PRINT_TIME _UxGT("Tiempo total de imp.") #define MSG_INFO_PRINT_LONGEST _UxGT("Impresión más larga") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Total de Extrusión") + #define MSG_INFO_PRINT_FILAMENT _UxGT("Total Extruido") #else #define MSG_INFO_PRINT_COUNT _UxGT("Impresiones") #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completadas") #define MSG_INFO_PRINT_TIME _UxGT("Total") #define MSG_INFO_PRINT_LONGEST _UxGT("Más larga") - #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrusión") + #define MSG_INFO_PRINT_FILAMENT _UxGT("Extruido") #endif - -#define MSG_INFO_MIN_TEMP _UxGT("Temperatura mínima") -#define MSG_INFO_MAX_TEMP _UxGT("Temperatura máxima") -#define MSG_INFO_PSU _UxGT("Fuente de poder") -#define MSG_DRIVE_STRENGTH _UxGT("Potencia driver") +#define MSG_INFO_MIN_TEMP _UxGT("Temp. Mínima") +#define MSG_INFO_MAX_TEMP _UxGT("Temp. Máxima") +#define MSG_INFO_PSU _UxGT("Fuente alimentación") +#define MSG_DRIVE_STRENGTH _UxGT("Fuerza de empuje") #define MSG_DAC_PERCENT _UxGT("Driver %") +#define MSG_ERROR_TMC _UxGT("ERROR CONEX. TMC") #define MSG_DAC_EEPROM_WRITE _UxGT("Escribe DAC EEPROM") - -#define MSG_FILAMENT_CHANGE_HEADER _UxGT("IMPR. PAUSADA") +#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("IMPRESIÓN PAUSADA") +#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("CARGAR FILAMENTO") +#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("DESCARGAR FILAMENTO") #define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("OPC. REINICIO:") -#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extruir más") -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Resumir imp.") - -#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Temp Mínima es ") +#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Purgar más") +#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Continuar imp.") #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Boquilla: ") +#define MSG_RUNOUT_SENSOR _UxGT("Sensor de sección") +#define MSG_RUNOUT_DISTANCE_MM _UxGT("Dist de secc. mm") +#define MSG_ERR_HOMING_FAILED _UxGT("Ir a origen Fallado") +#define MSG_ERR_PROBING_FAILED _UxGT("Sondeo Fallado") +#define MSG_M600_TOO_COLD _UxGT("M600: Muy Frio") -#define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Esperando para") +#define MSG_MMU2_FILAMENT_CHANGE_HEADER _UxGT("CAMBIAR FILAMENTO") +#define MSG_MMU2_CHOOSE_FILAMENT_HEADER _UxGT("ELIJE FILAMENTO") +#define MSG_MMU2_MENU _UxGT("MMU") +#define MSG_MMU2_WRONG_FIRMWARE _UxGT("¡Actu. MMU Firmware!") +#define MSG_MMU2_NOT_RESPONDING _UxGT("MMU Necesita Cuidado") +#define MSG_MMU2_RESUME _UxGT("Continuar imp.") +#define MSG_MMU2_RESUMING _UxGT("Resumiendo...") +#define MSG_MMU2_LOAD_FILAMENT _UxGT("Cargar Filamento") +#define MSG_MMU2_LOAD_ALL _UxGT("Cargar Todo") +#define MSG_MMU2_LOAD_TO_NOZZLE _UxGT("Cargar hasta boqui.") +#define MSG_MMU2_EJECT_FILAMENT _UxGT("Expulsar Filamento") +#define MSG_MMU2_EJECT_FILAMENT0 _UxGT("Expulsar Filamento 1") +#define MSG_MMU2_EJECT_FILAMENT1 _UxGT("Expulsar Filamento 2") +#define MSG_MMU2_EJECT_FILAMENT2 _UxGT("Expulsar Filamento 3") +#define MSG_MMU2_EJECT_FILAMENT3 _UxGT("Expulsar Filamento 4") +#define MSG_MMU2_EJECT_FILAMENT4 _UxGT("Expulsar Filamento 5") +#define MSG_MMU2_UNLOAD_FILAMENT _UxGT("Descargar Filamento") +#define MSG_MMU2_LOADING_FILAMENT _UxGT("Cargando Fil. %i...") +#define MSG_MMU2_EJECTING_FILAMENT _UxGT("Expulsando Fil. ...") +#define MSG_MMU2_UNLOADING_FILAMENT _UxGT("Descargando Fil....") +#define MSG_MMU2_ALL _UxGT("Todo") +#define MSG_MMU2_FILAMENT0 _UxGT("Filamento 1") +#define MSG_MMU2_FILAMENT1 _UxGT("Filamento 2") +#define MSG_MMU2_FILAMENT2 _UxGT("Filamento 3") +#define MSG_MMU2_FILAMENT3 _UxGT("Filamento 4") +#define MSG_MMU2_FILAMENT4 _UxGT("Filamento 5") +#define MSG_MMU2_RESET _UxGT("Reiniciar MMU") +#define MSG_MMU2_RESETTING _UxGT("Reiniciando MMU...") +#define MSG_MMU2_EJECT_RECOVER _UxGT("Retirar, y pulsar") -#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserte el filamento") -#define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("y presione el botón") +#define MSG_MIX _UxGT("Mezcla") +#define MSG_MIX_COMPONENT _UxGT("Componente") +#define MSG_MIXER _UxGT("Miezclador") +#define MSG_GRADIENT _UxGT("Degradado") +#define MSG_FULL_GRADIENT _UxGT("Degradado Total") +#define MSG_TOGGLE_MIX _UxGT("Mezcla Conmutada") +#define MSG_CYCLE_MIX _UxGT("Mezcla Cíclica") +#define MSG_GRADIENT_MIX _UxGT("Mezcla de Degradado") +#define MSG_REVERSE_GRADIENT _UxGT("Degradado inverso") +#define MSG_ACTIVE_VTOOL _UxGT("Activar Herr.V") +#define MSG_START_VTOOL _UxGT("Inicio Herr.V") +#define MSG_END_VTOOL _UxGT(" Fin Herr.V") +#define MSG_GRADIENT_ALIAS _UxGT("Alias Herr.V") +#define MSG_RESET_VTOOLS _UxGT("Reiniciar Herr.V") +#define MSG_COMMIT_VTOOL _UxGT("Cometer mezc. Herr.V") +#define MSG_VTOOLS_RESET _UxGT("Herr.V reiniciados") +#define MSG_START_Z _UxGT("Inicio Z") +#define MSG_END_Z _UxGT(" Fin Z") + +#define MSG_GAMES _UxGT("Games") +#define MSG_BRICKOUT _UxGT("Brickout") +#define MSG_INVADERS _UxGT("Invaders") +#define MSG_SNAKE _UxGT("Sn4k3") +#define MSG_MAZE _UxGT("Maze") #if LCD_HEIGHT >= 4 - // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("iniciar cambio") + #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Pulsar el botón para") + #define MSG_ADVANCED_PAUSE_WAITING_2 _UxGT("reanudar impresión") + #define MSG_PAUSE_PRINT_INIT_1 _UxGT("Aparcando...") + #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Esperando para") + #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("iniciar el cambio") #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("de filamento") + #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserte el filamento") + #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("y pulse el botón") #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("para continuar...") -#else // LCD_HEIGHT < 4 - // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("iniciar cambio fil.") -#endif // LCD_HEIGHT < 4 + #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Pulse el botón para") + #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("calentar la boquilla") + #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Calentando boquilla") + #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Espere por favor...") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Espere para") + #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("liberar el filamento") + #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Espere para") + #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("purgar el filamento") + #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Pulse para finalizar") + #define MSG_FILAMENT_CHANGE_CONT_PURGE_2 _UxGT("la purga de filamen.") + #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Esperando impresora") + #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("para reanudar...") +#else + #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Pulse para continuar") + #define MSG_PAUSE_PRINT_INIT_1 _UxGT("Aparcando...") + #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Por Favor espere...") + #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Inserte y Pulse") + #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Pulse para Calentar") + #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Calentando...") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Liberando...") + #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Cargando...") + #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Purgando...") + #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Pulse para finalizar") + #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Reanudando...") +#endif -#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Esperando para") -#define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("expulsar filamento") -#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperado para") -#define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("cargar el filamento") -#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Esperando imp.") -#define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("para resumir") -#define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Oprima botón para") -#define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("Calentar la boquilla") -#define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Calentando boquilla") -#define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Espere por favor") +#define MSG_TMC_DRIVERS _UxGT("Controladores TMC") +#define MSG_TMC_CURRENT _UxGT("Amperaje Controlador") +#define MSG_TMC_HYBRID_THRS _UxGT("Límite Hibrido") +#define MSG_TMC_HOMING_THRS _UxGT("Origen sin sensores") +#define MSG_TMC_STEPPING_MODE _UxGT("Modo de pasos") +#define MSG_TMC_STEALTH_ENABLED _UxGT("StealthChop Habilit.") + +#define MSG_SERVICE_RESET _UxGT("Reiniciar") +#define MSG_SERVICE_IN _UxGT(" dentro:") + +#define MSG_BACKLASH _UxGT("Backlash") +#define MSG_BACKLASH_CORRECTION _UxGT("Correction") +#define MSG_BACKLASH_SMOOTHING _UxGT("Suavizado") diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index 12767d536e..a77ae8a7fe 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -81,7 +81,6 @@ //#define MSG_USER_MENU _UxGT("Custom Commands") #define MSG_UBL_DOING_G29 _UxGT("G29 exekutatzen") -#define MSG_UBL_UNHOMED _UxGT("XYZ etxeratu lehenengo") #define MSG_UBL_TOOLS _UxGT("UBL Tresnak") #define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") #define MSG_UBL_MANUAL_MESH _UxGT("Sarea eskuz sortu") @@ -277,8 +276,7 @@ #define MSG_BLTOUCH_RESET _UxGT("BLTouch berrabia.") #define MSG_BLTOUCH_DEPLOY _UxGT("BLTouch jaitsi/luzatu") #define MSG_BLTOUCH_STOW _UxGT("BLTouch igo/jaso") -#define MSG_HOME _UxGT("Etxera") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("lehenengo") +#define MSG_HOME_FIRST _UxGT("Etxera %s%s%s lehenengo") #define MSG_ZPROBE_ZOFFSET _UxGT("Z Konpentsatu") #define MSG_BABYSTEP_X _UxGT("Mikro-urratsa X") #define MSG_BABYSTEP_Y _UxGT("Mikro-urratsa Y") @@ -291,7 +289,7 @@ #define MSG_ERR_MINTEMP _UxGT("Err: Tenp Minimoa") #define MSG_ERR_MAXTEMP_BED _UxGT("Err: Ohe Tenp Max") #define MSG_ERR_MINTEMP_BED _UxGT("Err: Ohe Tenp Min") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("Etxera XY lehenengo") #define MSG_HALTED _UxGT("INPRIMA. GELDIRIK") #define MSG_PLEASE_RESET _UxGT("Berrabia. Mesedez") #define MSG_SHORT_DAY _UxGT("d") // One character only diff --git a/Marlin/src/lcd/language/language_fi.h b/Marlin/src/lcd/language/language_fi.h index 4d02e0ac34..2fbf9e2d18 100644 --- a/Marlin/src/lcd/language/language_fi.h +++ b/Marlin/src/lcd/language/language_fi.h @@ -156,8 +156,7 @@ #define MSG_INIT_MEDIA _UxGT("Init. SD-Card") #define MSG_CHANGE_MEDIA _UxGT("Change SD-Card") #define MSG_ZPROBE_OUT _UxGT("Z probe out. bed") -#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("first") +#define MSG_HOME_FIRST _UxGT("Home %s%s%s first") #define MSG_ZPROBE_ZOFFSET _UxGT("Z Offset") #define MSG_BABYSTEP_X _UxGT("Babystep X") #define MSG_BABYSTEP_Y _UxGT("Babystep Y") diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 908b2e4590..da9a0d4acd 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -36,9 +36,14 @@ #define MSG_YES _UxGT("Oui") #define MSG_NO _UxGT("Non") #define MSG_BACK _UxGT("Retour") -#define MSG_MEDIA_INSERTED _UxGT("Carte insérée") -#define MSG_MEDIA_REMOVED _UxGT("Carte retirée") -#define MSG_MEDIA_RELEASED _UxGT("Carte libérée") +#define MSG_MEDIA_ABORTING _UxGT("Annulation...") +#define MSG_MEDIA_INSERTED _UxGT("Média inséré") +#define MSG_MEDIA_REMOVED _UxGT("Média retiré") +#define MSG_MEDIA_RELEASED _UxGT("Média libéré") +#define MSG_MEDIA_WAITING _UxGT("Attente média") +#define MSG_MEDIA_READ_ERROR _UxGT("Err lecture média") +#define MSG_MEDIA_USB_REMOVED _UxGT("USB débranché") +#define MSG_MEDIA_USB_FAILED _UxGT("Erreur média USB") #define MSG_LCD_ENDSTOPS _UxGT("Butées") #define MSG_LCD_SOFT_ENDSTOPS _UxGT("Butées SW") #define MSG_MAIN _UxGT("Menu principal") @@ -87,8 +92,9 @@ #define MSG_MOVE_AXIS _UxGT("Déplacer un axe") #define MSG_BED_LEVELING _UxGT("Régler Niv. lit") #define MSG_LEVEL_BED _UxGT("Niveau du lit") -#define MSG_LEVEL_CORNERS _UxGT("Niveau coins") +#define MSG_LEVEL_CORNERS _UxGT("Niveau des coins") #define MSG_NEXT_CORNER _UxGT("Coin suivant") +#define MSG_MESH_EDITOR _UxGT("Edition Maillage") #define MSG_EDIT_MESH _UxGT("Modifier maille") #define MSG_EDITING_STOPPED _UxGT("Arrêt édit. maillage") #define MSG_PROBING_MESH _UxGT("Mesure point") @@ -100,6 +106,7 @@ #define MSG_LCD_TILTING_MESH _UxGT("Touche point") #define MSG_M48_TEST _UxGT("Ecart sonde Z M48") #define MSG_M48_DEVIATION _UxGT("Ecart") +#define MSG_M48_POINT _UxGT("Point M48") #define MSG_IDEX_MENU _UxGT("Mode IDEX") #define MSG_IDEX_MODE_AUTOPARK _UxGT("Auto-Park") #define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplication") @@ -109,8 +116,14 @@ #define MSG_X_OFFSET _UxGT("Buse 2 X") #define MSG_Y_OFFSET _UxGT("Buse 2 Y") #define MSG_Z_OFFSET _UxGT("Buse 2 Z") +#define MSG_G26_HEATING_BED _UxGT("G26 Chauffe lit") +#define MSG_G26_HEATING_NOZZLE _UxGT("G26 Chauffe buse") +#define MSG_G26_MANUAL_PRIME _UxGT("Amorce manuelle...") +#define MSG_G26_FIXED_LENGTH _UxGT("Amorce longueur fixe") +#define MSG_G26_PRIME_DONE _UxGT("Amorce terminée") +#define MSG_G26_CANCELED _UxGT("G26 annulé") +#define MSG_G26_LEAVING _UxGT("Sortie G26") #define MSG_UBL_DOING_G29 _UxGT("G29 en cours") -#define MSG_UBL_UNHOMED _UxGT("Origine XYZ requise") #define MSG_UBL_TOOLS _UxGT("Outils UBL") #define MSG_UBL_LEVEL_BED _UxGT("Niveau lit unifié") #define MSG_UBL_MANUAL_MESH _UxGT("Maillage manuel") @@ -168,6 +181,7 @@ #define MSG_UBL_NO_STORAGE _UxGT("Pas de mémoire") #define MSG_UBL_SAVE_ERROR _UxGT("Err: Enreg. UBL") #define MSG_UBL_RESTORE_ERROR _UxGT("Err: Ouvrir UBL") +#define MSG_UBL_Z_OFFSET _UxGT("Z-Offset: ") #define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Décal. Z arrêté") #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL Pas à pas") @@ -292,7 +306,7 @@ #define MSG_STOP_PRINT _UxGT("Arrêter impr.") #define MSG_OUTAGE_RECOVERY _UxGT("Récupér. coupure") #define MSG_MEDIA_MENU _UxGT("Impression SD") -#define MSG_NO_MEDIA _UxGT("Pas de carte") +#define MSG_NO_MEDIA _UxGT("Pas de média") #define MSG_DWELL _UxGT("Repos...") #define MSG_USERWAIT _UxGT("Attente utilis.") #define MSG_PRINT_PAUSED _UxGT("Impr. en pause") @@ -321,9 +335,9 @@ #define MSG_FILAMENTLOAD _UxGT("Charger filament") #define MSG_FILAMENTUNLOAD _UxGT("Retrait filament") #define MSG_FILAMENTUNLOAD_ALL _UxGT("Décharger tout") -#define MSG_INIT_MEDIA _UxGT("Init. la carte SD") -#define MSG_CHANGE_MEDIA _UxGT("Actualiser carte SD") -#define MSG_RELEASE_MEDIA _UxGT("Retirer carte SD") +#define MSG_INIT_MEDIA _UxGT("Charger le média") +#define MSG_CHANGE_MEDIA _UxGT("Actualiser média") +#define MSG_RELEASE_MEDIA _UxGT("Retirer le média") #define MSG_ZPROBE_OUT _UxGT("Sonde Z hors lit") #define MSG_SKEW_FACTOR _UxGT("Facteur écart") #define MSG_BLTOUCH _UxGT("BLTouch") @@ -345,8 +359,7 @@ #define MSG_MANUAL_DEPLOY_TOUCHMI _UxGT("Déployer TouchMI") #define MSG_MANUAL_DEPLOY _UxGT("Déployer Sonde Z") #define MSG_MANUAL_STOW _UxGT("Ranger Sonde Z") -#define MSG_HOME _UxGT("Origine") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("Premier") +#define MSG_HOME_FIRST _UxGT("Origine %s%s%s Premier") #define MSG_ZPROBE_ZOFFSET _UxGT("Décalage Z") #define MSG_BABYSTEP_X _UxGT("Babystep X") #define MSG_BABYSTEP_Y _UxGT("Babystep Y") @@ -366,7 +379,7 @@ #define MSG_ERR_MINTEMP_BED _UxGT("Err TEMP. MIN LIT") #define MSG_ERR_MAXTEMP_CHAMBER _UxGT("Err MAXTEMP CAISSON") #define MSG_ERR_MINTEMP_CHAMBER _UxGT("Err MINTEMP CAISSON") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("Origine XY Premier") #define MSG_HALTED _UxGT("IMPR. STOPPÉE") #define MSG_PLEASE_RESET _UxGT("Redémarrer SVP") @@ -431,6 +444,7 @@ #define MSG_DRIVE_STRENGTH _UxGT("Puiss. moteur ") #define MSG_DAC_PERCENT _UxGT("Driver %") #define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM sauv.") +#define MSG_ERROR_TMC _UxGT("ERREUR CONNEXION TMC") #define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("IMPR. PAUSE") #define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("CHARGER FIL") @@ -507,8 +521,8 @@ #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insérer filament") #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("et app. bouton") #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("pour continuer...") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Presser le bouton...") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("pr chauffer la buse") + #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Presser le bouton") + #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("pour chauffer...") #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Buse en chauffe") #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Patienter SVP...") #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Attente") @@ -523,7 +537,7 @@ #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("impression") #else // LCD_HEIGHT < 4 // Up to 2 lines allowed - #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Presser pr continuer") + #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Clic pour continuer") #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Patience...") #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insérer fil.") #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Chauffer ?") diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index d3a87296b2..0de6382e54 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -82,36 +82,36 @@ #define MSG_BED _UxGT("Cama") #define MSG_FAN_SPEED _UxGT("Velocidade vent.") #define MSG_FLOW _UxGT("Fluxo") -#define MSG_CONTROL _UxGT("Control") +//#define MSG_CONTROL _UxGT("Control") #define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_LCD_ON _UxGT("On") -#define MSG_LCD_OFF _UxGT("Off") -#define MSG_PID_P _UxGT("PID-P") -#define MSG_PID_I _UxGT("PID-I") -#define MSG_PID_D _UxGT("PID-D") -#define MSG_PID_C _UxGT("PID-C") +//#define MSG_AUTOTEMP _UxGT("Autotemp") +//#define MSG_LCD_ON _UxGT("On") +//#define MSG_LCD_OFF _UxGT("Off") +//#define MSG_PID_P _UxGT("PID-P") +//#define MSG_PID_I _UxGT("PID-I") +//#define MSG_PID_D _UxGT("PID-D") +//#define MSG_PID_C _UxGT("PID-C") #define MSG_SELECT _UxGT("Escolla") #define MSG_ACC _UxGT("Acel") -#define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vc-jerk") -#else - #define MSG_VA_JERK _UxGT("Vx-jerk") - #define MSG_VB_JERK _UxGT("Vy-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#endif -#define MSG_VE_JERK _UxGT("Ve-jerk") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A-retract") -#define MSG_A_TRAVEL _UxGT("A-travel") +//#define MSG_JERK _UxGT("Jerk") +//#if IS_KINEMATIC +// #define MSG_VA_JERK _UxGT("Va-jerk") +// #define MSG_VB_JERK _UxGT("Vb-jerk") +// #define MSG_VC_JERK _UxGT("Vc-jerk") +//#else +// #define MSG_VA_JERK _UxGT("Vx-jerk") +// #define MSG_VB_JERK _UxGT("Vy-jerk") +// #define MSG_VC_JERK _UxGT("Vz-jerk") +//#endif +//#define MSG_VE_JERK _UxGT("Ve-jerk") +//#define MSG_VMAX _UxGT("Vmax ") +//#define MSG_VMIN _UxGT("Vmin") +//#define MSG_VTRAV_MIN _UxGT("VTrav min") +//#define MSG_AMAX _UxGT("Amax ") +//#define MSG_A_RETRACT _UxGT("A-retract") +//#define MSG_A_TRAVEL _UxGT("A-travel") #define MSG_STEPS_PER_MM _UxGT("Pasos/mm") #if IS_KINEMATIC #define MSG_ASTEPS _UxGT("A pasos/mm") @@ -165,10 +165,9 @@ #define MSG_INIT_MEDIA _UxGT("Iniciando SD") #define MSG_CHANGE_MEDIA _UxGT("Cambiar SD") #define MSG_ZPROBE_OUT _UxGT("Sonda-Z sen cama") -#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST +//#define MSG_HOME_FIRST _UxGT("Home %s%s%s first") #define MSG_BLTOUCH_SELFTEST _UxGT("Comprobar BLTouch") #define MSG_BLTOUCH_RESET _UxGT("Iniciar BLTouch") -#define MSG_FIRST _UxGT("first") #define MSG_ZPROBE_ZOFFSET _UxGT("Offset Z") #define MSG_BABYSTEP_X _UxGT("Micropaso X") #define MSG_BABYSTEP_Y _UxGT("Micropaso Y") @@ -177,16 +176,16 @@ #define MSG_HEATING_FAILED_LCD _UxGT("Fallo quentando") #define MSG_ERR_REDUNDANT_TEMP _UxGT("Erro temperatura") #define MSG_THERMAL_RUNAWAY _UxGT("Temp. excesiva") -#define MSG_ERR_MAXTEMP _UxGT("Err: temp. max.") -#define MSG_ERR_MINTEMP _UxGT("Err: temp. min.") -#define MSG_ERR_MAXTEMP_BED _UxGT("Err: MAXTEMP BED") -#define MSG_ERR_MINTEMP_BED _UxGT("Err: MINTEMP BED") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +//#define MSG_ERR_MAXTEMP _UxGT("Err: temp. max.") +//#define MSG_ERR_MINTEMP _UxGT("Err: temp. min.") +//#define MSG_ERR_MAXTEMP_BED _UxGT("Err: MAXTEMP BED") +//#define MSG_ERR_MINTEMP_BED _UxGT("Err: MINTEMP BED") +//#define MSG_ERR_Z_HOMING _UxGT("Home XY first") #define MSG_HALTED _UxGT("SISTEMA MORTO") #define MSG_PLEASE_RESET _UxGT("Debe reiniciar!") -#define MSG_SHORT_DAY _UxGT("d") // One character only -#define MSG_SHORT_HOUR _UxGT("h") // One character only -#define MSG_SHORT_MINUTE _UxGT("m") // One character only +//#define MSG_SHORT_DAY _UxGT("d") // One character only +//#define MSG_SHORT_HOUR _UxGT("h") // One character only +//#define MSG_SHORT_MINUTE _UxGT("m") // One character only #define MSG_HEATING _UxGT("Quentando...") #define MSG_BED_HEATING _UxGT("Quentando cama...") #define MSG_DELTA_CALIBRATE _UxGT("Calibracion Delta") @@ -229,26 +228,26 @@ #if LCD_HEIGHT >= 4 // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Agarde para") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("iniciar troco") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("de filamento") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Agarde pola") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("descarga do") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("filamento") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Introduza o") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("filamento e") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("faga click") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Agarde pola") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("carga do") - #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("filamento") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Agarde para") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("seguir co") - #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("traballo") + #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Agarde para") + #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("iniciar troco") + #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("de filamento") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Agarde pola") + #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("descarga do") + #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("filamento") + #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Introduza o") + #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("filamento e") + #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("faga click") + #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Agarde pola") + #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("carga do") + #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("filamento") + #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Agarde para") + #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("seguir co") + #define MSG_FILAMENT_CHANGE_RESUME_3 _UxGT("traballo") #else // LCD_HEIGHT < 4 // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Agarde...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Descargando...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Introduza e click") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Cargando...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Seguindo...") + #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Agarde...") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Descargando...") + #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Introduza e click") + #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Cargando...") + #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Seguindo...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index f60e91654a..6b46d730f2 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -35,8 +35,8 @@ #define WELCOME_MSG MACHINE_NAME _UxGT(" spreman.") #define MSG_MEDIA_INSERTED _UxGT("SD kartica umetnuta") #define MSG_MEDIA_REMOVED _UxGT("SD kartica uklonjena") -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters -#define MSG_MAIN _UxGT("Main") +//#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters +//#define MSG_MAIN _UxGT("Main") #define MSG_AUTOSTART _UxGT("Auto pokretanje") #define MSG_DISABLE_STEPPERS _UxGT("Ugasi steppere") #define MSG_AUTO_HOME _UxGT("Automatski homing") @@ -63,15 +63,15 @@ #define MSG_COOLDOWN _UxGT("Hlađenje") #define MSG_SWITCH_PS_ON _UxGT("Uključi napajanje") #define MSG_SWITCH_PS_OFF _UxGT("Isključi napajanje") -#define MSG_EXTRUDE _UxGT("Extrude") -#define MSG_RETRACT _UxGT("Retract") +//#define MSG_EXTRUDE _UxGT("Extrude") +//#define MSG_RETRACT _UxGT("Retract") #define MSG_MOVE_AXIS _UxGT("Miči os") #define MSG_BED_LEVELING _UxGT("Niveliraj bed") #define MSG_LEVEL_BED _UxGT("Niveliraj bed") #define MSG_MOVE_X _UxGT("Miči X") #define MSG_MOVE_Y _UxGT("Miči Y") #define MSG_MOVE_Z _UxGT("Miči Z") -#define MSG_MOVE_E _UxGT("Extruder") +//#define MSG_MOVE_E _UxGT("Extruder") #define MSG_MOVE_Z_DIST _UxGT("Miči %smm") #define MSG_MOVE_01MM _UxGT("Miči 0.1mm") #define MSG_MOVE_1MM _UxGT("Miči 1mm") @@ -81,57 +81,57 @@ #define MSG_NOZZLE _UxGT("Dizna") #define MSG_BED _UxGT("Bed") #define MSG_FAN_SPEED _UxGT("Brzina ventilatora") -#define MSG_FLOW _UxGT("Flow") -#define MSG_CONTROL _UxGT("Control") -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") -#define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_LCD_ON _UxGT("On") -#define MSG_LCD_OFF _UxGT("Off") -#define MSG_PID_P _UxGT("PID-P") -#define MSG_PID_I _UxGT("PID-I") -#define MSG_PID_D _UxGT("PID-D") -#define MSG_PID_C _UxGT("PID-C") +//#define MSG_FLOW _UxGT("Flow") +//#define MSG_CONTROL _UxGT("Control") +//#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") +//#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") +//#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") +//#define MSG_AUTOTEMP _UxGT("Autotemp") +//#define MSG_LCD_ON _UxGT("On") +//#define MSG_LCD_OFF _UxGT("Off") +//#define MSG_PID_P _UxGT("PID-P") +//#define MSG_PID_I _UxGT("PID-I") +//#define MSG_PID_D _UxGT("PID-D") +//#define MSG_PID_C _UxGT("PID-C") #define MSG_SELECT _UxGT("Odaberi") -#define MSG_ACC _UxGT("Accel") -#define MSG_JERK _UxGT("Jerk") -#if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vc-jerk") -#else - #define MSG_VA_JERK _UxGT("Vx-jerk") - #define MSG_VB_JERK _UxGT("Vy-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") -#endif -#define MSG_VE_JERK _UxGT("Ve-jerk") -#define MSG_VMAX _UxGT("Vmax ") -#define MSG_VMIN _UxGT("Vmin") -#define MSG_VTRAV_MIN _UxGT("VTrav min") -#define MSG_AMAX _UxGT("Amax ") -#define MSG_A_RETRACT _UxGT("A-retract") -#define MSG_A_TRAVEL _UxGT("A-travel") -#define MSG_STEPS_PER_MM _UxGT("Steps/mm") -#if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Asteps/mm") - #define MSG_BSTEPS _UxGT("Bsteps/mm") - #define MSG_CSTEPS _UxGT("Csteps/mm") -#else - #define MSG_ASTEPS _UxGT("Xsteps/mm") - #define MSG_BSTEPS _UxGT("Ysteps/mm") - #define MSG_CSTEPS _UxGT("Zsteps/mm") -#endif -#define MSG_ESTEPS _UxGT("Esteps/mm") -#define MSG_E1STEPS _UxGT("E1steps/mm") -#define MSG_E2STEPS _UxGT("E2steps/mm") -#define MSG_E3STEPS _UxGT("E3steps/mm") -#define MSG_E4STEPS _UxGT("E4steps/mm") -#define MSG_E5STEPS _UxGT("E5steps/mm") -#define MSG_E6STEPS _UxGT("E6steps/mm") +//#define MSG_ACC _UxGT("Accel") +//#define MSG_JERK _UxGT("Jerk") +//#if IS_KINEMATIC +// #define MSG_VA_JERK _UxGT("Va-jerk") +// #define MSG_VB_JERK _UxGT("Vb-jerk") +// #define MSG_VC_JERK _UxGT("Vc-jerk") +//#else +// #define MSG_VA_JERK _UxGT("Vx-jerk") +// #define MSG_VB_JERK _UxGT("Vy-jerk") +// #define MSG_VC_JERK _UxGT("Vz-jerk") +//#endif +//#define MSG_VE_JERK _UxGT("Ve-jerk") +//#define MSG_VMAX _UxGT("Vmax ") +//#define MSG_VMIN _UxGT("Vmin") +//#define MSG_VTRAV_MIN _UxGT("VTrav min") +//#define MSG_AMAX _UxGT("Amax ") +//#define MSG_A_RETRACT _UxGT("A-retract") +//#define MSG_A_TRAVEL _UxGT("A-travel") +//#define MSG_STEPS_PER_MM _UxGT("Steps/mm") +//#if IS_KINEMATIC +// #define MSG_ASTEPS _UxGT("Asteps/mm") +// #define MSG_BSTEPS _UxGT("Bsteps/mm") +// #define MSG_CSTEPS _UxGT("Csteps/mm") +//#else +// #define MSG_ASTEPS _UxGT("Xsteps/mm") +// #define MSG_BSTEPS _UxGT("Ysteps/mm") +// #define MSG_CSTEPS _UxGT("Zsteps/mm") +//#endif +//#define MSG_ESTEPS _UxGT("Esteps/mm") +//#define MSG_E1STEPS _UxGT("E1steps/mm") +//#define MSG_E2STEPS _UxGT("E2steps/mm") +//#define MSG_E3STEPS _UxGT("E3steps/mm") +//#define MSG_E4STEPS _UxGT("E4steps/mm") +//#define MSG_E5STEPS _UxGT("E5steps/mm") +//#define MSG_E6STEPS _UxGT("E6steps/mm") #define MSG_TEMPERATURE _UxGT("Temperature") #define MSG_MOTION _UxGT("Gibanje") -#define MSG_FILAMENT _UxGT("Filament") +//#define MSG_FILAMENT _UxGT("Filament") #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") #define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") #define MSG_CONTRAST _UxGT("Kontrast LCD-a") @@ -141,52 +141,51 @@ #define MSG_REFRESH _UxGT("Osvježi") #define MSG_WATCH _UxGT("Info screen") #define MSG_PREPARE _UxGT("Pripremi") -#define MSG_TUNE _UxGT("Tune") +//#define MSG_TUNE _UxGT("Tune") #define MSG_PAUSE_PRINT _UxGT("Pauziraj print") #define MSG_RESUME_PRINT _UxGT("Nastavi print") #define MSG_STOP_PRINT _UxGT("Zaustavi print") #define MSG_MEDIA_MENU _UxGT("Printaj s SD kartice") #define MSG_NO_MEDIA _UxGT("Nema SD kartice") -#define MSG_DWELL _UxGT("Sleep...") +//#define MSG_DWELL _UxGT("Sleep...") #define MSG_USERWAIT _UxGT("Čekaj korisnika...") #define MSG_PRINT_ABORTED _UxGT("Print otkazan") -#define MSG_NO_MOVE _UxGT("No move.") -#define MSG_KILLED _UxGT("KILLED. ") +//#define MSG_NO_MOVE _UxGT("No move.") +//#define MSG_KILLED _UxGT("KILLED. ") #define MSG_STOPPED _UxGT("ZAUSTAVLJEN. ") -#define MSG_CONTROL_RETRACT _UxGT("Retract mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Re.mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retract V") -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Hop mm") -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("S UnRet mm") -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") -#define MSG_AUTORETRACT _UxGT("AutoRetr.") +//#define MSG_CONTROL_RETRACT _UxGT("Retract mm") +//#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Re.mm") +//#define MSG_CONTROL_RETRACTF _UxGT("Retract V") +//#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Hop mm") +//#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") +//#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("S UnRet mm") +//#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") +//#define MSG_AUTORETRACT _UxGT("AutoRetr.") #define MSG_FILAMENTCHANGE _UxGT("Promijeni filament") #define MSG_INIT_MEDIA _UxGT("Init. SD karticu") #define MSG_CHANGE_MEDIA _UxGT("Promijeni SD karticu") -#define MSG_ZPROBE_OUT _UxGT("Z probe out. bed") -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") -#define MSG_BLTOUCH_RESET _UxGT("Reset BLTouch") -#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("first") -#define MSG_ZPROBE_ZOFFSET _UxGT("Z Offset") -#define MSG_BABYSTEP_X _UxGT("Babystep X") -#define MSG_BABYSTEP_Y _UxGT("Babystep Y") -#define MSG_BABYSTEP_Z _UxGT("Babystep Z") -#define MSG_ENDSTOP_ABORT _UxGT("Endstop abort") +//#define MSG_ZPROBE_OUT _UxGT("Z probe out. bed") +//#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") +//#define MSG_BLTOUCH_RESET _UxGT("Reset BLTouch") +//#define MSG_HOME_FIRST _UxGT("Home %s%s%s first") +//#define MSG_ZPROBE_ZOFFSET _UxGT("Z Offset") +//#define MSG_BABYSTEP_X _UxGT("Babystep X") +//#define MSG_BABYSTEP_Y _UxGT("Babystep Y") +//#define MSG_BABYSTEP_Z _UxGT("Babystep Z") +//#define MSG_ENDSTOP_ABORT _UxGT("Endstop abort") #define MSG_HEATING_FAILED_LCD _UxGT("Grijanje neuspješno") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: REDUNDANT TEMP") -#define MSG_THERMAL_RUNAWAY _UxGT("THERMAL RUNAWAY") -#define MSG_ERR_MAXTEMP _UxGT("Err: MAXTEMP") -#define MSG_ERR_MINTEMP _UxGT("Err: MINTEMP") -#define MSG_ERR_MAXTEMP_BED _UxGT("Err: MAXTEMP BED") -#define MSG_ERR_MINTEMP_BED _UxGT("Err: MINTEMP BED") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("PRINTER HALTED") -#define MSG_PLEASE_RESET _UxGT("Please reset") -#define MSG_SHORT_DAY _UxGT("d") // One character only -#define MSG_SHORT_HOUR _UxGT("h") // One character only -#define MSG_SHORT_MINUTE _UxGT("m") // One character only +//#define MSG_ERR_REDUNDANT_TEMP _UxGT("Err: REDUNDANT TEMP") +//#define MSG_THERMAL_RUNAWAY _UxGT("THERMAL RUNAWAY") +//#define MSG_ERR_MAXTEMP _UxGT("Err: MAXTEMP") +//#define MSG_ERR_MINTEMP _UxGT("Err: MINTEMP") +//#define MSG_ERR_MAXTEMP_BED _UxGT("Err: MAXTEMP BED") +//#define MSG_ERR_MINTEMP_BED _UxGT("Err: MINTEMP BED") +//#define MSG_ERR_Z_HOMING _UxGT("Home XY first") +//#define MSG_HALTED _UxGT("PRINTER HALTED") +//#define MSG_PLEASE_RESET _UxGT("Please reset") +//#define MSG_SHORT_DAY _UxGT("d") // One character only +//#define MSG_SHORT_HOUR _UxGT("h") // One character only +//#define MSG_SHORT_MINUTE _UxGT("m") // One character only #define MSG_HEATING _UxGT("Grijanje...") #define MSG_BED_HEATING _UxGT("Grijanje Bed-a...") #define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibracija") @@ -220,34 +219,34 @@ #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrudirano") #endif -#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") -#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") +//#define MSG_INFO_MIN_TEMP _UxGT("Min Temp") +//#define MSG_INFO_MAX_TEMP _UxGT("Max Temp") #define MSG_INFO_PSU _UxGT("Napajanje") -#define MSG_DRIVE_STRENGTH _UxGT("Drive Strength") -#define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM Write") +//#define MSG_DRIVE_STRENGTH _UxGT("Drive Strength") +//#define MSG_DAC_PERCENT _UxGT("Driver %") +//#define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM Write") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Nastavi print") #if LCD_HEIGHT >= 4 // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čekaj početak") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("filamenta") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("promijeni") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Čekaj") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament unload") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Umetni filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("i pritisni tipku") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("za nastavak...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Pričekaj") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament load") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wait for print") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("to resume") + #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čekaj početak") + #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("filamenta") + #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("promijeni") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Čekaj") + #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filament unload") + #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Umetni filament") + #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("i pritisni tipku") + #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("za nastavak...") + #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Pričekaj") + #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filament load") + //#define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Wait for print") + //#define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("to resume") #else // LCD_HEIGHT < 4 // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Pričekaj...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejecting...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert and Click") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Loading...") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Nastavljam...") + #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Pričekaj...") + //#define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejecting...") + //#define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insert and Click") + //#define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Loading...") + #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Nastavljam...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 38a80d3c68..976460d2f2 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -35,9 +35,14 @@ #define MSG_YES _UxGT("SI") #define MSG_NO _UxGT("NO") #define MSG_BACK _UxGT("Indietro") -#define MSG_MEDIA_INSERTED _UxGT("SD Card inserita") -#define MSG_MEDIA_REMOVED _UxGT("SD Card rimossa") -#define MSG_MEDIA_RELEASED _UxGT("SD Card rilasciata") +#define MSG_MEDIA_ABORTING _UxGT("Annullando...") +#define MSG_MEDIA_INSERTED _UxGT("Media inserito") +#define MSG_MEDIA_REMOVED _UxGT("Media rimosso") +#define MSG_MEDIA_RELEASED _UxGT("Media rilasciato") +#define MSG_MEDIA_WAITING _UxGT("Aspettando media") +#define MSG_MEDIA_READ_ERROR _UxGT("Err.leggendo media") +#define MSG_MEDIA_USB_REMOVED _UxGT("Dispos.USB rimosso") +#define MSG_MEDIA_USB_FAILED _UxGT("Avvio USB fallito") #define MSG_LCD_ENDSTOPS _UxGT("Finecor.") // Max 8 caratteri #define MSG_LCD_SOFT_ENDSTOPS _UxGT("Finecorsa Soft") #define MSG_MAIN _UxGT("Menu principale") @@ -92,6 +97,7 @@ #define MSG_LEVEL_BED MSG_BED_LEVELING #define MSG_LEVEL_CORNERS _UxGT("Livella spigoli") #define MSG_NEXT_CORNER _UxGT("Prossimo spigolo") +#define MSG_MESH_EDITOR _UxGT("Editor Mesh") #define MSG_EDIT_MESH _UxGT("Modifica Mesh") #define MSG_EDITING_STOPPED _UxGT("Modif. Mesh Fermata") #define MSG_PROBING_MESH _UxGT("Punto sondato") @@ -101,6 +107,7 @@ #define MSG_USER_MENU _UxGT("Comandi personaliz.") #define MSG_LCD_TILTING_MESH _UxGT("Punto inclinaz.") #define MSG_M48_TEST _UxGT("Test sonda M48") +#define MSG_M48_POINT _UxGT("Punto M48") #define MSG_M48_DEVIATION _UxGT("Deviazione") #define MSG_IDEX_MENU _UxGT("Modo IDEX") #define MSG_OFFSETS_MENU _UxGT("Strumenti Offsets") @@ -112,7 +119,6 @@ #define MSG_Y_OFFSET _UxGT("2° ugello Y") #define MSG_Z_OFFSET _UxGT("2° ugello Z") #define MSG_UBL_DOING_G29 _UxGT("G29 in corso") -#define MSG_UBL_UNHOMED _UxGT("Home XYZ prima") #define MSG_UBL_TOOLS _UxGT("Strumenti UBL") #define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") #define MSG_UBL_MANUAL_MESH _UxGT("Mesh Manuale") @@ -140,6 +146,13 @@ #define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Valida Mesh") #define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Valida Mesh " PREHEAT_1_LABEL) #define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Valida Mesh " PREHEAT_2_LABEL) +#define MSG_G26_HEATING_BED _UxGT("G26 riscald.letto") +#define MSG_G26_HEATING_NOZZLE _UxGT("G26 riscald.ugello") +#define MSG_G26_MANUAL_PRIME _UxGT("Priming manuale...") +#define MSG_G26_FIXED_LENGTH _UxGT("Prime a lung.fissa") +#define MSG_G26_PRIME_DONE _UxGT("Priming terminato") +#define MSG_G26_CANCELED _UxGT("G26 Annullato") +#define MSG_G26_LEAVING _UxGT("Uscita da G26") #define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Valida Mesh pers.") #define MSG_UBL_CONTINUE_MESH _UxGT("Continua Mesh") #define MSG_UBL_MESH_LEVELING _UxGT("Livell. Mesh") @@ -170,6 +183,7 @@ #define MSG_UBL_NO_STORAGE _UxGT("Nessuna memoria") #define MSG_UBL_SAVE_ERROR _UxGT("Err: Salvataggio UBL") #define MSG_UBL_RESTORE_ERROR _UxGT("Err: Ripristino UBL") +#define MSG_UBL_Z_OFFSET _UxGT("Z-Offset: ") #define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Offset Fermato") #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("UBL passo passo") @@ -274,7 +288,7 @@ #define MSG_LOAD_EEPROM _UxGT("Carica impostazioni") #define MSG_RESTORE_FAILSAFE _UxGT("Ripristina imp.") #define MSG_INIT_EEPROM _UxGT("Inizializza EEPROM") -#define MSG_MEDIA_UPDATE _UxGT("Aggiorna SD") +#define MSG_MEDIA_UPDATE _UxGT("Aggiorna media") #define MSG_RESET_PRINTER _UxGT("Resetta stampante") #define MSG_REFRESH _UxGT("Aggiorna") #define MSG_WATCH _UxGT("Schermata info") @@ -292,8 +306,8 @@ #define MSG_RESUME_PRINT _UxGT("Riprendi stampa") #define MSG_STOP_PRINT _UxGT("Arresta stampa") #define MSG_OUTAGE_RECOVERY _UxGT("Ripresa da PowerLoss") -#define MSG_MEDIA_MENU _UxGT("Stampa da SD") -#define MSG_NO_MEDIA _UxGT("SD non presente") +#define MSG_MEDIA_MENU _UxGT("Stampa da media") +#define MSG_NO_MEDIA _UxGT("Media non presente") #define MSG_DWELL _UxGT("Sospensione...") #define MSG_USERWAIT _UxGT("Premi tasto..") #define MSG_PRINT_PAUSED _UxGT("Stampa sospesa") @@ -322,9 +336,9 @@ #define MSG_FILAMENTLOAD _UxGT("Carica filamento") #define MSG_FILAMENTUNLOAD _UxGT("Rimuovi filamento") #define MSG_FILAMENTUNLOAD_ALL _UxGT("Rimuovi tutto") -#define MSG_INIT_MEDIA _UxGT("Iniz. SD card") -#define MSG_CHANGE_MEDIA _UxGT("Cambia SD card") -#define MSG_RELEASE_MEDIA _UxGT("Rilascia SD card") +#define MSG_INIT_MEDIA _UxGT("Inizializ. media") +#define MSG_CHANGE_MEDIA _UxGT("Cambia media") +#define MSG_RELEASE_MEDIA _UxGT("Rilascia media") #define MSG_ZPROBE_OUT _UxGT("Z probe fuori piatto") #define MSG_SKEW_FACTOR _UxGT("Fattore distorsione") #define MSG_BLTOUCH _UxGT("BLTouch") @@ -347,8 +361,7 @@ #define MSG_MANUAL_DEPLOY _UxGT("Estendi Sonda-Z") #define MSG_BLTOUCH_STOW _UxGT("Ritrai BLTouch") #define MSG_MANUAL_STOW _UxGT("Ritrai Sonda-Z") -#define MSG_HOME _UxGT("Home") // Usato come MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("prima") +#define MSG_HOME_FIRST _UxGT("Home %s%s%s prima") #define MSG_ZPROBE_ZOFFSET _UxGT("Offset sonda Z") #define MSG_BABYSTEP_X _UxGT("Babystep X") #define MSG_BABYSTEP_Y _UxGT("Babystep Y") @@ -368,7 +381,7 @@ #define MSG_ERR_MINTEMP_BED _UxGT("Err: TEMP MIN PIATTO") #define MSG_ERR_MAXTEMP_CHAMBER _UxGT("Err: TEMP MAX CAMERA") #define MSG_ERR_MINTEMP_CHAMBER _UxGT("Err: TEMP MIN CAMERA") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("Home XY prima") #define MSG_HALTED _UxGT("STAMPANTE FERMATA") #define MSG_PLEASE_RESET _UxGT("Riavviare prego") #define MSG_SHORT_DAY _UxGT("g") // Un solo carattere @@ -425,6 +438,7 @@ #define MSG_INFO_PSU _UxGT("Alimentatore") #define MSG_DRIVE_STRENGTH _UxGT("Potenza Drive") #define MSG_DAC_PERCENT _UxGT("Driver %") +#define MSG_ERROR_TMC _UxGT("ERR.CONNESSIONE TMC") #define MSG_DAC_EEPROM_WRITE _UxGT("Scrivi DAC EEPROM") #define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("STAMPA IN PAUSA") #define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("CARICA FILAMENTO") diff --git a/Marlin/src/lcd/language/language_jp-kana.h b/Marlin/src/lcd/language/language_jp-kana.h index 4792bb1ddf..1898ab01d6 100644 --- a/Marlin/src/lcd/language/language_jp-kana.h +++ b/Marlin/src/lcd/language/language_jp-kana.h @@ -161,8 +161,7 @@ #define MSG_ZPROBE_OUT _UxGT("Zプローブ ベッドガイ") // "Z probe out. bed" #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch ジコシンダン") // "BLTouch Self-Test" #define MSG_BLTOUCH_RESET _UxGT("BLTouch リセット") // "Reset BLTouch" -#define MSG_HOME _UxGT("サキニ") // "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("ヲフッキサセテクダサイ") // "first" +#define MSG_HOME_FIRST _UxGT("サキニ %s%s%s ヲフッキサセテクダサイ") // "Home ... first" #define MSG_ZPROBE_ZOFFSET _UxGT("Zオフセット") // "Z Offset" #define MSG_BABYSTEP_X _UxGT("Xジク ビドウ") // "Babystep X" #define MSG_BABYSTEP_Y _UxGT("Yジク ビドウ") // "Babystep Y" @@ -175,7 +174,7 @@ #define MSG_ERR_MINTEMP _UxGT("エラー:サイテイオンミマン") // "Err: MINTEMP" #define MSG_ERR_MAXTEMP_BED _UxGT("エラー:ベッド サイコウオンチョウカ") // "Err: MAXTEMP BED" #define MSG_ERR_MINTEMP_BED _UxGT("エラー:ベッド サイテイオンミマン") // "Err: MINTEMP BED" -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST // "Home XY first" +#define MSG_ERR_Z_HOMING _UxGT("サキニ XY ヲフッキサセテクダサイ") // "Home XY first" #define MSG_HALTED _UxGT("プリンターハテイシシマシタ") // "PRINTER HALTED" #define MSG_PLEASE_RESET _UxGT("リセットシテクダサイ") // "Please reset" #define MSG_SHORT_DAY _UxGT("d") // One character only diff --git a/Marlin/src/lcd/language/language_ko_KR.h b/Marlin/src/lcd/language/language_ko_KR.h index 8d24736e6c..20e35af58b 100644 --- a/Marlin/src/lcd/language/language_ko_KR.h +++ b/Marlin/src/lcd/language/language_ko_KR.h @@ -91,7 +91,6 @@ //#define MSG_Y_OFFSET _UxGT("2nd nozzle Y") //#define MSG_Z_OFFSET _UxGT("2nd nozzle Z") #define MSG_UBL_DOING_G29 _UxGT("오토레벨링 하기") -//#define MSG_UBL_UNHOMED _UxGT("Home XYZ first") //#define MSG_UBL_TOOLS _UxGT("UBL Tools") //#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") //#define MSG_UBL_MANUAL_MESH _UxGT("Manually Build Mesh") @@ -293,8 +292,7 @@ //#define MSG_BLTOUCH_STOW _UxGT("Stow BLTouch") //#define MSG_MANUAL_DEPLOY _UxGT("Deploy Z-Probe") //#define MSG_MANUAL_STOW _UxGT("Stow Z-Probe") -//#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -//#define MSG_FIRST _UxGT("first") +//#define MSG_HOME_FIRST _UxGT("Home %s%s%s first") //#define MSG_ZPROBE_ZOFFSET _UxGT("Probe Z Offset") //#define MSG_BABYSTEP_X _UxGT("Babystep X") //#define MSG_BABYSTEP_Y _UxGT("Babystep Y") @@ -309,7 +307,7 @@ //#define MSG_ERR_MINTEMP _UxGT("Err: MINTEMP") //#define MSG_ERR_MAXTEMP_BED _UxGT("Err: MAXTEMP BED") //#define MSG_ERR_MINTEMP_BED _UxGT("Err: MINTEMP BED") -//#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +//#define MSG_ERR_Z_HOMING _UxGT("Home XY first") //#define MSG_HALTED _UxGT("PRINTER HALTED") //#define MSG_PLEASE_RESET _UxGT("Please reset") //#define MSG_SHORT_DAY _UxGT("d") // One character only diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index 5e95c3554b..483b242501 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -176,8 +176,7 @@ #define MSG_ZPROBE_OUT _UxGT("Z probe uit. bed") #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Zelf-Test") #define MSG_BLTOUCH_RESET _UxGT("Reset BLTouch") -#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("Eerst") +#define MSG_HOME_FIRST _UxGT("Home %s%s%s Eerst") #define MSG_ZPROBE_ZOFFSET _UxGT("Z Offset") //accepted English term in Dutch #define MSG_BABYSTEP_X _UxGT("Babystap X") #define MSG_BABYSTEP_Y _UxGT("Babystap Y") @@ -190,7 +189,7 @@ #define MSG_ERR_MINTEMP _UxGT("Err: Min. temp") #define MSG_ERR_MAXTEMP_BED _UxGT("Err: Max.tmp bed") #define MSG_ERR_MINTEMP_BED _UxGT("Err: Min.tmp bed") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("Home XY Eerst") #define MSG_HALTED _UxGT("PRINTER GESTOPT") #define MSG_PLEASE_RESET _UxGT("Reset A.U.B.") #define MSG_SHORT_DAY _UxGT("d") // One character only. Keep English standard diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 575f313dff..97924a7024 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -166,8 +166,7 @@ #define MSG_ZPROBE_OUT _UxGT("Sonda Z za stołem") #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") #define MSG_BLTOUCH_RESET _UxGT("Reset BLTouch") -#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("first") +#define MSG_HOME_FIRST _UxGT("Home %s%s%s first") #define MSG_ZPROBE_ZOFFSET _UxGT("Offset Z") #define MSG_BABYSTEP_X _UxGT("Babystep X") #define MSG_BABYSTEP_Y _UxGT("Babystep Y") @@ -180,7 +179,7 @@ #define MSG_ERR_MINTEMP _UxGT("Err min temp") #define MSG_ERR_MAXTEMP_BED _UxGT("Err max temp stołu") #define MSG_ERR_MINTEMP_BED _UxGT("Err min temp stołu") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("Home XY first") #define MSG_HALTED _UxGT("Drukarka zatrzym.") #define MSG_PLEASE_RESET _UxGT("Proszę zresetować") #define MSG_SHORT_DAY _UxGT("d") // One character only diff --git a/Marlin/src/lcd/language/language_pt-br.h b/Marlin/src/lcd/language/language_pt-br.h index 9b97457870..d78bd5a138 100644 --- a/Marlin/src/lcd/language/language_pt-br.h +++ b/Marlin/src/lcd/language/language_pt-br.h @@ -102,7 +102,6 @@ #define MSG_Z_OFFSET _UxGT("2o bico Z") #define MSG_UBL_DOING_G29 _UxGT("Executando G29") -#define MSG_UBL_UNHOMED _UxGT("Fora da Origam") #define MSG_UBL_TOOLS _UxGT("Ferramentas UBL") #define MSG_UBL_LEVEL_BED _UxGT("Nivel. Mesa Unif.") #define MSG_UBL_MANUAL_MESH _UxGT("Fazer malha manual") @@ -311,8 +310,7 @@ #define MSG_MANUAL_DEPLOY _UxGT("Estender Sonda-Z") #define MSG_MANUAL_STOW _UxGT("Recolher Sonda-Z") -#define MSG_HOME _UxGT("Home") -#define MSG_FIRST _UxGT("Primeiro") +#define MSG_HOME_FIRST _UxGT("Home %s%s%s Primeiro") #define MSG_ZPROBE_ZOFFSET _UxGT("Compensar Sonda em Z") #define MSG_BABYSTEP_X _UxGT("Passinho X") #define MSG_BABYSTEP_Y _UxGT("Passinho Y") @@ -327,7 +325,7 @@ #define MSG_ERR_MINTEMP _UxGT("Erro:Temp Mínima") #define MSG_ERR_MAXTEMP_BED _UxGT("Erro:Temp Mesa Máx") #define MSG_ERR_MINTEMP_BED _UxGT("Erro:Temp Mesa Mín") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("Home XY Primeiro") #define MSG_HALTED _UxGT("IMPRESSORA PAROU") #define MSG_PLEASE_RESET _UxGT("Favor resetar") #define MSG_SHORT_DAY _UxGT("d") diff --git a/Marlin/src/lcd/language/language_pt.h b/Marlin/src/lcd/language/language_pt.h index 50d9d60c71..9fde8f89ba 100644 --- a/Marlin/src/lcd/language/language_pt.h +++ b/Marlin/src/lcd/language/language_pt.h @@ -162,8 +162,7 @@ #define MSG_INIT_MEDIA _UxGT("Inici. cartão SD") #define MSG_CHANGE_MEDIA _UxGT("Trocar cartão SD") #define MSG_ZPROBE_OUT _UxGT("Sensor fora/base") -#define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("first") +#define MSG_HOME_FIRST _UxGT("Home %s%s%s first") #define MSG_ZPROBE_ZOFFSET _UxGT("Desvio Z") #define MSG_BABYSTEP_X _UxGT("Babystep X") #define MSG_BABYSTEP_Y _UxGT("Babystep Y") diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 37e19c7873..e825dbe7d0 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -96,7 +96,6 @@ #define MSG_Z_OFFSET _UxGT("2-е сопло Z") #define MSG_UBL_DOING_G29 _UxGT("Выполняем G29") -#define MSG_UBL_UNHOMED _UxGT("Паркуем сначала XYZ") #define MSG_UBL_TOOLS _UxGT("Утилиты UBL") #define MSG_UBL_LEVEL_BED _UxGT("Калибровка UBL") #define MSG_UBL_MANUAL_MESH _UxGT("Постр. сетку от руки") @@ -316,8 +315,7 @@ // TODO: TouchMI Probe, Manual deploy/stow -#define MSG_HOME _UxGT("Паркуй") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("сначала") +#define MSG_HOME_FIRST _UxGT("Паркуй %s%s%s сначала") #define MSG_ZPROBE_ZOFFSET _UxGT("Смещение Z") #define MSG_BABYSTEP_X _UxGT("Микрошаг X") #define MSG_BABYSTEP_Y _UxGT("Микрошаг Y") @@ -334,7 +332,7 @@ #define MSG_ERR_MAXTEMP_BED _UxGT("Ошибка: Т стола макс") #define MSG_ERR_MINTEMP_BED _UxGT("Ошибка: Т стола мин.") // TODO: Heated chamber -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("Паркуй XY сначала") #define MSG_HALTED _UxGT("ПРИНТЕР ОСТАНОВЛЕН") #define MSG_PLEASE_RESET _UxGT("Сделайте сброс") #define MSG_SHORT_DAY _UxGT("д") // One character only diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index e92d741f4e..8897ff2310 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -107,8 +107,9 @@ #define MSG_MESH_Y _UxGT("Index Y") #define MSG_MESH_EDIT_Z _UxGT("Hodnota Z") #define MSG_USER_MENU _UxGT("Vlastné príkazy") - -#define MSG_LCD_TILTING_MESH _UxGT("Vyrovnávam bod") +#define MSG_M48_TEST _UxGT("M48 Test sondy") +#define MSG_M48_POINT _UxGT("M48 Bod") +#define MSG_M48_DEVIATION _UxGT("Odchýlka") #define MSG_IDEX_MENU _UxGT("IDEX režim") #define MSG_OFFSETS_MENU _UxGT("Ofset nástrojov") #define MSG_IDEX_MODE_AUTOPARK _UxGT("Auto-parkovanie") @@ -119,9 +120,9 @@ #define MSG_Y_OFFSET _UxGT("2. tryska Y") #define MSG_Z_OFFSET _UxGT("2. tryska Z") #define MSG_UBL_DOING_G29 _UxGT("Vykonávam G29") -#define MSG_UBL_UNHOMED _UxGT("Prejdite domov") #define MSG_UBL_TOOLS _UxGT("Nástroje UBL") #define MSG_UBL_LEVEL_BED _UxGT("UBL rovnanie") +#define MSG_LCD_TILTING_MESH _UxGT("Vyrovnávam bod") #define MSG_UBL_MANUAL_MESH _UxGT("Manuálna sieť bodov") #define MSG_UBL_BC_INSERT _UxGT("Položte a zmerajte") #define MSG_UBL_BC_INSERT2 _UxGT("Zmerajte") @@ -318,7 +319,8 @@ #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") #define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") #define MSG_AUTORETRACT _UxGT("AutoRetr.") -#define MSG_FILAMENT_SWAP_LENGTH _UxGT("Dĺžka retrakcie") +#define MSG_FILAMENT_SWAP_LENGTH _UxGT("Dĺžka výmeny") +#define MSG_FILAMENT_PURGE_LENGTH _UxGT("Dĺžka vytlačenia") #define MSG_TOOL_CHANGE _UxGT("Výmena nástroja") #define MSG_TOOL_CHANGE_ZLIFT _UxGT("Zdvihnúť Z") #define MSG_SINGLENOZZLE_PRIME_SPD _UxGT("Primárna rýchl.") @@ -354,8 +356,7 @@ #define MSG_MANUAL_DEPLOY_TOUCHMI _UxGT("Zasunúť TouchMI") #define MSG_MANUAL_DEPLOY _UxGT("Zasunúť sondu Z") #define MSG_MANUAL_STOW _UxGT("Vysunúť sondu Z") -#define MSG_HOME _UxGT("Najskôr os") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("domov") +#define MSG_HOME_FIRST _UxGT("Najskôr os %s%s%s domov") #define MSG_ZPROBE_ZOFFSET _UxGT("Ofset sondy Z") #define MSG_BABYSTEP_X _UxGT("Babystep X") #define MSG_BABYSTEP_Y _UxGT("Babystep Y") @@ -375,7 +376,7 @@ #define MSG_ERR_MINTEMP_BED _UxGT("Chyba: MINTEMP PODL.") #define MSG_ERR_MAXTEMP_CHAMBER _UxGT("Chyba: MAXTEMP KOMO.") #define MSG_ERR_MINTEMP_CHAMBER _UxGT("Chyba: MINTEMP KOMO.") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("Najskôr os XY domov") #define MSG_HALTED _UxGT("TLAČIAREŇ ZASTAVENÁ") #define MSG_PLEASE_RESET _UxGT("Reštartuje ju") #define MSG_SHORT_DAY _UxGT("d") @@ -499,6 +500,7 @@ #define MSG_VTOOLS_RESET _UxGT("V-tools vynulované") #define MSG_START_Z _UxGT("Počiat.Z") #define MSG_END_Z _UxGT("Konečn.Z") +#define MSG_GAMES _UxGT("Hry") #define MSG_BRICKOUT _UxGT("Brickout") #define MSG_INVADERS _UxGT("Nájazdníci") #define MSG_SNAKE _UxGT("Had") diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index de48759003..3e025934a7 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -101,7 +101,6 @@ #define MSG_Y_OFFSET _UxGT("2. nozul Y") #define MSG_Z_OFFSET _UxGT("2. nozul Z") #define MSG_UBL_DOING_G29 _UxGT("G29 Çalışıyor") -#define MSG_UBL_UNHOMED _UxGT("Ilk XYZ Sıfırla") #define MSG_UBL_TOOLS _UxGT("UBL Araçları") #define MSG_UBL_LEVEL_BED _UxGT("UBL Yatak Hizalama") #define MSG_UBL_MANUAL_MESH _UxGT("Elle Mesh Oluştur") @@ -309,8 +308,7 @@ #define MSG_BLTOUCH_STOW _UxGT("BLTouch Kapat") #define MSG_MANUAL_DEPLOY _UxGT("Z-Prob Aç") #define MSG_MANUAL_STOW _UxGT("Z-Sensör Kapat") -#define MSG_HOME _UxGT("Sıfırla") -#define MSG_FIRST _UxGT("Önce") +#define MSG_HOME_FIRST _UxGT("Sıfırla %s%s%s Önce") #define MSG_ZPROBE_ZOFFSET _UxGT("Z Offset") #define MSG_BABYSTEP_X _UxGT("Miniadım X") #define MSG_BABYSTEP_Y _UxGT("Miniadım Y") diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 7e866668c3..b358743be6 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -159,8 +159,7 @@ #define MSG_ZPROBE_OUT _UxGT("Z дет. не в межах") #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Само-Тест") #define MSG_BLTOUCH_RESET _UxGT("Скинути BLTouch") -#define MSG_HOME _UxGT("Дім") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("перший") +#define MSG_HOME_FIRST _UxGT("Дім %s%s%s перший") #define MSG_ZPROBE_ZOFFSET _UxGT("Зміщення Z") #define MSG_BABYSTEP_X _UxGT("Мікрокрок X") #define MSG_BABYSTEP_Y _UxGT("Мікрокрок Y") @@ -168,7 +167,7 @@ #define MSG_ENDSTOP_ABORT _UxGT("невдача кінцевика") #define MSG_HEATING_FAILED_LCD _UxGT("Невдалий нагрів") #define MSG_THERMAL_RUNAWAY _UxGT("ЗБІЙ ТЕМПЕРАТУРИ") -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("Дім XY перший") #define MSG_HALTED _UxGT("ПРИНТЕР ЗУПИНЕНО") #define MSG_PLEASE_RESET _UxGT("Перезавантажте") #define MSG_SHORT_DAY _UxGT("д") // One character only diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index 3453e88bda..3b8885e707 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -1,9 +1,9 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * 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 @@ -88,7 +88,6 @@ #define MSG_MESH_EDIT_Z _UxGT("Giá trị Z") // Z Value #define MSG_USER_MENU _UxGT("Các lệnh tự chọn") // Custom Commands #define MSG_UBL_DOING_G29 _UxGT("Đang chạy G29") // Doing G29 -#define MSG_UBL_UNHOMED _UxGT("Về nhà XYZ trước") #define MSG_UBL_TOOLS _UxGT("Công cụ UBL") // UBL tools #define MSG_UBL_LEVEL_BED _UxGT("San Lấp Bàn Thống Nhất (UBL)") // Unified Bed Leveling #define MSG_IDEX_MENU _UxGT("chế độ IDEX") // IDEX Mode @@ -307,8 +306,7 @@ #define MSG_BLTOUCH_STOW _UxGT("Cất BLTouch") // Stow BLTouch #define MSG_MANUAL_DEPLOY _UxGT("Đem Đầu Dò-Z") // Deploy Z-Probe #define MSG_MANUAL_STOW _UxGT("Cất Đầu Dò-Z") // Stow Z-Probe -#define MSG_HOME _UxGT("Về nhà") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("Trước") +#define MSG_HOME_FIRST _UxGT("Về nhà %s%s%s Trước") #define MSG_ZPROBE_ZOFFSET _UxGT("Đầu Dò Bù Đắp Z") // Probe Z Offset #define MSG_BABYSTEP_X _UxGT("Nhít X") // Babystep X #define MSG_BABYSTEP_Y _UxGT("Nhít Y") @@ -323,7 +321,7 @@ #define MSG_ERR_MINTEMP _UxGT("Điều sai: nhiệt độ tối thiểu") // Err: MINTEMP #define MSG_ERR_MAXTEMP_BED _UxGT("Điều sai: nhiệt độ bàn tối đa") // Err: MAXTEMP BED #define MSG_ERR_MINTEMP_BED _UxGT("Điều sai: nhiệt độ bàn tối thiểu") // Err: MINTEMP BED -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("Về nhà XY Trước") // Home XY First #define MSG_HALTED _UxGT("MÁY IN Đà DỪNG LẠI") // PRINTER HALTED #define MSG_PLEASE_RESET _UxGT("Xin bặt lại") // Please reset #define MSG_SHORT_DAY _UxGT("n") // d - ngày - One character only diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index bad55c974f..a87f469a0e 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -79,7 +79,6 @@ #define MSG_USER_MENU _UxGT("定制命令") // "Custom Commands" #define MSG_UBL_DOING_G29 _UxGT("执行G29") // "Doing G29" -#define MSG_UBL_UNHOMED _UxGT("先回XYZ原点") // "Home XYZ first" #define MSG_UBL_TOOLS _UxGT("UBL工具") // "UBL Tools" #define MSG_UBL_LEVEL_BED _UxGT("统一热床调平(UBL)") // "Unified Bed Leveling" #define MSG_UBL_MANUAL_MESH _UxGT("手工创设网格") // "Manually Build Mesh" @@ -274,8 +273,7 @@ #define MSG_BLTOUCH_RESET _UxGT("重置BLTouch") // "Reset BLTouch" #define MSG_BLTOUCH_DEPLOY _UxGT("部署BLTouch") // "Deploy BLTouch" #define MSG_BLTOUCH_STOW _UxGT("装载BLTouch") // "Stow BLTouch" -#define MSG_HOME _UxGT("归位") //"Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("先") //"first" +#define MSG_HOME_FIRST _UxGT("归位 %s%s%s 先") //"Home ... first" #define MSG_ZPROBE_ZOFFSET _UxGT("Z偏移") //"Z Offset" #define MSG_BABYSTEP_X _UxGT("微量调整X轴") //"Babystep X" lcd_babystep_x, Babystepping enables the user to control the axis in tiny amounts #define MSG_BABYSTEP_Y _UxGT("微量调整Y轴") //"Babystep Y" @@ -288,7 +286,7 @@ #define MSG_ERR_MINTEMP _UxGT("错误:最低温度") //"Err: MINTEMP" #define MSG_ERR_MAXTEMP_BED _UxGT("错误:最高热床温度") //"Err: MAXTEMP BED" #define MSG_ERR_MINTEMP_BED _UxGT("错误:最低热床温度") //"Err: MINTEMP BED" -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("归位 XY 先") // "Home XY First" #define MSG_HALTED _UxGT("打印停机") //"PRINTER HALTED" #define MSG_PLEASE_RESET _UxGT("请重置") //"Please reset" #define MSG_SHORT_DAY _UxGT("天") //"d" // One character only diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index e9e871ac2a..ce8cda2692 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -79,7 +79,6 @@ #define MSG_USER_MENU _UxGT("客制命令") // "Custom Commands" #define MSG_UBL_DOING_G29 _UxGT("执行G29") // "Doing G29" -#define MSG_UBL_UNHOMED _UxGT("先回XYZ原點") // "Home XYZ first" #define MSG_UBL_TOOLS _UxGT("UBL工具") // "UBL Tools" #define MSG_UBL_LEVEL_BED _UxGT("統一熱床調平(UBL)") // "Unified Bed Leveling" #define MSG_UBL_MANUAL_MESH _UxGT("手工建网") // "Manually Build Mesh" @@ -274,8 +273,7 @@ #define MSG_BLTOUCH_RESET _UxGT("重置BLTouch") // "Reset BLTouch" #define MSG_BLTOUCH_DEPLOY _UxGT("部署BLTouch") // "Deploy BLTouch" #define MSG_BLTOUCH_STOW _UxGT("裝載BLTouch") // "Stow BLTouch" -#define MSG_HOME _UxGT("歸位") //"Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST -#define MSG_FIRST _UxGT("先") //"first" +#define MSG_HOME_FIRST _UxGT("歸位 %s%s%s 先") //"Home ... first" #define MSG_ZPROBE_ZOFFSET _UxGT("Z偏移") //"Z Offset" #define MSG_BABYSTEP_X _UxGT("微量調整X軸") //"Babystep X" lcd_babystep_x, Babystepping enables the user to control the axis in tiny amounts #define MSG_BABYSTEP_Y _UxGT("微量調整Y軸") //"Babystep Y" @@ -288,7 +286,7 @@ #define MSG_ERR_MINTEMP _UxGT("錯誤:最低溫度") //"Err: MINTEMP" #define MSG_ERR_MAXTEMP_BED _UxGT("錯誤:最高熱床溫度") //"Err: MAXTEMP BED" #define MSG_ERR_MINTEMP_BED _UxGT("錯誤:最低熱床溫度") //"Err: MINTEMP BED" -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_ERR_Z_HOMING _UxGT("歸位 XY 先") //"Home XY First" #define MSG_HALTED _UxGT("印表機停機") //"PRINTER HALTED" #define MSG_PLEASE_RESET _UxGT("請重置") //"Please reset" #define MSG_SHORT_DAY _UxGT("天") //"d" // One character only diff --git a/Marlin/src/lcd/lcdprint.h b/Marlin/src/lcd/lcdprint.h index 9e9d6418d5..f35bc81691 100644 --- a/Marlin/src/lcd/lcdprint.h +++ b/Marlin/src/lcd/lcdprint.h @@ -22,7 +22,7 @@ #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u) -int lcd_glyph_height(void); +int lcd_glyph_height(); int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length); diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 5f6db8196d..012b3b5847 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -143,6 +143,9 @@ void MenuItem_gcode::action(PGM_P const pgcode) { queue.inject_P(pgcode); } * MenuItem_int3::action_edit(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) */ void MenuItemBase::edit(strfunc_t strfunc, loadfunc_t loadfunc) { + #if ENABLED(TOUCH_BUTTONS) + ui.repeat_delay = BUTTON_DELAY_EDIT; + #endif if (int16_t(ui.encoderPosition) < 0) ui.encoderPosition = 0; if (int16_t(ui.encoderPosition) > maxEditValue) ui.encoderPosition = maxEditValue; if (ui.should_draw()) @@ -212,6 +215,10 @@ bool printer_busy() { void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, const uint8_t top/*=0*/, const uint8_t items/*=0*/) { if (currentScreen != screen) { + #if ENABLED(TOUCH_BUTTONS) + repeat_delay = BUTTON_DELAY_MENU; + #endif + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) // Shadow for editing the fade height lcd_z_fade_height = planner.z_fade_height; @@ -395,7 +402,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) { ui.encoderPosition = 0; const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment, - new_probe_offset = zprobe_zoffset + diff, + new_probe_offset = probe_offset[Z_AXIS] + diff, new_offs = #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) do_probe ? new_probe_offset : hotend_offset[Z_AXIS][active_extruder] - diff @@ -407,7 +414,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) { babystep.add_steps(Z_AXIS, babystep_increment); - if (do_probe) zprobe_zoffset = new_offs; + if (do_probe) probe_offset[Z_AXIS] = new_offs; #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) else hotend_offset[Z_AXIS][active_extruder] = new_offs; #endif @@ -421,10 +428,10 @@ void scroll_screen(const uint8_t limit, const bool is_menu) { draw_edit_screen(PSTR(MSG_Z_OFFSET), ftostr43sign(hotend_offset[Z_AXIS][active_extruder])); else #endif - draw_edit_screen(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_zoffset)); + draw_edit_screen(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(probe_offset[Z_AXIS])); #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) - if (do_probe) _lcd_zoffset_overlay_gfx(zprobe_zoffset); + if (do_probe) _lcd_zoffset_overlay_gfx(probe_offset[Z_AXIS]); #endif } } diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index da1b9a7a73..0b638bc47a 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -30,7 +30,9 @@ extern int8_t encoderLine, encoderTopLine, screen_items; extern bool screen_changed; -constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP); +#if HOTENDS + constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP); +#endif void scroll_screen(const uint8_t limit, const bool is_menu); bool printer_busy(); @@ -57,7 +59,7 @@ DECLARE_MENU_EDIT_TYPE(uint16_t, uint16_5, ui16tostr5, 0.01 ); // 123 DECLARE_MENU_EDIT_TYPE(float, float3, ftostr3, 1 ); // 123 right-justified DECLARE_MENU_EDIT_TYPE(float, float52, ftostr42_52, 100 ); // _2.34, 12.34, -2.34 or 123.45, -23.45 DECLARE_MENU_EDIT_TYPE(float, float43, ftostr43sign, 1000 ); // 1.234 -DECLARE_MENU_EDIT_TYPE(float, float5, ftostr5rj, 0.01f ); // 12345 right-justified +DECLARE_MENU_EDIT_TYPE(float, float5, ftostr5rj, 1 ); // 12345 right-justified DECLARE_MENU_EDIT_TYPE(float, float5_25, ftostr5rj, 0.04f ); // 12345 right-justified (25 increment) DECLARE_MENU_EDIT_TYPE(float, float51, ftostr51rj, 10 ); // 1234.5 right-justified DECLARE_MENU_EDIT_TYPE(float, float51sign, ftostr51sign, 10 ); // +1234.5 @@ -76,9 +78,13 @@ inline void do_select_screen_yn(selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P do_select_screen(PSTR(MSG_YES), PSTR(MSG_NO), yesFunc, noFunc, pref, string, suff); } +#define SS_LEFT 0x00 +#define SS_CENTER 0x01 +#define SS_INVERT 0x02 + void draw_edit_screen(PGM_P const pstr, const char* const value=nullptr); void draw_menu_item(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char); -void draw_menu_item_static(const uint8_t row, PGM_P const pstr, const bool center=true, const bool invert=false, const char *valstr=nullptr); +void draw_menu_item_static(const uint8_t row, PGM_P const pstr, const uint8_t style=SS_CENTER, const char * const valstr=nullptr); void _draw_menu_item_edit(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm); FORCE_INLINE void draw_menu_item_back(const bool sel, const uint8_t row, PGM_P const pstr) { draw_menu_item(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]); } FORCE_INLINE void draw_menu_item_edit(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data) { _draw_menu_item_edit(sel, row, pstr, data, false); } @@ -304,30 +310,30 @@ class MenuItem_bool { * MenuItem_int3::action_edit(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) * */ -#define _MENU_ITEM_VARIANT_P(TYPE, VARIANT, USE_MULTIPLIER, PLABEL, ...) do { \ +#define _MENU_ITEM_VARIANT_P(TYPE, VARIANT, USE_MULTIPLIER, PLABEL, V...) do { \ _skipStatic = false; \ if (_menuLineNr == _thisItemNr) { \ if (encoderLine == _thisItemNr && ui.use_click()) { \ _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER); \ - MenuItem_##TYPE ::action ## VARIANT(__VA_ARGS__); \ + MenuItem_##TYPE ::action ## VARIANT(V); \ if (screen_changed) return; \ } \ if (ui.should_draw()) \ - draw_menu_item ## VARIANT ## _ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ## __VA_ARGS__); \ + draw_menu_item ## VARIANT ## _ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ##V); \ } \ ++_thisItemNr; \ }while(0) // Used to print static text with no visible cursor. // Parameters: label [, bool center [, bool invert [, char *value] ] ] -#define STATIC_ITEM_P(PLABEL, ...) do{ \ +#define STATIC_ITEM_P(PLABEL, V...) do{ \ if (_menuLineNr == _thisItemNr) { \ if (_skipStatic && encoderLine <= _thisItemNr) { \ ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ ++encoderLine; \ } \ if (ui.should_draw()) \ - draw_menu_item_static(_lcdLineNr, PLABEL, ## __VA_ARGS__); \ + draw_menu_item_static(_lcdLineNr, PLABEL, ##V); \ } \ ++_thisItemNr; \ } while(0) @@ -338,16 +344,16 @@ class MenuItem_bool { #define MENU_ITEM_ADDON_END() } }while(0) -#define STATIC_ITEM(LABEL, ...) STATIC_ITEM_P(PSTR(LABEL), ## __VA_ARGS__) +#define STATIC_ITEM(LABEL, V...) STATIC_ITEM_P(PSTR(LABEL), ##V) #define MENU_BACK(LABEL) MENU_ITEM(back, LABEL) #define MENU_ITEM_DUMMY() do { _thisItemNr++; }while(0) -#define MENU_ITEM_P(TYPE, PLABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, , false, PLABEL, ## __VA_ARGS__) -#define MENU_ITEM(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, , false, PSTR(LABEL), ## __VA_ARGS__) -#define MENU_ITEM_EDIT(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, _edit, false, PSTR(LABEL), PSTR(LABEL), ## __VA_ARGS__) -#define MENU_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, _edit, false, PSTR(LABEL), PSTR(LABEL), ## __VA_ARGS__) -#define MENU_MULTIPLIER_ITEM_EDIT(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, _edit, true, PSTR(LABEL), PSTR(LABEL), ## __VA_ARGS__) -#define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, _edit, true, PSTR(LABEL), PSTR(LABEL), ## __VA_ARGS__) +#define MENU_ITEM_P(TYPE, PLABEL, V...) _MENU_ITEM_VARIANT_P(TYPE, , false, PLABEL, ##V) +#define MENU_ITEM(TYPE, LABEL, V...) _MENU_ITEM_VARIANT_P(TYPE, , false, PSTR(LABEL), ##V) +#define MENU_ITEM_EDIT(TYPE, LABEL, V...) _MENU_ITEM_VARIANT_P(TYPE, _edit, false, PSTR(LABEL), PSTR(LABEL), ##V) +#define MENU_ITEM_EDIT_CALLBACK(TYPE, LABEL, V...) _MENU_ITEM_VARIANT_P(TYPE, _edit, false, PSTR(LABEL), PSTR(LABEL), ##V) +#define MENU_MULTIPLIER_ITEM_EDIT(TYPE, LABEL, V...) _MENU_ITEM_VARIANT_P(TYPE, _edit, true, PSTR(LABEL), PSTR(LABEL), ##V) +#define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(TYPE, LABEL, V...) _MENU_ITEM_VARIANT_P(TYPE, _edit, true, PSTR(LABEL), PSTR(LABEL), ##V) //////////////////////////////////////////// /////////////// Menu Screens /////////////// diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 0d8a562d9a..9e27469202 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -43,7 +43,7 @@ #include "../../module/temperature.h" #endif -#ifdef FILAMENT_RUNOUT_DISTANCE_MM +#if ENABLED(FILAMENT_RUNOUT_SENSOR) && FILAMENT_RUNOUT_DISTANCE_MM #include "../../feature/runout.h" float lcd_runout_distance_mm; #endif @@ -178,7 +178,7 @@ void menu_backlash(); #if EXTRUDERS == 1 MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &fc_settings[0].unload_length, 0, extrude_maxlength); - #else // EXTRUDERS > 1 + #elif EXTRUDERS > 1 #define EDIT_FIL_UNLOAD(N) MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E##N, &fc_settings[N-1].unload_length, 0, extrude_maxlength) MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength); EDIT_FIL_UNLOAD(1); @@ -199,7 +199,7 @@ void menu_backlash(); #if EXTRUDERS == 1 MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &fc_settings[0].load_length, 0, extrude_maxlength); - #else // EXTRUDERS > 1 + #elif EXTRUDERS > 1 #define EDIT_FIL_LOAD(N) MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E##N, &fc_settings[N-1].load_length, 0, extrude_maxlength) MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &fc_settings[active_extruder].load_length, 0, extrude_maxlength); EDIT_FIL_LOAD(1); @@ -219,7 +219,7 @@ void menu_backlash(); #endif // EXTRUDERS > 1 #endif - #ifdef FILAMENT_RUNOUT_DISTANCE_MM + #if ENABLED(FILAMENT_RUNOUT_SENSOR) && FILAMENT_RUNOUT_DISTANCE_MM MENU_ITEM_EDIT_CALLBACK(float3, MSG_RUNOUT_DISTANCE_MM, &lcd_runout_distance_mm, 1, 30, []{ runout.set_runout_distance(lcd_runout_distance_mm); }); @@ -620,7 +620,7 @@ void menu_backlash(); #endif // !SLIM_LCD_MENUS void menu_advanced_settings() { - #ifdef FILAMENT_RUNOUT_DISTANCE_MM + #if ENABLED(FILAMENT_RUNOUT_SENSOR) && FILAMENT_RUNOUT_DISTANCE_MM lcd_runout_distance_mm = runout.runout_distance(); #endif START_MENU(); diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index a559a68527..07629b7179 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -62,10 +62,10 @@ static inline void _lcd_goto_next_corner() { current_position[Y_AXIS] = Y_MIN_BED + LEVEL_CORNERS_INSET; break; case 1: - current_position[X_AXIS] = X_MAX_BED - LEVEL_CORNERS_INSET; + current_position[X_AXIS] = X_MAX_BED - (LEVEL_CORNERS_INSET); break; case 2: - current_position[Y_AXIS] = Y_MAX_BED - LEVEL_CORNERS_INSET; + current_position[Y_AXIS] = Y_MAX_BED - (LEVEL_CORNERS_INSET); break; case 3: current_position[X_AXIS] = X_MIN_BED + LEVEL_CORNERS_INSET; diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index 3f1f746af1..bb4eaa8456 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -279,7 +279,7 @@ void menu_bed_leveling() { #if ENABLED(BABYSTEP_ZPROBE_OFFSET) MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); #elif HAS_BED_PROBE - MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); + MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &probe_offset[Z_AXIS], Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); #endif #if ENABLED(LEVEL_BED_CORNERS) diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 0bc3963f29..8708c7d96f 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -75,7 +75,7 @@ static void lcd_factory_settings() { bar_percent += (int8_t)ui.encoderPosition; LIMIT(bar_percent, 0, 100); ui.encoderPosition = 0; - draw_menu_item_static(0, PSTR(MSG_PROGRESS_BAR_TEST), true, true); + draw_menu_item_static(0, PSTR(MSG_PROGRESS_BAR_TEST), SS_CENTER|SS_INVERT); lcd_put_int((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2, bar_percent); lcd_put_wchar('%'); lcd_moveto(0, LCD_HEIGHT - 1); ui.draw_progress_bar(bar_percent); } @@ -347,7 +347,7 @@ void menu_configuration() { #if ENABLED(BABYSTEP_ZPROBE_OFFSET) MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); #elif HAS_BED_PROBE - MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); + MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &probe_offset[Z_AXIS], Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); #endif const bool busy = printer_busy(); diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp index d76a6aa77e..474e326667 100644 --- a/Marlin/src/lcd/menu/menu_filament.cpp +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -79,7 +79,7 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) { _change_filament_temp_mode = mode; _change_filament_temp_extruder = extruder; START_MENU(); - if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), true, true); + if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), SS_CENTER|SS_INVERT); MENU_BACK(MSG_BACK); MENU_ITEM(function, MSG_PREHEAT_1, _lcd_change_filament_temp_1_func); MENU_ITEM(function, MSG_PREHEAT_2, _lcd_change_filament_temp_2_func); @@ -328,7 +328,7 @@ static PGM_P pause_header() { #define HOTEND_STATUS_ITEM() do { \ if (_menuLineNr == _thisItemNr) { \ if (ui.should_draw()) { \ - draw_menu_item_static(_lcdLineNr, PSTR(MSG_FILAMENT_CHANGE_NOZZLE), false, true); \ + draw_menu_item_static(_lcdLineNr, PSTR(MSG_FILAMENT_CHANGE_NOZZLE), SS_INVERT); \ ui.draw_hotend_status(_lcdLineNr, hotend_status_extruder); \ } \ if (_skipStatic && encoderLine <= _thisItemNr) { \ @@ -351,7 +351,7 @@ void lcd_pause_extrude_more() { void menu_pause_option() { START_MENU(); #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER, true, false); + STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER); #endif MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_PURGE, lcd_pause_extrude_more); #if HAS_FILAMENT_SENSOR @@ -369,7 +369,7 @@ void menu_pause_option() { void _lcd_pause_message(PGM_P const msg1, PGM_P const msg2=nullptr, PGM_P const msg3=nullptr) { START_SCREEN(); - STATIC_ITEM_P(pause_header(), true, true); + STATIC_ITEM_P(pause_header(), SS_CENTER|SS_INVERT); STATIC_ITEM_P(msg1); if (msg2) STATIC_ITEM_P(msg2); if (msg3 && (LCD_HEIGHT) >= 5) STATIC_ITEM_P(msg3); diff --git a/Marlin/src/lcd/menu/menu_info.cpp b/Marlin/src/lcd/menu/menu_info.cpp index 2373774c29..7732bd7eb6 100644 --- a/Marlin/src/lcd/menu/menu_info.cpp +++ b/Marlin/src/lcd/menu/menu_info.cpp @@ -34,6 +34,9 @@ #include "game/game.h" #endif +#define STATIC_PAIR(MSG, VALUE, STYL) do{ strcpy_P(buffer, PSTR(": ")); strcpy(buffer + 2, VALUE); STATIC_ITEM(MSG, STYL, buffer); }while(0) +#define STATIC_PAIR_P(MSG, PVALUE, STYL) do{ strcpy_P(buffer, PSTR(": ")); strcpy_P(buffer + 2, PSTR(PVALUE)); STATIC_ITEM(MSG, STYL, buffer); }while(0) + #if ENABLED(PRINTCOUNTER) #include "../../module/printcounter.h" @@ -48,46 +51,37 @@ #endif ); - char buffer[21]; + char buffer[21]; // for STATIC_PAIR_P + printStatistics stats = print_job_timer.getStats(); - START_SCREEN(); // 12345678901234567890 - STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, i16tostr3left(stats.totalPrints)); // Print Count: 999 - STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS": ", false, false, i16tostr3left(stats.finishedPrints)); // Completed : 666 + START_SCREEN(); // 12345678901234567890 + STATIC_PAIR(MSG_INFO_PRINT_COUNT, i16tostr3left(stats.totalPrints), SS_LEFT); // Print Count: 999 + STATIC_PAIR(MSG_INFO_COMPLETED_PRINTS, i16tostr3left(stats.finishedPrints), SS_LEFT); // Completed : 666 - duration_t elapsed = stats.printTime; - elapsed.toString(buffer); + STATIC_PAIR_P(MSG_INFO_PRINT_TIME, "", SS_LEFT); // Total print Time: + STATIC_ITEM("> ", SS_LEFT, duration_t(stats.printTime).toString(buffer)); // > 99y 364d 23h 59m 59s - STATIC_ITEM(MSG_INFO_PRINT_TIME ":", false, false); // Total print Time: - STATIC_ITEM("> ", false, false, buffer); // > 99y 364d 23h 59m 59s - - elapsed = stats.longestPrint; - elapsed.toString(buffer); - - STATIC_ITEM(MSG_INFO_PRINT_LONGEST ":", false, false); // Longest job time: - STATIC_ITEM("> ", false, false, buffer); // > 99y 364d 23h 59m 59s + STATIC_PAIR_P(MSG_INFO_PRINT_LONGEST, "", SS_LEFT); // Longest job time: + STATIC_ITEM("> ", SS_LEFT, duration_t(stats.longestPrint).toString(buffer)); // > 99y 364d 23h 59m 59s + STATIC_PAIR_P(MSG_INFO_PRINT_FILAMENT, "", SS_LEFT); // Extruded total: sprintf_P(buffer, PSTR("%ld.%im"), long(stats.filamentUsed / 1000), int16_t(stats.filamentUsed / 100) % 10); - STATIC_ITEM(MSG_INFO_PRINT_FILAMENT ":", false, false); // Extruded total: - STATIC_ITEM("> ", false, false, buffer); // > 125m + STATIC_ITEM("> ", SS_LEFT, buffer); // > 125m #if SERVICE_INTERVAL_1 > 0 - elapsed = stats.nextService1; - elapsed.toString(buffer); - STATIC_ITEM(SERVICE_NAME_1 MSG_SERVICE_IN, false, false); // Service X in: - STATIC_ITEM("> ", false, false, buffer); // > 7d 12h 11m 10s + STATIC_ITEM(SERVICE_NAME_1 MSG_SERVICE_IN, SS_LEFT); // Service X in: + STATIC_ITEM("> ", SS_LEFT, duration_t(stats.nextService1).toString(buffer)); // > 7d 12h 11m 10s #endif + #if SERVICE_INTERVAL_2 > 0 - elapsed = stats.nextService2; - elapsed.toString(buffer); - STATIC_ITEM(SERVICE_NAME_2 MSG_SERVICE_IN, false, false); - STATIC_ITEM("> ", false, false, buffer); + STATIC_ITEM(SERVICE_NAME_2 MSG_SERVICE_IN, SS_LEFT); + STATIC_ITEM("> ", SS_LEFT, duration_t(stats.nextService2).toString(buffer)); #endif + #if SERVICE_INTERVAL_3 > 0 - elapsed = stats.nextService3; - elapsed.toString(buffer); - STATIC_ITEM(SERVICE_NAME_3 MSG_SERVICE_IN, false, false); - STATIC_ITEM("> ", false, false, buffer); + STATIC_ITEM(SERVICE_NAME_3 MSG_SERVICE_IN, SS_LEFT); + STATIC_ITEM("> ", SS_LEFT, duration_t(stats.nextService3).toString(buffer)); #endif END_SCREEN(); @@ -104,65 +98,70 @@ void menu_info_thermistors() { true #endif ); + + char buffer[21]; // for STATIC_PAIR_P + START_SCREEN(); - #define THERMISTOR_ID TEMP_SENSOR_0 - #include "../thermistornames.h" - STATIC_ITEM("T0: " THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_0_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_0_MAXTEMP), false); + #if EXTRUDERS + #define THERMISTOR_ID TEMP_SENSOR_0 + #include "../thermistornames.h" + STATIC_ITEM("T0: " THERMISTOR_NAME, SS_INVERT); + STATIC_PAIR_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_0_MINTEMP), SS_LEFT); + STATIC_PAIR_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_0_MAXTEMP), SS_LEFT); + #endif #if TEMP_SENSOR_1 != 0 #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_1 #include "../thermistornames.h" - STATIC_ITEM("T1: " THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_1_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_1_MAXTEMP), false); + STATIC_ITEM("T1: " THERMISTOR_NAME, SS_INVERT); + STATIC_PAIR_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_1_MINTEMP), SS_LEFT); + STATIC_PAIR_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_1_MAXTEMP), SS_LEFT); #endif #if TEMP_SENSOR_2 != 0 #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_2 #include "../thermistornames.h" - STATIC_ITEM("T2: " THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_2_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_2_MAXTEMP), false); + STATIC_ITEM("T2: " THERMISTOR_NAME, SS_INVERT); + STATIC_PAIR_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_2_MINTEMP), SS_LEFT); + STATIC_PAIR_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_2_MAXTEMP), SS_LEFT); #endif #if TEMP_SENSOR_3 != 0 #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_3 #include "../thermistornames.h" - STATIC_ITEM("T3: " THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_3_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_3_MAXTEMP), false); + STATIC_ITEM("T3: " THERMISTOR_NAME, SS_INVERT); + STATIC_PAIR_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_3_MINTEMP), SS_LEFT); + STATIC_PAIR_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_3_MAXTEMP), SS_LEFT); #endif #if TEMP_SENSOR_4 != 0 #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_4 #include "../thermistornames.h" - STATIC_ITEM("T4: " THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_4_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_4_MAXTEMP), false); + STATIC_ITEM("T4: " THERMISTOR_NAME, SS_INVERT); + STATIC_PAIR_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_4_MINTEMP), SS_LEFT); + STATIC_PAIR_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_4_MAXTEMP), SS_LEFT); #endif #if TEMP_SENSOR_5 != 0 #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_5 #include "../thermistornames.h" - STATIC_ITEM("T5: " THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_5_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_5_MAXTEMP), false); + STATIC_ITEM("T5: " THERMISTOR_NAME, SS_INVERT); + STATIC_PAIR_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_5_MINTEMP), SS_LEFT); + STATIC_PAIR_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_5_MAXTEMP), SS_LEFT); #endif #if HAS_HEATED_BED #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_BED #include "../thermistornames.h" - STATIC_ITEM("TBed:" THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(BED_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(BED_MAXTEMP), false); + STATIC_ITEM("TBed:" THERMISTOR_NAME, SS_INVERT); + STATIC_PAIR_P(MSG_INFO_MIN_TEMP, STRINGIFY(BED_MINTEMP), SS_LEFT); + STATIC_PAIR_P(MSG_INFO_MAX_TEMP, STRINGIFY(BED_MAXTEMP), SS_LEFT); #endif END_SCREEN(); } @@ -176,45 +175,25 @@ void menu_info_board() { true #endif ); + + char buffer[21]; // for STATIC_PAIR_P + START_SCREEN(); - STATIC_ITEM(BOARD_INFO_NAME, true, true); // MyPrinterController - STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 250000 - STATIC_ITEM(MSG_INFO_PROTOCOL ": " PROTOCOL_VERSION, true); // Protocol: 1.0 - STATIC_ITEM(MSG_INFO_PSU ": " PSU_NAME, true); + STATIC_ITEM(BOARD_INFO_NAME, SS_CENTER|SS_INVERT); // MyPrinterController + #ifdef BOARD_WEBSITE_URL + STATIC_ITEM(BOARD_WEBSITE_URL, SS_LEFT); // www.my3dprinter.com + #endif + STATIC_PAIR_P(MSG_INFO_BAUDRATE, STRINGIFY(BAUDRATE), SS_CENTER); // Baud: 250000 + STATIC_PAIR_P(MSG_INFO_PROTOCOL, PROTOCOL_VERSION, SS_CENTER); // Protocol: 1.0 + STATIC_PAIR_P(MSG_INFO_PSU, PSU_NAME, SS_CENTER); END_SCREEN(); } // // About Printer > Printer Info // -#if DISABLED(LCD_PRINTER_INFO_IS_BOOTSCREEN) - void menu_info_printer() { - if (ui.use_click()) return ui.goto_previous_screen( - #if ENABLED(TURBO_BACK_MENU_ITEM) - true - #endif - ); - START_SCREEN(); - STATIC_ITEM(MSG_MARLIN, true, true); // Marlin - STATIC_ITEM(SHORT_BUILD_VERSION, true); // x.x.x-Branch - STATIC_ITEM(STRING_DISTRIBUTION_DATE, true); // YYYY-MM-DD HH:MM - STATIC_ITEM(MACHINE_NAME, true); // My3DPrinter - STATIC_ITEM(WEBSITE_URL, true); // www.my3dprinter.com - STATIC_ITEM(MSG_INFO_EXTRUDERS ": " STRINGIFY(EXTRUDERS), true); // Extruders: 2 - #if ENABLED(AUTO_BED_LEVELING_3POINT) - STATIC_ITEM(MSG_3POINT_LEVELING, true); // 3-Point Leveling - #elif ENABLED(AUTO_BED_LEVELING_LINEAR) - STATIC_ITEM(MSG_LINEAR_LEVELING, true); // Linear Leveling - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - STATIC_ITEM(MSG_BILINEAR_LEVELING, true); // Bi-linear Leveling - #elif ENABLED(AUTO_BED_LEVELING_UBL) - STATIC_ITEM(MSG_UBL_LEVELING, true); // Unified Bed Leveling - #elif ENABLED(MESH_BED_LEVELING) - STATIC_ITEM(MSG_MESH_LEVELING, true); // Mesh Leveling - #endif - END_SCREEN(); - } -#else +#if ENABLED(LCD_PRINTER_INFO_IS_BOOTSCREEN) + void menu_show_marlin_bootscreen() { if (ui.use_click()) { ui.goto_previous_screen_no_defer(); } ui.draw_marlin_bootscreen(); @@ -226,7 +205,37 @@ void menu_info_board() { ui.draw_custom_bootscreen(); } #endif -#endif // LCD_PRINTER_INFO_IS_BOOTSCREEN + +#else + + void menu_info_printer() { + if (ui.use_click()) return ui.goto_previous_screen( + #if ENABLED(TURBO_BACK_MENU_ITEM) + true + #endif + ); + START_SCREEN(); + STATIC_ITEM(MSG_MARLIN, SS_CENTER|SS_INVERT); // Marlin + STATIC_ITEM(SHORT_BUILD_VERSION); // x.x.x-Branch + STATIC_ITEM(STRING_DISTRIBUTION_DATE); // YYYY-MM-DD HH:MM + STATIC_ITEM(MACHINE_NAME); // My3DPrinter + STATIC_ITEM(WEBSITE_URL); // www.my3dprinter.com + STATIC_ITEM(MSG_INFO_EXTRUDERS ": " STRINGIFY(EXTRUDERS)); // Extruders: 2 + #if ENABLED(AUTO_BED_LEVELING_3POINT) + STATIC_ITEM(MSG_3POINT_LEVELING); // 3-Point Leveling + #elif ENABLED(AUTO_BED_LEVELING_LINEAR) + STATIC_ITEM(MSG_LINEAR_LEVELING); // Linear Leveling + #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) + STATIC_ITEM(MSG_BILINEAR_LEVELING); // Bi-linear Leveling + #elif ENABLED(AUTO_BED_LEVELING_UBL) + STATIC_ITEM(MSG_UBL_LEVELING); // Unified Bed Leveling + #elif ENABLED(MESH_BED_LEVELING) + STATIC_ITEM(MSG_MESH_LEVELING); // Mesh Leveling + #endif + END_SCREEN(); + } + +#endif // // "About Printer" submenu @@ -243,13 +252,15 @@ void menu_info() { #endif )); #else - MENU_ITEM(submenu, MSG_INFO_PRINTER_MENU, menu_info_printer); // Printer Info > - MENU_ITEM(submenu, MSG_INFO_BOARD_MENU, menu_info_board); // Board Info > - MENU_ITEM(submenu, MSG_INFO_THERMISTOR_MENU, menu_info_thermistors); // Thermistors > + MENU_ITEM(submenu, MSG_INFO_PRINTER_MENU, menu_info_printer); // Printer Info > + MENU_ITEM(submenu, MSG_INFO_BOARD_MENU, menu_info_board); // Board Info > + #if EXTRUDERS + MENU_ITEM(submenu, MSG_INFO_THERMISTOR_MENU, menu_info_thermistors); // Thermistors > + #endif #endif #if ENABLED(PRINTCOUNTER) - MENU_ITEM(submenu, MSG_INFO_STATS_MENU, menu_info_stats); // Printer Stats > + MENU_ITEM(submenu, MSG_INFO_STATS_MENU, menu_info_stats); // Printer Stats > #endif #if HAS_GAMES diff --git a/Marlin/src/lcd/menu/menu_led.cpp b/Marlin/src/lcd/menu/menu_led.cpp index a84a8c01f5..5ccac8a0ee 100644 --- a/Marlin/src/lcd/menu/menu_led.cpp +++ b/Marlin/src/lcd/menu/menu_led.cpp @@ -36,7 +36,7 @@ void menu_led_presets() { START_MENU(); #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_LED_PRESETS, true, true); + STATIC_ITEM(MSG_LED_PRESETS, SS_CENTER|SS_INVERT); #endif MENU_BACK(MSG_LED_CONTROL); MENU_ITEM(function, MSG_SET_LEDS_WHITE, leds.set_white); diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index 1ccbfd38bb..df43a09c72 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -101,7 +101,7 @@ void menu_main() { const bool busy = IS_SD_PRINTING() || print_job_timer.isRunning() #if ENABLED(SDSUPPORT) - , card_detected = card.isDetected() + , card_detected = card.isMounted() , card_open = card_detected && card.isFileOpen() #endif ; diff --git a/Marlin/src/lcd/menu/menu_media.cpp b/Marlin/src/lcd/menu/menu_media.cpp index 037f98531b..b11963b173 100644 --- a/Marlin/src/lcd/menu/menu_media.cpp +++ b/Marlin/src/lcd/menu/menu_media.cpp @@ -34,7 +34,7 @@ #if !PIN_EXISTS(SD_DETECT) void lcd_sd_refresh() { encoderTopLine = 0; - card.initsd(); + card.mount(); } #endif @@ -82,10 +82,14 @@ inline void sdcard_start_selected_file() { #if ENABLED(SD_MENU_CONFIRM_START) void menu_sd_confirm() { + char * const longest = card.longest_filename(); + char buffer[strlen(longest) + 2]; + buffer[0] = ' '; + strcpy(buffer + 1, longest); do_select_screen( PSTR(MSG_BUTTON_PRINT), PSTR(MSG_BUTTON_CANCEL), sdcard_start_selected_file, ui.goto_previous_screen, - PSTR(MSG_START_PRINT " "), card.longest_filename(), PSTR("?") + PSTR(MSG_START_PRINT), buffer, PSTR("?") ); } @@ -125,17 +129,21 @@ class MenuItem_sdfolder { void menu_media() { ui.encoder_direction_menus(); - const uint16_t fileCnt = card.get_num_Files(); + #if HAS_GRAPHICAL_LCD + static uint16_t fileCnt; + if (ui.first_page) fileCnt = card.get_num_Files(); + #else + const uint16_t fileCnt = card.get_num_Files(); + #endif START_MENU(); MENU_BACK(MSG_MAIN); - card.getWorkDirName(); - if (card.filename[0] == '/') { + if (card.flag.workDirIsRoot) { #if !PIN_EXISTS(SD_DETECT) MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh); #endif } - else if (card.isDetected()) + else if (card.isMounted()) MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir); if (ui.should_draw()) for (uint16_t i = 0; i < fileCnt; i++) { diff --git a/Marlin/src/lcd/menu/menu_mmu2.cpp b/Marlin/src/lcd/menu/menu_mmu2.cpp index a7dc4e8391..9a0908961e 100644 --- a/Marlin/src/lcd/menu/menu_mmu2.cpp +++ b/Marlin/src/lcd/menu/menu_mmu2.cpp @@ -164,7 +164,7 @@ inline void action_mmu2_choose4() { action_mmu2_choose(4); } void menu_mmu2_choose_filament() { START_MENU(); #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, true, true); + STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, SS_CENTER|SS_INVERT); #endif MENU_ITEM(function, MSG_MMU2_FILAMENT0, action_mmu2_choose0); MENU_ITEM(function, MSG_MMU2_FILAMENT1, action_mmu2_choose1); @@ -187,7 +187,7 @@ void menu_mmu2_pause() { currentTool = mmu2.get_current_tool(); START_MENU(); #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_MMU2_FILAMENT_CHANGE_HEADER, true, true); + STATIC_ITEM(MSG_MMU2_FILAMENT_CHANGE_HEADER, SS_CENTER|SS_INVERT); #endif MENU_ITEM(function, MSG_MMU2_RESUME, action_mmu2_M600_resume); MENU_ITEM(function, MSG_MMU2_UNLOAD_FILAMENT, action_mmu2_M600_unload_filament); diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 5885001372..2a75c2693d 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -158,80 +158,85 @@ static void _lcd_move_xyz(PGM_P name, AxisEnum axis) { void lcd_move_x() { _lcd_move_xyz(PSTR(MSG_MOVE_X), X_AXIS); } void lcd_move_y() { _lcd_move_xyz(PSTR(MSG_MOVE_Y), Y_AXIS); } void lcd_move_z() { _lcd_move_xyz(PSTR(MSG_MOVE_Z), Z_AXIS); } -static void _lcd_move_e( - #if E_MANUAL > 1 - const int8_t eindex=-1 - #endif -) { - if (ui.use_click()) return ui.goto_previous_screen_no_defer(); - if (ui.encoderPosition) { - if (!ui.processing_manual_move) { - const float diff = float(int16_t(ui.encoderPosition)) * move_menu_scale; - #if IS_KINEMATIC - manual_move_offset += diff; - #else - current_position[E_AXIS] += diff; - #endif - manual_move_to_current(E_AXIS - #if E_MANUAL > 1 - , eindex + +#if E_MANUAL + + static void _lcd_move_e( + #if E_MANUAL > 1 + const int8_t eindex=-1 + #endif + ) { + if (ui.use_click()) return ui.goto_previous_screen_no_defer(); + if (ui.encoderPosition) { + if (!ui.processing_manual_move) { + const float diff = float(int16_t(ui.encoderPosition)) * move_menu_scale; + #if IS_KINEMATIC + manual_move_offset += diff; + #else + current_position[E_AXIS] += diff; #endif - ); - ui.refresh(LCDVIEW_REDRAW_NOW); - } - ui.encoderPosition = 0; - } - if (ui.should_draw()) { - PGM_P pos_label; - #if E_MANUAL == 1 - pos_label = PSTR(MSG_MOVE_E); - #else - switch (eindex) { - default: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break; - case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break; - #if E_MANUAL > 2 - case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break; - #if E_MANUAL > 3 - case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break; - #if E_MANUAL > 4 - case 4: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E5); break; - #if E_MANUAL > 5 - case 5: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E6); break; - #endif // E_MANUAL > 5 - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 + manual_move_to_current(E_AXIS + #if E_MANUAL > 1 + , eindex + #endif + ); + ui.refresh(LCDVIEW_REDRAW_NOW); } - #endif // E_MANUAL > 1 + ui.encoderPosition = 0; + } + if (ui.should_draw()) { + PGM_P pos_label; + #if E_MANUAL == 1 + pos_label = PSTR(MSG_MOVE_E); + #else + switch (eindex) { + default: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break; + case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break; + #if E_MANUAL > 2 + case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break; + #if E_MANUAL > 3 + case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break; + #if E_MANUAL > 4 + case 4: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E5); break; + #if E_MANUAL > 5 + case 5: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E6); break; + #endif // E_MANUAL > 5 + #endif // E_MANUAL > 4 + #endif // E_MANUAL > 3 + #endif // E_MANUAL > 2 + } + #endif // E_MANUAL > 1 - draw_edit_screen(pos_label, ftostr41sign(current_position[E_AXIS] - #if IS_KINEMATIC - + manual_move_offset - #endif - #if ENABLED(MANUAL_E_MOVES_RELATIVE) - - manual_move_e_origin - #endif - )); + draw_edit_screen(pos_label, ftostr41sign(current_position[E_AXIS] + #if IS_KINEMATIC + + manual_move_offset + #endif + #if ENABLED(MANUAL_E_MOVES_RELATIVE) + - manual_move_e_origin + #endif + )); + } } -} -inline void lcd_move_e() { _lcd_move_e(); } -#if E_MANUAL > 1 - inline void lcd_move_e0() { _lcd_move_e(0); } - inline void lcd_move_e1() { _lcd_move_e(1); } - #if E_MANUAL > 2 - inline void lcd_move_e2() { _lcd_move_e(2); } - #if E_MANUAL > 3 - inline void lcd_move_e3() { _lcd_move_e(3); } - #if E_MANUAL > 4 - inline void lcd_move_e4() { _lcd_move_e(4); } - #if E_MANUAL > 5 - inline void lcd_move_e5() { _lcd_move_e(5); } - #endif // E_MANUAL > 5 - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 -#endif // E_MANUAL > 1 + inline void lcd_move_e() { _lcd_move_e(); } + #if E_MANUAL > 1 + inline void lcd_move_e0() { _lcd_move_e(0); } + inline void lcd_move_e1() { _lcd_move_e(1); } + #if E_MANUAL > 2 + inline void lcd_move_e2() { _lcd_move_e(2); } + #if E_MANUAL > 3 + inline void lcd_move_e3() { _lcd_move_e(3); } + #if E_MANUAL > 4 + inline void lcd_move_e4() { _lcd_move_e(4); } + #if E_MANUAL > 5 + inline void lcd_move_e5() { _lcd_move_e(5); } + #endif // E_MANUAL > 5 + #endif // E_MANUAL > 4 + #endif // E_MANUAL > 3 + #endif // E_MANUAL > 2 + #endif // E_MANUAL > 1 + +#endif // E_MANUAL // // "Motion" > "Move Xmm" > "Move XYZ" submenu @@ -257,14 +262,14 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int START_MENU(); if (LCD_HEIGHT >= 4) { switch (axis) { - case X_AXIS: STATIC_ITEM(MSG_MOVE_X, true, true); break; - case Y_AXIS: STATIC_ITEM(MSG_MOVE_Y, true, true); break; - case Z_AXIS: STATIC_ITEM(MSG_MOVE_Z, true, true); break; + case X_AXIS: STATIC_ITEM(MSG_MOVE_X, SS_CENTER|SS_INVERT); break; + case Y_AXIS: STATIC_ITEM(MSG_MOVE_Y, SS_CENTER|SS_INVERT); break; + case Z_AXIS: STATIC_ITEM(MSG_MOVE_Z, SS_CENTER|SS_INVERT); break; default: #if ENABLED(MANUAL_E_MOVES_RELATIVE) manual_move_e_origin = current_position[E_AXIS]; #endif - STATIC_ITEM(MSG_MOVE_E, true, true); + STATIC_ITEM(MSG_MOVE_E, SS_CENTER|SS_INVERT); break; } } @@ -295,23 +300,26 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int void lcd_move_get_x_amount() { _menu_move_distance(X_AXIS, lcd_move_x); } void lcd_move_get_y_amount() { _menu_move_distance(Y_AXIS, lcd_move_y); } void lcd_move_get_z_amount() { _menu_move_distance(Z_AXIS, lcd_move_z); } -void lcd_move_get_e_amount() { _menu_move_distance(E_AXIS, lcd_move_e, -1); } -#if E_MANUAL > 1 - void lcd_move_get_e0_amount() { _menu_move_distance(E_AXIS, lcd_move_e0, 0); } - void lcd_move_get_e1_amount() { _menu_move_distance(E_AXIS, lcd_move_e1, 1); } - #if E_MANUAL > 2 - void lcd_move_get_e2_amount() { _menu_move_distance(E_AXIS, lcd_move_e2, 2); } - #if E_MANUAL > 3 - void lcd_move_get_e3_amount() { _menu_move_distance(E_AXIS, lcd_move_e3, 3); } - #if E_MANUAL > 4 - void lcd_move_get_e4_amount() { _menu_move_distance(E_AXIS, lcd_move_e4, 4); } - #if E_MANUAL > 5 - void lcd_move_get_e5_amount() { _menu_move_distance(E_AXIS, lcd_move_e5, 5); } - #endif // E_MANUAL > 5 - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 -#endif // E_MANUAL > 1 + +#if E_MANUAL + void lcd_move_get_e_amount() { _menu_move_distance(E_AXIS, lcd_move_e, -1); } + #if E_MANUAL > 1 + void lcd_move_get_e0_amount() { _menu_move_distance(E_AXIS, lcd_move_e0, 0); } + void lcd_move_get_e1_amount() { _menu_move_distance(E_AXIS, lcd_move_e1, 1); } + #if E_MANUAL > 2 + void lcd_move_get_e2_amount() { _menu_move_distance(E_AXIS, lcd_move_e2, 2); } + #if E_MANUAL > 3 + void lcd_move_get_e3_amount() { _menu_move_distance(E_AXIS, lcd_move_e3, 3); } + #if E_MANUAL > 4 + void lcd_move_get_e4_amount() { _menu_move_distance(E_AXIS, lcd_move_e4, 4); } + #if E_MANUAL > 5 + void lcd_move_get_e5_amount() { _menu_move_distance(E_AXIS, lcd_move_e5, 5); } + #endif // E_MANUAL > 5 + #endif // E_MANUAL > 4 + #endif // E_MANUAL > 3 + #endif // E_MANUAL > 2 + #endif // E_MANUAL > 1 +#endif // E_MANUAL #if ENABLED(DELTA) void lcd_lower_z_to_clip_height() { @@ -396,39 +404,43 @@ void menu_move() { #endif - #if EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE) + #if E_MANUAL + + #if EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE) + + // Only the current... + MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount); + // ...and the non-switching + #if E_MANUAL == 5 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount); + #elif E_MANUAL == 3 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount); + #endif + + #else + + // Independent extruders with one E-stepper per hotend + MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount); + #if E_MANUAL > 1 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_get_e0_amount); + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_get_e1_amount); + #if E_MANUAL > 2 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount); + #if E_MANUAL > 3 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_get_e3_amount); + #if E_MANUAL > 4 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount); + #if E_MANUAL > 5 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E6, lcd_move_get_e5_amount); + #endif // E_MANUAL > 5 + #endif // E_MANUAL > 4 + #endif // E_MANUAL > 3 + #endif // E_MANUAL > 2 + #endif // E_MANUAL > 1 - // Only the current... - MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount); - // ...and the non-switching - #if E_MANUAL == 5 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount); - #elif E_MANUAL == 3 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount); #endif - #else - - // Independent extruders with one E-stepper per hotend - MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount); - #if E_MANUAL > 1 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_get_e0_amount); - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_get_e1_amount); - #if E_MANUAL > 2 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount); - #if E_MANUAL > 3 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_get_e3_amount); - #if E_MANUAL > 4 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount); - #if E_MANUAL > 5 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E6, lcd_move_get_e5_amount); - #endif // E_MANUAL > 5 - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 - #endif // E_MANUAL > 1 - - #endif + #endif // E_MANUAL END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index ad987850fd..24b88e829c 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -48,7 +48,9 @@ uint8_t MarlinUI::preheat_fan_speed[2]; // void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb, const uint8_t fan) { - if (temph > 0) thermalManager.setTargetHotend(_MIN(heater_maxtemp[endnum] - 15, temph), endnum); + #if HOTENDS + if (temph > 0) thermalManager.setTargetHotend(_MIN(heater_maxtemp[endnum] - 15, temph), endnum); + #endif #if HAS_HEATED_BED if (tempb >= 0) thermalManager.setTargetBed(tempb); #else @@ -165,12 +167,16 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb #if HAS_TEMP_HOTEND || HAS_HEATED_BED - void lcd_preheat_m1_e0_only() { _lcd_preheat(0, ui.preheat_hotend_temp[0], -1, ui.preheat_fan_speed[0]); } - void lcd_preheat_m2_e0_only() { _lcd_preheat(0, ui.preheat_hotend_temp[1], -1, ui.preheat_fan_speed[1]); } + #if HOTENDS + void lcd_preheat_m1_e0_only() { _lcd_preheat(0, ui.preheat_hotend_temp[0], -1, ui.preheat_fan_speed[0]); } + void lcd_preheat_m2_e0_only() { _lcd_preheat(0, ui.preheat_hotend_temp[1], -1, ui.preheat_fan_speed[1]); } + #endif #if HAS_HEATED_BED - void lcd_preheat_m1_e0() { _lcd_preheat(0, ui.preheat_hotend_temp[0], ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); } - void lcd_preheat_m2_e0() { _lcd_preheat(0, ui.preheat_hotend_temp[1], ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); } + #if HOTENDS + void lcd_preheat_m1_e0() { _lcd_preheat(0, ui.preheat_hotend_temp[0], ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); } + void lcd_preheat_m2_e0() { _lcd_preheat(0, ui.preheat_hotend_temp[1], ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); } + #endif void lcd_preheat_m1_bedonly() { _lcd_preheat(0, 0, ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); } void lcd_preheat_m2_bedonly() { _lcd_preheat(0, 0, ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); } #endif @@ -313,7 +319,7 @@ void menu_temperature() { // #if HOTENDS == 1 MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - 15, thermalManager.start_watching_E0); - #else // HOTENDS > 1 + #elif HOTENDS > 1 #define EDIT_TARGET(N) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_LCD_N##N, &thermalManager.temp_hotend[N].target, 0, HEATER_##N##_MAXTEMP - 15, thermalManager.start_watching_E##N) EDIT_TARGET(0); EDIT_TARGET(1); diff --git a/Marlin/src/lcd/menu/menu_tmc.cpp b/Marlin/src/lcd/menu/menu_tmc.cpp index 8b905cd095..917b39ebfa 100644 --- a/Marlin/src/lcd/menu/menu_tmc.cpp +++ b/Marlin/src/lcd/menu/menu_tmc.cpp @@ -29,7 +29,7 @@ #if HAS_TRINAMIC && HAS_LCD_MENU #include "menu.h" -#include "../../module/stepper_indirection.h" +#include "../../module/stepper/indirection.h" #include "../../feature/tmc_util.h" #define TMC_EDIT_STORED_I_RMS(ST,MSG) MENU_ITEM_EDIT_CALLBACK(uint16_4, MSG, &stepper##ST.val_mA, 100, 3000, refresh_stepper_current_##ST) @@ -217,6 +217,9 @@ void menu_tmc_current() { #if X_SENSORLESS void refresh_homing_thrs_X() { stepperX.refresh_homing_thrs(); } #endif + #if X2_SENSORLESS + void refresh_homing_thrs_X2() { stepperX2.refresh_homing_thrs(); } + #endif #if Y_SENSORLESS void refresh_homing_thrs_Y() { stepperY.refresh_homing_thrs(); } #endif @@ -230,6 +233,9 @@ void menu_tmc_current() { #if X_SENSORLESS TMC_EDIT_STORED_SGT(X); #endif + #if X2_SENSORLESS + TMC_EDIT_STORED_SGT(X2); + #endif #if Y_SENSORLESS TMC_EDIT_STORED_SGT(Y); #endif diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index 1c038ea133..3198e6a1b1 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -144,7 +144,7 @@ void menu_tune() { // #if HOTENDS == 1 MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - 15, thermalManager.start_watching_E0); - #else // HOTENDS > 1 + #elif HOTENDS > 1 #define EDIT_NOZZLE(N) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_LCD_N##N, &thermalManager.temp_hotend[N].target, 0, HEATER_##N##_MAXTEMP - 15, thermalManager.start_watching_E##N) EDIT_NOZZLE(0); EDIT_NOZZLE(1); diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index 85e42a8b87..2364a818ae 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -79,7 +79,7 @@ void _lcd_mesh_edit_NOP() { float lcd_mesh_edit() { ui.goto_screen(_lcd_mesh_edit_NOP); ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); - _lcd_mesh_fine_tune(PSTR("Mesh Editor")); + _lcd_mesh_fine_tune(PSTR(MSG_MESH_EDITOR)); return mesh_edit_value; } @@ -89,7 +89,7 @@ void lcd_mesh_edit_setup(const float &initial) { } void _lcd_z_offset_edit() { - _lcd_mesh_fine_tune(PSTR("Z-Offset: ")); + _lcd_mesh_fine_tune(PSTR(MSG_UBL_Z_OFFSET)); } float lcd_z_offset_edit() { @@ -420,8 +420,8 @@ void _lcd_ubl_map_homing() { */ void _lcd_ubl_map_lcd_edit_cmd() { char ubl_lcd_gcode[50], str[10], str2[10]; - dtostrf(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]), 0, 2, str); - dtostrf(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]), 0, 2, str2); + dtostrf(ubl.mesh_index_to_xpos(x_plot), 0, 2, str); + dtostrf(ubl.mesh_index_to_ypos(y_plot), 0, 2, str2); snprintf_P(ubl_lcd_gcode, sizeof(ubl_lcd_gcode), PSTR("G29 P4 X%s Y%s R%i"), str, str2, int(n_edit_pts)); lcd_enqueue_one_now(ubl_lcd_gcode); } @@ -430,21 +430,21 @@ void _lcd_ubl_map_lcd_edit_cmd() { * UBL LCD Map Movement */ void ubl_map_move_to_xy() { - REMEMBER(fr, feedrate_mm_s, MMM_TO_MMS(XY_PROBE_SPEED)); + const feedRate_t fr_mm_s = MMM_TO_MMS(XY_PROBE_SPEED); - set_destination_from_current(); // sync destination at the start + set_destination_from_current(); // sync destination at the start #if ENABLED(DELTA) if (current_position[Z_AXIS] > delta_clip_start_height) { destination[Z_AXIS] = delta_clip_start_height; - prepare_move_to_destination(); + prepare_internal_move_to_destination(fr_mm_s); } #endif destination[X_AXIS] = pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]); destination[Y_AXIS] = pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]); - prepare_move_to_destination(); + prepare_internal_move_to_destination(fr_mm_s); } /** diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index b25907a622..389a58f2dc 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -116,8 +116,6 @@ #endif #if ENABLED(TOUCH_BUTTONS) #include "../feature/touch/xpt2046.h" - volatile uint8_t MarlinUI::touch_buttons; - uint8_t MarlinUI::read_touch_buttons() { return touch.read_buttons(); } #endif #endif @@ -135,7 +133,7 @@ uint8_t MarlinUI::lcd_status_update_delay = 1; // First update one loop delayed millis_t MarlinUI::next_filament_display; // = 0 #endif -millis_t next_button_update_ms; +millis_t MarlinUI::next_button_update_ms; // = 0 #if HAS_GRAPHICAL_LCD bool MarlinUI::drawing_screen, MarlinUI::first_page; // = false @@ -197,6 +195,10 @@ millis_t next_button_update_ms; int8_t MarlinUI::encoderDirection = ENCODERBASE; #endif + #if ENABLED(TOUCH_BUTTONS) + uint8_t MarlinUI::repeat_delay; + #endif + bool MarlinUI::lcd_clicked; float move_menu_scale; @@ -266,17 +268,17 @@ millis_t next_button_update_ms; void MarlinUI::draw_select_screen_prompt(PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) { const uint8_t plen = utf8_strlen_P(pref), slen = suff ? utf8_strlen_P(suff) : 0; - uint8_t row = 0, col = 0; + uint8_t col = 0, row = 0; if (!string && plen + slen <= LCD_WIDTH) { - row = (LCD_WIDTH - plen - slen) / 2; - col = LCD_HEIGHT > 3 ? 1 : 0; + col = (LCD_WIDTH - plen - slen) / 2; + row = LCD_HEIGHT > 3 ? 1 : 0; } - wrap_string_P(row, col, pref, true); + wrap_string_P(col, row, pref, true); if (string) { - if (row) { row = 0; col++; } // Move to the start of the next line - wrap_string(row, col, string); + if (col) { col = 0; row++; } // Move to the start of the next line + wrap_string(col, row, string); } - if (suff) wrap_string_P(row, col, suff); + if (suff) wrap_string_P(col, row, suff); } #endif // HAS_LCD_MENU @@ -345,9 +347,6 @@ void MarlinUI::init() { #if HAS_SLOW_BUTTONS slow_buttons = 0; #endif - #if ENABLED(TOUCH_BUTTONS) - touch_buttons = 0; - #endif #endif update_buttons(); @@ -663,11 +662,9 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { if (manual_move_axis != (int8_t)NO_AXIS && ELAPSED(millis(), manual_move_start_time) && !planner.is_full()) { + const feedRate_t fr_mm_s = MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]); #if IS_KINEMATIC - const float old_feedrate = feedrate_mm_s; - feedrate_mm_s = MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]); - #if EXTRUDERS > 1 const int8_t old_extruder = active_extruder; if (manual_move_axis == E_AXIS) active_extruder = manual_move_e_index; @@ -686,17 +683,16 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { // previous invocation is being blocked. Modifications to manual_move_offset shouldn't be made while // processing_manual_move is true or the planner will get out of sync. processing_manual_move = true; - prepare_move_to_destination(); // will call set_current_from_destination() + prepare_internal_move_to_destination(fr_mm_s); // will set current_position from destination processing_manual_move = false; - feedrate_mm_s = old_feedrate; #if EXTRUDERS > 1 active_extruder = old_extruder; #endif #else - planner.buffer_line(current_position, MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]), manual_move_axis == E_AXIS ? manual_move_e_index : active_extruder); + planner.buffer_line(current_position, fr_mm_s, manual_move_axis == E_AXIS ? manual_move_e_index : active_extruder); manual_move_axis = (int8_t)NO_AXIS; #endif @@ -746,16 +742,19 @@ void MarlinUI::update() { static millis_t next_lcd_update_ms; millis_t ms = millis(); + #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS + static millis_t return_to_status_ms = 0; + #define RESET_STATUS_TIMEOUT() (return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS) + #else + #define RESET_STATUS_TIMEOUT() NOOP + #endif + #ifdef LED_BACKLIGHT_TIMEOUT leds.update_timeout(powersupply_on); #endif #if HAS_LCD_MENU - #if LCD_TIMEOUT_TO_STATUS - static millis_t return_to_status_ms = 0; - #endif - // Handle any queued Move Axis motion manage_manual_move(); @@ -764,36 +763,52 @@ void MarlinUI::update() { update_buttons(); // If the action button is pressed... - static bool wait_for_unclick; // = 0 + static bool wait_for_unclick; // = false + #if ENABLED(TOUCH_BUTTONS) - if (touch_buttons) { - if (!wait_for_unclick && (buttons & EN_C)) { // If not waiting for a debounce release: - wait_for_unclick = true; // - Set debounce flag to ignore continous clicks - lcd_clicked = !wait_for_user && !no_reentry; // - Keep the click if not waiting for a user-click - wait_for_user = false; // - Any click clears wait for user - quick_feedback(); // - Always make a click sound - } - else if (buttons & (EN_A | EN_B)) { // Ignore the encoder if clicked, to prevent "slippage" - const millis_t ms = millis(); - if (ELAPSED(ms, next_button_update_ms)) { - next_button_update_ms = ms + 50; - encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * (ENCODER_PULSES_PER_STEP); - if (buttons & EN_A) encoderDiff *= -1; - if (!wait_for_unclick) { - next_button_update_ms += 250; + + #define TOUCH_MENU_MASK 0x80 + + static bool arrow_pressed; // = false + + // Handle touch events which are slow to read + if (ELAPSED(ms, next_button_update_ms)) { + uint8_t touch_buttons = touch.read_buttons(); + if (touch_buttons) { + RESET_STATUS_TIMEOUT(); + if (touch_buttons & TOUCH_MENU_MASK) { // Processing Menu Area touch? + if (!wait_for_unclick) { // If not waiting for a debounce release: + wait_for_unclick = true; // - Set debounce flag to ignore continous clicks + wait_for_user = false; // - Any click clears wait for user + // TODO for next PR. + //uint8_t tpos = touch_buttons & ~(TOUCH_MENU_MASK); // Safe 7bit touched screen coordinate + next_button_update_ms = ms + 500; // Defer next check for 1/2 second + #if HAS_LCD_MENU + refresh(); + #endif + } + touch_buttons = 0; // Swallow the touch + } + buttons |= (touch_buttons & (EN_C | EN_D)); // Pass on Click and Back buttons + if (touch_buttons & (EN_A | EN_B)) { // A and/or B button? + encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * (ENCODER_PULSES_PER_STEP) * encoderDirection; + if (touch_buttons & EN_A) encoderDiff *= -1; + next_button_update_ms = ms + repeat_delay; // Assume the repeat delay + if (!wait_for_unclick && !arrow_pressed) { // On click prepare for repeat + next_button_update_ms += 250; // Longer delay on first press + arrow_pressed = true; // Mark arrow as pressed #if HAS_BUZZER buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); #endif - wait_for_unclick = true; // - Set debounce flag to ignore continous clicks } } } + if (!(touch_buttons & (EN_A | EN_B))) arrow_pressed = false; } - else - #endif //TOUCH_BUTTONS - // - // Integrated LCD click handling via button_pressed() - // + + #endif // TOUCH_BUTTONS + + // Integrated LCD click handling via button_pressed if (!external_control && button_pressed()) { if (!wait_for_unclick) { // If not waiting for a debounce release: wait_for_unclick = true; // - Set debounce flag to ignore continous clicks @@ -802,14 +817,13 @@ void MarlinUI::update() { quick_feedback(); // - Always make a click sound } } - else wait_for_unclick = false; + else + wait_for_unclick = false; - #if HAS_DIGITAL_BUTTONS && BUTTON_EXISTS(BACK) - if (LCD_BACK_CLICKED()) { - quick_feedback(); - goto_previous_screen(); - } - #endif + if (LCD_BACK_CLICKED()) { + quick_feedback(); + goto_previous_screen(); + } #endif // HAS_LCD_MENU @@ -825,7 +839,7 @@ void MarlinUI::update() { if (sd_status) { safe_delay(500); // Some boards need a delay to get settled - card.initsd(); + card.mount(); if (old_sd_status == 2) card.beginautostart(); // Initial boot else @@ -883,18 +897,8 @@ void MarlinUI::update() { slow_buttons = read_slow_buttons(); // Buttons that take too long to read in interrupt context #endif - #if ENABLED(TOUCH_BUTTONS) - touch_buttons = read_touch_buttons(); - #endif - #if ENABLED(REPRAPWORLD_KEYPAD) - - if (handle_keypad()) { - #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS - return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; - #endif - } - + if (handle_keypad()) RESET_STATUS_TIMEOUT(); #endif const float abs_diff = ABS(encoderDiff); @@ -940,9 +944,7 @@ void MarlinUI::update() { encoderDiff = 0; } - #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS - return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; - #endif + RESET_STATUS_TIMEOUT(); refresh(LCDVIEW_REDRAW_NOW); @@ -975,9 +977,7 @@ void MarlinUI::update() { lcd_status_update_delay = 12; } refresh(LCDVIEW_REDRAW_NOW); - #if LCD_TIMEOUT_TO_STATUS - return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; - #endif + RESET_STATUS_TIMEOUT(); } #endif @@ -1051,7 +1051,7 @@ void MarlinUI::update() { #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS // Return to Status Screen after a timeout if (on_status_screen() || defer_return_to_status) - return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; + RESET_STATUS_TIMEOUT(); else if (ELAPSED(ms, return_to_status_ms)) return_to_status(); #endif @@ -1120,7 +1120,7 @@ void MarlinUI::update() { ADC_BUTTON_VALUE(ADC_BUTTONS_MIDDLE_R_PULLDOWN) + 100, 1 + BLEN_KEYPAD_MIDDLE }, // ENTER (1205 ... 1405) }; - uint8_t get_ADC_keyValue(void) { + uint8_t get_ADC_keyValue() { if (thermalManager.ADCKey_count >= 16) { const uint16_t currentkpADCValue = thermalManager.current_ADCKey_raw << 2; thermalManager.current_ADCKey_raw = 1024; @@ -1234,12 +1234,12 @@ void MarlinUI::update() { #if HAS_SLOW_BUTTONS | slow_buttons #endif - #if ENABLED(TOUCH_BUTTONS) - | touch_buttons - #endif ; + #elif HAS_ADC_BUTTONS + buttons = 0; + #endif #if HAS_ADC_BUTTONS @@ -1482,7 +1482,7 @@ void MarlinUI::update() { host_action_cancel(); #endif #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_open(PROMPT_INFO, PSTR("UI Abort")); + host_prompt_open(PROMPT_INFO, PSTR("UI Aborted"), PSTR("Dismiss")); #endif print_job_timer.stop(); set_status_P(PSTR(MSG_PRINT_ABORTED)); diff --git a/Marlin/src/lcd/ultralcd.h b/Marlin/src/lcd/ultralcd.h index 9c9084dd76..f3dcb3a381 100644 --- a/Marlin/src/lcd/ultralcd.h +++ b/Marlin/src/lcd/ultralcd.h @@ -90,13 +90,13 @@ typedef void (*menuAction_t)(); // Manual Movement - constexpr float manual_feedrate_mm_m[XYZE] = MANUAL_FEEDRATE; + constexpr feedRate_t manual_feedrate_mm_m[XYZE] = MANUAL_FEEDRATE; extern float move_menu_scale; #if ENABLED(ADVANCED_PAUSE_FEATURE) void lcd_pause_show_message(const PauseMessage message, - const PauseMode mode=PAUSE_MODE_SAME, - const uint8_t extruder=active_extruder); + const PauseMode mode=PAUSE_MODE_SAME, + const uint8_t extruder=active_extruder); #endif #if ENABLED(AUTO_BED_LEVELING_UBL) @@ -215,7 +215,7 @@ #endif -#if BUTTON_EXISTS(BACK) +#if BUTTON_EXISTS(BACK) || ENABLED(TOUCH_BUTTONS) #define BLEN_D 3 #define EN_D _BV(BLEN_D) #define LCD_BACK_CLICKED() (buttons & EN_D) @@ -306,6 +306,8 @@ public: #if HAS_SPI_LCD + static millis_t next_button_update_ms; + static bool detected(); static LCDViewAction lcdDrawUpdate; @@ -319,7 +321,7 @@ public: #endif #if ENABLED(SHOW_BOOTSCREEN) - static void draw_marlin_bootscreen(); + static void draw_marlin_bootscreen(const bool line2=false); static void show_marlin_bootscreen(); static void show_bootscreen(); #endif @@ -340,7 +342,7 @@ public: static millis_t progress_bar_ms; // Start time for the current progress bar cycle static void draw_progress_bar(const uint8_t percent); #if PROGRESS_MSG_EXPIRE > 0 - static millis_t MarlinUI::expire_status_ms; // = 0 + static millis_t expire_status_ms; // = 0 static inline void reset_progress_bar_timeout() { expire_status_ms = 0; } #endif #endif @@ -404,6 +406,10 @@ public: #if HAS_LCD_MENU + #if ENABLED(TOUCH_BUTTONS) + static uint8_t repeat_delay; + #endif + #if ENABLED(ENCODER_RATE_MULTIPLIER) static bool encoderRateMultiplierEnabled; static millis_t lastEncoderMovementMillis; @@ -531,10 +537,6 @@ public: static volatile uint8_t slow_buttons; static uint8_t read_slow_buttons(); #endif - #if ENABLED(TOUCH_BUTTONS) - static volatile uint8_t touch_buttons; - static uint8_t read_touch_buttons(); - #endif static void update_buttons(); static inline bool button_pressed() { return BUTTON_CLICK(); } diff --git a/Marlin/src/libs/L6470/L6470_Marlin.cpp b/Marlin/src/libs/L6470/L6470_Marlin.cpp index ae90f761f7..d8b0fb833d 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.cpp +++ b/Marlin/src/libs/L6470/L6470_Marlin.cpp @@ -21,7 +21,7 @@ */ /** - * The monitor_driver routines are a close copy of the TMC code + * The monitor_driver routines are a close copy of the TMC code */ #include "../../inc/MarlinConfig.h" @@ -32,9 +32,9 @@ L6470_Marlin L6470; -#include "../stepper_indirection.h" +#include "../../module/stepper/indirection.h" +#include "../../module/planner.h" #include "../../gcode/gcode.h" -#include "../planner.h" #define DEBUG_OUT ENABLED(L6470_CHITCHAT) #include "../../core/debug_out.h" @@ -384,8 +384,8 @@ bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], } break; case 'Z': { - position_min = center[E_AXIS] - displacement; - position_max = center[E_AXIS] + displacement; + position_min = center[Z_AXIS] - displacement; + position_max = center[Z_AXIS] + displacement; echo_min_max('Z', position_min, position_max); if (false #ifdef Z_MIN_POS diff --git a/Marlin/src/libs/L6470/L6470_Marlin.h b/Marlin/src/libs/L6470/L6470_Marlin.h index 3311574a16..bc9a033e4a 100644 --- a/Marlin/src/libs/L6470/L6470_Marlin.h +++ b/Marlin/src/libs/L6470/L6470_Marlin.h @@ -27,7 +27,7 @@ #define L6470_GETPARAM(P,Q) stepper##Q.GetParam(P) -#define MAX_L6470 (7 + MAX_EXTRUDERS) // Maximum number of axes in Marlin +enum L6470_driver_enum : unsigned char { X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5, MAX_L6470 }; #define L6470_ERROR_MASK (STATUS_UVLO | STATUS_TH_WRN | STATUS_TH_SD | STATUS_OCD | STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B) #define dSPIN_STEP_CLOCK_FWD dSPIN_STEP_CLOCK diff --git a/Marlin/src/libs/circularqueue.h b/Marlin/src/libs/circularqueue.h index 479e90daba..6b1923986d 100644 --- a/Marlin/src/libs/circularqueue.h +++ b/Marlin/src/libs/circularqueue.h @@ -52,8 +52,8 @@ class CircularQueue { * items that can be stored on the queue. */ CircularQueue() { - this->buffer.size = N; - this->buffer.count = this->buffer.head = this->buffer.tail = 0; + buffer.size = N; + buffer.count = buffer.head = buffer.tail = 0; } /** @@ -63,15 +63,15 @@ class CircularQueue { * @return type T item */ T dequeue() { - if (this->isEmpty()) return T(); + if (isEmpty()) return T(); - uint8_t index = this->buffer.head; + uint8_t index = buffer.head; - --this->buffer.count; - if (++this->buffer.head == this->buffer.size) - this->buffer.head = 0; + --buffer.count; + if (++buffer.head == buffer.size) + buffer.head = 0; - return this->buffer.queue[index]; + return buffer.queue[index]; } /** @@ -82,13 +82,13 @@ class CircularQueue { * @return true if the operation was successful */ bool enqueue(T const &item) { - if (this->isFull()) return false; + if (isFull()) return false; - this->buffer.queue[this->buffer.tail] = item; + buffer.queue[buffer.tail] = item; - ++this->buffer.count; - if (++this->buffer.tail == this->buffer.size) - this->buffer.tail = 0; + ++buffer.count; + if (++buffer.tail == buffer.size) + buffer.tail = 0; return true; } @@ -98,27 +98,21 @@ class CircularQueue { * @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; - } + bool isEmpty() { return 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; - } + bool isFull() { return buffer.count == 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; - } + uint8_t size() { return buffer.size; } /** * @brief Gets the next item from the queue without removing it @@ -126,16 +120,12 @@ class CircularQueue { * or updating the pointers. * @return first item in the queue */ - T peek() { - return this->buffer.queue[this->buffer.head]; - } + T peek() { return buffer.queue[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; - } + uint8_t count() { return buffer.count; } }; diff --git a/Marlin/src/libs/duration_t.h b/Marlin/src/libs/duration_t.h index c376e5dae2..2015c17436 100644 --- a/Marlin/src/libs/duration_t.h +++ b/Marlin/src/libs/duration_t.h @@ -120,7 +120,7 @@ struct duration_t { * 59m 59s * 59s */ - void toString(char *buffer) const { + char* toString(char * const buffer) const { int y = this->year(), d = this->day() % 365, h = this->hour() % 24, @@ -132,6 +132,7 @@ struct duration_t { 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); + return buffer; } /** diff --git a/Marlin/src/libs/heatshrink/LICENSE b/Marlin/src/libs/heatshrink/LICENSE index 6b6963415e..a40fc72b91 100644 --- a/Marlin/src/libs/heatshrink/LICENSE +++ b/Marlin/src/libs/heatshrink/LICENSE @@ -1,10 +1,10 @@ Copyright (c) 2013-2015, Scott Vokes All rights reserved. - + Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR diff --git a/Marlin/src/libs/least_squares_fit.h b/Marlin/src/libs/least_squares_fit.h index 8eb47585e0..bfef8b14ad 100644 --- a/Marlin/src/libs/least_squares_fit.h +++ b/Marlin/src/libs/least_squares_fit.h @@ -44,28 +44,29 @@ struct linear_fit_data { A, B, D, N; }; -void inline incremental_LSF_reset(struct linear_fit_data *lsf) { +inline void incremental_LSF_reset(struct linear_fit_data *lsf) { memset(lsf, 0, sizeof(linear_fit_data)); } -void inline incremental_WLSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z, const float &w) { +inline void incremental_WLSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z, const float &w) { // weight each accumulator by factor w, including the "number" of samples // (analogous to calling inc_LSF twice with same values to weight it by 2X) - lsf->xbar += w * x; - lsf->ybar += w * y; - lsf->zbar += w * z; - lsf->x2bar += w * x * x; // don't use sq(x) -- let compiler re-use w*x four times - lsf->y2bar += w * y * y; - lsf->z2bar += w * z * z; - lsf->xybar += w * x * y; - lsf->xzbar += w * x * z; - lsf->yzbar += w * y * z; + const float wx = w * x, wy = w * y, wz = w * z; + lsf->xbar += wx; + lsf->ybar += wy; + lsf->zbar += wz; + lsf->x2bar += wx * x; + lsf->y2bar += wy * y; + lsf->z2bar += wz * z; + lsf->xybar += wx * y; + lsf->xzbar += wx * z; + lsf->yzbar += wy * z; lsf->N += w; - lsf->max_absx = _MAX(ABS(w * x), lsf->max_absx); - lsf->max_absy = _MAX(ABS(w * y), lsf->max_absy); + lsf->max_absx = _MAX(ABS(wx), lsf->max_absx); + lsf->max_absy = _MAX(ABS(wy), lsf->max_absy); } -void inline incremental_LSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z) { +inline void incremental_LSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z) { lsf->xbar += x; lsf->ybar += y; lsf->zbar += z; diff --git a/Marlin/src/libs/nozzle.cpp b/Marlin/src/libs/nozzle.cpp index 3926bfc93c..829d46e1da 100644 --- a/Marlin/src/libs/nozzle.cpp +++ b/Marlin/src/libs/nozzle.cpp @@ -175,16 +175,9 @@ Nozzle nozzle; if (!TEST(cleans, Z_AXIS)) start.z = end.z = current_position[Z_AXIS]; switch (pattern) { - case 1: - zigzag(start, end, strokes, objects); - break; - - case 2: - circle(start, end, strokes, radius); - break; - - default: - stroke(start, end, strokes); + case 1: zigzag(start, end, strokes, objects); break; + case 2: circle(start, end, strokes, radius); break; + default: stroke(start, end, strokes); } } @@ -193,8 +186,7 @@ Nozzle nozzle; #if ENABLED(NOZZLE_PARK_FEATURE) void Nozzle::park(const uint8_t z_action, const point_t &park/*=NOZZLE_PARK_POINT*/) { - const float fr_xy = NOZZLE_PARK_XY_FEEDRATE, - fr_z = NOZZLE_PARK_Z_FEEDRATE; + constexpr feedRate_t fr_xy = NOZZLE_PARK_XY_FEEDRATE, fr_z = NOZZLE_PARK_Z_FEEDRATE; switch (z_action) { case 1: // Go to Z-park height diff --git a/Marlin/src/libs/numtostr.cpp b/Marlin/src/libs/numtostr.cpp index fabc5b498f..6be9da7afb 100644 --- a/Marlin/src/libs/numtostr.cpp +++ b/Marlin/src/libs/numtostr.cpp @@ -21,6 +21,8 @@ */ #include "numtostr.h" + +#include "../inc/MarlinConfigPre.h" #include "../core/utility.h" char conv[8] = { 0 }; @@ -183,7 +185,7 @@ char* ftostr52(const float &f) { return &conv[3]; } -#endif // LCD_DECIMAL_SMALL_XY +#endif // Convert float to fixed-length string with +123.4 / -123.4 format char* ftostr41sign(const float &f) { diff --git a/Marlin/src/libs/numtostr.h b/Marlin/src/libs/numtostr.h index 1c18fd6edd..6af2ac4869 100644 --- a/Marlin/src/libs/numtostr.h +++ b/Marlin/src/libs/numtostr.h @@ -21,7 +21,7 @@ */ #pragma once -#include "../inc/MarlinConfigPre.h" +#include // Convert a full-range unsigned 8bit int to a percentage char* ui8tostr4pct(const uint8_t i); @@ -83,9 +83,13 @@ char* ftostr52sign(const float &x); // Convert unsigned float to string with 1234.5 format omitting trailing zeros char* ftostr51rj(const float &x); +#include "../core/macros.h" + // Convert float to rj string with 123 or -12 format FORCE_INLINE char* ftostr3(const float &x) { return i16tostr3(int16_t(x + (x < 0 ? -0.5f : 0.5f))); } +#include "../inc/MarlinConfigPre.h" + #if ENABLED(LCD_DECIMAL_SMALL_XY) // Convert float to rj string with 1234, _123, 12.3, _1.2, -123, _-12, or -1.2 format char* ftostr4sign(const float &fx); diff --git a/Marlin/src/libs/softspi.h b/Marlin/src/libs/softspi.h index 8595a69e81..39d56b26f7 100644 --- a/Marlin/src/libs/softspi.h +++ b/Marlin/src/libs/softspi.h @@ -475,7 +475,7 @@ static constexpr uint8_t digitalPinCount = sizeof(pinMap) / sizeof(pin_map_t); /** generate bad pin number error */ - void badPinNumber(void) + void badPinNumber() __attribute__((error("Pin number is too large or not a constant"))); /** diff --git a/Marlin/src/libs/stopwatch.cpp b/Marlin/src/libs/stopwatch.cpp index 49eaa5f2b0..b80a1597d5 100644 --- a/Marlin/src/libs/stopwatch.cpp +++ b/Marlin/src/libs/stopwatch.cpp @@ -24,6 +24,10 @@ #include "../inc/MarlinConfig.h" +#if ENABLED(EXTENSIBLE_UI) + #include "../lcd/extensible_ui/ui_api.h" +#endif + Stopwatch::State Stopwatch::state; millis_t Stopwatch::accumulator; millis_t Stopwatch::startTimestamp; @@ -35,6 +39,9 @@ bool Stopwatch::stop() { #endif if (isRunning() || isPaused()) { + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onPrintTimerStopped(); + #endif state = STOPPED; stopTimestamp = millis(); return true; @@ -48,6 +55,9 @@ bool Stopwatch::pause() { #endif if (isRunning()) { + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onPrintTimerPaused(); + #endif state = PAUSED; stopTimestamp = millis(); return true; diff --git a/Marlin/src/libs/stopwatch.h b/Marlin/src/libs/stopwatch.h index 77e9df98b0..013c243cfe 100644 --- a/Marlin/src/libs/stopwatch.h +++ b/Marlin/src/libs/stopwatch.h @@ -25,7 +25,9 @@ //#define DEBUG_STOPWATCH #include "../core/macros.h" // for FORCE_INLINE -#include "../core/millis_t.h" + +#include +typedef uint32_t millis_t; /** * @brief Stopwatch class diff --git a/Marlin/src/libs/vector_3.cpp b/Marlin/src/libs/vector_3.cpp index 9ffc852feb..e733cce3a5 100644 --- a/Marlin/src/libs/vector_3.cpp +++ b/Marlin/src/libs/vector_3.cpp @@ -57,8 +57,11 @@ vector_3 vector_3::cross(const vector_3 &left, const vector_3 &right) { left.x * right.y - left.y * right.x); } -vector_3 vector_3::operator+(const vector_3 &v) { return vector_3((x + v.x), (y + v.y), (z + v.z)); } -vector_3 vector_3::operator-(const vector_3 &v) { return vector_3((x - v.x), (y - v.y), (z - v.z)); } +vector_3 vector_3::operator+(const vector_3 &v) { return vector_3(x + v.x, y + v.y, z + v.z); } +vector_3 vector_3::operator-(const vector_3 &v) { return vector_3(x - v.x, y - v.y, z - v.z); } + +vector_3 vector_3::operator* (const float &v) { return vector_3(x * v, y * v, z * v); } +vector_3& vector_3::operator*=(const float &v) { x *= v; y *= v; z *= v; return *this; } vector_3 vector_3::get_normal() const { vector_3 normalized = vector_3(x, y, z); diff --git a/Marlin/src/libs/vector_3.h b/Marlin/src/libs/vector_3.h index b56e1d60bb..6f9153817a 100644 --- a/Marlin/src/libs/vector_3.h +++ b/Marlin/src/libs/vector_3.h @@ -52,6 +52,10 @@ struct vector_3 { vector_3 operator+(const vector_3 &v); vector_3 operator-(const vector_3 &v); + + vector_3 operator* (const float &v); + vector_3& operator*=(const float &v); + void normalize(); float get_length() const; vector_3 get_normal() const; diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index 15c0922692..3d723909b0 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -37,7 +37,7 @@ */ // Change EEPROM version if the structure changes -#define EEPROM_VERSION "V68" +#define EEPROM_VERSION "V70" #define EEPROM_OFFSET 100 // Check the integrity of data offsets. @@ -60,6 +60,8 @@ #include "../HAL/shared/persistent_store_api.h" #endif +#include "probe.h" + #if HAS_LEVELING #include "../feature/bedlevel/bedlevel.h" #endif @@ -78,10 +80,6 @@ #define EEPROM_NUM_SERVOS NUM_SERVO_PLUGS #endif -#if HAS_BED_PROBE - #include "probe.h" -#endif - #include "../feature/fwretract.h" #if ENABLED(POWER_LOSS_RECOVERY) @@ -112,7 +110,7 @@ #endif #if HAS_TRINAMIC - #include "stepper_indirection.h" + #include "stepper/indirection.h" #include "../feature/tmc_util.h" #endif @@ -120,12 +118,17 @@ typedef struct { uint16_t X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_stepper_current_t; typedef struct { uint32_t X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_hybrid_threshold_t; -typedef struct { int16_t X, Y, Z; } tmc_sgt_t; +typedef struct { int16_t X, Y, Z, X2; } tmc_sgt_t; typedef struct { bool X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_stealth_enabled_t; // Limit an index to an array size #define ALIM(I,ARR) _MIN(I, COUNT(ARR) - 1) +// Defaults for reset / fill in on load +static const uint32_t _DMA[] PROGMEM = DEFAULT_MAX_ACCELERATION; +static const float _DASU[] PROGMEM = DEFAULT_AXIS_STEPS_PER_UNIT; +static const feedRate_t _DMF[] PROGMEM = DEFAULT_MAX_FEEDRATE; + /** * Current EEPROM Layout * @@ -178,7 +181,7 @@ typedef struct SettingsDataStruct { // HAS_BED_PROBE // - float zprobe_zoffset; + float probe_offset[XYZ]; // // ABL_PLANAR @@ -283,7 +286,7 @@ typedef struct SettingsDataStruct { // tmc_stepper_current_t tmc_stepper_current; // M906 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5 tmc_hybrid_threshold_t tmc_hybrid_threshold; // M913 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5 - tmc_sgt_t tmc_sgt; // M914 X Y Z + tmc_sgt_t tmc_sgt; // M914 X Y Z X2 tmc_stealth_enabled_t tmc_stealth_enabled; // M569 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5 // @@ -309,7 +312,9 @@ typedef struct SettingsDataStruct { // // ADVANCED_PAUSE_FEATURE // - fil_change_settings_t fc_settings[EXTRUDERS]; // M603 T U L + #if EXTRUDERS + fil_change_settings_t fc_settings[EXTRUDERS]; // M603 T U L + #endif // // Tool-change settings @@ -367,7 +372,7 @@ void MarlinSettings::postprocess() { #if DISABLED(NO_VOLUMETRICS) planner.calculate_volumetric_multipliers(); - #else + #elif EXTRUDERS for (uint8_t i = COUNT(planner.e_factor); i--;) planner.refresh_e_factor(i); #endif @@ -613,12 +618,8 @@ void MarlinSettings::postprocess() { // Probe Z Offset // { - _FIELD_TEST(zprobe_zoffset); - - #if !HAS_BED_PROBE - const float zprobe_zoffset = 0; - #endif - EEPROM_WRITE(zprobe_zoffset); + _FIELD_TEST(probe_offset[Z_AXIS]); + EEPROM_WRITE(probe_offset); } // @@ -759,7 +760,7 @@ void MarlinSettings::postprocess() { { _FIELD_TEST(ui_preheat_hotend_temp); - #if HAS_LCD_MENU + #if HOTENDS && HAS_LCD_MENU const int16_t (&ui_preheat_hotend_temp)[2] = ui.preheat_hotend_temp, (&ui_preheat_bed_temp)[2] = ui.preheat_bed_temp; const uint8_t (&ui_preheat_fan_speed)[2] = ui.preheat_fan_speed; @@ -1032,11 +1033,14 @@ void MarlinSettings::postprocess() { // TMC StallGuard threshold // { - tmc_sgt_t tmc_sgt = { 0, 0, 0 }; + tmc_sgt_t tmc_sgt = { 0 }; #if USE_SENSORLESS #if X_SENSORLESS tmc_sgt.X = stepperX.homing_threshold(); #endif + #if X2_SENSORLESS + tmc_sgt.X2 = stepperX2.homing_threshold(); + #endif #if Y_SENSORLESS tmc_sgt.Y = stepperY.homing_threshold(); #endif @@ -1161,6 +1165,7 @@ void MarlinSettings::postprocess() { // // Advanced Pause filament load & unload lengths // + #if EXTRUDERS { #if DISABLED(ADVANCED_PAUSE_FEATURE) const fil_change_settings_t fc_settings[EXTRUDERS] = { 0, 0 }; @@ -1168,6 +1173,7 @@ void MarlinSettings::postprocess() { _FIELD_TEST(fc_settings); EEPROM_WRITE(fc_settings); } + #endif // // Multiple Extruders @@ -1182,25 +1188,20 @@ void MarlinSettings::postprocess() { // Backlash Compensation // { - #ifdef BACKLASH_DISTANCE_MM + #if ENABLED(BACKLASH_GCODE) const float (&backlash_distance_mm)[XYZ] = backlash.distance_mm; - #else - const float backlash_distance_mm[XYZ] = { 0 }; - #endif - #if ENABLED(BACKLASH_COMPENSATION) const uint8_t &backlash_correction = backlash.correction; #else + const float backlash_distance_mm[XYZ] = { 0 }; const uint8_t backlash_correction = 0; #endif - #ifdef BACKLASH_SMOOTHING_MM + #if ENABLED(BACKLASH_GCODE) && defined(BACKLASH_SMOOTHING_MM) const float &backlash_smoothing_mm = backlash.smoothing_mm; #else const float backlash_smoothing_mm = 3; #endif _FIELD_TEST(backlash_distance_mm); - EEPROM_WRITE(backlash_distance_mm[X_AXIS]); - EEPROM_WRITE(backlash_distance_mm[Y_AXIS]); - EEPROM_WRITE(backlash_distance_mm[Z_AXIS]); + EEPROM_WRITE(backlash_distance_mm); EEPROM_WRITE(backlash_correction); EEPROM_WRITE(backlash_smoothing_mm); } @@ -1293,21 +1294,19 @@ void MarlinSettings::postprocess() { { // Get only the number of E stepper parameters previously stored // Any steppers added later are set to their defaults - const uint32_t def1[] = DEFAULT_MAX_ACCELERATION; - const float def2[] = DEFAULT_AXIS_STEPS_PER_UNIT, def3[] = DEFAULT_MAX_FEEDRATE; - uint32_t tmp1[XYZ + esteppers]; + float tmp2[XYZ + esteppers]; + feedRate_t tmp3[XYZ + esteppers]; EEPROM_READ(tmp1); // max_acceleration_mm_per_s2 EEPROM_READ(planner.settings.min_segment_time_us); - - float tmp2[XYZ + esteppers], tmp3[XYZ + esteppers]; EEPROM_READ(tmp2); // axis_steps_per_mm EEPROM_READ(tmp3); // max_feedrate_mm_s + if (!validating) LOOP_XYZE_N(i) { const bool in = (i < esteppers + XYZ); - planner.settings.max_acceleration_mm_per_s2[i] = in ? tmp1[i] : def1[ALIM(i, def1)]; - planner.settings.axis_steps_per_mm[i] = in ? tmp2[i] : def2[ALIM(i, def2)]; - planner.settings.max_feedrate_mm_s[i] = in ? tmp3[i] : def3[ALIM(i, def3)]; + planner.settings.max_acceleration_mm_per_s2[i] = in ? tmp1[i] : pgm_read_dword(&_DMA[ALIM(i, _DMA)]); + planner.settings.axis_steps_per_mm[i] = in ? tmp2[i] : pgm_read_float(&_DASU[ALIM(i, _DASU)]); + planner.settings.max_feedrate_mm_s[i] = in ? tmp3[i] : pgm_read_float(&_DMF[ALIM(i, _DMF)]); } EEPROM_READ(planner.settings.acceleration); @@ -1419,12 +1418,14 @@ void MarlinSettings::postprocess() { // Probe Z Offset // { - _FIELD_TEST(zprobe_zoffset); + _FIELD_TEST(probe_offset[Z_AXIS]); - #if !HAS_BED_PROBE - float zprobe_zoffset; + #if HAS_BED_PROBE + float (&zpo)[XYZ] = probe_offset; + #else + float zpo[XYZ]; #endif - EEPROM_READ(zprobe_zoffset); + EEPROM_READ(zpo); } // @@ -1557,7 +1558,7 @@ void MarlinSettings::postprocess() { { _FIELD_TEST(ui_preheat_hotend_temp); - #if HAS_LCD_MENU + #if HOTENDS && HAS_LCD_MENU int16_t (&ui_preheat_hotend_temp)[2] = ui.preheat_hotend_temp, (&ui_preheat_bed_temp)[2] = ui.preheat_bed_temp; uint8_t (&ui_preheat_fan_speed)[2] = ui.preheat_fan_speed; @@ -1820,10 +1821,13 @@ void MarlinSettings::postprocess() { #if AXIS_HAS_STALLGUARD(X) stepperX.homing_threshold(tmc_sgt.X); #endif - #if AXIS_HAS_STALLGUARD(X2) + #if AXIS_HAS_STALLGUARD(X2) && !X2_SENSORLESS stepperX2.homing_threshold(tmc_sgt.X); #endif #endif + #if X2_SENSORLESS + stepperX2.homing_threshold(tmc_sgt.X2); + #endif #ifdef Y_STALL_SENSITIVITY #if AXIS_HAS_STALLGUARD(Y) stepperY.homing_threshold(tmc_sgt.Y); @@ -1962,6 +1966,7 @@ void MarlinSettings::postprocess() { // // Advanced Pause filament load & unload lengths // + #if EXTRUDERS { #if DISABLED(ADVANCED_PAUSE_FEATURE) fil_change_settings_t fc_settings[EXTRUDERS]; @@ -1969,6 +1974,7 @@ void MarlinSettings::postprocess() { _FIELD_TEST(fc_settings); EEPROM_READ(fc_settings); } + #endif // // Tool-change settings @@ -1982,25 +1988,20 @@ void MarlinSettings::postprocess() { // Backlash Compensation // { - #ifdef BACKLASH_DISTANCE_MM + #if ENABLED(BACKLASH_GCODE) float (&backlash_distance_mm)[XYZ] = backlash.distance_mm; - #else - float backlash_distance_mm[XYZ]; - #endif - #if ENABLED(BACKLASH_COMPENSATION) uint8_t &backlash_correction = backlash.correction; #else + float backlash_distance_mm[XYZ]; uint8_t backlash_correction; #endif - #ifdef BACKLASH_SMOOTHING_MM + #if ENABLED(BACKLASH_GCODE) && defined(BACKLASH_SMOOTHING_MM) float &backlash_smoothing_mm = backlash.smoothing_mm; #else float backlash_smoothing_mm; #endif _FIELD_TEST(backlash_distance_mm); - EEPROM_READ(backlash_distance_mm[X_AXIS]); - EEPROM_READ(backlash_distance_mm[Y_AXIS]); - EEPROM_READ(backlash_distance_mm[Z_AXIS]); + EEPROM_READ(backlash_distance_mm); EEPROM_READ(backlash_correction); EEPROM_READ(backlash_smoothing_mm); } @@ -2063,7 +2064,7 @@ void MarlinSettings::postprocess() { } else { ubl.reset(); - DEBUG_ECHOLNPGM("UBL System reset()"); + DEBUG_ECHOLNPGM("UBL reset"); } } #endif @@ -2207,20 +2208,18 @@ void MarlinSettings::postprocess() { * M502 - Reset Configuration */ void MarlinSettings::reset() { - static const float tmp1[] PROGMEM = DEFAULT_AXIS_STEPS_PER_UNIT, tmp2[] PROGMEM = DEFAULT_MAX_FEEDRATE; - static const uint32_t tmp3[] PROGMEM = DEFAULT_MAX_ACCELERATION; LOOP_XYZE_N(i) { - planner.settings.axis_steps_per_mm[i] = pgm_read_float(&tmp1[ALIM(i, tmp1)]); - planner.settings.max_feedrate_mm_s[i] = pgm_read_float(&tmp2[ALIM(i, tmp2)]); - planner.settings.max_acceleration_mm_per_s2[i] = pgm_read_dword(&tmp3[ALIM(i, tmp3)]); + planner.settings.max_acceleration_mm_per_s2[i] = pgm_read_dword(&_DMA[ALIM(i, _DMA)]); + planner.settings.axis_steps_per_mm[i] = pgm_read_float(&_DASU[ALIM(i, _DASU)]); + planner.settings.max_feedrate_mm_s[i] = pgm_read_float(&_DMF[ALIM(i, _DMF)]); } planner.settings.min_segment_time_us = DEFAULT_MINSEGMENTTIME; planner.settings.acceleration = DEFAULT_ACCELERATION; planner.settings.retract_acceleration = DEFAULT_RETRACT_ACCELERATION; planner.settings.travel_acceleration = DEFAULT_TRAVEL_ACCELERATION; - planner.settings.min_feedrate_mm_s = DEFAULT_MINIMUMFEEDRATE; - planner.settings.min_travel_feedrate_mm_s = DEFAULT_MINTRAVELFEEDRATE; + planner.settings.min_feedrate_mm_s = feedRate_t(DEFAULT_MINIMUMFEEDRATE); + planner.settings.min_travel_feedrate_mm_s = feedRate_t(DEFAULT_MINTRAVELFEEDRATE); #if HAS_CLASSIC_JERK #ifndef DEFAULT_XJERK @@ -2285,12 +2284,10 @@ void MarlinSettings::reset() { #if ENABLED(BACKLASH_GCODE) backlash.correction = (BACKLASH_CORRECTION) * 255; - #ifdef BACKLASH_DISTANCE_MM - constexpr float tmp[XYZ] = BACKLASH_DISTANCE_MM; - backlash.distance_mm[X_AXIS] = tmp[X_AXIS]; - backlash.distance_mm[Y_AXIS] = tmp[Y_AXIS]; - backlash.distance_mm[Z_AXIS] = tmp[Z_AXIS]; - #endif + constexpr float tmp[XYZ] = BACKLASH_DISTANCE_MM; + backlash.distance_mm[X_AXIS] = tmp[X_AXIS]; + backlash.distance_mm[Y_AXIS] = tmp[Y_AXIS]; + backlash.distance_mm[Z_AXIS] = tmp[Z_AXIS]; #ifdef BACKLASH_SMOOTHING_MM backlash.smoothing_mm = BACKLASH_SMOOTHING_MM; #endif @@ -2321,7 +2318,12 @@ void MarlinSettings::reset() { #endif #if HAS_BED_PROBE - zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER; + #ifndef NOZZLE_TO_PROBE_OFFSET + #define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } + #endif + constexpr float dpo[XYZ] = NOZZLE_TO_PROBE_OFFSET; + static_assert(COUNT(dpo) == 3, "NOZZLE_TO_PROBE_OFFSET must contain offsets for X, Y, and Z."); + LOOP_XYZ(a) probe_offset[a] = dpo[a]; #endif // @@ -2404,7 +2406,7 @@ void MarlinSettings::reset() { // Preheat parameters // - #if HAS_LCD_MENU + #if HOTENDS && HAS_LCD_MENU ui.preheat_hotend_temp[0] = PREHEAT_1_TEMP_HOTEND; ui.preheat_hotend_temp[1] = PREHEAT_2_TEMP_HOTEND; ui.preheat_bed_temp[0] = PREHEAT_1_TEMP_BED; @@ -2579,17 +2581,18 @@ void MarlinSettings::reset() { #if HAS_TRINAMIC inline void say_M906(const bool forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOPGM(" M906"); } #if HAS_STEALTHCHOP - void say_M569(const char * const etc=nullptr) { + void say_M569(const bool forReplay, const char * const etc=nullptr, const bool newLine = false) { + CONFIG_ECHO_START(); SERIAL_ECHOPGM(" M569 S1"); if (etc) { SERIAL_CHAR(' '); serialprintPGM(etc); - SERIAL_EOL(); } + if (newLine) SERIAL_EOL(); } #endif #if ENABLED(HYBRID_THRESHOLD) - inline void say_M913() { SERIAL_ECHOPGM(" M913"); } + inline void say_M913(const bool forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOPGM(" M913"); } #endif #if USE_SENSORLESS inline void say_M914() { SERIAL_ECHOPGM(" M914"); } @@ -2792,9 +2795,8 @@ void MarlinSettings::reset() { CONFIG_ECHO_START(); for (uint8_t e = 1; e < HOTENDS; e++) { SERIAL_ECHOPAIR( - " M218 T", (int)e - , " X", LINEAR_UNIT(hotend_offset[X_AXIS][e]) - , " Y", LINEAR_UNIT(hotend_offset[Y_AXIS][e]) + " M218 T", (int)e, + " X", LINEAR_UNIT(hotend_offset[X_AXIS][e]), " Y", LINEAR_UNIT(hotend_offset[Y_AXIS][e]) ); SERIAL_ECHOLNPAIR_F(" Z", LINEAR_UNIT(hotend_offset[Z_AXIS][e]), 3); } @@ -2909,9 +2911,9 @@ void MarlinSettings::reset() { CONFIG_ECHO_HEADING("Endstop adjustment:"); CONFIG_ECHO_START(); SERIAL_ECHOLNPAIR( - " M666 X", LINEAR_UNIT(delta_endstop_adj[X_AXIS]) - , " Y", LINEAR_UNIT(delta_endstop_adj[Y_AXIS]) - , " Z", LINEAR_UNIT(delta_endstop_adj[Z_AXIS]) + " M666 X", LINEAR_UNIT(delta_endstop_adj[A_AXIS]) + , " Y", LINEAR_UNIT(delta_endstop_adj[B_AXIS]) + , " Z", LINEAR_UNIT(delta_endstop_adj[C_AXIS]) ); CONFIG_ECHO_HEADING("Delta settings: L R H S B XYZ"); @@ -2949,7 +2951,7 @@ void MarlinSettings::reset() { #endif // [XYZ]_DUAL_ENDSTOPS - #if HAS_LCD_MENU + #if HOTENDS && HAS_LCD_MENU CONFIG_ECHO_HEADING("Material heatup parameters:"); for (uint8_t i = 0; i < COUNT(ui.preheat_hotend_temp); i++) { @@ -3038,7 +3040,7 @@ void MarlinSettings::reset() { SERIAL_ECHOLNPAIR( " M207 S", LINEAR_UNIT(fwretract.settings.retract_length) , " W", LINEAR_UNIT(fwretract.settings.swap_retract_length) - , " F", MMS_TO_MMM(LINEAR_UNIT(fwretract.settings.retract_feedrate_mm_s)) + , " F", LINEAR_UNIT(MMS_TO_MMM(fwretract.settings.retract_feedrate_mm_s)) , " Z", LINEAR_UNIT(fwretract.settings.retract_zraise) ); @@ -3047,7 +3049,7 @@ void MarlinSettings::reset() { SERIAL_ECHOLNPAIR( " M208 S", LINEAR_UNIT(fwretract.settings.retract_recover_extra) , " W", LINEAR_UNIT(fwretract.settings.swap_retract_recover_extra) - , " F", MMS_TO_MMM(LINEAR_UNIT(fwretract.settings.retract_recover_feedrate_mm_s)) + , " F", LINEAR_UNIT(MMS_TO_MMM(fwretract.settings.retract_recover_feedrate_mm_s)) ); #if ENABLED(FWRETRACT_AUTORETRACT) @@ -3070,7 +3072,9 @@ void MarlinSettings::reset() { say_units(true); } CONFIG_ECHO_START(); - SERIAL_ECHOLNPAIR(" M851 Z", LINEAR_UNIT(zprobe_zoffset)); + SERIAL_ECHOLNPAIR(" M851 X", LINEAR_UNIT(probe_offset[X_AXIS]), + " Y", LINEAR_UNIT(probe_offset[Y_AXIS]), + " Z", LINEAR_UNIT(probe_offset[Z_AXIS])); #endif /** @@ -3162,9 +3166,8 @@ void MarlinSettings::reset() { */ #if ENABLED(HYBRID_THRESHOLD) CONFIG_ECHO_HEADING("Hybrid Threshold:"); - CONFIG_ECHO_START(); #if AXIS_HAS_STEALTHCHOP(X) || AXIS_HAS_STEALTHCHOP(Y) || AXIS_HAS_STEALTHCHOP(Z) - say_M913(); + say_M913(forReplay); #endif #if AXIS_HAS_STEALTHCHOP(X) SERIAL_ECHOPAIR(" X", stepperX.get_pwm_thrs()); @@ -3180,7 +3183,7 @@ void MarlinSettings::reset() { #endif #if AXIS_HAS_STEALTHCHOP(X2) || AXIS_HAS_STEALTHCHOP(Y2) || AXIS_HAS_STEALTHCHOP(Z2) - say_M913(); + say_M913(forReplay); SERIAL_ECHOPGM(" I1"); #endif #if AXIS_HAS_STEALTHCHOP(X2) @@ -3197,32 +3200,32 @@ void MarlinSettings::reset() { #endif #if AXIS_HAS_STEALTHCHOP(Z3) - say_M913(); + say_M913(forReplay); SERIAL_ECHOLNPAIR(" I2 Z", stepperZ3.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(E0) - say_M913(); + say_M913(forReplay); SERIAL_ECHOLNPAIR(" T0 E", stepperE0.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(E1) - say_M913(); + say_M913(forReplay); SERIAL_ECHOLNPAIR(" T1 E", stepperE1.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(E2) - say_M913(); + say_M913(forReplay); SERIAL_ECHOLNPAIR(" T2 E", stepperE2.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(E3) - say_M913(); + say_M913(forReplay); SERIAL_ECHOLNPAIR(" T3 E", stepperE3.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(E4) - say_M913(); + say_M913(forReplay); SERIAL_ECHOLNPAIR(" T4 E", stepperE4.get_pwm_thrs()); #endif #if AXIS_HAS_STEALTHCHOP(E5) - say_M913(); + say_M913(forReplay); SERIAL_ECHOLNPAIR(" T5 E", stepperE5.get_pwm_thrs()); #endif SERIAL_EOL(); @@ -3233,8 +3236,8 @@ void MarlinSettings::reset() { */ #if USE_SENSORLESS CONFIG_ECHO_HEADING("StallGuard threshold:"); - CONFIG_ECHO_START(); #if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS + CONFIG_ECHO_START(); say_M914(); #if X_SENSORLESS SERIAL_ECHOPAIR(" X", stepperX.homing_threshold()); @@ -3253,6 +3256,7 @@ void MarlinSettings::reset() { #define HAS_Z2_SENSORLESS (defined(Z_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z2)) #define HAS_Z3_SENSORLESS (defined(Z_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z3)) #if HAS_X2_SENSORLESS || HAS_Y2_SENSORLESS || HAS_Z2_SENSORLESS + CONFIG_ECHO_START(); say_M914(); SERIAL_ECHOPGM(" I1"); #if HAS_X2_SENSORLESS @@ -3268,6 +3272,7 @@ void MarlinSettings::reset() { #endif #if HAS_Z3_SENSORLESS + CONFIG_ECHO_START(); say_M914(); SERIAL_ECHOLNPAIR(" I2 Z", stepperZ3.homing_threshold()); #endif @@ -3279,7 +3284,6 @@ void MarlinSettings::reset() { */ #if HAS_STEALTHCHOP CONFIG_ECHO_HEADING("Driver stepping mode:"); - CONFIG_ECHO_START(); #if AXIS_HAS_STEALTHCHOP(X) const bool chop_x = stepperX.get_stealthChop_status(); #else @@ -3296,11 +3300,13 @@ void MarlinSettings::reset() { constexpr bool chop_z = false; #endif - if (chop_x || chop_y || chop_z) say_M569(); - if (chop_x) SERIAL_ECHOPGM(" X"); - if (chop_y) SERIAL_ECHOPGM(" Y"); - if (chop_z) SERIAL_ECHOPGM(" Z"); - if (chop_x || chop_y || chop_z) SERIAL_EOL(); + if (chop_x || chop_y || chop_z) { + say_M569(forReplay); + if (chop_x) SERIAL_ECHOPGM(" X"); + if (chop_y) SERIAL_ECHOPGM(" Y"); + if (chop_z) SERIAL_ECHOPGM(" Z"); + SERIAL_EOL(); + } #if AXIS_HAS_STEALTHCHOP(X2) const bool chop_x2 = stepperX2.get_stealthChop_status(); @@ -3318,33 +3324,35 @@ void MarlinSettings::reset() { constexpr bool chop_z2 = false; #endif - if (chop_x2 || chop_y2 || chop_z2) say_M569(PSTR("I1")); - if (chop_x2) SERIAL_ECHOPGM(" X"); - if (chop_y2) SERIAL_ECHOPGM(" Y"); - if (chop_z2) SERIAL_ECHOPGM(" Z"); - if (chop_x2 || chop_y2 || chop_z2) SERIAL_EOL(); + if (chop_x2 || chop_y2 || chop_z2) { + say_M569(forReplay, PSTR("I1")); + if (chop_x2) SERIAL_ECHOPGM(" X"); + if (chop_y2) SERIAL_ECHOPGM(" Y"); + if (chop_z2) SERIAL_ECHOPGM(" Z"); + SERIAL_EOL(); + } #if AXIS_HAS_STEALTHCHOP(Z3) - if (stepperZ3.get_stealthChop_status()) { say_M569(PSTR("I2 Z")); } + if (stepperZ3.get_stealthChop_status()) { say_M569(forReplay, PSTR("I2 Z"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E0) - if (stepperE0.get_stealthChop_status()) { say_M569(PSTR("T0 E")); } + if (stepperE0.get_stealthChop_status()) { say_M569(forReplay, PSTR("T0 E"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E1) - if (stepperE1.get_stealthChop_status()) { say_M569(PSTR("T1 E")); } + if (stepperE1.get_stealthChop_status()) { say_M569(forReplay, PSTR("T1 E"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E2) - if (stepperE2.get_stealthChop_status()) { say_M569(PSTR("T2 E")); } + if (stepperE2.get_stealthChop_status()) { say_M569(forReplay, PSTR("T2 E"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E3) - if (stepperE3.get_stealthChop_status()) { say_M569(PSTR("T3 E")); } + if (stepperE3.get_stealthChop_status()) { say_M569(forReplay, PSTR("T3 E"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E4) - if (stepperE4.get_stealthChop_status()) { say_M569(PSTR("T4 E")); } + if (stepperE4.get_stealthChop_status()) { say_M569(forReplay, PSTR("T4 E"), true); } #endif #if AXIS_HAS_STEALTHCHOP(E5) - if (stepperE5.get_stealthChop_status()) { say_M569(PSTR("T5 E")); } + if (stepperE5.get_stealthChop_status()) { say_M569(forReplay, PSTR("T5 E"), true); } #endif #endif // HAS_STEALTHCHOP diff --git a/Marlin/src/module/delta.cpp b/Marlin/src/module/delta.cpp index 88485605b9..b1b943b944 100644 --- a/Marlin/src/module/delta.cpp +++ b/Marlin/src/module/delta.cpp @@ -43,7 +43,7 @@ #if ENABLED(SENSORLESS_HOMING) #include "../feature/tmc_util.h" - #include "stepper_indirection.h" + #include "stepper/indirection.h" #endif #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) @@ -101,12 +101,8 @@ void recalc_delta_settings() { */ #define DELTA_DEBUG(VAR) do { \ - SERIAL_ECHOPAIR("cartesian X:", VAR[X_AXIS]); \ - SERIAL_ECHOPAIR(" Y:", VAR[Y_AXIS]); \ - SERIAL_ECHOLNPAIR(" Z:", VAR[Z_AXIS]); \ - SERIAL_ECHOPAIR("delta A:", delta[A_AXIS]); \ - SERIAL_ECHOPAIR(" B:", delta[B_AXIS]); \ - SERIAL_ECHOLNPAIR(" C:", delta[C_AXIS]); \ + SERIAL_ECHOLNPAIR("Cartesian X", VAR[X_AXIS], " Y", VAR[Y_AXIS], " Z", VAR[Z_AXIS]); \ + SERIAL_ECHOLNPAIR("Delta A", delta[A_AXIS], " B", delta[B_AXIS], " C", delta[C_AXIS]); \ }while(0) void inverse_kinematics(const float (&raw)[XYZ]) { @@ -235,12 +231,12 @@ void home_delta() { #endif // Move all carriages together linearly until an endstop is hit. - destination[Z_AXIS] = (delta_height + current_position[Z_AXIS] = (delta_height + 10 #if HAS_BED_PROBE - - zprobe_zoffset + - probe_offset[Z_AXIS] #endif - + 10); - buffer_line_to_destination(homing_feedrate(X_AXIS)); + ); + line_to_current_position(homing_feedrate(X_AXIS)); planner.synchronize(); // Re-enable stealthChop if used. Disable diag1 pin on driver. diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index b1a4f9e57f..6970a051b3 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -44,6 +44,10 @@ #include "../feature/bltouch.h" #endif +#if ENABLED(JOYSTICK) + #include "../feature/joystick.h" +#endif + Endstops endstops; // private: @@ -369,7 +373,7 @@ void Endstops::event_handler() { SERIAL_EOL(); #if HAS_SPI_LCD - ui.status_printf_P(0, PSTR(MSG_LCD_ENDSTOPS " %c %c %c %c"), chrX, chrY, chrZ, chrP); + ui.status_printf_P(0, PSTR(S_FMT " %c %c %c %c"), PSTR(MSG_LCD_ENDSTOPS), chrX, chrY, chrZ, chrP); #endif #if BOTH(SD_ABORT_ON_ENDSTOP_HIT, SDSUPPORT) @@ -474,6 +478,11 @@ void _O2 Endstops::M119() { #if ENABLED(BLTOUCH) bltouch._reset_SW_mode(); #endif + + #if ENABLED(JOYSTICK_DEBUG) + joystick.report(); + #endif + } // Endstops::M119 // The following routines are called from an ISR context. It could be the temperature ISR, the diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index a31f1c08e5..928bb65ac0 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -105,7 +105,7 @@ float current_position[XYZE] = { X_HOME_POS, Y_HOME_POS, Z_HOME_POS }; * Cartesian Destination * The destination for a move, filled in by G-code movement commands, * and expected by functions like 'prepare_move_to_destination'. - * Set with 'get_destination_from_command' or 'set_destination_from_current'. + * G-codes can set destination using 'get_destination_from_command' */ float destination[XYZE]; // = { 0 } @@ -134,12 +134,11 @@ float destination[XYZE]; // = { 0 } // no other feedrate is specified. Overridden for special moves. // Set by the last G0 through G5 command's "F" parameter. // Functions that override this for custom moves *must always* restore it! -float feedrate_mm_s = MMM_TO_MMS(1500.0f); - +feedRate_t feedrate_mm_s = MMM_TO_MMS(1500); int16_t feedrate_percentage = 100; // Homing feedrate is const progmem - compare to constexpr in the header -const float homing_feedrate_mm_s[XYZ] PROGMEM = { +const feedRate_t homing_feedrate_mm_s[XYZ] PROGMEM = { #if ENABLED(DELTA) MMM_TO_MMS(HOMING_FEEDRATE_Z), MMM_TO_MMS(HOMING_FEEDRATE_Z), #else @@ -285,29 +284,21 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { * Move the planner to the current position from wherever it last moved * (or from wherever it has been told it is located). */ -void line_to_current_position(const float &fr_mm_s/*=feedrate_mm_s*/) { - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], fr_mm_s, active_extruder); -} - -/** - * Move the planner to the position stored in the destination array, which is - * used by G0/G1/G2/G3/G5 and many other functions to set a destination. - */ -void buffer_line_to_destination(const float fr_mm_s) { - planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], fr_mm_s, active_extruder); +void line_to_current_position(const feedRate_t &fr_mm_s/*=feedrate_mm_s*/) { + planner.buffer_line(current_position, fr_mm_s, active_extruder); } #if IS_KINEMATIC /** - * Calculate delta, start a line, and set current_position to destination + * Buffer a fast move without interpolation. Set current_position to destination */ - void prepare_uninterpolated_move_to_destination(const float &fr_mm_s/*=0.0*/) { - if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_uninterpolated_move_to_destination", destination); + void prepare_fast_move_to_destination(const feedRate_t &scaled_fr_mm_s/*=MMS_SCALED(feedrate_mm_s)*/) { + if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_fast_move_to_destination", destination); #if UBL_SEGMENTED - // ubl segmented line will do z-only moves in single segment - ubl.prepare_segmented_line_to(destination, MMS_SCALED(fr_mm_s ? fr_mm_s : feedrate_mm_s)); + // UBL segmented line will do Z-only moves in single segment + ubl.line_to_destination_segmented(scaled_fr_mm_s); #else if ( current_position[X_AXIS] == destination[X_AXIS] && current_position[Y_AXIS] == destination[Y_AXIS] @@ -315,7 +306,7 @@ void buffer_line_to_destination(const float fr_mm_s) { && current_position[E_AXIS] == destination[E_AXIS] ) return; - planner.buffer_line(destination, MMS_SCALED(fr_mm_s ? fr_mm_s : feedrate_mm_s), active_extruder); + planner.buffer_line(destination, scaled_fr_mm_s, active_extruder); #endif set_current_from_destination(); @@ -323,14 +314,40 @@ void buffer_line_to_destination(const float fr_mm_s) { #endif // IS_KINEMATIC +void _internal_move_to_destination(const feedRate_t &fr_mm_s/*=0.0f*/ + #if IS_KINEMATIC + , const bool is_fast/*=false*/ + #endif +) { + const feedRate_t old_feedrate = feedrate_mm_s; + if (fr_mm_s) feedrate_mm_s = fr_mm_s; + + const uint16_t old_pct = feedrate_percentage; + feedrate_percentage = 100; + + const float old_fac = planner.e_factor[active_extruder]; + planner.e_factor[active_extruder] = 1.0f; + + #if IS_KINEMATIC + if (is_fast) + prepare_fast_move_to_destination(); + else + #endif + prepare_move_to_destination(); + + feedrate_mm_s = old_feedrate; + feedrate_percentage = old_pct; + planner.e_factor[active_extruder] = old_fac; +} + /** * Plan a move to (X, Y, Z) and set the current_position */ -void do_blocking_move_to(const float rx, const float ry, const float rz, const float &fr_mm_s/*=0.0*/) { +void do_blocking_move_to(const float rx, const float ry, const float rz, const feedRate_t &fr_mm_s/*=0.0*/) { if (DEBUGGING(LEVELING)) DEBUG_XYZ(">>> do_blocking_move_to", rx, ry, rz); - const float z_feedrate = fr_mm_s ? fr_mm_s : homing_feedrate(Z_AXIS), - xy_feedrate = fr_mm_s ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S; + const feedRate_t z_feedrate = fr_mm_s ? fr_mm_s : homing_feedrate(Z_AXIS), + xy_feedrate = fr_mm_s ? fr_mm_s : feedRate_t(XY_PROBE_FEEDRATE_MM_S); #if ENABLED(DELTA) @@ -344,33 +361,33 @@ void do_blocking_move_to(const float rx, const float ry, const float rz, const f // when in the danger zone if (current_position[Z_AXIS] > delta_clip_start_height) { - if (rz > delta_clip_start_height) { // staying in the danger zone - destination[X_AXIS] = rx; // move directly (uninterpolated) + if (rz > delta_clip_start_height) { // staying in the danger zone + destination[X_AXIS] = rx; // move directly (uninterpolated) destination[Y_AXIS] = ry; destination[Z_AXIS] = rz; - prepare_uninterpolated_move_to_destination(); // set_current_from_destination() + prepare_internal_fast_move_to_destination(); // set_current_from_destination() if (DEBUGGING(LEVELING)) DEBUG_POS("danger zone move", current_position); return; } destination[Z_AXIS] = delta_clip_start_height; - prepare_uninterpolated_move_to_destination(); // set_current_from_destination() + prepare_internal_fast_move_to_destination(); // set_current_from_destination() if (DEBUGGING(LEVELING)) DEBUG_POS("zone border move", current_position); } - if (rz > current_position[Z_AXIS]) { // raising? + if (rz > current_position[Z_AXIS]) { // raising? destination[Z_AXIS] = rz; - prepare_uninterpolated_move_to_destination(z_feedrate); // set_current_from_destination() + prepare_internal_fast_move_to_destination(z_feedrate); // set_current_from_destination() if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position); } destination[X_AXIS] = rx; destination[Y_AXIS] = ry; - prepare_move_to_destination(); // set_current_from_destination() + prepare_internal_move_to_destination(); // set_current_from_destination() if (DEBUGGING(LEVELING)) DEBUG_POS("xy move", current_position); - if (rz < current_position[Z_AXIS]) { // lowering? + if (rz < current_position[Z_AXIS]) { // lowering? destination[Z_AXIS] = rz; - prepare_uninterpolated_move_to_destination(z_feedrate); // set_current_from_destination() + prepare_fast_move_to_destination(z_feedrate); // set_current_from_destination() if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position); } @@ -383,17 +400,17 @@ void do_blocking_move_to(const float rx, const float ry, const float rz, const f // If Z needs to raise, do it before moving XY if (destination[Z_AXIS] < rz) { destination[Z_AXIS] = rz; - prepare_uninterpolated_move_to_destination(z_feedrate); + prepare_internal_fast_move_to_destination(z_feedrate); } destination[X_AXIS] = rx; destination[Y_AXIS] = ry; - prepare_uninterpolated_move_to_destination(xy_feedrate); + prepare_internal_fast_move_to_destination(xy_feedrate); // If Z needs to lower, do it after moving XY if (destination[Z_AXIS] > rz) { destination[Z_AXIS] = rz; - prepare_uninterpolated_move_to_destination(z_feedrate); + prepare_internal_fast_move_to_destination(z_feedrate); } #else @@ -420,16 +437,16 @@ void do_blocking_move_to(const float rx, const float ry, const float rz, const f planner.synchronize(); } -void do_blocking_move_to_x(const float &rx, const float &fr_mm_s/*=0.0*/) { +void do_blocking_move_to_x(const float &rx, const feedRate_t &fr_mm_s/*=0.0*/) { do_blocking_move_to(rx, current_position[Y_AXIS], current_position[Z_AXIS], fr_mm_s); } -void do_blocking_move_to_y(const float &ry, const float &fr_mm_s/*=0.0*/) { - do_blocking_move_to(current_position[Y_AXIS], ry, current_position[Z_AXIS], fr_mm_s); +void do_blocking_move_to_y(const float &ry, const feedRate_t &fr_mm_s/*=0.0*/) { + do_blocking_move_to(current_position[X_AXIS], ry, current_position[Z_AXIS], fr_mm_s); } -void do_blocking_move_to_z(const float &rz, const float &fr_mm_s/*=0.0*/) { +void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s/*=0.0*/) { do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], rz, fr_mm_s); } -void do_blocking_move_to_xy(const float &rx, const float &ry, const float &fr_mm_s/*=0.0*/) { +void do_blocking_move_to_xy(const float &rx, const float &ry, const feedRate_t &fr_mm_s/*=0.0*/) { do_blocking_move_to(rx, ry, current_position[Z_AXIS], fr_mm_s); } @@ -439,12 +456,15 @@ void do_blocking_move_to_xy(const float &rx, const float &ry, const float &fr_mm // static float saved_feedrate_mm_s; static int16_t saved_feedrate_percentage; -void setup_for_endstop_or_probe_move() { +void remember_feedrate_and_scaling() { saved_feedrate_mm_s = feedrate_mm_s; saved_feedrate_percentage = feedrate_percentage; +} +void remember_feedrate_scaling_off() { + remember_feedrate_and_scaling(); feedrate_percentage = 100; } -void clean_up_after_endstop_or_probe_move() { +void restore_feedrate_and_scaling() { feedrate_mm_s = saved_feedrate_mm_s; feedrate_percentage = saved_feedrate_percentage; } @@ -502,7 +522,7 @@ void clean_up_after_endstop_or_probe_move() { soft_endstop[axis].min = base_min_pos(axis); soft_endstop[axis].max = (axis == Z_AXIS ? delta_height #if HAS_BED_PROBE - - zprobe_zoffset + - probe_offset[Z_AXIS] #endif : base_max_pos(axis)); @@ -626,31 +646,31 @@ void clean_up_after_endstop_or_probe_move() { * small incremental moves for DELTA or SCARA. * * For Unified Bed Leveling (Delta or Segmented Cartesian) - * the ubl.prepare_segmented_line_to method replaces this. + * the ubl.line_to_destination_segmented method replaces this. * * For Auto Bed Leveling (Bilinear) with SEGMENT_LEVELED_MOVES * this is replaced by segmented_line_to_destination below. */ - inline bool prepare_kinematic_move_to(const float (&rtarget)[XYZE]) { + inline bool line_to_destination_kinematic() { // Get the top feedrate of the move in the XY plane - const float _feedrate_mm_s = MMS_SCALED(feedrate_mm_s); + const float scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s); - const float xdiff = rtarget[X_AXIS] - current_position[X_AXIS], - ydiff = rtarget[Y_AXIS] - current_position[Y_AXIS]; + const float xdiff = destination[X_AXIS] - current_position[X_AXIS], + ydiff = destination[Y_AXIS] - current_position[Y_AXIS]; // If the move is only in Z/E don't split up the move if (!xdiff && !ydiff) { - planner.buffer_line(rtarget, _feedrate_mm_s, active_extruder); + planner.buffer_line(destination, scaled_fr_mm_s, active_extruder); return false; // caller will update current_position } // Fail if attempting move outside printable radius - if (!position_is_reachable(rtarget[X_AXIS], rtarget[Y_AXIS])) return true; + if (!position_is_reachable(destination[X_AXIS], destination[Y_AXIS])) return true; // Remaining cartesian distances - const float zdiff = rtarget[Z_AXIS] - current_position[Z_AXIS], - ediff = rtarget[E_AXIS] - current_position[E_AXIS]; + const float zdiff = destination[Z_AXIS] - current_position[Z_AXIS], + ediff = destination[E_AXIS] - current_position[E_AXIS]; // Get the linear distance in XYZ float cartesian_mm = SQRT(sq(xdiff) + sq(ydiff) + sq(zdiff)); @@ -662,7 +682,7 @@ void clean_up_after_endstop_or_probe_move() { if (UNEAR_ZERO(cartesian_mm)) return true; // Minimum number of seconds to move the given distance - const float seconds = cartesian_mm / _feedrate_mm_s; + const float seconds = cartesian_mm / scaled_fr_mm_s; // The number of segments-per-second times the duration // gives the number of segments @@ -670,7 +690,7 @@ void clean_up_after_endstop_or_probe_move() { // For SCARA enforce a minimum segment size #if IS_SCARA - NOMORE(segments, cartesian_mm * (1.0f / float(SCARA_MIN_SEGMENT_LENGTH))); + NOMORE(segments, cartesian_mm * RECIPROCAL(SCARA_MIN_SEGMENT_LENGTH)); #endif // At least one segment is required @@ -687,7 +707,7 @@ void clean_up_after_endstop_or_probe_move() { cartesian_segment_mm = cartesian_mm * inv_segments; #if ENABLED(SCARA_FEEDRATE_SCALING) - const float inv_duration = _feedrate_mm_s / cartesian_segment_mm; + const float inv_duration = scaled_fr_mm_s / cartesian_segment_mm; #endif /* @@ -714,7 +734,7 @@ void clean_up_after_endstop_or_probe_move() { LOOP_XYZE(i) raw[i] += segment_distance[i]; - if (!planner.buffer_line(raw, _feedrate_mm_s, active_extruder, cartesian_segment_mm + if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, cartesian_segment_mm #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif @@ -723,7 +743,7 @@ void clean_up_after_endstop_or_probe_move() { } // Ensure last segment arrives at target location. - planner.buffer_line(rtarget, _feedrate_mm_s, active_extruder, cartesian_segment_mm + planner.buffer_line(destination, scaled_fr_mm_s, active_extruder, cartesian_segment_mm #if ENABLED(SCARA_FEEDRATE_SCALING) , inv_duration #endif @@ -743,7 +763,7 @@ void clean_up_after_endstop_or_probe_move() { * small incremental moves. This allows the planner to * apply more detailed bed leveling to the full move. */ - inline void segmented_line_to_destination(const float &fr_mm_s, const float segment_size=LEVELED_SEGMENT_LENGTH) { + inline void segmented_line_to_destination(const feedRate_t &fr_mm_s, const float segment_size=LEVELED_SEGMENT_LENGTH) { const float xdiff = destination[X_AXIS] - current_position[X_AXIS], ydiff = destination[Y_AXIS] - current_position[Y_AXIS]; @@ -781,7 +801,7 @@ void clean_up_after_endstop_or_probe_move() { }; #if ENABLED(SCARA_FEEDRATE_SCALING) - const float inv_duration = _feedrate_mm_s / cartesian_segment_mm; + const float inv_duration = scaled_fr_mm_s / cartesian_segment_mm; #endif // SERIAL_ECHOPAIR("mm=", cartesian_mm); @@ -829,13 +849,14 @@ void clean_up_after_endstop_or_probe_move() { * Returns true if current_position[] was set to destination[] */ inline bool prepare_move_to_destination_cartesian() { + const float scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s); #if HAS_MESH if (planner.leveling_active && planner.leveling_active_at_z(destination[Z_AXIS])) { #if ENABLED(AUTO_BED_LEVELING_UBL) - ubl.line_to_destination_cartesian(MMS_SCALED(feedrate_mm_s), active_extruder); // UBL's motion routine needs to know about - return true; // all moves, including Z-only moves. + ubl.line_to_destination_cartesian(scaled_fr_mm_s, active_extruder); // UBL's motion routine needs to know about + return true; // all moves, including Z-only moves. #elif ENABLED(SEGMENT_LEVELED_MOVES) - segmented_line_to_destination(MMS_SCALED(feedrate_mm_s)); + segmented_line_to_destination(scaled_fr_mm_s); return false; // caller will update current_position #else /** @@ -844,9 +865,9 @@ void clean_up_after_endstop_or_probe_move() { */ if (current_position[X_AXIS] != destination[X_AXIS] || current_position[Y_AXIS] != destination[Y_AXIS]) { #if ENABLED(MESH_BED_LEVELING) - mbl.line_to_destination(MMS_SCALED(feedrate_mm_s)); + mbl.line_to_destination(scaled_fr_mm_s); #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - bilinear_line_to_destination(MMS_SCALED(feedrate_mm_s)); + bilinear_line_to_destination(scaled_fr_mm_s); #endif return true; } @@ -854,7 +875,7 @@ void clean_up_after_endstop_or_probe_move() { } #endif // HAS_MESH - buffer_line_to_destination(MMS_SCALED(feedrate_mm_s)); + planner.buffer_line(destination, scaled_fr_mm_s, active_extruder); return false; // caller will update current_position } @@ -968,6 +989,8 @@ void clean_up_after_endstop_or_probe_move() { * * Make sure current_position[E] and destination[E] are good * before calling or cold/lengthy extrusion may get missed. + * + * Before exit, current_position is set to destination. */ void prepare_move_to_destination() { apply_motion_limits(destination); @@ -1011,14 +1034,13 @@ void prepare_move_to_destination() { if ( #if UBL_SEGMENTED - //ubl.prepare_segmented_line_to(destination, MMS_SCALED(feedrate_mm_s)) // This doesn't seem to work correctly on UBL. - #if IS_KINEMATIC // Use Kinematic / Cartesian cases as a workaround for now. - ubl.prepare_segmented_line_to(destination, MMS_SCALED(feedrate_mm_s)) + #if IS_KINEMATIC // UBL using Kinematic / Cartesian cases as a workaround for now. + ubl.line_to_destination_segmented(MMS_SCALED(feedrate_mm_s)) #else prepare_move_to_destination_cartesian() #endif #elif IS_KINEMATIC - prepare_kinematic_move_to(destination) + line_to_destination_kinematic() #else prepare_move_to_destination_cartesian() #endif @@ -1027,26 +1049,32 @@ void prepare_move_to_destination() { set_current_from_destination(); } -bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool z/*=true*/) { +uint8_t axes_need_homing(uint8_t axis_bits/*=0x07*/) { #if ENABLED(HOME_AFTER_DEACTIVATE) - const bool xx = x && !TEST(axis_known_position, X_AXIS), - yy = y && !TEST(axis_known_position, Y_AXIS), - zz = z && !TEST(axis_known_position, Z_AXIS); + #define HOMED_FLAGS axis_known_position #else - const bool xx = x && !TEST(axis_homed, X_AXIS), - yy = y && !TEST(axis_homed, Y_AXIS), - zz = z && !TEST(axis_homed, Z_AXIS); + #define HOMED_FLAGS axis_homed #endif - if (xx || yy || zz) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_HOME " "); - if (xx) SERIAL_CHAR('X'); - if (yy) SERIAL_CHAR('Y'); - if (zz) SERIAL_CHAR('Z'); - SERIAL_ECHOLNPGM(" " MSG_FIRST); + // Clear test bits that are homed + if (TEST(axis_bits, X_AXIS) && TEST(HOMED_FLAGS, X_AXIS)) CBI(axis_bits, X_AXIS); + if (TEST(axis_bits, Y_AXIS) && TEST(HOMED_FLAGS, Y_AXIS)) CBI(axis_bits, Y_AXIS); + if (TEST(axis_bits, Z_AXIS) && TEST(HOMED_FLAGS, Z_AXIS)) CBI(axis_bits, Z_AXIS); + return axis_bits; +} +bool axis_unhomed_error(uint8_t axis_bits/*=0x07*/) { + if ((axis_bits = axes_need_homing(axis_bits))) { + static const char home_first[] PROGMEM = MSG_HOME_FIRST; + char msg[sizeof(home_first)]; + sprintf_P(msg, home_first, + TEST(axis_bits, X_AXIS) ? "X" : "", + TEST(axis_bits, Y_AXIS) ? "Y" : "", + TEST(axis_bits, Z_AXIS) ? "Z" : "" + ); + SERIAL_ECHO_START(); + SERIAL_ECHOLN(msg); #if HAS_DISPLAY - ui.status_printf_P(0, PSTR(MSG_HOME " %s%s%s " MSG_FIRST), xx ? MSG_X : "", yy ? MSG_Y : "", zz ? MSG_Z : ""); + ui.set_status(msg); #endif return true; } @@ -1056,7 +1084,7 @@ bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool /** * Homing bump feedrate (mm/s) */ -float get_homing_bump_feedrate(const AxisEnum axis) { +feedRate_t get_homing_bump_feedrate(const AxisEnum axis) { #if HOMING_Z_WITH_PROBE if (axis == Z_AXIS) return MMM_TO_MMS(Z_PROBE_SPEED_SLOW); #endif @@ -1066,7 +1094,7 @@ float get_homing_bump_feedrate(const AxisEnum axis) { hbd = 10; SERIAL_ECHO_MSG("Warning: Homing Bump Divisor < 1"); } - return homing_feedrate(axis) / hbd; + return homing_feedrate(axis) / float(hbd); } #if ENABLED(SENSORLESS_HOMING) @@ -1212,7 +1240,7 @@ float get_homing_bump_feedrate(const AxisEnum axis) { /** * Home an individual linear axis */ -void do_homing_move(const AxisEnum axis, const float distance, const float fr_mm_s=0.0) { +void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t fr_mm_s=0.0) { if (DEBUGGING(LEVELING)) { DEBUG_ECHOPAIR(">>> do_homing_move(", axis_codes[axis], ", ", distance, ", "); @@ -1257,12 +1285,13 @@ void do_homing_move(const AxisEnum axis, const float distance, const float fr_mm #endif } + const feedRate_t real_fr_mm_s = fr_mm_s ? fr_mm_s : homing_feedrate(axis); #if IS_SCARA // Tell the planner the axis is at 0 current_position[axis] = 0; sync_plan_position(); current_position[axis] = distance; - planner.buffer_line(current_position, fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder); + line_to_current_position(real_fr_mm_s); #else float target[ABCE] = { planner.get_axis_position_mm(A_AXIS), planner.get_axis_position_mm(B_AXIS), planner.get_axis_position_mm(C_AXIS), planner.get_axis_position_mm(E_AXIS) }; target[axis] = 0; @@ -1278,7 +1307,7 @@ void do_homing_move(const AxisEnum axis, const float distance, const float fr_mm #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) , delta_mm_cart #endif - , fr_mm_s ? fr_mm_s : homing_feedrate(axis), active_extruder + , real_fr_mm_s, active_extruder ); #endif @@ -1325,11 +1354,6 @@ void set_axis_is_at_home(const AxisEnum axis) { SBI(axis_known_position, axis); SBI(axis_homed, axis); - #if HAS_POSITION_SHIFT - position_shift[axis] = 0; - update_workspace_offset(axis); - #endif - #if ENABLED(DUAL_X_CARRIAGE) if (axis == X_AXIS && (active_extruder == 1 || dual_x_carriage_mode == DXC_DUPLICATION_MODE)) { current_position[X_AXIS] = x_home_pos(active_extruder); @@ -1342,7 +1366,7 @@ void set_axis_is_at_home(const AxisEnum axis) { #elif ENABLED(DELTA) current_position[axis] = (axis == Z_AXIS ? delta_height #if HAS_BED_PROBE - - zprobe_zoffset + - probe_offset[Z_AXIS] #endif : base_home_pos(axis)); #else @@ -1356,9 +1380,9 @@ void set_axis_is_at_home(const AxisEnum axis) { if (axis == Z_AXIS) { #if HOMING_Z_WITH_PROBE - current_position[Z_AXIS] -= zprobe_zoffset; + current_position[Z_AXIS] -= probe_offset[Z_AXIS]; - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***\n> zprobe_zoffset = ", zprobe_zoffset); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***\n> probe_offset[Z_AXIS] = ", probe_offset[Z_AXIS]); #else @@ -1503,7 +1527,7 @@ void homeaxis(const AxisEnum axis) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Move Away:"); do_homing_move(axis, -bump #if HOMING_Z_WITH_PROBE - , axis == Z_AXIS ? MMM_TO_MMS(Z_PROBE_SPEED_FAST) : 0.0 + , MMM_TO_MMS(axis == Z_AXIS ? Z_PROBE_SPEED_FAST : 0) #endif ); @@ -1663,7 +1687,12 @@ void homeaxis(const AxisEnum axis) { ]; if (backoff_mm) { current_position[axis] -= ABS(backoff_mm) * axis_home_dir; - line_to_current_position(Z_PROBE_SPEED_FAST); + line_to_current_position( + #if HOMING_Z_WITH_PROBE + (axis == Z_AXIS) ? MMM_TO_MMS(Z_PROBE_SPEED_FAST) : + #endif + homing_feedrate(axis) + ); } #endif diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index 7c637f9cb8..9c465a1d59 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -30,6 +30,10 @@ #include "../inc/MarlinConfig.h" +#if HAS_BED_PROBE + #include "probe.h" +#endif + #if IS_SCARA #include "scara.h" #endif @@ -81,17 +85,16 @@ extern float cartes[XYZ]; * Feed rates are often configured with mm/m * but the planner and stepper like mm/s units. */ -extern const float homing_feedrate_mm_s[XYZ]; -FORCE_INLINE float homing_feedrate(const AxisEnum a) { return pgm_read_float(&homing_feedrate_mm_s[a]); } -float get_homing_bump_feedrate(const AxisEnum axis); +extern const feedRate_t homing_feedrate_mm_s[XYZ]; +FORCE_INLINE feedRate_t homing_feedrate(const AxisEnum a) { return pgm_read_float(&homing_feedrate_mm_s[a]); } +feedRate_t get_homing_bump_feedrate(const AxisEnum axis); -extern float feedrate_mm_s; +extern feedRate_t feedrate_mm_s; /** - * Feedrate scaling and conversion + * Feedrate scaling */ extern int16_t feedrate_percentage; -#define MMS_SCALED(MM_S) ((MM_S)*feedrate_percentage*0.01f) // The active extruder (tool). Set with T command. #if EXTRUDERS > 1 @@ -124,8 +127,10 @@ XYZ_DEFS(signed char, home_dir, HOME_DIR); #if HAS_HOTEND_OFFSET extern float hotend_offset[XYZ][HOTENDS]; void reset_hotend_offsets(); -#else +#elif HOTENDS > 0 constexpr float hotend_offset[XYZ][HOTENDS] = { { 0 }, { 0 }, { 0 } }; +#else + constexpr float hotend_offset[XYZ][1] = { { 0 }, { 0 }, { 0 } }; #endif typedef struct { float min, max; } axis_limits_t; @@ -166,45 +171,55 @@ void sync_plan_position_e(); * Move the planner to the current position from wherever it last moved * (or from wherever it has been told it is located). */ -void line_to_current_position(const float &fr_mm_s=feedrate_mm_s); - -/** - * Move the planner to the position stored in the destination array, which is - * used by G0/G1/G2/G3/G5 and many other functions to set a destination. - */ -void buffer_line_to_destination(const float fr_mm_s); - -#if IS_KINEMATIC - void prepare_uninterpolated_move_to_destination(const float &fr_mm_s=0); -#endif +void line_to_current_position(const feedRate_t &fr_mm_s=feedrate_mm_s); void prepare_move_to_destination(); +void _internal_move_to_destination(const feedRate_t &fr_mm_s=0.0f + #if IS_KINEMATIC + , const bool is_fast=false + #endif +); + +inline void prepare_internal_move_to_destination(const feedRate_t &fr_mm_s=0.0f) { + _internal_move_to_destination(fr_mm_s); +} + +#if IS_KINEMATIC + void prepare_fast_move_to_destination(const feedRate_t &scaled_fr_mm_s=MMS_SCALED(feedrate_mm_s)); + + inline void prepare_internal_fast_move_to_destination(const feedRate_t &fr_mm_s=0.0f) { + _internal_move_to_destination(fr_mm_s, true); + } +#endif + /** * Blocking movement and shorthand functions */ -void do_blocking_move_to(const float rx, const float ry, const float rz, const float &fr_mm_s=0); -void do_blocking_move_to_x(const float &rx, const float &fr_mm_s=0); -void do_blocking_move_to_y(const float &ry, const float &fr_mm_s=0); -void do_blocking_move_to_z(const float &rz, const float &fr_mm_s=0); -void do_blocking_move_to_xy(const float &rx, const float &ry, const float &fr_mm_s=0); +void do_blocking_move_to(const float rx, const float ry, const float rz, const feedRate_t &fr_mm_s=0.0f); +void do_blocking_move_to_x(const float &rx, const feedRate_t &fr_mm_s=0.0f); +void do_blocking_move_to_y(const float &ry, const feedRate_t &fr_mm_s=0.0f); +void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s=0.0f); +void do_blocking_move_to_xy(const float &rx, const float &ry, const feedRate_t &fr_mm_s=0.0f); -FORCE_INLINE void do_blocking_move_to(const float (&raw)[XYZ], const float &fr_mm_s=0) { +FORCE_INLINE void do_blocking_move_to(const float (&raw)[XYZ], const feedRate_t &fr_mm_s=0) { do_blocking_move_to(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], fr_mm_s); } -FORCE_INLINE void do_blocking_move_to(const float (&raw)[XYZE], const float &fr_mm_s=0) { +FORCE_INLINE void do_blocking_move_to(const float (&raw)[XYZE], const feedRate_t &fr_mm_s=0) { do_blocking_move_to(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], fr_mm_s); } -void setup_for_endstop_or_probe_move(); -void clean_up_after_endstop_or_probe_move(); +void remember_feedrate_and_scaling(); +void remember_feedrate_scaling_off(); +void restore_feedrate_and_scaling(); // // Homing // -bool axis_unhomed_error(const bool x=true, const bool y=true, const bool z=true); +uint8_t axes_need_homing(uint8_t axis_bits=0x07); +bool axis_unhomed_error(uint8_t axis_bits=0x07); #if ENABLED(NO_MOTION_BEFORE_HOMING) #define MOTION_CONDITIONS (IsRunning() && !axis_unhomed_error()) @@ -254,11 +269,6 @@ void homeaxis(const AxisEnum axis); */ #if IS_KINEMATIC // (DELTA or SCARA) - - #if IS_SCARA - extern const float L1, L2; - #endif - #if HAS_SCARA_OFFSET extern float scara_home_offset[ABC]; // A and B angular offsets, Z mm offset #endif @@ -282,7 +292,7 @@ void homeaxis(const AxisEnum axis); // Return true if the both nozzle and the probe can reach the given point. // Note: This won't work on SCARA since the probe offset rotates with the arm. inline bool position_is_reachable_by_probe(const float &rx, const float &ry) { - return position_is_reachable(rx - (X_PROBE_OFFSET_FROM_EXTRUDER), ry - (Y_PROBE_OFFSET_FROM_EXTRUDER)) + return position_is_reachable(rx - probe_offset[X_AXIS], ry - probe_offset[Y_AXIS]) && position_is_reachable(rx, ry, ABS(MIN_PROBE_EDGE)); } #endif @@ -311,9 +321,9 @@ void homeaxis(const AxisEnum axis); * nozzle must be be able to reach +10,-10. */ inline bool position_is_reachable_by_probe(const float &rx, const float &ry) { - return position_is_reachable(rx - (X_PROBE_OFFSET_FROM_EXTRUDER), ry - (Y_PROBE_OFFSET_FROM_EXTRUDER)) - && WITHIN(rx, MIN_PROBE_X - slop, MAX_PROBE_X + slop) - && WITHIN(ry, MIN_PROBE_Y - slop, MAX_PROBE_Y + slop); + return position_is_reachable(rx - probe_offset[X_AXIS], ry - probe_offset[Y_AXIS]) + && WITHIN(rx, probe_min_x() - slop, probe_max_x() + slop) + && WITHIN(ry, probe_min_y() - slop, probe_max_y() + slop); } #endif diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 56695f3a9b..2715221f32 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -96,6 +96,10 @@ #include "../feature/backlash.h" #endif +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../feature/power_loss_recovery.h" +#endif + // Delay for delivery of first block to the stepper ISR, if the queue contains 2 or // fewer movements. The delay is measured in milliseconds, and must be less than 250ms #define BLOCK_DELAY_FOR_1ST_MOVE 100 @@ -147,9 +151,10 @@ float Planner::steps_to_mm[XYZE_N]; // (mm) Millimeters per step uint8_t Planner::last_extruder = 0; // Respond to extruder change #endif -int16_t Planner::flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100); // Extrusion factor for each extruder - -float Planner::e_factor[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(1.0f); // The flow percentage and volumetric multiplier combine to scale E movement +#if EXTRUDERS + int16_t Planner::flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100); // Extrusion factor for each extruder + float Planner::e_factor[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(1.0f); // The flow percentage and volumetric multiplier combine to scale E movement +#endif #if DISABLED(NO_VOLUMETRICS) float Planner::filament_size[EXTRUDERS], // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder @@ -994,23 +999,23 @@ void Planner::forward_pass() { // pass will never modify the values at the tail. uint8_t block_index = block_buffer_planned; - block_t *current; + block_t *block; const block_t * previous = nullptr; while (block_index != block_buffer_head) { // Perform the forward pass - current = &block_buffer[block_index]; + block = &block_buffer[block_index]; // Skip SYNC blocks - if (!TEST(current->flag, BLOCK_BIT_SYNC_POSITION)) { + if (!TEST(block->flag, BLOCK_BIT_SYNC_POSITION)) { // If there's no previous block or the previous block is not // BUSY (thus, modifiable) run the forward_pass_kernel. Otherwise, // the previous block became BUSY, so assume the current block's // entry speed can't be altered (since that would also require // updating the exit speed of the previous block). if (!previous || !stepper.is_block_busy(previous)) - forward_pass_kernel(previous, current, block_index); - previous = current; + forward_pass_kernel(previous, block, block_index); + previous = block; } // Advance to the previous block_index = next_block_index(block_index); @@ -1045,7 +1050,7 @@ void Planner::recalculate_trapezoids() { } // Go from the tail (currently executed block) to the first block, without including it) - block_t *current = nullptr, *next = nullptr; + block_t *block = nullptr, *next = nullptr; float current_entry_speed = 0.0, next_entry_speed = 0.0; while (block_index != head_block_index) { @@ -1055,41 +1060,41 @@ void Planner::recalculate_trapezoids() { if (!TEST(next->flag, BLOCK_BIT_SYNC_POSITION)) { next_entry_speed = SQRT(next->entry_speed_sqr); - if (current) { + if (block) { // Recalculate if current block entry or exit junction speed has changed. - if (TEST(current->flag, BLOCK_BIT_RECALCULATE) || TEST(next->flag, BLOCK_BIT_RECALCULATE)) { + if (TEST(block->flag, BLOCK_BIT_RECALCULATE) || TEST(next->flag, BLOCK_BIT_RECALCULATE)) { // Mark the current block as RECALCULATE, to protect it from the Stepper ISR running it. // Note that due to the above condition, there's a chance the current block isn't marked as // RECALCULATE yet, but the next one is. That's the reason for the following line. - SBI(current->flag, BLOCK_BIT_RECALCULATE); + SBI(block->flag, BLOCK_BIT_RECALCULATE); // But there is an inherent race condition here, as the block maybe // became BUSY, just before it was marked as RECALCULATE, so check // if that is the case! - if (!stepper.is_block_busy(current)) { + if (!stepper.is_block_busy(block)) { // Block is not BUSY, we won the race against the Stepper ISR: // NOTE: Entry and exit factors always > 0 by all previous logic operations. - const float current_nominal_speed = SQRT(current->nominal_speed_sqr), + const float current_nominal_speed = SQRT(block->nominal_speed_sqr), nomr = 1.0f / current_nominal_speed; - calculate_trapezoid_for_block(current, current_entry_speed * nomr, next_entry_speed * nomr); + calculate_trapezoid_for_block(block, current_entry_speed * nomr, next_entry_speed * nomr); #if ENABLED(LIN_ADVANCE) - if (current->use_advance_lead) { - const float comp = current->e_D_ratio * extruder_advance_K[active_extruder] * settings.axis_steps_per_mm[E_AXIS]; - current->max_adv_steps = current_nominal_speed * comp; - current->final_adv_steps = next_entry_speed * comp; + if (block->use_advance_lead) { + const float comp = block->e_D_ratio * extruder_advance_K[active_extruder] * settings.axis_steps_per_mm[E_AXIS]; + block->max_adv_steps = current_nominal_speed * comp; + block->final_adv_steps = next_entry_speed * comp; } #endif } // Reset current only to ensure next trapezoid is computed - The // stepper is free to use the block from now on. - CBI(current->flag, BLOCK_BIT_RECALCULATE); + CBI(block->flag, BLOCK_BIT_RECALCULATE); } } - current = next; + block = next; current_entry_speed = next_entry_speed; } @@ -1107,7 +1112,7 @@ void Planner::recalculate_trapezoids() { // But there is an inherent race condition here, as the block maybe // became BUSY, just before it was marked as RECALCULATE, so check // if that is the case! - if (!stepper.is_block_busy(current)) { + if (!stepper.is_block_busy(block)) { // Block is not BUSY, we won the race against the Stepper ISR: const float next_nominal_speed = SQRT(next->nominal_speed_sqr), @@ -1169,7 +1174,10 @@ void Planner::recalculate() { * Maintain fans, paste extruder pressure, */ void Planner::check_axes_activity() { - uint8_t axis_active[NUM_AXIS] = { 0 }; + + #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_E) + uint8_t axis_active[NUM_AXIS] = { 0 }; + #endif #if FAN_COUNT > 0 uint8_t tail_fan_speed[FAN_COUNT]; @@ -1185,10 +1193,9 @@ void Planner::check_axes_activity() { #endif if (has_blocks_queued()) { - block_t* block; #if FAN_COUNT > 0 || ENABLED(BARICUDA) - block = &block_buffer[block_buffer_tail]; + block_t *block = &block_buffer[block_buffer_tail]; #endif #if FAN_COUNT > 0 @@ -1205,10 +1212,12 @@ void Planner::check_axes_activity() { #endif #endif - for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { - block = &block_buffer[b]; - LOOP_XYZE(i) if (block->steps[i]) axis_active[i]++; - } + #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_E) + for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { + block_t *block = &block_buffer[b]; + LOOP_XYZE(i) if (block->steps[i]) axis_active[i] = true; + } + #endif } else { #if FAN_COUNT > 0 @@ -1327,14 +1336,14 @@ void Planner::check_axes_activity() { * into a volumetric multiplier. Conversion differs when using * linear extrusion vs volumetric extrusion. */ - void Planner::calculate_volumetric_for_width_sensor(const int8_t encoded_ratio) { + void Planner::apply_filament_width_sensor(const int8_t encoded_ratio) { // Reconstitute the nominal/measured ratio const float nom_meas_ratio = 1 + 0.01f * encoded_ratio, ratio_2 = sq(nom_meas_ratio); volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = parser.volumetric_enabled - ? ratio_2 / CIRCLE_AREA(filament_width_nominal * 0.5f) // Volumetric uses a true volumetric multiplier - : ratio_2; // Linear squares the ratio, which scales the volume + ? ratio_2 / CIRCLE_AREA(filwidth.nominal_mm * 0.5f) // Volumetric uses a true volumetric multiplier + : ratio_2; // Linear squares the ratio, which scales the volume refresh_e_factor(FILAMENT_SENSOR_EXTRUDER_NUM); } @@ -1512,14 +1521,14 @@ float Planner::get_axis_position_mm(const AxisEnum axis) { const bool was_enabled = STEPPER_ISR_ENABLED(); if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - // ((a1+a2)+(a1-a2))/2 -> (a1+a2+a1-a2)/2 -> (a1+a1)/2 -> a1 - // ((a1+a2)-(a1-a2))/2 -> (a1+a2-a1+a2)/2 -> (a2+a2)/2 -> a2 - axis_steps = 0.5f * ( - axis == CORE_AXIS_2 ? CORESIGN(stepper.position(CORE_AXIS_1) - stepper.position(CORE_AXIS_2)) - : stepper.position(CORE_AXIS_1) + stepper.position(CORE_AXIS_2) - ); + const int32_t p1 = stepper.position(CORE_AXIS_1), + p2 = stepper.position(CORE_AXIS_2); if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); + + // ((a1+a2)+(a1-a2))/2 -> (a1+a2+a1-a2)/2 -> (a1+a1)/2 -> a1 + // ((a1+a2)-(a1-a2))/2 -> (a1+a2-a1+a2)/2 -> (a2+a2)/2 -> a2 + axis_steps = (axis == CORE_AXIS_2 ? CORESIGN(p1 - p2) : p1 + p2) * 0.5f; } else axis_steps = stepper.position(axis); @@ -1546,11 +1555,11 @@ void Planner::synchronize() { * * Add a new linear movement to the planner queue (in terms of steps). * - * target - target position in steps units - * target_float - target position in direct (mm, degrees) units. optional - * fr_mm_s - (target) speed of the move - * extruder - target extruder - * millimeters - the length of the movement, if known + * target - target position in steps units + * target_float - target position in direct (mm, degrees) units. optional + * fr_mm_s - (target) speed of the move + * extruder - target extruder + * millimeters - the length of the movement, if known * * Returns true if movement was properly queued, false otherwise */ @@ -1561,7 +1570,7 @@ bool Planner::_buffer_steps(const int32_t (&target)[XYZE] #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) , const float (&delta_mm_cart)[XYZE] #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters + , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters ) { // If we are cleaning, do not accept queuing of movements @@ -1625,26 +1634,28 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) , const float (&delta_mm_cart)[XYZE] #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/ + , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/ ) { const int32_t da = target[A_AXIS] - position[A_AXIS], db = target[B_AXIS] - position[B_AXIS], dc = target[C_AXIS] - position[C_AXIS]; - int32_t de = target[E_AXIS] - position[E_AXIS]; + #if EXTRUDERS + int32_t de = target[E_AXIS] - position[E_AXIS]; + #else + constexpr int32_t de = 0; + #endif /* <-- add a slash to enable - SERIAL_ECHOPAIR(" _populate_block FR:", fr_mm_s); - SERIAL_ECHOPAIR(" A:", target[A_AXIS]); - SERIAL_ECHOPAIR(" (", da); - SERIAL_ECHOPAIR(" steps) B:", target[B_AXIS]); - SERIAL_ECHOPAIR(" (", db); - SERIAL_ECHOPAIR(" steps) C:", target[C_AXIS]); - SERIAL_ECHOPAIR(" (", dc); - SERIAL_ECHOPAIR(" steps) E:", target[E_AXIS]); - SERIAL_ECHOPAIR(" (", de); - SERIAL_ECHOLNPGM(" steps)"); + SERIAL_ECHOLNPAIR(" _populate_block FR:", fr_mm_s, + " A:", target[A_AXIS], " (", da, " steps)" + " B:", target[B_AXIS], " (", db, " steps)" + " C:", target[C_AXIS], " (", dc, " steps)" + #if EXTRUDERS + " E:", target[E_AXIS], " (", de, " steps)" + #endif + ); //*/ #if EITHER(PREVENT_COLD_EXTRUSION, PREVENT_LENGTHY_EXTRUDE) @@ -1712,8 +1723,12 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif if (de < 0) SBI(dm, E_AXIS); - const float esteps_float = de * e_factor[extruder]; - const uint32_t esteps = ABS(esteps_float) + 0.5f; + #if EXTRUDERS + const float esteps_float = de * e_factor[extruder]; + const uint32_t esteps = ABS(esteps_float) + 0.5f; + #else + constexpr uint32_t esteps = 0; + #endif // Clear all flags, including the "busy" bit block->flag = 0x00; @@ -1781,10 +1796,17 @@ bool Planner::_populate_block(block_t * const block, bool split_move, delta_mm[B_AXIS] = db * steps_to_mm[B_AXIS]; delta_mm[C_AXIS] = dc * steps_to_mm[C_AXIS]; #endif - delta_mm[E_AXIS] = esteps_float * steps_to_mm[E_AXIS_N(extruder)]; + + #if EXTRUDERS + delta_mm[E_AXIS] = esteps_float * steps_to_mm[E_AXIS_N(extruder)]; + #endif if (block->steps[A_AXIS] < MIN_STEPS_PER_SEGMENT && block->steps[B_AXIS] < MIN_STEPS_PER_SEGMENT && block->steps[C_AXIS] < MIN_STEPS_PER_SEGMENT) { - block->millimeters = ABS(delta_mm[E_AXIS]); + block->millimeters = (0 + #if EXTRUDERS + + ABS(delta_mm[E_AXIS]) + #endif + ); } else { if (millimeters) @@ -1816,7 +1838,10 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif } - block->steps[E_AXIS] = esteps; + #if EXTRUDERS + block->steps[E_AXIS] = esteps; + #endif + block->step_event_count = _MAX(block->steps[A_AXIS], block->steps[B_AXIS], block->steps[C_AXIS], esteps); // Bail if this is a zero-length block @@ -1874,129 +1899,131 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif // Enable extruder(s) - if (esteps) { - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif + #if EXTRUDERS + if (esteps) { + #if ENABLED(AUTO_POWER_CONTROL) + powerManager.power_on(); + #endif - #if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Enable only the selected extruder + #if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Enable only the selected extruder - #define DISABLE_IDLE_E(N) if (!g_uc_extruder_last_move[N]) disable_E##N(); + #define DISABLE_IDLE_E(N) if (!g_uc_extruder_last_move[N]) disable_E##N(); - for (uint8_t i = 0; i < EXTRUDERS; i++) - if (g_uc_extruder_last_move[i] > 0) g_uc_extruder_last_move[i]--; + for (uint8_t i = 0; i < EXTRUDERS; i++) + if (g_uc_extruder_last_move[i] > 0) g_uc_extruder_last_move[i]--; - switch (extruder) { - case 0: + switch (extruder) { + case 0: + #if EXTRUDERS > 1 + DISABLE_IDLE_E(1); + #if EXTRUDERS > 2 + DISABLE_IDLE_E(2); + #if EXTRUDERS > 3 + DISABLE_IDLE_E(3); + #if EXTRUDERS > 4 + DISABLE_IDLE_E(4); + #if EXTRUDERS > 5 + DISABLE_IDLE_E(5); + #endif // EXTRUDERS > 5 + #endif // EXTRUDERS > 4 + #endif // EXTRUDERS > 3 + #endif // EXTRUDERS > 2 + #endif // EXTRUDERS > 1 + enable_E0(); + g_uc_extruder_last_move[0] = (BLOCK_BUFFER_SIZE) * 2; + #if HAS_DUPLICATION_MODE + if (extruder_duplication_enabled) { + enable_E1(); + g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2; + } + #endif + break; #if EXTRUDERS > 1 - DISABLE_IDLE_E(1); + case 1: + DISABLE_IDLE_E(0); + #if EXTRUDERS > 2 + DISABLE_IDLE_E(2); + #if EXTRUDERS > 3 + DISABLE_IDLE_E(3); + #if EXTRUDERS > 4 + DISABLE_IDLE_E(4); + #if EXTRUDERS > 5 + DISABLE_IDLE_E(5); + #endif // EXTRUDERS > 5 + #endif // EXTRUDERS > 4 + #endif // EXTRUDERS > 3 + #endif // EXTRUDERS > 2 + enable_E1(); + g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2; + break; #if EXTRUDERS > 2 - DISABLE_IDLE_E(2); + case 2: + DISABLE_IDLE_E(0); + DISABLE_IDLE_E(1); + #if EXTRUDERS > 3 + DISABLE_IDLE_E(3); + #if EXTRUDERS > 4 + DISABLE_IDLE_E(4); + #if EXTRUDERS > 5 + DISABLE_IDLE_E(5); + #endif + #endif + #endif + enable_E2(); + g_uc_extruder_last_move[2] = (BLOCK_BUFFER_SIZE) * 2; + break; #if EXTRUDERS > 3 - DISABLE_IDLE_E(3); + case 3: + DISABLE_IDLE_E(0); + DISABLE_IDLE_E(1); + DISABLE_IDLE_E(2); + #if EXTRUDERS > 4 + DISABLE_IDLE_E(4); + #if EXTRUDERS > 5 + DISABLE_IDLE_E(5); + #endif + #endif + enable_E3(); + g_uc_extruder_last_move[3] = (BLOCK_BUFFER_SIZE) * 2; + break; #if EXTRUDERS > 4 - DISABLE_IDLE_E(4); + case 4: + DISABLE_IDLE_E(0); + DISABLE_IDLE_E(1); + DISABLE_IDLE_E(2); + DISABLE_IDLE_E(3); + #if EXTRUDERS > 5 + DISABLE_IDLE_E(5); + #endif + enable_E4(); + g_uc_extruder_last_move[4] = (BLOCK_BUFFER_SIZE) * 2; + break; #if EXTRUDERS > 5 - DISABLE_IDLE_E(5); + case 5: + DISABLE_IDLE_E(0); + DISABLE_IDLE_E(1); + DISABLE_IDLE_E(2); + DISABLE_IDLE_E(3); + DISABLE_IDLE_E(4); + enable_E5(); + g_uc_extruder_last_move[5] = (BLOCK_BUFFER_SIZE) * 2; + break; #endif // EXTRUDERS > 5 #endif // EXTRUDERS > 4 #endif // EXTRUDERS > 3 #endif // EXTRUDERS > 2 #endif // EXTRUDERS > 1 - enable_E0(); - g_uc_extruder_last_move[0] = (BLOCK_BUFFER_SIZE) * 2; - #if HAS_DUPLICATION_MODE - if (extruder_duplication_enabled) { - enable_E1(); - g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2; - } - #endif - break; - #if EXTRUDERS > 1 - case 1: - DISABLE_IDLE_E(0); - #if EXTRUDERS > 2 - DISABLE_IDLE_E(2); - #if EXTRUDERS > 3 - DISABLE_IDLE_E(3); - #if EXTRUDERS > 4 - DISABLE_IDLE_E(4); - #if EXTRUDERS > 5 - DISABLE_IDLE_E(5); - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - enable_E1(); - g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2; - break; - #if EXTRUDERS > 2 - case 2: - DISABLE_IDLE_E(0); - DISABLE_IDLE_E(1); - #if EXTRUDERS > 3 - DISABLE_IDLE_E(3); - #if EXTRUDERS > 4 - DISABLE_IDLE_E(4); - #if EXTRUDERS > 5 - DISABLE_IDLE_E(5); - #endif - #endif - #endif - enable_E2(); - g_uc_extruder_last_move[2] = (BLOCK_BUFFER_SIZE) * 2; - break; - #if EXTRUDERS > 3 - case 3: - DISABLE_IDLE_E(0); - DISABLE_IDLE_E(1); - DISABLE_IDLE_E(2); - #if EXTRUDERS > 4 - DISABLE_IDLE_E(4); - #if EXTRUDERS > 5 - DISABLE_IDLE_E(5); - #endif - #endif - enable_E3(); - g_uc_extruder_last_move[3] = (BLOCK_BUFFER_SIZE) * 2; - break; - #if EXTRUDERS > 4 - case 4: - DISABLE_IDLE_E(0); - DISABLE_IDLE_E(1); - DISABLE_IDLE_E(2); - DISABLE_IDLE_E(3); - #if EXTRUDERS > 5 - DISABLE_IDLE_E(5); - #endif - enable_E4(); - g_uc_extruder_last_move[4] = (BLOCK_BUFFER_SIZE) * 2; - break; - #if EXTRUDERS > 5 - case 5: - DISABLE_IDLE_E(0); - DISABLE_IDLE_E(1); - DISABLE_IDLE_E(2); - DISABLE_IDLE_E(3); - DISABLE_IDLE_E(4); - enable_E5(); - g_uc_extruder_last_move[5] = (BLOCK_BUFFER_SIZE) * 2; - break; - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - } - #else - enable_E0(); - enable_E1(); - enable_E2(); - enable_E3(); - enable_E4(); - enable_E5(); - #endif - } + } + #else + enable_E0(); + enable_E1(); + enable_E2(); + enable_E3(); + enable_E4(); + enable_E5(); + #endif + } + #endif // EXTRUDERS if (esteps) NOLESS(fr_mm_s, settings.min_feedrate_mm_s); @@ -2046,37 +2073,8 @@ bool Planner::_populate_block(block_t * const block, bool split_move, block->nominal_rate = CEIL(block->step_event_count * inverse_secs); // (step/sec) Always > 0 #if ENABLED(FILAMENT_WIDTH_SENSOR) - static float filwidth_e_count = 0, filwidth_delay_dist = 0; - - //FMM update ring buffer used for delay with filament measurements - if (extruder == FILAMENT_SENSOR_EXTRUDER_NUM && filwidth_delay_index[1] >= 0) { //only for extruder with filament sensor and if ring buffer is initialized - - constexpr int MMD_CM = MAX_MEASUREMENT_DELAY + 1, MMD_MM = MMD_CM * 10; - - // increment counters with next move in e axis - filwidth_e_count += delta_mm[E_AXIS]; - filwidth_delay_dist += delta_mm[E_AXIS]; - - // Only get new measurements on forward E movement - if (!UNEAR_ZERO(filwidth_e_count)) { - - // Loop the delay distance counter (modulus by the mm length) - while (filwidth_delay_dist >= MMD_MM) filwidth_delay_dist -= MMD_MM; - - // Convert into an index into the measurement array - filwidth_delay_index[0] = int8_t(filwidth_delay_dist * 0.1f); - - // If the index has changed (must have gone forward)... - if (filwidth_delay_index[0] != filwidth_delay_index[1]) { - filwidth_e_count = 0; // Reset the E movement counter - const int8_t meas_sample = thermalManager.widthFil_to_size_ratio(); - do { - filwidth_delay_index[1] = (filwidth_delay_index[1] + 1) % MMD_CM; // The next unused slot - measurement_delay[filwidth_delay_index[1]] = meas_sample; // Store the measurement - } while (filwidth_delay_index[0] != filwidth_delay_index[1]); // More slots to fill? - } - } - } + if (extruder == FILAMENT_SENSOR_EXTRUDER_NUM) // Only for extruder with filament sensor + filwidth.advance_e(delta_mm[E_AXIS]); #endif // Calculate and limit speed in mm/sec for each axis @@ -2093,7 +2091,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #else const float delta_mm_i = delta_mm[i]; #endif - const float cs = ABS(current_speed[i] = delta_mm_i * inverse_secs); + const feedRate_t cs = ABS(current_speed[i] = delta_mm_i * inverse_secs); #if ENABLED(DISTINCT_E_FACTORS) if (i == E_AXIS) i += extruder; #endif @@ -2513,6 +2511,10 @@ bool Planner::_populate_block(block_t * const block, bool split_move, mixer.gradient_control(target_float[Z_AXIS]); #endif + #if ENABLED(POWER_LOSS_RECOVERY) + block->sdpos = recovery.command_sdpos(); + #endif + // Movement was accepted return true; } // _populate_block() @@ -2567,7 +2569,7 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) , const float (&delta_mm_cart)[XYZE] #endif - , const float &fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/ + , const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/ ) { // If we are cleaning, do not accept queuing of movements @@ -2584,10 +2586,10 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con // The target position of the tool in absolute steps // Calculate target position in absolute steps const int32_t target[ABCE] = { - LROUND(a * settings.axis_steps_per_mm[A_AXIS]), - LROUND(b * settings.axis_steps_per_mm[B_AXIS]), - LROUND(c * settings.axis_steps_per_mm[C_AXIS]), - LROUND(e * settings.axis_steps_per_mm[E_AXIS_N(extruder)]) + int32_t(LROUND(a * settings.axis_steps_per_mm[A_AXIS])), + int32_t(LROUND(b * settings.axis_steps_per_mm[B_AXIS])), + int32_t(LROUND(c * settings.axis_steps_per_mm[C_AXIS])), + int32_t(LROUND(e * settings.axis_steps_per_mm[E_AXIS_N(extruder)])) }; #if HAS_POSITION_FLOAT @@ -2631,7 +2633,7 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con //*/ // Queue the movement - if ( + if ( !_buffer_steps(target #if HAS_POSITION_FLOAT , target_float @@ -2649,9 +2651,8 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con /** * Add a new linear movement to the buffer. - * The target is cartesian, it's translated to delta/scara if - * needed. - * + * The target is cartesian. It's translated to + * delta/scara if needed. * * rx,ry,rz,e - target position in mm or degrees * fr_mm_s - (target) speed of the move (mm/s) @@ -2659,7 +2660,7 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con * millimeters - the length of the movement, if known * inv_duration - the reciprocal if the duration of the movement, if known (kinematic only if feeedrate scaling is enabled) */ -bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, const float &e, const float &fr_mm_s, const uint8_t extruder, const float millimeters +bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, const float &e, const feedRate_t &fr_mm_s, const uint8_t extruder, const float millimeters #if ENABLED(SCARA_FEEDRATE_SCALING) , const float &inv_duration #endif @@ -2688,10 +2689,10 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con #if ENABLED(SCARA_FEEDRATE_SCALING) // For SCARA scale the feed rate from mm/s to degrees/s // i.e., Complete the angular vector in the given time. - const float duration_recip = inv_duration ? inv_duration : fr_mm_s / mm, - feedrate = HYPOT(delta[A_AXIS] - position_float[A_AXIS], delta[B_AXIS] - position_float[B_AXIS]) * duration_recip; + const float duration_recip = inv_duration ? inv_duration : fr_mm_s / mm; + const feedRate_t feedrate = HYPOT(delta[A_AXIS] - position_float[A_AXIS], delta[B_AXIS] - position_float[B_AXIS]) * duration_recip; #else - const float feedrate = fr_mm_s; + const feedRate_t feedrate = fr_mm_s; #endif if (buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS] #if ENABLED(JUNCTION_DEVIATION) diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 38884cffa9..2f3ee471d6 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -159,6 +159,10 @@ typedef struct block_t { uint32_t segment_time_us; #endif + #if ENABLED(POWER_LOSS_RECOVERY) + uint32_t sdpos; + #endif + } block_t; #define HAS_POSITION_FLOAT ANY(LIN_ADVANCE, SCARA_FEEDRATE_SCALING, GRADIENT_MIX) @@ -166,15 +170,15 @@ typedef struct block_t { #define BLOCK_MOD(n) ((n)&(BLOCK_BUFFER_SIZE-1)) typedef struct { - uint32_t max_acceleration_mm_per_s2[XYZE_N], // (mm/s^2) M201 XYZE - min_segment_time_us; // (µs) M205 B - float axis_steps_per_mm[XYZE_N], // (steps) M92 XYZE - Steps per millimeter - max_feedrate_mm_s[XYZE_N], // (mm/s) M203 XYZE - Max speeds - acceleration, // (mm/s^2) M204 S - Normal acceleration. DEFAULT ACCELERATION for all printing moves. - retract_acceleration, // (mm/s^2) M204 R - Retract acceleration. Filament pull-back and push-forward while standing still in the other axes - travel_acceleration, // (mm/s^2) M204 T - Travel acceleration. DEFAULT ACCELERATION for all NON printing moves. - min_feedrate_mm_s, // (mm/s) M205 S - Minimum linear feedrate - min_travel_feedrate_mm_s; // (mm/s) M205 T - Minimum travel feedrate + uint32_t max_acceleration_mm_per_s2[XYZE_N], // (mm/s^2) M201 XYZE + min_segment_time_us; // (µs) M205 B + float axis_steps_per_mm[XYZE_N]; // (steps) M92 XYZE - Steps per millimeter + feedRate_t max_feedrate_mm_s[XYZE_N]; // (mm/s) M203 XYZE - Max speeds + float acceleration, // (mm/s^2) M204 S - Normal acceleration. DEFAULT ACCELERATION for all printing moves. + retract_acceleration, // (mm/s^2) M204 R - Retract acceleration. Filament pull-back and push-forward while standing still in the other axes + travel_acceleration; // (mm/s^2) M204 T - Travel acceleration. DEFAULT ACCELERATION for all NON printing moves. + feedRate_t min_feedrate_mm_s, // (mm/s) M205 S - Minimum linear feedrate + min_travel_feedrate_mm_s; // (mm/s) M205 T - Minimum travel feedrate } planner_settings_t; #if DISABLED(SKEW_CORRECTION) @@ -226,9 +230,10 @@ class Planner { static uint8_t last_extruder; // Respond to extruder change #endif - static int16_t flow_percentage[EXTRUDERS]; // Extrusion factor for each extruder - - static float e_factor[EXTRUDERS]; // The flow percentage and volumetric multiplier combine to scale E movement + #if EXTRUDERS + static int16_t flow_percentage[EXTRUDERS]; // Extrusion factor for each extruder + static float e_factor[EXTRUDERS]; // The flow percentage and volumetric multiplier combine to scale E movement + #endif #if DISABLED(NO_VOLUMETRICS) static float filament_size[EXTRUDERS], // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder @@ -357,13 +362,15 @@ class Planner { static void reset_acceleration_rates(); static void refresh_positioning(); - FORCE_INLINE static void refresh_e_factor(const uint8_t e) { - e_factor[e] = (flow_percentage[e] * 0.01f - #if DISABLED(NO_VOLUMETRICS) - * volumetric_multiplier[e] - #endif - ); - } + #if EXTRUDERS + FORCE_INLINE static void refresh_e_factor(const uint8_t e) { + e_factor[e] = (flow_percentage[e] * 0.01f + #if DISABLED(NO_VOLUMETRICS) + * volumetric_multiplier[e] + #endif + ); + } + #endif // Manage fans, paste pressure, etc. static void check_axes_activity(); @@ -372,7 +379,14 @@ class Planner { static void calculate_volumetric_multipliers(); #if ENABLED(FILAMENT_WIDTH_SENSOR) - void calculate_volumetric_for_width_sensor(const int8_t encoded_ratio); + void apply_filament_width_sensor(const int8_t encoded_ratio); + + static inline float volumetric_percent(const bool vol) { + return 100.0f * (vol + ? volumetric_area_nominal / volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] + : volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] + ); + } #endif #if DISABLED(NO_VOLUMETRICS) @@ -397,15 +411,13 @@ class Planner { */ static inline float fade_scaling_factor_for_z(const float &rz) { static float z_fade_factor = 1; - if (z_fade_height) { - if (rz >= z_fade_height) return 0; - if (last_fade_z != rz) { - last_fade_z = rz; - z_fade_factor = 1 - rz * inverse_z_fade_height; - } - return z_fade_factor; + if (!z_fade_height) return 1; + if (rz >= z_fade_height) return 0; + if (last_fade_z != rz) { + last_fade_z = rz; + z_fade_factor = 1 - rz * inverse_z_fade_height; } - return 1; + return z_fade_factor; } FORCE_INLINE static void force_fade_recalc() { last_fade_z = -999.999f; } @@ -493,8 +505,7 @@ class Planner { skew(pos); #endif #if HAS_LEVELING - if (leveling) - apply_leveling(pos); + if (leveling) apply_leveling(pos); #endif #if ENABLED(FWRETRACT) apply_retract(pos); @@ -515,8 +526,7 @@ class Planner { unapply_retract(pos); #endif #if HAS_LEVELING - if (leveling) - unapply_leveling(pos); + if (leveling) unapply_leveling(pos); #endif #if ENABLED(SKEW_CORRECTION) unskew(pos); @@ -575,7 +585,7 @@ class Planner { #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) , const float (&delta_mm_cart)[XYZE] #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 + , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 ); /** @@ -598,7 +608,7 @@ class Planner { #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) , const float (&delta_mm_cart)[XYZE] #endif - , float fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 + , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 ); /** @@ -611,7 +621,7 @@ class Planner { private: // Allow do_homing_move to access internal functions, such as buffer_segment. - friend void do_homing_move(const AxisEnum, const float, const float); + friend void do_homing_move(const AxisEnum, const float, const feedRate_t); #endif /** @@ -630,14 +640,14 @@ class Planner { #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) , const float (&delta_mm_cart)[XYZE] #endif - , const float &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 + , const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 ); FORCE_INLINE static bool buffer_segment(const float (&abce)[ABCE] #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) , const float (&delta_mm_cart)[XYZE] #endif - , const float &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 + , const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0 ) { return buffer_segment(abce[A_AXIS], abce[B_AXIS], abce[C_AXIS], abce[E_AXIS] #if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION) @@ -650,9 +660,8 @@ class Planner { /** * Add a new linear movement to the buffer. - * The target is cartesian, it's translated to delta/scara if - * needed. - * + * The target is cartesian. It's translated to + * delta/scara if needed. * * rx,ry,rz,e - target position in mm or degrees * fr_mm_s - (target) speed of the move (mm/s) @@ -660,13 +669,13 @@ class Planner { * millimeters - the length of the movement, if known * inv_duration - the reciprocal if the duration of the movement, if known (kinematic only if feeedrate scaling is enabled) */ - static bool buffer_line(const float &rx, const float &ry, const float &rz, const float &e, const float &fr_mm_s, const uint8_t extruder, const float millimeters=0.0 + static bool buffer_line(const float &rx, const float &ry, const float &rz, const float &e, const feedRate_t &fr_mm_s, const uint8_t extruder, const float millimeters=0.0 #if ENABLED(SCARA_FEEDRATE_SCALING) , const float &inv_duration=0.0 #endif ); - FORCE_INLINE static bool buffer_line(const float (&cart)[XYZE], const float &fr_mm_s, const uint8_t extruder, const float millimeters=0.0 + FORCE_INLINE static bool buffer_line(const float (&cart)[XYZE], const feedRate_t &fr_mm_s, const uint8_t extruder, const float millimeters=0.0 #if ENABLED(SCARA_FEEDRATE_SCALING) , const float &inv_duration=0.0 #endif @@ -715,8 +724,8 @@ class Planner { FORCE_INLINE static float get_axis_position_degrees(const AxisEnum axis) { return get_axis_position_mm(axis); } #endif - // Called to force a quick stop of the machine (for example, when an emergency - // stop is required, or when endstops are hit) + // Called to force a quick stop of the machine (for example, when + // a Full Shutdown is required, or when endstops are hit) static void quick_stop(); // Called when an endstop is triggered. Causes the machine to stop inmediately diff --git a/Marlin/src/module/planner_bezier.cpp b/Marlin/src/module/planner_bezier.cpp index 71a99594f5..6e6746bce8 100644 --- a/Marlin/src/module/planner_bezier.cpp +++ b/Marlin/src/module/planner_bezier.cpp @@ -107,13 +107,18 @@ static inline float dist1(const float &x1, const float &y1, const float &x2, con * the mitigation offered by MIN_STEP and the small computational * power available on Arduino, I think it is not wise to implement it. */ -void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS], const float offset[4], float fr_mm_s, uint8_t extruder) { +void cubic_b_spline( + const float position[NUM_AXIS], // current position + const float target[NUM_AXIS], // target position + const float (&offset)[4], // a pair of offsets + const feedRate_t &scaled_fr_mm_s, // mm/s scaled by feedrate % + const uint8_t extruder +) { // Absolute first and second control points are recovered. const float first0 = position[X_AXIS] + offset[0], first1 = position[Y_AXIS] + offset[1], second0 = target[X_AXIS] + offset[2], second1 = target[Y_AXIS] + offset[3]; - float t = 0; float bez_target[4]; bez_target[X_AXIS] = position[X_AXIS]; @@ -122,7 +127,7 @@ void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS] millis_t next_idle_ms = millis() + 200UL; - while (t < 1) { + for (float t = 0; t < 1;) { thermalManager.manage_heater(); millis_t now = millis(); @@ -197,7 +202,7 @@ void cubic_b_spline(const float position[NUM_AXIS], const float target[NUM_AXIS] const float (&pos)[XYZE] = bez_target; #endif - if (!planner.buffer_line(pos, fr_mm_s, active_extruder, step)) + if (!planner.buffer_line(pos, scaled_fr_mm_s, active_extruder, step)) break; } } diff --git a/Marlin/src/module/planner_bezier.h b/Marlin/src/module/planner_bezier.h index 492bf51146..5e959dd0f3 100644 --- a/Marlin/src/module/planner_bezier.h +++ b/Marlin/src/module/planner_bezier.h @@ -32,9 +32,9 @@ #include "../core/macros.h" void cubic_b_spline( - const float position[NUM_AXIS], // current position - const float target[NUM_AXIS], // target position - const float offset[4], // a pair of offsets - float fr_mm_s, - uint8_t extruder - ); + const float position[NUM_AXIS], // current position + const float target[NUM_AXIS], // target position + const float (&offset)[4], // a pair of offsets + const feedRate_t &scaled_fr_mm_s, // mm/s scaled by feedrate % + const uint8_t extruder +); diff --git a/Marlin/src/module/printcounter.cpp b/Marlin/src/module/printcounter.cpp index ba308142e4..cef233d9ac 100644 --- a/Marlin/src/module/printcounter.cpp +++ b/Marlin/src/module/printcounter.cpp @@ -183,11 +183,9 @@ void PrintCounter::saveStats() { #if HAS_SERVICE_INTERVALS inline void _service_when(char buffer[], const char * const msg, const uint32_t when) { - duration_t elapsed = when; - elapsed.toString(buffer); SERIAL_ECHOPGM(MSG_STATS); serialprintPGM(msg); - SERIAL_ECHOLNPAIR(" in ", buffer); + SERIAL_ECHOLNPAIR(" in ", duration_t(when).toString(buffer)); } #endif diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 7e2a0deb5f..ce0d84e41b 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -28,9 +28,9 @@ #if HAS_BED_PROBE -#include "../libs/buzzer.h" - #include "probe.h" + +#include "../libs/buzzer.h" #include "motion.h" #include "temperature.h" #include "endstops.h" @@ -56,7 +56,7 @@ #include "../feature/backlash.h" #endif -float zprobe_zoffset; // Initialized by settings.load() +float probe_offset[XYZ]; // Initialized by settings.load() #if ENABLED(BLTOUCH) #include "../feature/bltouch.h" @@ -76,7 +76,7 @@ float zprobe_zoffset; // Initialized by settings.load() #endif #if QUIET_PROBING - #include "stepper_indirection.h" + #include "stepper/indirection.h" #endif #if ENABLED(EXTENSIBLE_UI) @@ -116,6 +116,9 @@ float zprobe_zoffset; // Initialized by settings.load() #if TOUCH_MI_DEPLOY_XPOS > X_MAX_BED TemporaryGlobalEndstopsState unlock_x(false); #endif + #if TOUCH_MI_DEPLOY_YPOS > Y_MAX_BED + TemporaryGlobalEndstopsState unlock_y(false); + #endif #if ENABLED(TOUCH_MI_MANUAL_DEPLOY) @@ -132,10 +135,12 @@ float zprobe_zoffset; // Initialized by settings.load() ui.reset_status(); ui.goto_screen(prev_screen); + #elif defined(TOUCH_MI_DEPLOY_XPOS) && defined(TOUCH_MI_DEPLOY_YPOS) + do_blocking_move_to_xy(TOUCH_MI_DEPLOY_XPOS, TOUCH_MI_DEPLOY_YPOS); #elif defined(TOUCH_MI_DEPLOY_XPOS) - do_blocking_move_to_x(TOUCH_MI_DEPLOY_XPOS); - + #elif defined(TOUCH_MI_DEPLOY_YPOS) + do_blocking_move_to_y(TOUCH_MI_DEPLOY_YPOS); #endif } @@ -150,167 +155,77 @@ float zprobe_zoffset; // Initialized by settings.load() #elif ENABLED(Z_PROBE_ALLEN_KEY) void run_deploy_moves_script() { - #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Z) - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_X - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_Y - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_1 #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE 0.0 #endif - const float deploy_1[] = { Z_PROBE_ALLEN_KEY_DEPLOY_1_X, Z_PROBE_ALLEN_KEY_DEPLOY_1_Y, Z_PROBE_ALLEN_KEY_DEPLOY_1_Z }; + constexpr float deploy_1[] = Z_PROBE_ALLEN_KEY_DEPLOY_1; do_blocking_move_to(deploy_1, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_2_Z) - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_X - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_Y - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_2 #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE 0.0 #endif - const float deploy_2[] = { Z_PROBE_ALLEN_KEY_DEPLOY_2_X, Z_PROBE_ALLEN_KEY_DEPLOY_2_Y, Z_PROBE_ALLEN_KEY_DEPLOY_2_Z }; + constexpr float deploy_2[] = Z_PROBE_ALLEN_KEY_DEPLOY_2; do_blocking_move_to(deploy_2, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_3_Z) - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_X - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_Y - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_3 #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE 0.0 #endif - const float deploy_3[] = { Z_PROBE_ALLEN_KEY_DEPLOY_3_X, Z_PROBE_ALLEN_KEY_DEPLOY_3_Y, Z_PROBE_ALLEN_KEY_DEPLOY_3_Z }; + constexpr float deploy_3[] = Z_PROBE_ALLEN_KEY_DEPLOY_3; do_blocking_move_to(deploy_3, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_4_Z) - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_X - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_Y - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_4 #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE #define Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE 0.0 #endif - const float deploy_4[] = { Z_PROBE_ALLEN_KEY_DEPLOY_4_X, Z_PROBE_ALLEN_KEY_DEPLOY_4_Y, Z_PROBE_ALLEN_KEY_DEPLOY_4_Z }; + constexpr float deploy_4[] = Z_PROBE_ALLEN_KEY_DEPLOY_4; do_blocking_move_to(deploy_4, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_5_Z) - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_X - #define Z_PROBE_ALLEN_KEY_DEPLOY_5_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_Y - #define Z_PROBE_ALLEN_KEY_DEPLOY_5_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_Z - #define Z_PROBE_ALLEN_KEY_DEPLOY_5_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_DEPLOY_5 #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE #define Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE 0.0 #endif - const float deploy_5[] = { Z_PROBE_ALLEN_KEY_DEPLOY_5_X, Z_PROBE_ALLEN_KEY_DEPLOY_5_Y, Z_PROBE_ALLEN_KEY_DEPLOY_5_Z }; + constexpr float deploy_5[] = Z_PROBE_ALLEN_KEY_DEPLOY_5; do_blocking_move_to(deploy_5, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE)); #endif } void run_stow_moves_script() { - #if defined(Z_PROBE_ALLEN_KEY_STOW_1_X) || defined(Z_PROBE_ALLEN_KEY_STOW_1_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_1_Z) - #ifndef Z_PROBE_ALLEN_KEY_STOW_1_X - #define Z_PROBE_ALLEN_KEY_STOW_1_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_1_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_1_Z - #define Z_PROBE_ALLEN_KEY_STOW_1_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_STOW_1 #ifndef Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE 0.0 #endif - const float stow_1[] = { Z_PROBE_ALLEN_KEY_STOW_1_X, Z_PROBE_ALLEN_KEY_STOW_1_Y, Z_PROBE_ALLEN_KEY_STOW_1_Z }; + constexpr float stow_1[] = Z_PROBE_ALLEN_KEY_STOW_1; do_blocking_move_to(stow_1, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_STOW_2_X) || defined(Z_PROBE_ALLEN_KEY_STOW_2_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_2_Z) - #ifndef Z_PROBE_ALLEN_KEY_STOW_2_X - #define Z_PROBE_ALLEN_KEY_STOW_2_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_2_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_2_Z - #define Z_PROBE_ALLEN_KEY_STOW_2_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_STOW_2 #ifndef Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE 0.0 #endif - const float stow_2[] = { Z_PROBE_ALLEN_KEY_STOW_2_X, Z_PROBE_ALLEN_KEY_STOW_2_Y, Z_PROBE_ALLEN_KEY_STOW_2_Z }; + constexpr float stow_2[] = Z_PROBE_ALLEN_KEY_STOW_2; do_blocking_move_to(stow_2, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_STOW_3_X) || defined(Z_PROBE_ALLEN_KEY_STOW_3_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_3_Z) - #ifndef Z_PROBE_ALLEN_KEY_STOW_3_X - #define Z_PROBE_ALLEN_KEY_STOW_3_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_3_Y - #define Z_PROBE_ALLEN_KEY_STOW_3_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_3_Z - #define Z_PROBE_ALLEN_KEY_STOW_3_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_STOW_3 #ifndef Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE 0.0 #endif - const float stow_3[] = { Z_PROBE_ALLEN_KEY_STOW_3_X, Z_PROBE_ALLEN_KEY_STOW_3_Y, Z_PROBE_ALLEN_KEY_STOW_3_Z }; + constexpr float stow_3[] = Z_PROBE_ALLEN_KEY_STOW_3; do_blocking_move_to(stow_3, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_STOW_4_X) || defined(Z_PROBE_ALLEN_KEY_STOW_4_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_4_Z) - #ifndef Z_PROBE_ALLEN_KEY_STOW_4_X - #define Z_PROBE_ALLEN_KEY_STOW_4_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_4_Y - #define Z_PROBE_ALLEN_KEY_STOW_4_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_4_Z - #define Z_PROBE_ALLEN_KEY_STOW_4_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_STOW_4 #ifndef Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE 0.0 #endif - const float stow_4[] = { Z_PROBE_ALLEN_KEY_STOW_4_X, Z_PROBE_ALLEN_KEY_STOW_4_Y, Z_PROBE_ALLEN_KEY_STOW_4_Z }; + constexpr float stow_4[] = Z_PROBE_ALLEN_KEY_STOW_4; do_blocking_move_to(stow_4, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE)); #endif - #if defined(Z_PROBE_ALLEN_KEY_STOW_5_X) || defined(Z_PROBE_ALLEN_KEY_STOW_5_Y) || defined(Z_PROBE_ALLEN_KEY_STOW_5_Z) - #ifndef Z_PROBE_ALLEN_KEY_STOW_5_X - #define Z_PROBE_ALLEN_KEY_STOW_5_X current_position[X_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_5_Y - #define Z_PROBE_ALLEN_KEY_STOW_5_Y current_position[Y_AXIS] - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_5_Z - #define Z_PROBE_ALLEN_KEY_STOW_5_Z current_position[Z_AXIS] - #endif + #ifdef Z_PROBE_ALLEN_KEY_STOW_5 #ifndef Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE #define Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE 0.0 #endif - const float stow_5[] = { Z_PROBE_ALLEN_KEY_STOW_5_X, Z_PROBE_ALLEN_KEY_STOW_5_Y, Z_PROBE_ALLEN_KEY_STOW_5_Z }; + constexpr float stow_5[] = Z_PROBE_ALLEN_KEY_STOW_5; do_blocking_move_to(stow_5, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE)); #endif } @@ -348,7 +263,7 @@ inline void do_probe_raise(const float z_raise) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("do_probe_raise(", z_raise, ")"); float z_dest = z_raise; - if (zprobe_zoffset < 0) z_dest -= zprobe_zoffset; + if (probe_offset[Z_AXIS] < 0) z_dest -= probe_offset[Z_AXIS]; NOMORE(z_dest, Z_MAX_POS); @@ -458,12 +373,11 @@ bool set_probe_deployed(const bool deploy) { do_probe_raise(_MAX(Z_CLEARANCE_BETWEEN_PROBES, Z_CLEARANCE_DEPLOY_PROBE)); #if EITHER(Z_PROBE_SLED, Z_PROBE_ALLEN_KEY) - #if ENABLED(Z_PROBE_SLED) - #define _AUE_ARGS true, false, false - #else - #define _AUE_ARGS - #endif - if (axis_unhomed_error(_AUE_ARGS)) { + if (axis_unhomed_error( + #if ENABLED(Z_PROBE_SLED) + _BV(X_AXIS) + #endif + )) { SERIAL_ERROR_MSG(MSG_STOP_UNHOMED); stop(); return true; @@ -532,7 +446,7 @@ bool set_probe_deployed(const bool deploy) { const char msg_wait_for_bed_heating[25] PROGMEM = "Wait for bed heating...\n"; #endif -static bool do_probe_move(const float z, const float fr_mm_s) { +static bool do_probe_move(const float z, const feedRate_t fr_mm_s) { if (DEBUGGING(LEVELING)) DEBUG_POS(">>> do_probe_move", current_position); #if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) @@ -617,7 +531,7 @@ static bool do_probe_move(const float z, const float fr_mm_s) { /** * @brief Probe at the current XY (possibly more than once) to find the bed Z. * - * @details Used by probe_pt to get the bed Z height at the current XY. + * @details Used by probe_at_point to get the bed Z height at the current XY. * Leaves current_position[Z_AXIS] at the height where the probe triggered. * * @return The Z position of the bed at the current XY or NAN on error. @@ -628,7 +542,7 @@ static float run_z_probe() { // Stop the probe before it goes too low to prevent damage. // If Z isn't known then probe to -10mm. - const float z_probe_low_point = TEST(axis_known_position, Z_AXIS) ? -zprobe_zoffset + Z_PROBE_LOW_POINT : -10.0; + const float z_probe_low_point = TEST(axis_known_position, Z_AXIS) ? -probe_offset[Z_AXIS] + Z_PROBE_LOW_POINT : -10.0; // Double-probing does a fast probe followed by a slow probe #if TOTAL_PROBING == 2 @@ -653,7 +567,7 @@ static float run_z_probe() { // If the nozzle is well over the travel height then // move down quickly before doing the slow probe - const float z = Z_CLEARANCE_DEPLOY_PROBE + 5.0 + (zprobe_zoffset < 0 ? -zprobe_zoffset : 0); + const float z = Z_CLEARANCE_DEPLOY_PROBE + 5.0 + (probe_offset[Z_AXIS] < 0 ? -probe_offset[Z_AXIS] : 0); if (current_position[Z_AXIS] > z) { // Probe down fast. If the probe never triggered, raise for probe clearance if (!do_probe_move(z, MMM_TO_MMS(Z_PROBE_SPEED_FAST))) @@ -736,7 +650,7 @@ static float run_z_probe() { #endif - const float measured_z = probes_total * (1.0f / (MULTIPLE_PROBING)); + const float measured_z = probes_total * RECIPROCAL(MULTIPLE_PROBING); #elif TOTAL_PROBING == 2 @@ -768,10 +682,10 @@ static float run_z_probe() { * - Raise to the BETWEEN height * - Return the probed Z position */ -float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/, const uint8_t verbose_level/*=0*/, const bool probe_relative/*=true*/) { +float probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/, const uint8_t verbose_level/*=0*/, const bool probe_relative/*=true*/) { if (DEBUGGING(LEVELING)) { DEBUG_ECHOLNPAIR( - ">>> probe_pt(", LOGICAL_X_POSITION(rx), ", ", LOGICAL_Y_POSITION(ry), + ">>> probe_at_point(", LOGICAL_X_POSITION(rx), ", ", LOGICAL_Y_POSITION(ry), ", ", raise_after == PROBE_PT_RAISE ? "raise" : raise_after == PROBE_PT_STOW ? "stow" : "none", ", ", int(verbose_level), ", ", probe_relative ? "probe" : "nozzle", "_relative)" @@ -783,8 +697,8 @@ float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/ float nx = rx, ny = ry; if (probe_relative) { if (!position_is_reachable_by_probe(rx, ry)) return NAN; // The given position is in terms of the probe - nx -= (X_PROBE_OFFSET_FROM_EXTRUDER); // Get the nozzle position - ny -= (Y_PROBE_OFFSET_FROM_EXTRUDER); + nx -= probe_offset[X_AXIS]; // Get the nozzle position + ny -= probe_offset[Y_AXIS]; } else if (!position_is_reachable(nx, ny)) return NAN; // The given position is in terms of the nozzle @@ -805,7 +719,7 @@ float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/ float measured_z = NAN; if (!DEPLOY_PROBE()) { - measured_z = run_z_probe() + zprobe_zoffset; + measured_z = run_z_probe() + probe_offset[Z_AXIS]; const bool big_raise = raise_after == PROBE_PT_BIG_RAISE; if (big_raise || raise_after == PROBE_PT_RAISE) @@ -828,7 +742,7 @@ float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/ SERIAL_ERROR_MSG(MSG_ERR_PROBING_FAILED); } - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< probe_pt"); + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< probe_at_point"); return measured_z; } diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index f08a452e58..dbdb66e143 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -28,7 +28,11 @@ #include "../inc/MarlinConfig.h" #if HAS_BED_PROBE - extern float zprobe_zoffset; + + constexpr float nozzle_to_probe_offset[XYZ] = NOZZLE_TO_PROBE_OFFSET; + + extern float probe_offset[XYZ]; + bool set_probe_deployed(const bool deploy); #ifdef Z_AFTER_PROBING void move_z_after_probing(); @@ -39,15 +43,63 @@ PROBE_PT_RAISE, // Raise to "between" clearance after run_z_probe PROBE_PT_BIG_RAISE // Raise to big clearance after run_z_probe }; - float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true); + float probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true); #define DEPLOY_PROBE() set_probe_deployed(true) #define STOW_PROBE() set_probe_deployed(false) #if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) extern const char msg_wait_for_bed_heating[25]; #endif + #else + + constexpr float probe_offset[XYZ] = { 0 }; #define DEPLOY_PROBE() #define STOW_PROBE() + +#endif + +#if HAS_LEVELING && HAS_BED_PROBE + inline float probe_min_x() { + return _MAX( + #if IS_KINEMATIC + PROBE_X_MIN, MESH_MIN_X + #else + (X_MIN_BED) + (MIN_PROBE_EDGE_LEFT), (X_MIN_POS) + probe_offset[X_AXIS] + #endif + ); + } + inline float probe_max_x() { + return _MIN( + #if IS_KINEMATIC + PROBE_X_MAX, MESH_MAX_X + #else + (X_MAX_BED) - (MIN_PROBE_EDGE_RIGHT), (X_MAX_POS) + probe_offset[X_AXIS] + #endif + ); + } + inline float probe_min_y() { + return _MAX( + #if IS_KINEMATIC + PROBE_Y_MIN, MESH_MIN_Y + #else + (Y_MIN_BED) + (MIN_PROBE_EDGE_FRONT), (Y_MIN_POS) + probe_offset[Y_AXIS] + #endif + ); + } + inline float probe_max_y() { + return _MIN( + #if IS_KINEMATIC + PROBE_Y_MAX, MESH_MAX_Y + #else + (Y_MAX_BED) - (MIN_PROBE_EDGE_BACK), (Y_MAX_POS) + probe_offset[Y_AXIS] + #endif + ); + } +#else + inline float probe_min_x() { return 0; }; + inline float probe_max_x() { return 0; }; + inline float probe_min_y() { return 0; }; + inline float probe_max_y() { return 0; }; #endif #if HAS_Z_SERVO_PROBE diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 862c608776..b806cb1142 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -121,6 +121,10 @@ Stepper stepper; // Singleton #include "../libs/L6470/L6470_Marlin.h" #endif +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../feature/power_loss_recovery.h" +#endif + // public: #if HAS_EXTRA_ENDSTOPS || ENABLED(Z_STEPPER_AUTO_ALIGN) @@ -170,8 +174,8 @@ int32_t Stepper::delta_error[XYZE] = { 0 }; uint32_t Stepper::advance_dividend[XYZE] = { 0 }, Stepper::advance_divisor = 0, Stepper::step_events_completed = 0, // The number of step events executed in the current block - Stepper::accelerate_until, // The point from where we need to stop acceleration - Stepper::decelerate_after, // The point from where we need to start decelerating + Stepper::accelerate_until, // The count at which to stop accelerating + Stepper::decelerate_after, // The count at which to start decelerating Stepper::step_event_count; // The total event count for the current block #if EXTRUDERS > 1 || ENABLED(MIXING_EXTRUDER) @@ -354,6 +358,10 @@ void Stepper::set_directions() { uint8_t L6470_buf[MAX_L6470 + 1]; // chip command sequence - element 0 not used #endif + #if MINIMUM_STEPPER_PRE_DIR_DELAY > 0 + DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY); + #endif + #define SET_STEP_DIR(A) \ if (motor_direction(_AXIS(A))) { \ A##_APPLY_DIR(INVERT_## A##_DIR, false); \ @@ -422,8 +430,8 @@ void Stepper::set_directions() { #endif // A small delay may be needed after changing direction - #if MINIMUM_STEPPER_DIR_DELAY > 0 - DELAY_NS(MINIMUM_STEPPER_DIR_DELAY); + #if MINIMUM_STEPPER_POST_DIR_DELAY > 0 + DELAY_NS(MINIMUM_STEPPER_POST_DIR_DELAY); #endif } @@ -1663,6 +1671,10 @@ uint32_t Stepper::stepper_block_phase_isr() { return interval; // No more queued movements! } + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.info.sdpos = current_block->sdpos; + #endif + // Flag all moving axes for proper endstop handling #if IS_CORE @@ -1879,19 +1891,28 @@ uint32_t Stepper::stepper_block_phase_isr() { else interval = LA_ADV_NEVER; - #if ENABLED(MIXING_EXTRUDER) - // We don't know which steppers will be stepped because LA loop follows, - // with potentially multiple steps. Set all. - if (LA_steps >= 0) - MIXER_STEPPER_LOOP(j) NORM_E_DIR(j); - else - MIXER_STEPPER_LOOP(j) REV_E_DIR(j); - #else - if (LA_steps >= 0) - NORM_E_DIR(stepper_extruder); - else - REV_E_DIR(stepper_extruder); - #endif + #if MINIMUM_STEPPER_PRE_DIR_DELAY > 0 + DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY); + #endif + + #if ENABLED(MIXING_EXTRUDER) + // We don't know which steppers will be stepped because LA loop follows, + // with potentially multiple steps. Set all. + if (LA_steps >= 0) + MIXER_STEPPER_LOOP(j) NORM_E_DIR(j); + else + MIXER_STEPPER_LOOP(j) REV_E_DIR(j); + #else + if (LA_steps >= 0) + NORM_E_DIR(stepper_extruder); + else + REV_E_DIR(stepper_extruder); + #endif + + // A small delay may be needed after changing direction + #if MINIMUM_STEPPER_POST_DIR_DELAY > 0 + DELAY_NS(MINIMUM_STEPPER_POST_DIR_DELAY); + #endif // Get the timer count and estimate the end of the pulse hal_timer_t pulse_end = HAL_timer_get_count(PULSE_TIMER_NUM) + hal_timer_t(MIN_PULSE_TICKS); @@ -2226,19 +2247,16 @@ void Stepper::endstop_triggered(const AxisEnum axis) { const bool was_enabled = STEPPER_ISR_ENABLED(); if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); - - #if IS_CORE - - endstops_trigsteps[axis] = 0.5f * ( - axis == CORE_AXIS_2 ? CORESIGN(count_position[CORE_AXIS_1] - count_position[CORE_AXIS_2]) - : count_position[CORE_AXIS_1] + count_position[CORE_AXIS_2] - ); - - #else // !COREXY && !COREXZ && !COREYZ - - endstops_trigsteps[axis] = count_position[axis]; - - #endif // !COREXY && !COREXZ && !COREYZ + endstops_trigsteps[axis] = ( + #if IS_CORE + (axis == CORE_AXIS_2 + ? CORESIGN(count_position[CORE_AXIS_1] - count_position[CORE_AXIS_2]) + : count_position[CORE_AXIS_1] + count_position[CORE_AXIS_2] + ) * 0.5f + #else // !IS_CORE + count_position[axis] + #endif + ); // Discard the rest of the move if there is a current block quick_stop(); @@ -2266,15 +2284,19 @@ int32_t Stepper::triggered_position(const AxisEnum axis) { void Stepper::report_positions() { - // Protect the access to the position. - const bool was_enabled = STEPPER_ISR_ENABLED(); - if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); + #ifdef __AVR__ + // Protect the access to the position. + const bool was_enabled = STEPPER_ISR_ENABLED(); + if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); + #endif const int32_t xpos = count_position[X_AXIS], ypos = count_position[Y_AXIS], zpos = count_position[Z_AXIS]; - if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); + #ifdef __AVR__ + if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); + #endif #if CORE_IS_XY || CORE_IS_XZ || ENABLED(DELTA) || IS_SCARA SERIAL_ECHOPGM(MSG_COUNT_A); @@ -2339,8 +2361,9 @@ void Stepper::report_positions() { #define BABYSTEP_AXIS(AXIS, INVERT, DIR) { \ const uint8_t old_dir = _READ_DIR(AXIS); \ _ENABLE(AXIS); \ + DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY); \ _APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^DIR^INVERT); \ - DELAY_NS(MINIMUM_STEPPER_DIR_DELAY); \ + DELAY_NS(MINIMUM_STEPPER_POST_DIR_DELAY); \ _SAVE_START; \ _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \ _PULSE_WAIT; \ @@ -2404,6 +2427,10 @@ void Stepper::report_positions() { enable_Y(); enable_Z(); + #if MINIMUM_STEPPER_PRE_DIR_DELAY > 0 + DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY); + #endif + const uint8_t old_x_dir_pin = X_DIR_READ(), old_y_dir_pin = Y_DIR_READ(), old_z_dir_pin = Z_DIR_READ(); @@ -2412,8 +2439,8 @@ void Stepper::report_positions() { Y_DIR_WRITE(INVERT_Y_DIR ^ z_direction); Z_DIR_WRITE(INVERT_Z_DIR ^ z_direction); - #if MINIMUM_STEPPER_DIR_DELAY > 0 - DELAY_NS(MINIMUM_STEPPER_DIR_DELAY); + #if MINIMUM_STEPPER_POST_DIR_DELAY > 0 + DELAY_NS(MINIMUM_STEPPER_POST_DIR_DELAY); #endif _SAVE_START; diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index eca4a75c17..d098dd4484 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -43,6 +43,12 @@ #include "../inc/MarlinConfig.h" +#include "planner.h" +#include "stepper/indirection.h" +#ifdef __AVR__ + #include "speed_lookuptable.h" +#endif + // Disable multiple steps per ISR //#define DISABLE_MULTI_STEPPING @@ -164,7 +170,7 @@ // adding the "start stepper pulse" code section execution cycles to account for that not all // pulses start at the beginning of the loop, so an extra time must be added to compensate so // the last generated pulse (usually the extruder stepper) has the right length -#if HAS_DRIVER(LV8729) +#if HAS_DRIVER(LV8729) && MINIMUM_STEPPER_PULSE == 0 #define MIN_PULSE_TICKS ((((PULSE_TIMER_TICKS_PER_US) + 1) / 2) + ((MIN_ISR_START_LOOP_CYCLES) / uint32_t(PULSE_TIMER_PRESCALE))) #else #define MIN_PULSE_TICKS (((PULSE_TIMER_TICKS_PER_US) * uint32_t(MINIMUM_STEPPER_PULSE)) + ((MIN_ISR_START_LOOP_CYCLES) / uint32_t(PULSE_TIMER_PRESCALE))) @@ -217,16 +223,6 @@ // // Stepper class definition // - -#include "stepper_indirection.h" - -#ifdef __AVR__ - #include "speed_lookuptable.h" -#endif - -#include "planner.h" -#include "../core/language.h" - class Stepper { public: @@ -321,6 +317,9 @@ class Stepper { static uint32_t acc_step_rate; // needed for deceleration start point #endif + // + // Exact steps at which an endstop was triggered + // static volatile int32_t endstops_trigsteps[XYZ]; // diff --git a/Marlin/src/module/stepper/L6470.cpp b/Marlin/src/module/stepper/L6470.cpp new file mode 100644 index 0000000000..d682193aa9 --- /dev/null +++ b/Marlin/src/module/stepper/L6470.cpp @@ -0,0 +1,143 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ + +/** + * stepper/L6470.cpp + * Stepper driver indirection for L6470 drivers + */ + +#include "../../inc/MarlinConfig.h" + +#if HAS_DRIVER(L6470) + +#include "L6470.h" + +#define _L6470_DEFINE(ST) L6470 stepper##ST((const int)L6470_CHAIN_SS_PIN) + +// L6470 Stepper objects +#if AXIS_DRIVER_TYPE_X(L6470) + _L6470_DEFINE(X); +#endif +#if AXIS_DRIVER_TYPE_X2(L6470) + _L6470_DEFINE(X2); +#endif +#if AXIS_DRIVER_TYPE_Y(L6470) + _L6470_DEFINE(Y); +#endif +#if AXIS_DRIVER_TYPE_Y2(L6470) + _L6470_DEFINE(Y2); +#endif +#if AXIS_DRIVER_TYPE_Z(L6470) + _L6470_DEFINE(Z); +#endif +#if AXIS_DRIVER_TYPE_Z2(L6470) + _L6470_DEFINE(Z2); +#endif +#if AXIS_DRIVER_TYPE_Z3(L6470) + _L6470_DEFINE(Z3); +#endif +#if AXIS_DRIVER_TYPE_E0(L6470) + _L6470_DEFINE(E0); +#endif +#if AXIS_DRIVER_TYPE_E1(L6470) + _L6470_DEFINE(E1); +#endif +#if AXIS_DRIVER_TYPE_E2(L6470) + _L6470_DEFINE(E2); +#endif +#if AXIS_DRIVER_TYPE_E3(L6470) + _L6470_DEFINE(E3); +#endif +#if AXIS_DRIVER_TYPE_E4(L6470) + _L6470_DEFINE(E4); +#endif +#if AXIS_DRIVER_TYPE_E5(L6470) + _L6470_DEFINE(E5); +#endif + +// not using L6470 library's init command because it +// briefly sends power to the steppers + +#define _L6470_INIT_CHIP(Q) do{ \ + stepper##Q.resetDev(); \ + stepper##Q.softFree(); \ + stepper##Q.SetParam(L6470_CONFIG, CONFIG_PWM_DIV_1 \ + | CONFIG_PWM_MUL_2 \ + | CONFIG_SR_290V_us \ + | CONFIG_OC_SD_DISABLE \ + | CONFIG_VS_COMP_DISABLE \ + | CONFIG_SW_HARD_STOP \ + | CONFIG_INT_16MHZ); \ + stepper##Q.SetParam(L6470_KVAL_RUN, 0xFF); \ + stepper##Q.SetParam(L6470_KVAL_ACC, 0xFF); \ + stepper##Q.SetParam(L6470_KVAL_DEC, 0xFF); \ + stepper##Q.setMicroSteps(Q##_MICROSTEPS); \ + stepper##Q.setOverCurrent(Q##_OVERCURRENT); \ + stepper##Q.setStallCurrent(Q##_STALLCURRENT); \ + stepper##Q.SetParam(L6470_KVAL_HOLD, Q##_MAX_VOLTAGE); \ + stepper##Q.SetParam(L6470_ABS_POS, 0); \ + stepper##Q.getStatus(); \ +}while(0) + +void L6470_Marlin::init_to_defaults() { + #if AXIS_DRIVER_TYPE_X(L6470) + _L6470_INIT_CHIP(X); + #endif + #if AXIS_DRIVER_TYPE_X2(L6470) + _L6470_INIT_CHIP(X2); + #endif + #if AXIS_DRIVER_TYPE_Y(L6470) + _L6470_INIT_CHIP(Y); + #endif + #if AXIS_DRIVER_TYPE_Y2(L6470) + _L6470_INIT_CHIP(Y2); + #endif + #if AXIS_DRIVER_TYPE_Z(L6470) + _L6470_INIT_CHIP(Z); + #endif + #if AXIS_DRIVER_TYPE_Z2(L6470) + _L6470_INIT_CHIP(Z2); + #endif + #if AXIS_DRIVER_TYPE_Z3(L6470) + _L6470_INIT_CHIP(Z3); + #endif + #if AXIS_DRIVER_TYPE_E0(L6470) + _L6470_INIT_CHIP(E0); + #endif + #if AXIS_DRIVER_TYPE_E1(L6470) + _L6470_INIT_CHIP(E1); + #endif + #if AXIS_DRIVER_TYPE_E2(L6470) + _L6470_INIT_CHIP(E2); + #endif + #if AXIS_DRIVER_TYPE_E3(L6470) + _L6470_INIT_CHIP(E3); + #endif + #if AXIS_DRIVER_TYPE_E4(L6470) + _L6470_INIT_CHIP(E4); + #endif + #if AXIS_DRIVER_TYPE_E5(L6470) + _L6470_INIT_CHIP(E5); + #endif +} + +#endif // L6470 diff --git a/Marlin/src/module/stepper/L6470.h b/Marlin/src/module/stepper/L6470.h new file mode 100644 index 0000000000..8c731a8042 --- /dev/null +++ b/Marlin/src/module/stepper/L6470.h @@ -0,0 +1,176 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * stepper/L6470.h + * Stepper driver indirection for L6470 drivers + */ + +#include "../../inc/MarlinConfig.h" +#include "../../libs/L6470/L6470_Marlin.h" + +// L6470 has STEP on normal pins, but DIR/ENABLE via SPI +#define L6470_WRITE_DIR_COMMAND(STATE,Q) do{ L6470_dir_commands[Q] = (STATE ? dSPIN_STEP_CLOCK_REV : dSPIN_STEP_CLOCK_FWD); }while(0) + +// X Stepper +#if AXIS_DRIVER_TYPE_X(L6470) + extern L6470 stepperX; + #define X_ENABLE_INIT NOOP + #define X_ENABLE_WRITE(STATE) NOOP + #define X_ENABLE_READ() (stepperX.getStatus() & STATUS_HIZ) + #define X_DIR_INIT NOOP + #define X_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,X) + #define X_DIR_READ() (stepperX.getStatus() & STATUS_DIR) +#endif + +// Y Stepper +#if AXIS_DRIVER_TYPE_Y(L6470) + extern L6470 stepperY; + #define Y_ENABLE_INIT NOOP + #define Y_ENABLE_WRITE(STATE) NOOP + #define Y_ENABLE_READ() (stepperY.getStatus() & STATUS_HIZ) + #define Y_DIR_INIT NOOP + #define Y_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Y) + #define Y_DIR_READ() (stepperY.getStatus() & STATUS_DIR) +#endif + +// Z Stepper +#if AXIS_DRIVER_TYPE_Z(L6470) + extern L6470 stepperZ; + #define Z_ENABLE_INIT NOOP + #define Z_ENABLE_WRITE(STATE) NOOP + #define Z_ENABLE_READ() (stepperZ.getStatus() & STATUS_HIZ) + #define Z_DIR_INIT NOOP + #define Z_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z) + #define Z_DIR_READ() (stepperZ.getStatus() & STATUS_DIR) +#endif + +// X2 Stepper +#if HAS_X2_ENABLE && AXIS_DRIVER_TYPE_X2(L6470) + extern L6470 stepperX2; + #define X2_ENABLE_INIT NOOP + #define X2_ENABLE_WRITE(STATE) NOOP + #define X2_ENABLE_READ() (stepperX2.getStatus() & STATUS_HIZ) + #define X2_DIR_INIT NOOP + #define X2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,X2) + #define X2_DIR_READ() (stepperX2.getStatus() & STATUS_DIR) +#endif + +// Y2 Stepper +#if HAS_Y2_ENABLE && AXIS_DRIVER_TYPE_Y2(L6470) + extern L6470 stepperY2; + #define Y2_ENABLE_INIT NOOP + #define Y2_ENABLE_WRITE(STATE) NOOP + #define Y2_ENABLE_READ() (stepperY2.getStatus() & STATUS_HIZ) + #define Y2_DIR_INIT NOOP + #define Y2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Y2) + #define Y2_DIR_READ() (stepperY2.getStatus() & STATUS_DIR) +#endif + +// Z2 Stepper +#if HAS_Z2_ENABLE && AXIS_DRIVER_TYPE_Z2(L6470) + extern L6470 stepperZ2; + #define Z2_ENABLE_INIT NOOP + #define Z2_ENABLE_WRITE(STATE) NOOP + #define Z2_ENABLE_READ() (stepperZ2.getStatus() & STATUS_HIZ) + #define Z2_DIR_INIT NOOP + #define Z2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z2) + #define Z2_DIR_READ() (stepperZ2.getStatus() & STATUS_DIR) +#endif + +// Z3 Stepper +#if HAS_Z3_ENABLE && AXIS_DRIVER_TYPE_Z3(L6470) + extern L6470 stepperZ3; + #define Z3_ENABLE_INIT NOOP + #define Z3_ENABLE_WRITE(STATE) NOOP + #define Z3_ENABLE_READ() (stepperZ3.getStatus() & STATUS_HIZ) + #define Z3_DIR_INIT NOOP + #define Z3_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z3) + #define Z3_DIR_READ() (stepperZ3.getStatus() & STATUS_DIR) +#endif + +// E0 Stepper +#if AXIS_DRIVER_TYPE_E0(L6470) + extern L6470 stepperE0; + #define E0_ENABLE_INIT NOOP + #define E0_ENABLE_WRITE(STATE) NOOP + #define E0_ENABLE_READ() (stepperE0.getStatus() & STATUS_HIZ) + #define E0_DIR_INIT NOOP + #define E0_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E0) + #define E0_DIR_READ() (stepperE0.getStatus() & STATUS_DIR) +#endif + +// E1 Stepper +#if AXIS_DRIVER_TYPE_E1(L6470) + extern L6470 stepperE1; + #define E1_ENABLE_INIT NOOP + #define E1_ENABLE_WRITE(STATE) NOOP + #define E1_ENABLE_READ() (stepperE1.getStatus() & STATUS_HIZ) + #define E1_DIR_INIT NOOP + #define E1_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E1) + #define E1_DIR_READ() (stepperE1.getStatus() & STATUS_DIR) +#endif + +// E2 Stepper +#if AXIS_DRIVER_TYPE_E2(L6470) + extern L6470 stepperE2; + #define E2_ENABLE_INIT NOOP + #define E2_ENABLE_WRITE(STATE) NOOP + #define E2_ENABLE_READ() (stepperE2.getStatus() & STATUS_HIZ) + #define E2_DIR_INIT NOOP + #define E2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E2) + #define E2_DIR_READ() (stepperE2.getStatus() & STATUS_DIR) +#endif + +// E3 Stepper +#if AXIS_DRIVER_TYPE_E3(L6470) + extern L6470 stepperE3; + #define E3_ENABLE_INIT NOOP + #define E3_ENABLE_WRITE(STATE) NOOP + #define E3_ENABLE_READ() (stepperE3.getStatus() & STATUS_HIZ) + #define E3_DIR_INIT NOOP + #define E3_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E3) + #define E3_DIR_READ() (stepperE3.getStatus() & STATUS_DIR) +#endif + +// E4 Stepper +#if AXIS_DRIVER_TYPE_E4(L6470) + extern L6470 stepperE4; + #define E4_ENABLE_INIT NOOP + #define E4_ENABLE_WRITE(STATE) NOOP + #define E4_ENABLE_READ() (stepperE4.getStatus() & STATUS_HIZ) + #define E4_DIR_INIT NOOP + #define E4_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E4) + #define E4_DIR_READ() (stepperE4.getStatus() & STATUS_DIR) +#endif + +// E5 Stepper +#if AXIS_DRIVER_TYPE_E5(L6470) + extern L6470 stepperE5; + #define E5_ENABLE_INIT NOOP + #define E5_ENABLE_WRITE(STATE) NOOP + #define E5_ENABLE_READ() (stepperE5.getStatus() & STATUS_HIZ) + #define E5_DIR_INIT NOOP + #define E5_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E5) + #define E5_DIR_READ() (stepperE5.getStatus() & STATUS_DIR) +#endif diff --git a/Marlin/src/module/stepper/TMC26X.cpp b/Marlin/src/module/stepper/TMC26X.cpp new file mode 100644 index 0000000000..8acb735c9d --- /dev/null +++ b/Marlin/src/module/stepper/TMC26X.cpp @@ -0,0 +1,126 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ + +/** + * stepper/TMC26X.cpp + * Stepper driver indirection for TMC26X drivers + */ + +#include "../../inc/MarlinConfig.h" + +// +// TMC26X Driver objects and inits +// +#if HAS_DRIVER(TMC26X) + +#include "TMC26X.h" + +#define _TMC26X_DEFINE(ST) TMC26XStepper stepper##ST(200, ST##_CS_PIN, ST##_STEP_PIN, ST##_DIR_PIN, ST##_MAX_CURRENT, ST##_SENSE_RESISTOR) + +#if AXIS_DRIVER_TYPE_X(TMC26X) + _TMC26X_DEFINE(X); +#endif +#if AXIS_DRIVER_TYPE_X2(TMC26X) + _TMC26X_DEFINE(X2); +#endif +#if AXIS_DRIVER_TYPE_Y(TMC26X) + _TMC26X_DEFINE(Y); +#endif +#if AXIS_DRIVER_TYPE_Y2(TMC26X) + _TMC26X_DEFINE(Y2); +#endif +#if AXIS_DRIVER_TYPE_Z(TMC26X) + _TMC26X_DEFINE(Z); +#endif +#if AXIS_DRIVER_TYPE_Z2(TMC26X) + _TMC26X_DEFINE(Z2); +#endif +#if AXIS_DRIVER_TYPE_Z3(TMC26X) + _TMC26X_DEFINE(Z3); +#endif +#if AXIS_DRIVER_TYPE_E0(TMC26X) + _TMC26X_DEFINE(E0); +#endif +#if AXIS_DRIVER_TYPE_E1(TMC26X) + _TMC26X_DEFINE(E1); +#endif +#if AXIS_DRIVER_TYPE_E2(TMC26X) + _TMC26X_DEFINE(E2); +#endif +#if AXIS_DRIVER_TYPE_E3(TMC26X) + _TMC26X_DEFINE(E3); +#endif +#if AXIS_DRIVER_TYPE_E4(TMC26X) + _TMC26X_DEFINE(E4); +#endif +#if AXIS_DRIVER_TYPE_E5(TMC26X) + _TMC26X_DEFINE(E5); +#endif + +#define _TMC26X_INIT(A) do{ \ + stepper##A.setMicrosteps(A##_MICROSTEPS); \ + stepper##A.start(); \ +}while(0) + +void tmc26x_init_to_defaults() { + #if AXIS_DRIVER_TYPE_X(TMC26X) + _TMC26X_INIT(X); + #endif + #if AXIS_DRIVER_TYPE_X2(TMC26X) + _TMC26X_INIT(X2); + #endif + #if AXIS_DRIVER_TYPE_Y(TMC26X) + _TMC26X_INIT(Y); + #endif + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + _TMC26X_INIT(Y2); + #endif + #if AXIS_DRIVER_TYPE_Z(TMC26X) + _TMC26X_INIT(Z); + #endif + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + _TMC26X_INIT(Z2); + #endif + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + _TMC26X_INIT(Z3); + #endif + #if AXIS_DRIVER_TYPE_E0(TMC26X) + _TMC26X_INIT(E0); + #endif + #if AXIS_DRIVER_TYPE_E1(TMC26X) + _TMC26X_INIT(E1); + #endif + #if AXIS_DRIVER_TYPE_E2(TMC26X) + _TMC26X_INIT(E2); + #endif + #if AXIS_DRIVER_TYPE_E3(TMC26X) + _TMC26X_INIT(E3); + #endif + #if AXIS_DRIVER_TYPE_E4(TMC26X) + _TMC26X_INIT(E4); + #endif + #if AXIS_DRIVER_TYPE_E5(TMC26X) + _TMC26X_INIT(E5); + #endif +} + +#endif // TMC26X diff --git a/Marlin/src/module/stepper/TMC26X.h b/Marlin/src/module/stepper/TMC26X.h new file mode 100644 index 0000000000..a1c2704823 --- /dev/null +++ b/Marlin/src/module/stepper/TMC26X.h @@ -0,0 +1,144 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * stepper/TMC26X.h + * Stepper driver indirection for TMC26X drivers + */ + +#include "../../inc/MarlinConfig.h" + +// TMC26X drivers have STEP/DIR on normal pins, but ENABLE via SPI + +#include +#if defined(STM32GENERIC) && defined(STM32F7) + #include "../../HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.h" +#else + #include +#endif + +void tmc26x_init_to_defaults(); + +// X Stepper +#if AXIS_DRIVER_TYPE_X(TMC26X) + extern TMC26XStepper stepperX; + #define X_ENABLE_INIT NOOP + #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE) + #define X_ENABLE_READ() stepperX.isEnabled() +#endif + +// Y Stepper +#if AXIS_DRIVER_TYPE_Y(TMC26X) + extern TMC26XStepper stepperY; + #define Y_ENABLE_INIT NOOP + #define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE) + #define Y_ENABLE_READ() stepperY.isEnabled() +#endif + +// Z Stepper +#if AXIS_DRIVER_TYPE_Z(TMC26X) + extern TMC26XStepper stepperZ; + #define Z_ENABLE_INIT NOOP + #define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE) + #define Z_ENABLE_READ() stepperZ.isEnabled() +#endif + +// X2 Stepper +#if HAS_X2_ENABLE && AXIS_DRIVER_TYPE_X2(TMC26X) + extern TMC26XStepper stepperX2; + #define X2_ENABLE_INIT NOOP + #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE) + #define X2_ENABLE_READ() stepperX2.isEnabled() +#endif + +// Y2 Stepper +#if HAS_Y2_ENABLE && AXIS_DRIVER_TYPE_Y2(TMC26X) + extern TMC26XStepper stepperY2; + #define Y2_ENABLE_INIT NOOP + #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE) + #define Y2_ENABLE_READ() stepperY2.isEnabled() +#endif + +// Z2 Stepper +#if HAS_Z2_ENABLE && AXIS_DRIVER_TYPE_Z2(TMC26X) + extern TMC26XStepper stepperZ2; + #define Z2_ENABLE_INIT NOOP + #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE) + #define Z2_ENABLE_READ() stepperZ2.isEnabled() +#endif + +// Z3 Stepper +#if HAS_Z3_ENABLE && ENABLED(Z3_IS_TMC26X) + extern TMC26XStepper stepperZ3; + #define Z3_ENABLE_INIT NOOP + #define Z3_ENABLE_WRITE(STATE) stepperZ3.setEnabled(STATE) + #define Z3_ENABLE_READ() stepperZ3.isEnabled() +#endif + +// E0 Stepper +#if AXIS_DRIVER_TYPE_E0(TMC26X) + extern TMC26XStepper stepperE0; + #define E0_ENABLE_INIT NOOP + #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE) + #define E0_ENABLE_READ() stepperE0.isEnabled() +#endif + +// E1 Stepper +#if AXIS_DRIVER_TYPE_E1(TMC26X) + extern TMC26XStepper stepperE1; + #define E1_ENABLE_INIT NOOP + #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE) + #define E1_ENABLE_READ() stepperE1.isEnabled() +#endif + +// E2 Stepper +#if AXIS_DRIVER_TYPE_E2(TMC26X) + extern TMC26XStepper stepperE2; + #define E2_ENABLE_INIT NOOP + #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE) + #define E2_ENABLE_READ() stepperE2.isEnabled() +#endif + +// E3 Stepper +#if AXIS_DRIVER_TYPE_E3(TMC26X) + extern TMC26XStepper stepperE3; + #define E3_ENABLE_INIT NOOP + #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE) + #define E3_ENABLE_READ() stepperE3.isEnabled() +#endif + +// E4 Stepper +#if AXIS_DRIVER_TYPE_E4(TMC26X) + extern TMC26XStepper stepperE4; + #define E4_ENABLE_INIT NOOP + #define E4_ENABLE_WRITE(STATE) stepperE4.setEnabled(STATE) + #define E4_ENABLE_READ() stepperE4.isEnabled() +#endif + +// E5 Stepper +#if AXIS_DRIVER_TYPE_E5(TMC26X) + extern TMC26XStepper stepperE5; + #define E5_ENABLE_INIT NOOP + #define E5_ENABLE_WRITE(STATE) stepperE5.setEnabled(STATE) + #define E5_ENABLE_READ() stepperE5.isEnabled() +#endif diff --git a/Marlin/src/module/stepper/indirection.cpp b/Marlin/src/module/stepper/indirection.cpp new file mode 100644 index 0000000000..2037c1b84e --- /dev/null +++ b/Marlin/src/module/stepper/indirection.cpp @@ -0,0 +1,53 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ + +/** + * stepper/indirection.cpp + * + * Stepper motor driver indirection to allow some stepper functions to + * be done via SPI/I2c instead of direct pin manipulation. + * + * Copyright (c) 2015 Dominik Wenger + */ + +#include "../../inc/MarlinConfig.h" +#include "indirection.h" + +void restore_stepper_drivers() { + #if HAS_TRINAMIC + restore_trinamic_drivers(); + #endif +} + +void reset_stepper_drivers() { + #if HAS_DRIVER(TMC26X) + tmc26x_init_to_defaults(); + #endif + + #if HAS_DRIVER(L6470) + L6470.init_to_defaults(); + #endif + + #if HAS_TRINAMIC + reset_trinamic_drivers(); + #endif +} diff --git a/Marlin/src/module/stepper/indirection.h b/Marlin/src/module/stepper/indirection.h new file mode 100644 index 0000000000..ed87fde83c --- /dev/null +++ b/Marlin/src/module/stepper/indirection.h @@ -0,0 +1,399 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * stepper/indirection.h + * + * Stepper motor driver indirection to allow some stepper functions to + * be done via SPI/I2c instead of direct pin manipulation. + * + * Copyright (c) 2015 Dominik Wenger + */ + +#include "../../inc/MarlinConfig.h" + +#if HAS_DRIVER(L6470) + #include "L6470.h" +#endif + +#if HAS_DRIVER(TMC26X) + #include "TMC26X.h" +#endif + +#if HAS_TRINAMIC + #include "trinamic.h" +#endif + +void restore_stepper_drivers(); // Called by PSU_ON +void reset_stepper_drivers(); // Called by settings.load / settings.reset + +// X Stepper +#ifndef X_ENABLE_INIT + #define X_ENABLE_INIT SET_OUTPUT(X_ENABLE_PIN) + #define X_ENABLE_WRITE(STATE) WRITE(X_ENABLE_PIN,STATE) + #define X_ENABLE_READ() READ(X_ENABLE_PIN) +#endif +#ifndef X_DIR_INIT + #define X_DIR_INIT SET_OUTPUT(X_DIR_PIN) + #define X_DIR_WRITE(STATE) WRITE(X_DIR_PIN,STATE) + #define X_DIR_READ() READ(X_DIR_PIN) +#endif +#define X_STEP_INIT SET_OUTPUT(X_STEP_PIN) +#ifndef X_STEP_WRITE + #define X_STEP_WRITE(STATE) WRITE(X_STEP_PIN,STATE) +#endif +#define X_STEP_READ READ(X_STEP_PIN) + +// Y Stepper +#ifndef Y_ENABLE_INIT + #define Y_ENABLE_INIT SET_OUTPUT(Y_ENABLE_PIN) + #define Y_ENABLE_WRITE(STATE) WRITE(Y_ENABLE_PIN,STATE) + #define Y_ENABLE_READ() READ(Y_ENABLE_PIN) +#endif +#ifndef Y_DIR_INIT + #define Y_DIR_INIT SET_OUTPUT(Y_DIR_PIN) + #define Y_DIR_WRITE(STATE) WRITE(Y_DIR_PIN,STATE) + #define Y_DIR_READ() READ(Y_DIR_PIN) +#endif +#define Y_STEP_INIT SET_OUTPUT(Y_STEP_PIN) +#ifndef Y_STEP_WRITE + #define Y_STEP_WRITE(STATE) WRITE(Y_STEP_PIN,STATE) +#endif +#define Y_STEP_READ READ(Y_STEP_PIN) + +// Z Stepper +#ifndef Z_ENABLE_INIT + #define Z_ENABLE_INIT SET_OUTPUT(Z_ENABLE_PIN) + #define Z_ENABLE_WRITE(STATE) WRITE(Z_ENABLE_PIN,STATE) + #define Z_ENABLE_READ() READ(Z_ENABLE_PIN) +#endif +#ifndef Z_DIR_INIT + #define Z_DIR_INIT SET_OUTPUT(Z_DIR_PIN) + #define Z_DIR_WRITE(STATE) WRITE(Z_DIR_PIN,STATE) + #define Z_DIR_READ() READ(Z_DIR_PIN) +#endif +#define Z_STEP_INIT SET_OUTPUT(Z_STEP_PIN) +#ifndef Z_STEP_WRITE + #define Z_STEP_WRITE(STATE) WRITE(Z_STEP_PIN,STATE) +#endif +#define Z_STEP_READ READ(Z_STEP_PIN) + +// X2 Stepper +#if HAS_X2_ENABLE + #ifndef X2_ENABLE_INIT + #define X2_ENABLE_INIT SET_OUTPUT(X2_ENABLE_PIN) + #define X2_ENABLE_WRITE(STATE) WRITE(X2_ENABLE_PIN,STATE) + #define X2_ENABLE_READ() READ(X2_ENABLE_PIN) + #endif + #ifndef X2_DIR_INIT + #define X2_DIR_INIT SET_OUTPUT(X2_DIR_PIN) + #define X2_DIR_WRITE(STATE) WRITE(X2_DIR_PIN,STATE) + #define X2_DIR_READ() READ(X2_DIR_PIN) + #endif + #define X2_STEP_INIT SET_OUTPUT(X2_STEP_PIN) + #ifndef X2_STEP_WRITE + #define X2_STEP_WRITE(STATE) WRITE(X2_STEP_PIN,STATE) + #endif + #define X2_STEP_READ READ(X2_STEP_PIN) +#endif + +// Y2 Stepper +#if HAS_Y2_ENABLE + #ifndef Y2_ENABLE_INIT + #define Y2_ENABLE_INIT SET_OUTPUT(Y2_ENABLE_PIN) + #define Y2_ENABLE_WRITE(STATE) WRITE(Y2_ENABLE_PIN,STATE) + #define Y2_ENABLE_READ() READ(Y2_ENABLE_PIN) + #endif + #ifndef Y2_DIR_INIT + #define Y2_DIR_INIT SET_OUTPUT(Y2_DIR_PIN) + #define Y2_DIR_WRITE(STATE) WRITE(Y2_DIR_PIN,STATE) + #define Y2_DIR_READ() READ(Y2_DIR_PIN) + #endif + #define Y2_STEP_INIT SET_OUTPUT(Y2_STEP_PIN) + #ifndef Y2_STEP_WRITE + #define Y2_STEP_WRITE(STATE) WRITE(Y2_STEP_PIN,STATE) + #endif + #define Y2_STEP_READ READ(Y2_STEP_PIN) +#else + #define Y2_DIR_WRITE(STATE) NOOP +#endif + +// Z2 Stepper +#if HAS_Z2_ENABLE + #ifndef Z2_ENABLE_INIT + #define Z2_ENABLE_INIT SET_OUTPUT(Z2_ENABLE_PIN) + #define Z2_ENABLE_WRITE(STATE) WRITE(Z2_ENABLE_PIN,STATE) + #define Z2_ENABLE_READ() READ(Z2_ENABLE_PIN) + #endif + #ifndef Z2_DIR_INIT + #define Z2_DIR_INIT SET_OUTPUT(Z2_DIR_PIN) + #define Z2_DIR_WRITE(STATE) WRITE(Z2_DIR_PIN,STATE) + #define Z2_DIR_READ() READ(Z2_DIR_PIN) + #endif + #define Z2_STEP_INIT SET_OUTPUT(Z2_STEP_PIN) + #ifndef Z2_STEP_WRITE + #define Z2_STEP_WRITE(STATE) WRITE(Z2_STEP_PIN,STATE) + #endif + #define Z2_STEP_READ READ(Z2_STEP_PIN) +#else + #define Z2_DIR_WRITE(STATE) NOOP +#endif + +// Z3 Stepper +#if HAS_Z3_ENABLE + #ifndef Z3_ENABLE_INIT + #define Z3_ENABLE_INIT SET_OUTPUT(Z3_ENABLE_PIN) + #define Z3_ENABLE_WRITE(STATE) WRITE(Z3_ENABLE_PIN,STATE) + #define Z3_ENABLE_READ() READ(Z3_ENABLE_PIN) + #endif + #ifndef Z3_DIR_INIT + #define Z3_DIR_INIT SET_OUTPUT(Z3_DIR_PIN) + #define Z3_DIR_WRITE(STATE) WRITE(Z3_DIR_PIN,STATE) + #define Z3_DIR_READ() READ(Z3_DIR_PIN) + #endif + #define Z3_STEP_INIT SET_OUTPUT(Z3_STEP_PIN) + #ifndef Z3_STEP_WRITE + #define Z3_STEP_WRITE(STATE) WRITE(Z3_STEP_PIN,STATE) + #endif + #define Z3_STEP_READ READ(Z3_STEP_PIN) +#else + #define Z3_DIR_WRITE(STATE) NOOP +#endif + +// E0 Stepper +#ifndef E0_ENABLE_INIT + #define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN) + #define E0_ENABLE_WRITE(STATE) WRITE(E0_ENABLE_PIN,STATE) + #define E0_ENABLE_READ() READ(E0_ENABLE_PIN) +#endif +#ifndef E0_DIR_INIT + #define E0_DIR_INIT SET_OUTPUT(E0_DIR_PIN) + #define E0_DIR_WRITE(STATE) WRITE(E0_DIR_PIN,STATE) + #define E0_DIR_READ() READ(E0_DIR_PIN) +#endif +#define E0_STEP_INIT SET_OUTPUT(E0_STEP_PIN) +#ifndef E0_STEP_WRITE + #define E0_STEP_WRITE(STATE) WRITE(E0_STEP_PIN,STATE) +#endif +#define E0_STEP_READ READ(E0_STEP_PIN) + +// E1 Stepper +#ifndef E1_ENABLE_INIT + #define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN) + #define E1_ENABLE_WRITE(STATE) WRITE(E1_ENABLE_PIN,STATE) + #define E1_ENABLE_READ() READ(E1_ENABLE_PIN) +#endif +#ifndef E1_DIR_INIT + #define E1_DIR_INIT SET_OUTPUT(E1_DIR_PIN) + #define E1_DIR_WRITE(STATE) WRITE(E1_DIR_PIN,STATE) + #define E1_DIR_READ() READ(E1_DIR_PIN) +#endif +#define E1_STEP_INIT SET_OUTPUT(E1_STEP_PIN) +#ifndef E1_STEP_WRITE + #define E1_STEP_WRITE(STATE) WRITE(E1_STEP_PIN,STATE) +#endif +#define E1_STEP_READ READ(E1_STEP_PIN) + +// E2 Stepper +#ifndef E2_ENABLE_INIT + #define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN) + #define E2_ENABLE_WRITE(STATE) WRITE(E2_ENABLE_PIN,STATE) + #define E2_ENABLE_READ() READ(E2_ENABLE_PIN) +#endif +#ifndef E2_DIR_INIT + #define E2_DIR_INIT SET_OUTPUT(E2_DIR_PIN) + #define E2_DIR_WRITE(STATE) WRITE(E2_DIR_PIN,STATE) + #define E2_DIR_READ() READ(E2_DIR_PIN) +#endif +#define E2_STEP_INIT SET_OUTPUT(E2_STEP_PIN) +#ifndef E2_STEP_WRITE + #define E2_STEP_WRITE(STATE) WRITE(E2_STEP_PIN,STATE) +#endif +#define E2_STEP_READ READ(E2_STEP_PIN) + +// E3 Stepper +#ifndef E3_ENABLE_INIT + #define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN) + #define E3_ENABLE_WRITE(STATE) WRITE(E3_ENABLE_PIN,STATE) + #define E3_ENABLE_READ() READ(E3_ENABLE_PIN) +#endif +#ifndef E3_DIR_INIT + #define E3_DIR_INIT SET_OUTPUT(E3_DIR_PIN) + #define E3_DIR_WRITE(STATE) WRITE(E3_DIR_PIN,STATE) + #define E3_DIR_READ() READ(E3_DIR_PIN) +#endif +#define E3_STEP_INIT SET_OUTPUT(E3_STEP_PIN) +#ifndef E3_STEP_WRITE + #define E3_STEP_WRITE(STATE) WRITE(E3_STEP_PIN,STATE) +#endif +#define E3_STEP_READ READ(E3_STEP_PIN) + +// E4 Stepper +#ifndef E4_ENABLE_INIT + #define E4_ENABLE_INIT SET_OUTPUT(E4_ENABLE_PIN) + #define E4_ENABLE_WRITE(STATE) WRITE(E4_ENABLE_PIN,STATE) + #define E4_ENABLE_READ() READ(E4_ENABLE_PIN) +#endif +#ifndef E4_DIR_INIT + #define E4_DIR_INIT SET_OUTPUT(E4_DIR_PIN) + #define E4_DIR_WRITE(STATE) WRITE(E4_DIR_PIN,STATE) + #define E4_DIR_READ() READ(E4_DIR_PIN) +#endif +#define E4_STEP_INIT SET_OUTPUT(E4_STEP_PIN) +#ifndef E4_STEP_WRITE + #define E4_STEP_WRITE(STATE) WRITE(E4_STEP_PIN,STATE) +#endif +#define E4_STEP_READ READ(E4_STEP_PIN) + +// E5 Stepper +#ifndef E5_ENABLE_INIT + #define E5_ENABLE_INIT SET_OUTPUT(E5_ENABLE_PIN) + #define E5_ENABLE_WRITE(STATE) WRITE(E5_ENABLE_PIN,STATE) + #define E5_ENABLE_READ() READ(E5_ENABLE_PIN) +#endif +#ifndef E5_DIR_INIT + #define E5_DIR_INIT SET_OUTPUT(E5_DIR_PIN) + #define E5_DIR_WRITE(STATE) WRITE(E5_DIR_PIN,STATE) + #define E5_DIR_READ() READ(E5_DIR_PIN) +#endif +#define E5_STEP_INIT SET_OUTPUT(E5_STEP_PIN) +#ifndef E5_STEP_WRITE + #define E5_STEP_WRITE(STATE) WRITE(E5_STEP_PIN,STATE) +#endif +#define E5_STEP_READ READ(E5_STEP_PIN) + +/** + * Extruder indirection for the single E axis + */ +#if ENABLED(SWITCHING_EXTRUDER) // One stepper driver per two extruders, reversed on odd index + #if EXTRUDERS > 5 + #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else if (E < 4) { E1_STEP_WRITE(V); } else { E2_STEP_WRITE(V); } }while(0) + #define NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; case 4: E2_DIR_WRITE(!INVERT_E2_DIR); case 5: E2_DIR_WRITE( INVERT_E2_DIR); } }while(0) + #define REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 4: E2_DIR_WRITE( INVERT_E2_DIR); case 5: E2_DIR_WRITE(!INVERT_E2_DIR); } }while(0) + #elif EXTRUDERS > 4 + #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else if (E < 4) { E1_STEP_WRITE(V); } else { E2_STEP_WRITE(V); } }while(0) + #define NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; case 4: E2_DIR_WRITE(!INVERT_E2_DIR); } }while(0) + #define REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 4: E2_DIR_WRITE( INVERT_E2_DIR); } }while(0) + #elif EXTRUDERS > 3 + #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) + #define NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); } }while(0) + #define REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0) + #elif EXTRUDERS > 2 + #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) + #define NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0) + #define REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE( INVERT_E1_DIR); } }while(0) + #else + #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) + #define NORM_E_DIR(E) do{ E0_DIR_WRITE(E ? INVERT_E0_DIR : !INVERT_E0_DIR); }while(0) + #define REV_E_DIR(E) do{ E0_DIR_WRITE(E ? !INVERT_E0_DIR : INVERT_E0_DIR); }while(0) + #endif +#elif ENABLED(PRUSA_MMU2) + #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) + #define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR) + #define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR) + +#elif ENABLED(MK2_MULTIPLEXER) // One multiplexed stepper driver, reversed on odd index + #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) + #define NORM_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? !INVERT_E0_DIR: INVERT_E0_DIR); }while(0) + #define REV_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? INVERT_E0_DIR: !INVERT_E0_DIR); }while(0) + +#elif E_STEPPERS > 1 + + #if E_STEPPERS > 5 + #define _E_STEP_WRITE(E,V) do{ switch (E) { case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); break; case 3: E3_STEP_WRITE(V); break; case 4: E4_STEP_WRITE(V); case 5: E5_STEP_WRITE(V); } }while(0) + #define _NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; case 4: E4_DIR_WRITE(!INVERT_E4_DIR); case 5: E5_DIR_WRITE(!INVERT_E5_DIR); } }while(0) + #define _REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; case 4: E4_DIR_WRITE( INVERT_E4_DIR); case 5: E5_DIR_WRITE( INVERT_E5_DIR); } }while(0) + #elif E_STEPPERS > 4 + #define _E_STEP_WRITE(E,V) do{ switch (E) { case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); break; case 3: E3_STEP_WRITE(V); break; case 4: E4_STEP_WRITE(V); } }while(0) + #define _NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; case 4: E4_DIR_WRITE(!INVERT_E4_DIR); } }while(0) + #define _REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; case 4: E4_DIR_WRITE( INVERT_E4_DIR); } }while(0) + #elif E_STEPPERS > 3 + #define _E_STEP_WRITE(E,V) do{ switch (E) { case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); break; case 3: E3_STEP_WRITE(V); } }while(0) + #define _NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); } }while(0) + #define _REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); } }while(0) + #elif E_STEPPERS > 2 + #define _E_STEP_WRITE(E,V) do{ switch (E) { case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); } }while(0) + #define _NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); } }while(0) + #define _REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 2: E2_DIR_WRITE( INVERT_E2_DIR); } }while(0) + #else + #define _E_STEP_WRITE(E,V) do{ if (E == 0) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) + #define _NORM_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0) + #define _REV_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE( INVERT_E0_DIR); } else { E1_DIR_WRITE( INVERT_E1_DIR); } }while(0) + #endif + + #if HAS_DUPLICATION_MODE + + #if ENABLED(MULTI_NOZZLE_DUPLICATION) + #define _DUPE(N,T,V) do{ if (TEST(duplication_e_mask, N)) E##N##_##T##_WRITE(V); }while(0) + #else + #define _DUPE(N,T,V) E##N##_##T##_WRITE(V) + #endif + + #define NDIR(N) _DUPE(N,DIR,!INVERT_E##N##_DIR) + #define RDIR(N) _DUPE(N,DIR, INVERT_E##N##_DIR) + + #define E_STEP_WRITE(E,V) do{ if (extruder_duplication_enabled) { DUPE(STEP,V); } else _E_STEP_WRITE(E,V); }while(0) + + #if E_STEPPERS > 2 + #if E_STEPPERS > 5 + #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); _DUPE(3,T,V); _DUPE(4,T,V); _DUPE(5,T,V); }while(0) + #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); NDIR(3); NDIR(4); NDIR(5); } else _NORM_E_DIR(E); }while(0) + #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); RDIR(3); RDIR(4); RDIR(5); } else _REV_E_DIR(E); }while(0) + #elif E_STEPPERS > 4 + #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); _DUPE(3,T,V); _DUPE(4,T,V); }while(0) + #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); NDIR(3); NDIR(4); } else _NORM_E_DIR(E); }while(0) + #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); RDIR(3); RDIR(4); } else _REV_E_DIR(E); }while(0) + #elif E_STEPPERS > 3 + #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); _DUPE(3,T,V); }while(0) + #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); NDIR(3); } else _NORM_E_DIR(E); }while(0) + #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); RDIR(3); } else _REV_E_DIR(E); }while(0) + #else + #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); }while(0) + #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); } else _NORM_E_DIR(E); }while(0) + #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); } else _REV_E_DIR(E); }while(0) + #endif + #else + #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); }while(0) + #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); } else _NORM_E_DIR(E); }while(0) + #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); } else _REV_E_DIR(E); }while(0) + #endif + + #else + + #define E_STEP_WRITE(E,V) _E_STEP_WRITE(E,V) + #define NORM_E_DIR(E) _NORM_E_DIR(E) + #define REV_E_DIR(E) _REV_E_DIR(E) + + #endif + +#elif E_STEPPERS + #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) + #define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR) + #define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR) + +#else + #define E_STEP_WRITE(E,V) NOOP + #define NORM_E_DIR(E) NOOP + #define REV_E_DIR(E) NOOP + +#endif diff --git a/Marlin/src/module/stepper_indirection.cpp b/Marlin/src/module/stepper/trinamic.cpp similarity index 64% rename from Marlin/src/module/stepper_indirection.cpp rename to Marlin/src/module/stepper/trinamic.cpp index 786cb1db8f..a0910204e6 100644 --- a/Marlin/src/module/stepper_indirection.cpp +++ b/Marlin/src/module/stepper/trinamic.cpp @@ -21,204 +21,90 @@ */ /** - * stepper_indirection.cpp - * - * Stepper motor driver indirection to allow some stepper functions to - * be done via SPI/I2c instead of direct pin manipulation. - * - * Copyright (c) 2015 Dominik Wenger + * stepper/trinamic.cpp + * Stepper driver indirection for Trinamic */ -#include "stepper_indirection.h" - -#include "../inc/MarlinConfig.h" - -#include "stepper.h" - -#if HAS_DRIVER(L6470) - #include "L6470/L6470_Marlin.h" -#endif - -// -// TMC26X Driver objects and inits -// -#if HAS_DRIVER(TMC26X) - #include - - #if defined(STM32GENERIC) && defined(STM32F7) - #include "../HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.h" - #else - #include - #endif - - #define _TMC26X_DEFINE(ST) TMC26XStepper stepper##ST(200, ST##_CS_PIN, ST##_STEP_PIN, ST##_DIR_PIN, ST##_MAX_CURRENT, ST##_SENSE_RESISTOR) - - #if AXIS_DRIVER_TYPE_X(TMC26X) - _TMC26X_DEFINE(X); - #endif - #if AXIS_DRIVER_TYPE_X2(TMC26X) - _TMC26X_DEFINE(X2); - #endif - #if AXIS_DRIVER_TYPE_Y(TMC26X) - _TMC26X_DEFINE(Y); - #endif - #if AXIS_DRIVER_TYPE_Y2(TMC26X) - _TMC26X_DEFINE(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z(TMC26X) - _TMC26X_DEFINE(Z); - #endif - #if AXIS_DRIVER_TYPE_Z2(TMC26X) - _TMC26X_DEFINE(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(TMC26X) - _TMC26X_DEFINE(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(TMC26X) - _TMC26X_DEFINE(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(TMC26X) - _TMC26X_DEFINE(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(TMC26X) - _TMC26X_DEFINE(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(TMC26X) - _TMC26X_DEFINE(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(TMC26X) - _TMC26X_DEFINE(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(TMC26X) - _TMC26X_DEFINE(E5); - #endif - - #define _TMC26X_INIT(A) do{ \ - stepper##A.setMicrosteps(A##_MICROSTEPS); \ - stepper##A.start(); \ - }while(0) - - void tmc26x_init_to_defaults() { - #if AXIS_DRIVER_TYPE_X(TMC26X) - _TMC26X_INIT(X); - #endif - #if AXIS_DRIVER_TYPE_X2(TMC26X) - _TMC26X_INIT(X2); - #endif - #if AXIS_DRIVER_TYPE_Y(TMC26X) - _TMC26X_INIT(Y); - #endif - #if AXIS_DRIVER_TYPE_Y2(TMC26X) - _TMC26X_INIT(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z(TMC26X) - _TMC26X_INIT(Z); - #endif - #if AXIS_DRIVER_TYPE_Z2(TMC26X) - _TMC26X_INIT(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(TMC26X) - _TMC26X_INIT(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(TMC26X) - _TMC26X_INIT(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(TMC26X) - _TMC26X_INIT(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(TMC26X) - _TMC26X_INIT(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(TMC26X) - _TMC26X_INIT(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(TMC26X) - _TMC26X_INIT(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(TMC26X) - _TMC26X_INIT(E5); - #endif - } -#endif // TMC26X +#include "../../inc/MarlinConfig.h" #if HAS_TRINAMIC - #include - #include - #include "planner.h" - #include "../core/enum.h" - enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; - #define _TMC_INIT(ST, STEALTH_INDEX) tmc_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, stealthchop_by_axis[STEALTH_INDEX]) +#include "trinamic.h" +#include "../stepper.h" - // IC = TMC model number - // ST = Stepper object letter - // L = Label characters - // AI = Axis Enum Index - // SWHW = SW/SH UART selection - #if ENABLED(TMC_USE_SW_SPI) - #define __TMC_SPI_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_CS_PIN, ST##_RSENSE, TMC_SW_MOSI, TMC_SW_MISO, TMC_SW_SCK) - #else - #define __TMC_SPI_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_CS_PIN, ST##_RSENSE) - #endif +#include +#include - #define TMC_UART_HW_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(&ST##_HARDWARE_SERIAL, ST##_RSENSE, ST##_SLAVE_ADDRESS) - #define TMC_UART_SW_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_SERIAL_RX_PIN, ST##_SERIAL_TX_PIN, ST##_RSENSE, ST##_SLAVE_ADDRESS, ST##_SERIAL_RX_PIN > -1) +enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; +#define _TMC_INIT(ST, STEALTH_INDEX) tmc_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, stealthchop_by_axis[STEALTH_INDEX]) - #define _TMC_SPI_DEFINE(IC, ST, AI) __TMC_SPI_DEFINE(IC, ST, TMC_##ST##_LABEL, AI) - #define TMC_SPI_DEFINE(ST, AI) _TMC_SPI_DEFINE(ST##_DRIVER_TYPE, ST, AI##_AXIS) +// IC = TMC model number +// ST = Stepper object letter +// L = Label characters +// AI = Axis Enum Index +// SWHW = SW/SH UART selection +#if ENABLED(TMC_USE_SW_SPI) + #define __TMC_SPI_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_CS_PIN, ST##_RSENSE, TMC_SW_MOSI, TMC_SW_MISO, TMC_SW_SCK) +#else + #define __TMC_SPI_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_CS_PIN, ST##_RSENSE) +#endif - #define _TMC_UART_DEFINE(SWHW, IC, ST, AI) TMC_UART_##SWHW##_DEFINE(IC, ST, TMC_##ST##_LABEL, AI) - #define TMC_UART_DEFINE(SWHW, ST, AI) _TMC_UART_DEFINE(SWHW, ST##_DRIVER_TYPE, ST, AI##_AXIS) +#define TMC_UART_HW_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(&ST##_HARDWARE_SERIAL, ST##_RSENSE, ST##_SLAVE_ADDRESS) +#define TMC_UART_SW_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_SERIAL_RX_PIN, ST##_SERIAL_TX_PIN, ST##_RSENSE, ST##_SLAVE_ADDRESS, ST##_SERIAL_RX_PIN > -1) - #if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1 - #define TMC_SPI_DEFINE_E(AI) TMC_SPI_DEFINE(E##AI, E##AI) - #define TMC_UART_DEFINE_E(SWHW, AI) TMC_UART_DEFINE(SWHW, E##AI, E##AI) - #else - #define TMC_SPI_DEFINE_E(AI) TMC_SPI_DEFINE(E##AI, E) - #define TMC_UART_DEFINE_E(SWHW, AI) TMC_UART_DEFINE(SWHW, E##AI, E) - #endif +#define _TMC_SPI_DEFINE(IC, ST, AI) __TMC_SPI_DEFINE(IC, ST, TMC_##ST##_LABEL, AI) +#define TMC_SPI_DEFINE(ST, AI) _TMC_SPI_DEFINE(ST##_DRIVER_TYPE, ST, AI##_AXIS) - // Stepper objects of TMC2130/TMC2160/TMC2660/TMC5130/TMC5160 steppers used - #if AXIS_HAS_SPI(X) - TMC_SPI_DEFINE(X, X); - #endif - #if AXIS_HAS_SPI(X2) - TMC_SPI_DEFINE(X2, X); - #endif - #if AXIS_HAS_SPI(Y) - TMC_SPI_DEFINE(Y, Y); - #endif - #if AXIS_HAS_SPI(Y2) - TMC_SPI_DEFINE(Y2, Y); - #endif - #if AXIS_HAS_SPI(Z) - TMC_SPI_DEFINE(Z, Z); - #endif - #if AXIS_HAS_SPI(Z2) - TMC_SPI_DEFINE(Z2, Z); - #endif - #if AXIS_HAS_SPI(Z3) - TMC_SPI_DEFINE(Z3, Z); - #endif - #if AXIS_HAS_SPI(E0) - TMC_SPI_DEFINE_E(0); - #endif - #if AXIS_HAS_SPI(E1) - TMC_SPI_DEFINE_E(1); - #endif - #if AXIS_HAS_SPI(E2) - TMC_SPI_DEFINE_E(2); - #endif - #if AXIS_HAS_SPI(E3) - TMC_SPI_DEFINE_E(3); - #endif - #if AXIS_HAS_SPI(E4) - TMC_SPI_DEFINE_E(4); - #endif - #if AXIS_HAS_SPI(E5) - TMC_SPI_DEFINE_E(5); - #endif +#define _TMC_UART_DEFINE(SWHW, IC, ST, AI) TMC_UART_##SWHW##_DEFINE(IC, ST, TMC_##ST##_LABEL, AI) +#define TMC_UART_DEFINE(SWHW, ST, AI) _TMC_UART_DEFINE(SWHW, ST##_DRIVER_TYPE, ST, AI##_AXIS) +#if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1 + #define TMC_SPI_DEFINE_E(AI) TMC_SPI_DEFINE(E##AI, E##AI) + #define TMC_UART_DEFINE_E(SWHW, AI) TMC_UART_DEFINE(SWHW, E##AI, E##AI) +#else + #define TMC_SPI_DEFINE_E(AI) TMC_SPI_DEFINE(E##AI, E) + #define TMC_UART_DEFINE_E(SWHW, AI) TMC_UART_DEFINE(SWHW, E##AI, E) +#endif + +// Stepper objects of TMC2130/TMC2160/TMC2660/TMC5130/TMC5160 steppers used +#if AXIS_HAS_SPI(X) + TMC_SPI_DEFINE(X, X); +#endif +#if AXIS_HAS_SPI(X2) + TMC_SPI_DEFINE(X2, X); +#endif +#if AXIS_HAS_SPI(Y) + TMC_SPI_DEFINE(Y, Y); +#endif +#if AXIS_HAS_SPI(Y2) + TMC_SPI_DEFINE(Y2, Y); +#endif +#if AXIS_HAS_SPI(Z) + TMC_SPI_DEFINE(Z, Z); +#endif +#if AXIS_HAS_SPI(Z2) + TMC_SPI_DEFINE(Z2, Z); +#endif +#if AXIS_HAS_SPI(Z3) + TMC_SPI_DEFINE(Z3, Z); +#endif +#if AXIS_HAS_SPI(E0) + TMC_SPI_DEFINE_E(0); +#endif +#if AXIS_HAS_SPI(E1) + TMC_SPI_DEFINE_E(1); +#endif +#if AXIS_HAS_SPI(E2) + TMC_SPI_DEFINE_E(2); +#endif +#if AXIS_HAS_SPI(E3) + TMC_SPI_DEFINE_E(3); +#endif +#if AXIS_HAS_SPI(E4) + TMC_SPI_DEFINE_E(4); +#endif +#if AXIS_HAS_SPI(E5) + TMC_SPI_DEFINE_E(5); #endif #if HAS_DRIVER(TMC2130) @@ -704,7 +590,7 @@ } #endif // TMC5160 -void restore_stepper_drivers() { +void restore_trinamic_drivers() { #if AXIS_IS_TMC(X) stepperX.push(); #endif @@ -746,37 +632,113 @@ void restore_stepper_drivers() { #endif } -void reset_stepper_drivers() { +void reset_trinamic_drivers() { + static constexpr bool stealthchop_by_axis[] = { + #if ENABLED(STEALTHCHOP_XY) + true + #else + false + #endif + , + #if ENABLED(STEALTHCHOP_Z) + true + #else + false + #endif + , + #if ENABLED(STEALTHCHOP_E) + true + #else + false + #endif + }; - #if HAS_DRIVER(TMC26X) - tmc26x_init_to_defaults(); - #endif + #if TMC_USE_CHAIN - #if HAS_DRIVER(L6470) - L6470.init_to_defaults(); - #endif + enum TMC_axis_enum : unsigned char { _, X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5 }; + #define __TMC_CHAIN(Q,V) do{ stepper##Q.set_chain_info(Q,V); }while(0) + #define _TMC_CHAIN(Q) __TMC_CHAIN(Q, Q##_CHAIN_POS) - #if HAS_TRINAMIC - static constexpr bool stealthchop_by_axis[] = { - #if ENABLED(STEALTHCHOP_XY) - true - #else - false - #endif - , - #if ENABLED(STEALTHCHOP_Z) - true - #else - false - #endif - , - #if ENABLED(STEALTHCHOP_E) - true - #else - false - #endif - }; - #endif + #if AXIS_HAS_SPI(X) // First set chain array to uninitialized + __TMC_CHAIN(X, 0); + #endif + #if AXIS_HAS_SPI(X2) + __TMC_CHAIN(X2, 0); + #endif + #if AXIS_HAS_SPI(Y) + __TMC_CHAIN(Y, 0); + #endif + #if AXIS_HAS_SPI(Y2) + __TMC_CHAIN(Y2, 0); + #endif + #if AXIS_HAS_SPI(Z) + __TMC_CHAIN(Z, 0); + #endif + #if AXIS_HAS_SPI(Z2) + __TMC_CHAIN(Z2, 0); + #endif + #if AXIS_HAS_SPI(Z3) + __TMC_CHAIN(Z3, 0); + #endif + #if AXIS_HAS_SPI(E0) + __TMC_CHAIN(E0, 0); + #endif + #if AXIS_HAS_SPI(E1) + __TMC_CHAIN(E1, 0); + #endif + #if AXIS_HAS_SPI(E2) + __TMC_CHAIN(E2, 0); + #endif + #if AXIS_HAS_SPI(E3) + __TMC_CHAIN(E3, 0); + #endif + #if AXIS_HAS_SPI(E4) + __TMC_CHAIN(E4, 0); + #endif + #if AXIS_HAS_SPI(E5) + __TMC_CHAIN(E5, 0); + #endif + + #if AXIS_HAS_SPI(X) && X_CHAIN_POS // Now set up the SPI chain + _TMC_CHAIN(X); + #endif + #if AXIS_HAS_SPI(X2) && X2_CHAIN_POS + _TMC_CHAIN(X2); + #endif + #if AXIS_HAS_SPI(Y) && Y_CHAIN_POS + _TMC_CHAIN(Y); + #endif + #if AXIS_HAS_SPI(Y2) && Y2_CHAIN_POS + _TMC_CHAIN(Y2); + #endif + #if AXIS_HAS_SPI(Z) && Z_CHAIN_POS + _TMC_CHAIN(Z); + #endif + #if AXIS_HAS_SPI(Z2) && Z2_CHAIN_POS + _TMC_CHAIN(Z2); + #endif + #if AXIS_HAS_SPI(Z3) && Z3_CHAIN_POS + _TMC_CHAIN(Z3); + #endif + #if AXIS_HAS_SPI(E0) && E0_CHAIN_POS + _TMC_CHAIN(E0); + #endif + #if AXIS_HAS_SPI(E1) && E1_CHAIN_POS + _TMC_CHAIN(E1); + #endif + #if AXIS_HAS_SPI(E2) && E2_CHAIN_POS + _TMC_CHAIN(E2); + #endif + #if AXIS_HAS_SPI(E3) && E3_CHAIN_POS + _TMC_CHAIN(E3); + #endif + #if AXIS_HAS_SPI(E4) && E4_CHAIN_POS + _TMC_CHAIN(E4); + #endif + #if AXIS_HAS_SPI(E5) && E5_CHAIN_POS + _TMC_CHAIN(E5); + #endif + #endif // TMC_USE_CHAIN #if AXIS_IS_TMC(X) _TMC_INIT(X, STEALTH_AXIS_XY); @@ -823,10 +785,13 @@ void reset_stepper_drivers() { #if AXIS_HAS_STALLGUARD(X) stepperX.homing_threshold(X_STALL_SENSITIVITY); #endif - #if AXIS_HAS_STALLGUARD(X2) + #if AXIS_HAS_STALLGUARD(X2) && !X2_SENSORLESS stepperX2.homing_threshold(X_STALL_SENSITIVITY); #endif #endif + #if X2_SENSORLESS + stepperX2.homing_threshold(X2_STALL_SENSITIVITY); + #endif #if Y_SENSORLESS #if AXIS_HAS_STALLGUARD(Y) stepperY.homing_threshold(Y_STALL_SENSITIVITY); @@ -852,125 +817,7 @@ void reset_stepper_drivers() { TMC_ADV() #endif - #if HAS_TRINAMIC - stepper.set_directions(); - #endif + stepper.set_directions(); } -// -// L6470 Driver objects and inits -// -#if HAS_DRIVER(L6470) - - // create stepper objects - - #define _L6470_DEFINE(ST) L6470 stepper##ST((const int)L6470_CHAIN_SS_PIN) - - // L6470 Stepper objects - #if AXIS_DRIVER_TYPE_X(L6470) - _L6470_DEFINE(X); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - _L6470_DEFINE(X2); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - _L6470_DEFINE(Y); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - _L6470_DEFINE(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - _L6470_DEFINE(Z); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - _L6470_DEFINE(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - _L6470_DEFINE(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - _L6470_DEFINE(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - _L6470_DEFINE(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - _L6470_DEFINE(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - _L6470_DEFINE(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - _L6470_DEFINE(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - _L6470_DEFINE(E5); - #endif - - // not using L6470 library's init command because it - // briefly sends power to the steppers - - #define _L6470_INIT_CHIP(Q) do{ \ - stepper##Q.resetDev(); \ - stepper##Q.softFree(); \ - stepper##Q.SetParam(L6470_CONFIG, CONFIG_PWM_DIV_1 \ - | CONFIG_PWM_MUL_2 \ - | CONFIG_SR_290V_us \ - | CONFIG_OC_SD_DISABLE \ - | CONFIG_VS_COMP_DISABLE \ - | CONFIG_SW_HARD_STOP \ - | CONFIG_INT_16MHZ); \ - stepper##Q.SetParam(L6470_KVAL_RUN, 0xFF); \ - stepper##Q.SetParam(L6470_KVAL_ACC, 0xFF); \ - stepper##Q.SetParam(L6470_KVAL_DEC, 0xFF); \ - stepper##Q.setMicroSteps(Q##_MICROSTEPS); \ - stepper##Q.setOverCurrent(Q##_OVERCURRENT); \ - stepper##Q.setStallCurrent(Q##_STALLCURRENT); \ - stepper##Q.SetParam(L6470_KVAL_HOLD, Q##_MAX_VOLTAGE); \ - stepper##Q.SetParam(L6470_ABS_POS, 0); \ - stepper##Q.getStatus(); \ - }while(0) - - void L6470_Marlin::init_to_defaults() { - #if AXIS_DRIVER_TYPE_X(L6470) - _L6470_INIT_CHIP(X); - #endif - #if AXIS_DRIVER_TYPE_X2(L6470) - _L6470_INIT_CHIP(X2); - #endif - #if AXIS_DRIVER_TYPE_Y(L6470) - _L6470_INIT_CHIP(Y); - #endif - #if AXIS_DRIVER_TYPE_Y2(L6470) - _L6470_INIT_CHIP(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z(L6470) - _L6470_INIT_CHIP(Z); - #endif - #if AXIS_DRIVER_TYPE_Z2(L6470) - _L6470_INIT_CHIP(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(L6470) - _L6470_INIT_CHIP(Z3); - #endif - #if AXIS_DRIVER_TYPE_E0(L6470) - _L6470_INIT_CHIP(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(L6470) - _L6470_INIT_CHIP(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(L6470) - _L6470_INIT_CHIP(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(L6470) - _L6470_INIT_CHIP(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(L6470) - _L6470_INIT_CHIP(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(L6470) - _L6470_INIT_CHIP(E5); - #endif - } - -#endif // L6470 +#endif // HAS_TRINAMIC diff --git a/Marlin/src/module/stepper/trinamic.h b/Marlin/src/module/stepper/trinamic.h new file mode 100644 index 0000000000..8c6e9c21aa --- /dev/null +++ b/Marlin/src/module/stepper/trinamic.h @@ -0,0 +1,232 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * stepper/trinamic.h + * Stepper driver indirection for Trinamic + */ + +#include +#if TMCSTEPPER_VERSION < 0x000500 + #error "Update TMCStepper library to 0.5.0 or newer." +#endif + +#include "../../inc/MarlinConfig.h" +#include "../../feature/tmc_util.h" + +#define ____TMC_CLASS(MODEL, A, I, E) TMCMarlin +#define ___TMC_CLASS(MODEL, A, I, E) ____TMC_CLASS(MODEL, A, I, E) +#define __TMC_CLASS(MODEL, A, I, E) ___TMC_CLASS(_##MODEL, A, I, E) +#define _TMC_CLASS(MODEL, L, E) __TMC_CLASS(MODEL, L, E) +#define TMC_CLASS(ST, A) _TMC_CLASS(ST##_DRIVER_TYPE, TMC_##ST##_LABEL, A##_AXIS) +#if ENABLED(DISTINCT_E_FACTORS) + #define TMC_CLASS_E(I) TMC_CLASS(E##I, E##I) +#else + #define TMC_CLASS_E(I) TMC_CLASS(E##I, E) +#endif + +typedef struct { + uint8_t toff; + int8_t hend; + uint8_t hstrt; +} chopper_timing_t; + +static constexpr chopper_timing_t chopper_timing = CHOPPER_TIMING; + +#if HAS_TMC220x + void tmc_serial_begin(); +#endif + +void restore_trinamic_drivers(); +void reset_trinamic_drivers(); + +#define AXIS_HAS_SQUARE_WAVE(A) (AXIS_IS_TMC(A) && ENABLED(SQUARE_WAVE_STEPPING)) + +// X Stepper +#if AXIS_IS_TMC(X) + extern TMC_CLASS(X, X) stepperX; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) + #define X_ENABLE_INIT NOOP + #define X_ENABLE_WRITE(STATE) stepperX.toff((STATE)==X_ENABLE_ON ? chopper_timing.toff : 0) + #define X_ENABLE_READ() stepperX.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(X) + #define X_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(X_STEP_PIN); }while(0) + #endif +#endif + +// Y Stepper +#if AXIS_IS_TMC(Y) + extern TMC_CLASS(Y, Y) stepperY; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) + #define Y_ENABLE_INIT NOOP + #define Y_ENABLE_WRITE(STATE) stepperY.toff((STATE)==Y_ENABLE_ON ? chopper_timing.toff : 0) + #define Y_ENABLE_READ() stepperY.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(Y) + #define Y_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Y_STEP_PIN); }while(0) + #endif +#endif + +// Z Stepper +#if AXIS_IS_TMC(Z) + extern TMC_CLASS(Z, Z) stepperZ; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) + #define Z_ENABLE_INIT NOOP + #define Z_ENABLE_WRITE(STATE) stepperZ.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0) + #define Z_ENABLE_READ() stepperZ.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(Z) + #define Z_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Z_STEP_PIN); }while(0) + #endif +#endif + +// X2 Stepper +#if HAS_X2_ENABLE && AXIS_IS_TMC(X2) + extern TMC_CLASS(X2, X) stepperX2; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) + #define X2_ENABLE_INIT NOOP + #define X2_ENABLE_WRITE(STATE) stepperX2.toff((STATE)==X_ENABLE_ON ? chopper_timing.toff : 0) + #define X2_ENABLE_READ() stepperX2.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(X2) + #define X2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(X2_STEP_PIN); }while(0) + #endif +#endif + +// Y2 Stepper +#if HAS_Y2_ENABLE && AXIS_IS_TMC(Y2) + extern TMC_CLASS(Y2, Y) stepperY2; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) + #define Y2_ENABLE_INIT NOOP + #define Y2_ENABLE_WRITE(STATE) stepperY2.toff((STATE)==Y_ENABLE_ON ? chopper_timing.toff : 0) + #define Y2_ENABLE_READ() stepperY2.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(Y2) + #define Y2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Y2_STEP_PIN); }while(0) + #endif +#endif + +// Z2 Stepper +#if HAS_Z2_ENABLE && AXIS_IS_TMC(Z2) + extern TMC_CLASS(Z2, Z) stepperZ2; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2) + #define Z2_ENABLE_INIT NOOP + #define Z2_ENABLE_WRITE(STATE) stepperZ2.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0) + #define Z2_ENABLE_READ() stepperZ2.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(Z2) + #define Z2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Z2_STEP_PIN); }while(0) + #endif +#endif + +// Z3 Stepper +#if HAS_Z3_ENABLE && AXIS_IS_TMC(Z3) + extern TMC_CLASS(Z3, Z) stepperZ3; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) + #define Z3_ENABLE_INIT NOOP + #define Z3_ENABLE_WRITE(STATE) stepperZ3.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0) + #define Z3_ENABLE_READ() stepperZ3.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(Z3) + #define Z3_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Z3_STEP_PIN); }while(0) + #endif +#endif + +// E0 Stepper +#if AXIS_IS_TMC(E0) + extern TMC_CLASS_E(0) stepperE0; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0) + #define E0_ENABLE_INIT NOOP + #define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E0_ENABLE_READ() stepperE0.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(E0) + #define E0_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E0_STEP_PIN); }while(0) + #endif +#endif + +// E1 Stepper +#if AXIS_IS_TMC(E1) + extern TMC_CLASS_E(1) stepperE1; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1) + #define E1_ENABLE_INIT NOOP + #define E1_ENABLE_WRITE(STATE) stepperE1.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E1_ENABLE_READ() stepperE1.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(E1) + #define E1_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E1_STEP_PIN); }while(0) + #endif +#endif + +// E2 Stepper +#if AXIS_IS_TMC(E2) + extern TMC_CLASS_E(2) stepperE2; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2) + #define E2_ENABLE_INIT NOOP + #define E2_ENABLE_WRITE(STATE) stepperE2.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E2_ENABLE_READ() stepperE2.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(E2) + #define E2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E2_STEP_PIN); }while(0) + #endif +#endif + +// E3 Stepper +#if AXIS_IS_TMC(E3) + extern TMC_CLASS_E(3) stepperE3; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3) + #define E3_ENABLE_INIT NOOP + #define E3_ENABLE_WRITE(STATE) stepperE3.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E3_ENABLE_READ() stepperE3.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(E3) + #define E3_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E3_STEP_PIN); }while(0) + #endif +#endif + +// E4 Stepper +#if AXIS_IS_TMC(E4) + extern TMC_CLASS_E(4) stepperE4; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4) + #define E4_ENABLE_INIT NOOP + #define E4_ENABLE_WRITE(STATE) stepperE4.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E4_ENABLE_READ() stepperE4.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(E4) + #define E4_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E4_STEP_PIN); }while(0) + #endif +#endif + +// E5 Stepper +#if AXIS_IS_TMC(E5) + extern TMC_CLASS_E(5) stepperE5; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5) + #define E5_ENABLE_INIT NOOP + #define E5_ENABLE_WRITE(STATE) stepperE5.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E5_ENABLE_READ() stepperE5.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(E5) + #define E5_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E5_STEP_PIN); }while(0) + #endif +#endif diff --git a/Marlin/src/module/stepper_indirection.h b/Marlin/src/module/stepper_indirection.h deleted file mode 100644 index 4651b707c2..0000000000 --- a/Marlin/src/module/stepper_indirection.h +++ /dev/null @@ -1,727 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 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 . - * - */ -#pragma once - -/** - * stepper_indirection.h - * - * Stepper motor driver indirection to allow some stepper functions to - * be done via SPI/I2c instead of direct pin manipulation. - * - * Copyright (c) 2015 Dominik Wenger - */ - -#include "../inc/MarlinConfig.h" - -// TMC26X drivers have STEP/DIR on normal pins, but ENABLE via SPI -#if HAS_DRIVER(TMC26X) - #include - #if defined(STM32GENERIC) && defined(STM32F7) - #include "../HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.h" - #else - #include - #endif - void tmc26x_init_to_defaults(); -#endif - -#if HAS_TRINAMIC - #include - #include "../feature/tmc_util.h" - #if TMCSTEPPER_VERSION < 0x000405 - #error "Update TMCStepper library to 0.4.5 or newer." - #endif - - #define ____TMC_CLASS(MODEL, A, I, E) TMCMarlin - #define ___TMC_CLASS(MODEL, A, I, E) ____TMC_CLASS(MODEL, A, I, E) - #define __TMC_CLASS(MODEL, A, I, E) ___TMC_CLASS(_##MODEL, A, I, E) - #define _TMC_CLASS(MODEL, L, E) __TMC_CLASS(MODEL, L, E) - #define TMC_CLASS(ST, A) _TMC_CLASS(ST##_DRIVER_TYPE, TMC_##ST##_LABEL, A##_AXIS) - #if ENABLED(DISTINCT_E_FACTORS) - #define TMC_CLASS_E(I) TMC_CLASS(E##I, E##I) - #else - #define TMC_CLASS_E(I) TMC_CLASS(E##I, E) - #endif - - typedef struct { - uint8_t toff; - int8_t hend; - uint8_t hstrt; - } chopper_timing_t; - - static constexpr chopper_timing_t chopper_timing = CHOPPER_TIMING; - - #if HAS_TMC220x - void tmc_serial_begin(); - #endif -#endif - -// L6470 has STEP on normal pins, but DIR/ENABLE via SPI -#if HAS_DRIVER(L6470) - #include "L6470/L6470_Marlin.h" - #define L6470_WRITE_DIR_COMMAND(STATE,Q) do{ L6470_dir_commands[Q] = (STATE ? dSPIN_STEP_CLOCK_REV : dSPIN_STEP_CLOCK_FWD); }while(0) -#endif - -void restore_stepper_drivers(); // Called by PSU_ON -void reset_stepper_drivers(); // Called by settings.load / settings.reset - -#define AXIS_HAS_SQUARE_WAVE(A) (AXIS_IS_TMC(A) && ENABLED(SQUARE_WAVE_STEPPING)) - -// X Stepper -#if AXIS_DRIVER_TYPE_X(L6470) - extern L6470 stepperX; - #define X_ENABLE_INIT NOOP - #define X_ENABLE_WRITE(STATE) NOOP - #define X_ENABLE_READ() (stepperX.getStatus() & STATUS_HIZ) - #define X_DIR_INIT NOOP - #define X_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,X) - #define X_DIR_READ() (stepperX.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(X) - extern TMC_CLASS(X, X) stepperX; - #endif - #if AXIS_DRIVER_TYPE_X(TMC26X) - extern TMC26XStepper stepperX; - #define X_ENABLE_INIT NOOP - #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE) - #define X_ENABLE_READ() stepperX.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X) - #define X_ENABLE_INIT NOOP - #define X_ENABLE_WRITE(STATE) stepperX.toff((STATE)==X_ENABLE_ON ? chopper_timing.toff : 0) - #define X_ENABLE_READ() stepperX.isEnabled() - #else - #define X_ENABLE_INIT SET_OUTPUT(X_ENABLE_PIN) - #define X_ENABLE_WRITE(STATE) WRITE(X_ENABLE_PIN,STATE) - #define X_ENABLE_READ() READ(X_ENABLE_PIN) - #endif - #define X_DIR_INIT SET_OUTPUT(X_DIR_PIN) - #define X_DIR_WRITE(STATE) WRITE(X_DIR_PIN,STATE) - #define X_DIR_READ() READ(X_DIR_PIN) -#endif -#define X_STEP_INIT SET_OUTPUT(X_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(X) - #define X_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(X_STEP_PIN); }while(0) -#else - #define X_STEP_WRITE(STATE) WRITE(X_STEP_PIN,STATE) -#endif -#define X_STEP_READ READ(X_STEP_PIN) - -// Y Stepper -#if AXIS_DRIVER_TYPE_Y(L6470) - extern L6470 stepperY; - #define Y_ENABLE_INIT NOOP - #define Y_ENABLE_WRITE(STATE) NOOP - #define Y_ENABLE_READ() (stepperY.getStatus() & STATUS_HIZ) - #define Y_DIR_INIT NOOP - #define Y_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Y) - #define Y_DIR_READ() (stepperY.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(Y) - extern TMC_CLASS(Y, Y) stepperY; - #endif - #if AXIS_DRIVER_TYPE_Y(TMC26X) - extern TMC26XStepper stepperY; - #define Y_ENABLE_INIT NOOP - #define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE) - #define Y_ENABLE_READ() stepperY.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y) - #define Y_ENABLE_INIT NOOP - #define Y_ENABLE_WRITE(STATE) stepperY.toff((STATE)==Y_ENABLE_ON ? chopper_timing.toff : 0) - #define Y_ENABLE_READ() stepperY.isEnabled() - #else - #define Y_ENABLE_INIT SET_OUTPUT(Y_ENABLE_PIN) - #define Y_ENABLE_WRITE(STATE) WRITE(Y_ENABLE_PIN,STATE) - #define Y_ENABLE_READ() READ(Y_ENABLE_PIN) - #endif - #define Y_DIR_INIT SET_OUTPUT(Y_DIR_PIN) - #define Y_DIR_WRITE(STATE) WRITE(Y_DIR_PIN,STATE) - #define Y_DIR_READ() READ(Y_DIR_PIN) -#endif -#define Y_STEP_INIT SET_OUTPUT(Y_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(Y) - #define Y_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Y_STEP_PIN); }while(0) -#else - #define Y_STEP_WRITE(STATE) WRITE(Y_STEP_PIN,STATE) -#endif -#define Y_STEP_READ READ(Y_STEP_PIN) - -// Z Stepper -#if AXIS_DRIVER_TYPE_Z(L6470) - extern L6470 stepperZ; - #define Z_ENABLE_INIT NOOP - #define Z_ENABLE_WRITE(STATE) NOOP - #define Z_ENABLE_READ() (stepperZ.getStatus() & STATUS_HIZ) - #define Z_DIR_INIT NOOP - #define Z_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z) - #define Z_DIR_READ() (stepperZ.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(Z) - extern TMC_CLASS(Z, Z) stepperZ; - #endif - #if AXIS_DRIVER_TYPE_Z(TMC26X) - extern TMC26XStepper stepperZ; - #define Z_ENABLE_INIT NOOP - #define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE) - #define Z_ENABLE_READ() stepperZ.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z) - #define Z_ENABLE_INIT NOOP - #define Z_ENABLE_WRITE(STATE) stepperZ.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0) - #define Z_ENABLE_READ() stepperZ.isEnabled() - #else - #define Z_ENABLE_INIT SET_OUTPUT(Z_ENABLE_PIN) - #define Z_ENABLE_WRITE(STATE) WRITE(Z_ENABLE_PIN,STATE) - #define Z_ENABLE_READ() READ(Z_ENABLE_PIN) - #endif - #define Z_DIR_INIT SET_OUTPUT(Z_DIR_PIN) - #define Z_DIR_WRITE(STATE) WRITE(Z_DIR_PIN,STATE) - #define Z_DIR_READ() READ(Z_DIR_PIN) -#endif -#define Z_STEP_INIT SET_OUTPUT(Z_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(Z) - #define Z_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Z_STEP_PIN); }while(0) -#else - #define Z_STEP_WRITE(STATE) WRITE(Z_STEP_PIN,STATE) -#endif -#define Z_STEP_READ READ(Z_STEP_PIN) - -// X2 Stepper -#if HAS_X2_ENABLE - #if AXIS_DRIVER_TYPE_X2(L6470) - extern L6470 stepperX2; - #define X2_ENABLE_INIT NOOP - #define X2_ENABLE_WRITE(STATE) NOOP - #define X2_ENABLE_READ() (stepperX2.getStatus() & STATUS_HIZ) - #define X2_DIR_INIT NOOP - #define X2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,X2) - #define X2_DIR_READ() (stepperX2.getStatus() & STATUS_DIR) - #else - #if AXIS_IS_TMC(X2) - extern TMC_CLASS(X2, X) stepperX2; - #endif - #if AXIS_DRIVER_TYPE_X2(TMC26X) - extern TMC26XStepper stepperX2; - #define X2_ENABLE_INIT NOOP - #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE) - #define X2_ENABLE_READ() stepperX2.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X2) - #define X2_ENABLE_INIT NOOP - #define X2_ENABLE_WRITE(STATE) stepperX2.toff((STATE)==X_ENABLE_ON ? chopper_timing.toff : 0) - #define X2_ENABLE_READ() stepperX2.isEnabled() - #else - #define X2_ENABLE_INIT SET_OUTPUT(X2_ENABLE_PIN) - #define X2_ENABLE_WRITE(STATE) WRITE(X2_ENABLE_PIN,STATE) - #define X2_ENABLE_READ() READ(X2_ENABLE_PIN) - #endif - #define X2_DIR_INIT SET_OUTPUT(X2_DIR_PIN) - #define X2_DIR_WRITE(STATE) WRITE(X2_DIR_PIN,STATE) - #define X2_DIR_READ() READ(X2_DIR_PIN) - #endif - #define X2_STEP_INIT SET_OUTPUT(X2_STEP_PIN) - #if AXIS_HAS_SQUARE_WAVE(X2) - #define X2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(X2_STEP_PIN); }while(0) - #else - #define X2_STEP_WRITE(STATE) WRITE(X2_STEP_PIN,STATE) - #endif - - #define X2_STEP_READ READ(X2_STEP_PIN) -#endif - -// Y2 Stepper -#if HAS_Y2_ENABLE - #if AXIS_DRIVER_TYPE_Y2(L6470) - extern L6470 stepperY2; - #define Y2_ENABLE_INIT NOOP - #define Y2_ENABLE_WRITE(STATE) NOOP - #define Y2_ENABLE_READ() (stepperY2.getStatus() & STATUS_HIZ) - #define Y2_DIR_INIT NOOP - #define Y2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Y2) - #define Y2_DIR_READ() (stepperY2.getStatus() & STATUS_DIR) - #else - #if AXIS_IS_TMC(Y2) - extern TMC_CLASS(Y2, Y) stepperY2; - #endif - #if AXIS_DRIVER_TYPE_Y2(TMC26X) - extern TMC26XStepper stepperY2; - #define Y2_ENABLE_INIT NOOP - #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE) - #define Y2_ENABLE_READ() stepperY2.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2) - #define Y2_ENABLE_INIT NOOP - #define Y2_ENABLE_WRITE(STATE) stepperY2.toff((STATE)==Y_ENABLE_ON ? chopper_timing.toff : 0) - #define Y2_ENABLE_READ() stepperY2.isEnabled() - #else - #define Y2_ENABLE_INIT SET_OUTPUT(Y2_ENABLE_PIN) - #define Y2_ENABLE_WRITE(STATE) WRITE(Y2_ENABLE_PIN,STATE) - #define Y2_ENABLE_READ() READ(Y2_ENABLE_PIN) - #endif - #define Y2_DIR_INIT SET_OUTPUT(Y2_DIR_PIN) - #define Y2_DIR_WRITE(STATE) WRITE(Y2_DIR_PIN,STATE) - #define Y2_DIR_READ() READ(Y2_DIR_PIN) - #endif - #define Y2_STEP_INIT SET_OUTPUT(Y2_STEP_PIN) - #if AXIS_HAS_SQUARE_WAVE(Y2) - #define Y2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Y2_STEP_PIN); }while(0) - #else - #define Y2_STEP_WRITE(STATE) WRITE(Y2_STEP_PIN,STATE) - #endif - - #define Y2_STEP_READ READ(Y2_STEP_PIN) -#else - #define Y2_DIR_WRITE(STATE) NOOP -#endif - -// Z2 Stepper -#if HAS_Z2_ENABLE - #if AXIS_DRIVER_TYPE_Z2(L6470) - extern L6470 stepperZ2; - #define Z2_ENABLE_INIT NOOP - #define Z2_ENABLE_WRITE(STATE) NOOP - #define Z2_ENABLE_READ() (stepperZ2.getStatus() & STATUS_HIZ) - #define Z2_DIR_INIT NOOP - #define Z2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z2) - #define Z2_DIR_READ() (stepperZ2.getStatus() & STATUS_DIR) - #else - #if AXIS_IS_TMC(Z2) - extern TMC_CLASS(Z2, Z) stepperZ2; - #endif - #if AXIS_DRIVER_TYPE_Z2(TMC26X) - extern TMC26XStepper stepperZ2; - #define Z2_ENABLE_INIT NOOP - #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE) - #define Z2_ENABLE_READ() stepperZ2.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2) - #define Z2_ENABLE_INIT NOOP - #define Z2_ENABLE_WRITE(STATE) stepperZ2.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0) - #define Z2_ENABLE_READ() stepperZ2.isEnabled() - #else - #define Z2_ENABLE_INIT SET_OUTPUT(Z2_ENABLE_PIN) - #define Z2_ENABLE_WRITE(STATE) WRITE(Z2_ENABLE_PIN,STATE) - #define Z2_ENABLE_READ() READ(Z2_ENABLE_PIN) - #endif - #define Z2_DIR_INIT SET_OUTPUT(Z2_DIR_PIN) - #define Z2_DIR_WRITE(STATE) WRITE(Z2_DIR_PIN,STATE) - #define Z2_DIR_READ() READ(Z2_DIR_PIN) - #endif - #define Z2_STEP_INIT SET_OUTPUT(Z2_STEP_PIN) - #if AXIS_HAS_SQUARE_WAVE(Z2) - #define Z2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Z2_STEP_PIN); }while(0) - #else - #define Z2_STEP_WRITE(STATE) WRITE(Z2_STEP_PIN,STATE) - #endif - - #define Z2_STEP_READ READ(Z2_STEP_PIN) -#else - #define Z2_DIR_WRITE(STATE) NOOP -#endif - -// Z3 Stepper -#if HAS_Z3_ENABLE - #if AXIS_DRIVER_TYPE_Z3(L6470) - extern L6470 stepperZ3; - #define Z3_ENABLE_INIT NOOP - #define Z3_ENABLE_WRITE(STATE) NOOP - #define Z3_ENABLE_READ() (stepperZ3.getStatus() & STATUS_HIZ) - #define Z3_DIR_INIT NOOP - #define Z3_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z3) - #define Z3_DIR_READ() (stepperZ3.getStatus() & STATUS_DIR) - #else - #if AXIS_IS_TMC(Z3) - extern TMC_CLASS(Z3, Z) stepperZ3; - #endif - #if ENABLED(Z3_IS_TMC26X) - extern TMC26XStepper stepperZ3; - #define Z3_ENABLE_INIT NOOP - #define Z3_ENABLE_WRITE(STATE) stepperZ3.setEnabled(STATE) - #define Z3_ENABLE_READ() stepperZ3.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3) - #define Z3_ENABLE_INIT NOOP - #define Z3_ENABLE_WRITE(STATE) stepperZ3.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0) - #define Z3_ENABLE_READ() stepperZ3.isEnabled() - #else - #define Z3_ENABLE_INIT SET_OUTPUT(Z3_ENABLE_PIN) - #define Z3_ENABLE_WRITE(STATE) WRITE(Z3_ENABLE_PIN,STATE) - #define Z3_ENABLE_READ() READ(Z3_ENABLE_PIN) - #endif - #define Z3_DIR_INIT SET_OUTPUT(Z3_DIR_PIN) - #define Z3_DIR_WRITE(STATE) WRITE(Z3_DIR_PIN,STATE) - #define Z3_DIR_READ() READ(Z3_DIR_PIN) - #endif - #define Z3_STEP_INIT SET_OUTPUT(Z3_STEP_PIN) - #if AXIS_HAS_SQUARE_WAVE(Z3) - #define Z3_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Z3_STEP_PIN); }while(0) - #else - #define Z3_STEP_WRITE(STATE) WRITE(Z3_STEP_PIN,STATE) - #endif - - #define Z3_STEP_READ READ(Z3_STEP_PIN) -#else - #define Z3_DIR_WRITE(STATE) NOOP -#endif - -// E0 Stepper -#if AXIS_DRIVER_TYPE_E0(L6470) - extern L6470 stepperE0; - #define E0_ENABLE_INIT NOOP - #define E0_ENABLE_WRITE(STATE) NOOP - #define E0_ENABLE_READ() (stepperE0.getStatus() & STATUS_HIZ) - #define E0_DIR_INIT NOOP - #define E0_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E0) - #define E0_DIR_READ() (stepperE0.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E0) - extern TMC_CLASS_E(0) stepperE0; - #endif - #if AXIS_DRIVER_TYPE_E0(TMC26X) - extern TMC26XStepper stepperE0; - #define E0_ENABLE_INIT NOOP - #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE) - #define E0_ENABLE_READ() stepperE0.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0) - #define E0_ENABLE_INIT NOOP - #define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E0_ENABLE_READ() stepperE0.isEnabled() - #else - #define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN) - #define E0_ENABLE_WRITE(STATE) WRITE(E0_ENABLE_PIN,STATE) - #define E0_ENABLE_READ() READ(E0_ENABLE_PIN) - #endif - #define E0_DIR_INIT SET_OUTPUT(E0_DIR_PIN) - #define E0_DIR_WRITE(STATE) WRITE(E0_DIR_PIN,STATE) - #define E0_DIR_READ() READ(E0_DIR_PIN) -#endif -#define E0_STEP_INIT SET_OUTPUT(E0_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(E0) - #define E0_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E0_STEP_PIN); }while(0) -#else - #define E0_STEP_WRITE(STATE) WRITE(E0_STEP_PIN,STATE) -#endif -#define E0_STEP_READ READ(E0_STEP_PIN) - -// E1 Stepper -#if AXIS_DRIVER_TYPE_E1(L6470) - extern L6470 stepperE1; - #define E1_ENABLE_INIT NOOP - #define E1_ENABLE_WRITE(STATE) NOOP - #define E1_ENABLE_READ() (stepperE1.getStatus() & STATUS_HIZ) - #define E1_DIR_INIT NOOP - #define E1_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E1) - #define E1_DIR_READ() (stepperE1.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E1) - extern TMC_CLASS_E(1) stepperE1; - #endif - #if AXIS_DRIVER_TYPE_E1(TMC26X) - extern TMC26XStepper stepperE1; - #define E1_ENABLE_INIT NOOP - #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE) - #define E1_ENABLE_READ() stepperE1.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1) - #define E1_ENABLE_INIT NOOP - #define E1_ENABLE_WRITE(STATE) stepperE1.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E1_ENABLE_READ() stepperE1.isEnabled() - #else - #define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN) - #define E1_ENABLE_WRITE(STATE) WRITE(E1_ENABLE_PIN,STATE) - #define E1_ENABLE_READ() READ(E1_ENABLE_PIN) - #endif - #define E1_DIR_INIT SET_OUTPUT(E1_DIR_PIN) - #define E1_DIR_WRITE(STATE) WRITE(E1_DIR_PIN,STATE) - #define E1_DIR_READ() READ(E1_DIR_PIN) -#endif -#define E1_STEP_INIT SET_OUTPUT(E1_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(E1) - #define E1_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E1_STEP_PIN); }while(0) -#else - #define E1_STEP_WRITE(STATE) WRITE(E1_STEP_PIN,STATE) -#endif -#define E1_STEP_READ READ(E1_STEP_PIN) - -// E2 Stepper -#if AXIS_DRIVER_TYPE_E2(L6470) - extern L6470 stepperE2; - #define E2_ENABLE_INIT NOOP - #define E2_ENABLE_WRITE(STATE) NOOP - #define E2_ENABLE_READ() (stepperE2.getStatus() & STATUS_HIZ) - #define E2_DIR_INIT NOOP - #define E2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E2) - #define E2_DIR_READ() (stepperE2.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E2) - extern TMC_CLASS_E(2) stepperE2; - #endif - #if AXIS_DRIVER_TYPE_E2(TMC26X) - extern TMC26XStepper stepperE2; - #define E2_ENABLE_INIT NOOP - #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE) - #define E2_ENABLE_READ() stepperE2.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2) - #define E2_ENABLE_INIT NOOP - #define E2_ENABLE_WRITE(STATE) stepperE2.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E2_ENABLE_READ() stepperE2.isEnabled() - #else - #define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN) - #define E2_ENABLE_WRITE(STATE) WRITE(E2_ENABLE_PIN,STATE) - #define E2_ENABLE_READ() READ(E2_ENABLE_PIN) - #endif - #define E2_DIR_INIT SET_OUTPUT(E2_DIR_PIN) - #define E2_DIR_WRITE(STATE) WRITE(E2_DIR_PIN,STATE) - #define E2_DIR_READ() READ(E2_DIR_PIN) -#endif -#define E2_STEP_INIT SET_OUTPUT(E2_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(E2) - #define E2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E2_STEP_PIN); }while(0) -#else - #define E2_STEP_WRITE(STATE) WRITE(E2_STEP_PIN,STATE) -#endif -#define E2_STEP_READ READ(E2_STEP_PIN) - -// E3 Stepper -#if AXIS_DRIVER_TYPE_E3(L6470) - extern L6470 stepperE3; - #define E3_ENABLE_INIT NOOP - #define E3_ENABLE_WRITE(STATE) NOOP - #define E3_ENABLE_READ() (stepperE3.getStatus() & STATUS_HIZ) - #define E3_DIR_INIT NOOP - #define E3_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E3) - #define E3_DIR_READ() (stepperE3.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E3) - extern TMC_CLASS_E(3) stepperE3; - #endif - #if AXIS_DRIVER_TYPE_E3(TMC26X) - extern TMC26XStepper stepperE3; - #define E3_ENABLE_INIT NOOP - #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE) - #define E3_ENABLE_READ() stepperE3.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3) - #define E3_ENABLE_INIT NOOP - #define E3_ENABLE_WRITE(STATE) stepperE3.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E3_ENABLE_READ() stepperE3.isEnabled() - #else - #define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN) - #define E3_ENABLE_WRITE(STATE) WRITE(E3_ENABLE_PIN,STATE) - #define E3_ENABLE_READ() READ(E3_ENABLE_PIN) - #endif - #define E3_DIR_INIT SET_OUTPUT(E3_DIR_PIN) - #define E3_DIR_WRITE(STATE) WRITE(E3_DIR_PIN,STATE) - #define E3_DIR_READ() READ(E3_DIR_PIN) -#endif -#define E3_STEP_INIT SET_OUTPUT(E3_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(E3) - #define E3_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E3_STEP_PIN); }while(0) -#else - #define E3_STEP_WRITE(STATE) WRITE(E3_STEP_PIN,STATE) -#endif -#define E3_STEP_READ READ(E3_STEP_PIN) - -// E4 Stepper -#if AXIS_DRIVER_TYPE_E4(L6470) - extern L6470 stepperE4; - #define E4_ENABLE_INIT NOOP - #define E4_ENABLE_WRITE(STATE) NOOP - #define E4_ENABLE_READ() (stepperE4.getStatus() & STATUS_HIZ) - #define E4_DIR_INIT NOOP - #define E4_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E4) - #define E4_DIR_READ() (stepperE4.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E4) - extern TMC_CLASS_E(4) stepperE4; - #endif - #if AXIS_DRIVER_TYPE_E4(TMC26X) - extern TMC26XStepper stepperE4; - #define E4_ENABLE_INIT NOOP - #define E4_ENABLE_WRITE(STATE) stepperE4.setEnabled(STATE) - #define E4_ENABLE_READ() stepperE4.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4) - #define E4_ENABLE_INIT NOOP - #define E4_ENABLE_WRITE(STATE) stepperE4.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E4_ENABLE_READ() stepperE4.isEnabled() - #else - #define E4_ENABLE_INIT SET_OUTPUT(E4_ENABLE_PIN) - #define E4_ENABLE_WRITE(STATE) WRITE(E4_ENABLE_PIN,STATE) - #define E4_ENABLE_READ() READ(E4_ENABLE_PIN) - #endif - #define E4_DIR_INIT SET_OUTPUT(E4_DIR_PIN) - #define E4_DIR_WRITE(STATE) WRITE(E4_DIR_PIN,STATE) - #define E4_DIR_READ() READ(E4_DIR_PIN) -#endif -#define E4_STEP_INIT SET_OUTPUT(E4_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(E4) - #define E4_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E4_STEP_PIN); }while(0) -#else - #define E4_STEP_WRITE(STATE) WRITE(E4_STEP_PIN,STATE) -#endif -#define E4_STEP_READ READ(E4_STEP_PIN) - -// E5 Stepper -#if AXIS_DRIVER_TYPE_E5(L6470) - extern L6470 stepperE5; - #define E5_ENABLE_INIT NOOP - #define E5_ENABLE_WRITE(STATE) NOOP - #define E5_ENABLE_READ() (stepperE5.getStatus() & STATUS_HIZ) - #define E5_DIR_INIT NOOP - #define E5_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E5) - #define E5_DIR_READ() (stepperE5.getStatus() & STATUS_DIR) -#else - #if AXIS_IS_TMC(E5) - extern TMC_CLASS_E(5) stepperE5; - #endif - #if AXIS_DRIVER_TYPE_E5(TMC26X) - extern TMC26XStepper stepperE5; - #define E5_ENABLE_INIT NOOP - #define E5_ENABLE_WRITE(STATE) stepperE5.setEnabled(STATE) - #define E5_ENABLE_READ() stepperE5.isEnabled() - #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5) - #define E5_ENABLE_INIT NOOP - #define E5_ENABLE_WRITE(STATE) stepperE5.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) - #define E5_ENABLE_READ() stepperE5.isEnabled() - #else - #define E5_ENABLE_INIT SET_OUTPUT(E5_ENABLE_PIN) - #define E5_ENABLE_WRITE(STATE) WRITE(E5_ENABLE_PIN,STATE) - #define E5_ENABLE_READ() READ(E5_ENABLE_PIN) - #endif - #define E5_DIR_INIT SET_OUTPUT(E5_DIR_PIN) - #define E5_DIR_WRITE(STATE) WRITE(E5_DIR_PIN,STATE) - #define E5_DIR_READ() READ(E5_DIR_PIN) -#endif -#define E5_STEP_INIT SET_OUTPUT(E5_STEP_PIN) -#if AXIS_HAS_SQUARE_WAVE(E5) - #define E5_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E5_STEP_PIN); }while(0) -#else - #define E5_STEP_WRITE(STATE) WRITE(E5_STEP_PIN,STATE) -#endif -#define E5_STEP_READ READ(E5_STEP_PIN) - -/** - * Extruder indirection for the single E axis - */ -#if ENABLED(SWITCHING_EXTRUDER) // One stepper driver per two extruders, reversed on odd index - #if EXTRUDERS > 5 - #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else if (E < 4) { E1_STEP_WRITE(V); } else { E2_STEP_WRITE(V); } }while(0) - #define NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; case 4: E2_DIR_WRITE(!INVERT_E2_DIR); case 5: E2_DIR_WRITE( INVERT_E2_DIR); } }while(0) - #define REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 4: E2_DIR_WRITE( INVERT_E2_DIR); case 5: E2_DIR_WRITE(!INVERT_E2_DIR); } }while(0) - #elif EXTRUDERS > 4 - #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else if (E < 4) { E1_STEP_WRITE(V); } else { E2_STEP_WRITE(V); } }while(0) - #define NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; case 4: E2_DIR_WRITE(!INVERT_E2_DIR); } }while(0) - #define REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 4: E2_DIR_WRITE( INVERT_E2_DIR); } }while(0) - #elif EXTRUDERS > 3 - #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) - #define NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); } }while(0) - #define REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0) - #elif EXTRUDERS > 2 - #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) - #define NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0) - #define REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE( INVERT_E1_DIR); } }while(0) - #else - #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) - #define NORM_E_DIR(E) do{ E0_DIR_WRITE(E ? INVERT_E0_DIR : !INVERT_E0_DIR); }while(0) - #define REV_E_DIR(E) do{ E0_DIR_WRITE(E ? !INVERT_E0_DIR : INVERT_E0_DIR); }while(0) - #endif -#elif ENABLED(PRUSA_MMU2) - #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) - #define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR) - #define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR) - -#elif ENABLED(MK2_MULTIPLEXER) // One multiplexed stepper driver, reversed on odd index - #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) - #define NORM_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? !INVERT_E0_DIR: INVERT_E0_DIR); }while(0) - #define REV_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? INVERT_E0_DIR: !INVERT_E0_DIR); }while(0) - -#elif E_STEPPERS > 1 - - #if E_STEPPERS > 5 - #define _E_STEP_WRITE(E,V) do{ switch (E) { case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); break; case 3: E3_STEP_WRITE(V); break; case 4: E4_STEP_WRITE(V); case 5: E5_STEP_WRITE(V); } }while(0) - #define _NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; case 4: E4_DIR_WRITE(!INVERT_E4_DIR); case 5: E5_DIR_WRITE(!INVERT_E5_DIR); } }while(0) - #define _REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; case 4: E4_DIR_WRITE( INVERT_E4_DIR); case 5: E5_DIR_WRITE( INVERT_E5_DIR); } }while(0) - #elif E_STEPPERS > 4 - #define _E_STEP_WRITE(E,V) do{ switch (E) { case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); break; case 3: E3_STEP_WRITE(V); break; case 4: E4_STEP_WRITE(V); } }while(0) - #define _NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; case 4: E4_DIR_WRITE(!INVERT_E4_DIR); } }while(0) - #define _REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; case 4: E4_DIR_WRITE( INVERT_E4_DIR); } }while(0) - #elif E_STEPPERS > 3 - #define _E_STEP_WRITE(E,V) do{ switch (E) { case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); break; case 3: E3_STEP_WRITE(V); } }while(0) - #define _NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); } }while(0) - #define _REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); } }while(0) - #elif E_STEPPERS > 2 - #define _E_STEP_WRITE(E,V) do{ switch (E) { case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); } }while(0) - #define _NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); } }while(0) - #define _REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 2: E2_DIR_WRITE( INVERT_E2_DIR); } }while(0) - #else - #define _E_STEP_WRITE(E,V) do{ if (E == 0) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) - #define _NORM_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0) - #define _REV_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE( INVERT_E0_DIR); } else { E1_DIR_WRITE( INVERT_E1_DIR); } }while(0) - #endif - - #if HAS_DUPLICATION_MODE - - #if ENABLED(MULTI_NOZZLE_DUPLICATION) - #define _DUPE(N,T,V) do{ if (TEST(duplication_e_mask, N)) E##N##_##T##_WRITE(V); }while(0) - #else - #define _DUPE(N,T,V) E##N##_##T##_WRITE(V) - #endif - - #define NDIR(N) _DUPE(N,DIR,!INVERT_E##N##_DIR) - #define RDIR(N) _DUPE(N,DIR, INVERT_E##N##_DIR) - - #define E_STEP_WRITE(E,V) do{ if (extruder_duplication_enabled) { DUPE(STEP,V); } else _E_STEP_WRITE(E,V); }while(0) - - #if E_STEPPERS > 2 - #if E_STEPPERS > 5 - #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); _DUPE(3,T,V); _DUPE(4,T,V); _DUPE(5,T,V); }while(0) - #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); NDIR(3); NDIR(4); NDIR(5); } else _NORM_E_DIR(E); }while(0) - #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); RDIR(3); RDIR(4); RDIR(5); } else _REV_E_DIR(E); }while(0) - #elif E_STEPPERS > 4 - #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); _DUPE(3,T,V); _DUPE(4,T,V); }while(0) - #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); NDIR(3); NDIR(4); } else _NORM_E_DIR(E); }while(0) - #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); RDIR(3); RDIR(4); } else _REV_E_DIR(E); }while(0) - #elif E_STEPPERS > 3 - #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); _DUPE(3,T,V); }while(0) - #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); NDIR(3); } else _NORM_E_DIR(E); }while(0) - #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); RDIR(3); } else _REV_E_DIR(E); }while(0) - #else - #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); }while(0) - #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); } else _NORM_E_DIR(E); }while(0) - #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); } else _REV_E_DIR(E); }while(0) - #endif - #else - #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); }while(0) - #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); } else _NORM_E_DIR(E); }while(0) - #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); } else _REV_E_DIR(E); }while(0) - #endif - - #else - - #define E_STEP_WRITE(E,V) _E_STEP_WRITE(E,V) - #define NORM_E_DIR(E) _NORM_E_DIR(E) - #define REV_E_DIR(E) _REV_E_DIR(E) - - #endif - -#elif E_STEPPERS - #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) - #define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR) - #define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR) - -#else - #define E_STEP_WRITE(E,V) NOOP - #define NORM_E_DIR(E) NOOP - #define REV_E_DIR(E) NOOP - -#endif diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 04492987b7..d637b68d7b 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -64,6 +64,10 @@ #include "../feature/leds/printer_event_leds.h" #endif +#if ENABLED(JOYSTICK) + #include "../feature/joystick.h" +#endif + #if ENABLED(SINGLENOZZLE) #include "tool_change.h" #endif @@ -108,11 +112,9 @@ Temperature thermalManager; bool Temperature::adaptive_fan_slowing = true; #endif -hotend_info_t Temperature::temp_hotend[HOTENDS - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - + 1 - #endif -]; // = { 0 } +#if HOTENDS + hotend_info_t Temperature::temp_hotend[HOTEND_TEMPS]; // = { 0 } +#endif #if ENABLED(AUTO_POWER_E_FANS) uint8_t Temperature::autofan_speed[HOTENDS]; // = { 0 } @@ -243,7 +245,7 @@ hotend_info_t Temperature::temp_hotend[HOTENDS int16_t Temperature::maxtemp_raw_CHAMBER = HEATER_CHAMBER_RAW_HI_TEMP; #endif #if WATCH_CHAMBER - heater_watch_t Temperature::watch_chamber = { 0 }; + heater_watch_t Temperature::watch_chamber{0}; #endif millis_t Temperature::next_chamber_check_ms; #endif // HAS_HEATED_CHAMBER @@ -279,15 +281,17 @@ volatile bool Temperature::temp_meas_ready = false; #define TEMPDIR(N) ((HEATER_##N##_RAW_LO_TEMP) < (HEATER_##N##_RAW_HI_TEMP) ? 1 : -1) -// Init mintemp and maxtemp with extreme values to prevent false errors during startup -constexpr temp_range_t sensor_heater_0 { HEATER_0_RAW_LO_TEMP, HEATER_0_RAW_HI_TEMP, 0, 16383 }, - sensor_heater_1 { HEATER_1_RAW_LO_TEMP, HEATER_1_RAW_HI_TEMP, 0, 16383 }, - sensor_heater_2 { HEATER_2_RAW_LO_TEMP, HEATER_2_RAW_HI_TEMP, 0, 16383 }, - sensor_heater_3 { HEATER_3_RAW_LO_TEMP, HEATER_3_RAW_HI_TEMP, 0, 16383 }, - sensor_heater_4 { HEATER_4_RAW_LO_TEMP, HEATER_4_RAW_HI_TEMP, 0, 16383 }, - sensor_heater_5 { HEATER_5_RAW_LO_TEMP, HEATER_5_RAW_HI_TEMP, 0, 16383 }; +#if HOTENDS + // Init mintemp and maxtemp with extreme values to prevent false errors during startup + constexpr temp_range_t sensor_heater_0 { HEATER_0_RAW_LO_TEMP, HEATER_0_RAW_HI_TEMP, 0, 16383 }, + sensor_heater_1 { HEATER_1_RAW_LO_TEMP, HEATER_1_RAW_HI_TEMP, 0, 16383 }, + sensor_heater_2 { HEATER_2_RAW_LO_TEMP, HEATER_2_RAW_HI_TEMP, 0, 16383 }, + sensor_heater_3 { HEATER_3_RAW_LO_TEMP, HEATER_3_RAW_HI_TEMP, 0, 16383 }, + sensor_heater_4 { HEATER_4_RAW_LO_TEMP, HEATER_4_RAW_HI_TEMP, 0, 16383 }, + sensor_heater_5 { HEATER_5_RAW_LO_TEMP, HEATER_5_RAW_HI_TEMP, 0, 16383 }; -temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0, sensor_heater_1, sensor_heater_2, sensor_heater_3, sensor_heater_4, sensor_heater_5); + temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0, sensor_heater_1, sensor_heater_2, sensor_heater_3, sensor_heater_4, sensor_heater_5); +#endif #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED uint8_t Temperature::consecutive_low_temperature_error[HOTENDS] = { 0 }; @@ -297,10 +301,6 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 millis_t Temperature::preheat_end_time[HOTENDS] = { 0 }; #endif -#if ENABLED(FILAMENT_WIDTH_SENSOR) - int8_t Temperature::meas_shift_index; // Index of a delayed sample in buffer -#endif - #if HAS_AUTO_FAN millis_t Temperature::next_auto_fan_check_ms = 0; #endif @@ -310,10 +310,6 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 Temperature::soft_pwm_count_fan[FAN_COUNT]; #endif -#if ENABLED(FILAMENT_WIDTH_SENSOR) - uint16_t Temperature::current_raw_filwidth = 0; // Measured filament diameter - one extruder only -#endif - #if ENABLED(PROBING_HEATERS_OFF) bool Temperature::paused; #endif @@ -342,7 +338,7 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 * temperature to succeed. */ void Temperature::PID_autotune(const float &target, const heater_ind_t heater, const int8_t ncycles, const bool set_result/*=false*/) { - float current = 0.0; + float current_temp = 0.0; int cycles = 0; bool heating = true; @@ -351,7 +347,7 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 long bias, d; PID_t tune_pid = { 0, 0, 0 }; - float max = 0, min = 10000; + float maxT = 0, minT = 10000; const bool isbed = (heater == H_BED); @@ -406,7 +402,7 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 wait_for_heatup = true; // Can be interrupted with M108 #if ENABLED(PRINTER_EVENT_LEDS) - const float start_temp = GHV(temp_bed.current, temp_hotend[heater].current); + const float start_temp = GHV(temp_bed.celsius, temp_hotend[heater].celsius); LEDColor color = ONHEATINGSTART(); #endif @@ -423,12 +419,12 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 updateTemperaturesFromRawValues(); // Get the current temperature and constrain it - current = GHV(temp_bed.current, temp_hotend[heater].current); - NOLESS(max, current); - NOMORE(min, current); + current_temp = GHV(temp_bed.celsius, temp_hotend[heater].celsius); + NOLESS(maxT, current_temp); + NOMORE(minT, current_temp); #if ENABLED(PRINTER_EVENT_LEDS) - ONHEATING(start_temp, current, target); + ONHEATING(start_temp, current_temp, target); #endif #if HAS_AUTO_FAN @@ -438,17 +434,17 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 } #endif - if (heating && current > target) { + if (heating && current_temp > target) { if (ELAPSED(ms, t2 + 5000UL)) { heating = false; SHV((bias - d) >> 1, (bias - d) >> 1); t1 = ms; t_high = t1 - t2; - max = target; + maxT = target; } } - if (!heating && current < target) { + if (!heating && current_temp < target) { if (ELAPSED(ms, t1 + 5000UL)) { heating = true; t2 = ms; @@ -459,9 +455,9 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 LIMIT(bias, 20, max_pow - 20); d = (bias > max_pow >> 1) ? max_pow - 1 - bias : bias; - SERIAL_ECHOPAIR(MSG_BIAS, bias, MSG_D, d, MSG_T_MIN, min, MSG_T_MAX, max); + SERIAL_ECHOPAIR(MSG_BIAS, bias, MSG_D, d, MSG_T_MIN, minT, MSG_T_MAX, maxT); if (cycles > 2) { - const float Ku = (4.0f * d) / (float(M_PI) * (max - min) * 0.5f), + const float Ku = (4.0f * d) / (float(M_PI) * (maxT - minT) * 0.5f), Tu = float(t_low + t_high) * 0.001f, pf = isbed ? 0.2f : 0.6f, df = isbed ? 1.0f / 3.0f : 1.0f / 8.0f; @@ -497,16 +493,16 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 } SHV((bias + d) >> 1, (bias + d) >> 1); cycles++; - min = target; + minT = target; } } } // Did the temperature overshoot very far? #ifndef MAX_OVERSHOOT_PID_AUTOTUNE - #define MAX_OVERSHOOT_PID_AUTOTUNE 20 + #define MAX_OVERSHOOT_PID_AUTOTUNE 30 #endif - if (current > target + MAX_OVERSHOOT_PID_AUTOTUNE) { + if (current_temp > target + MAX_OVERSHOOT_PID_AUTOTUNE) { SERIAL_ECHOLNPGM(MSG_PID_TEMP_TOO_HIGH); break; } @@ -531,15 +527,15 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 #endif ) { if (!heated) { // If not yet reached target... - if (current > next_watch_temp) { // Over the watch temp? - next_watch_temp = current + watch_temp_increase; // - set the next temp to watch for + if (current_temp > next_watch_temp) { // Over the watch temp? + next_watch_temp = current_temp + watch_temp_increase; // - set the next temp to watch for temp_change_ms = ms + watch_temp_period * 1000UL; // - move the expiration timer up - if (current > watch_temp_target) heated = true; // - Flag if target temperature reached + if (current_temp > watch_temp_target) heated = true; // - Flag if target temperature reached } else if (ELAPSED(ms, temp_change_ms)) // Watch timer expired _temp_error(heater, PSTR(MSG_T_HEATING_FAILED), TEMP_ERR_PSTR(MSG_HEATING_FAILED_LCD, heater)); } - else if (current < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far? + else if (current_temp < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far? _temp_error(heater, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, heater)); } #endif @@ -623,17 +619,20 @@ temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0 * Class and Instance Methods */ -Temperature::Temperature() { } - int16_t Temperature::getHeaterPower(const heater_ind_t heater_id) { switch (heater_id) { - default: return temp_hotend[heater_id].soft_pwm_amount; #if HAS_HEATED_BED case H_BED: return temp_bed.soft_pwm_amount; #endif #if HAS_HEATED_CHAMBER case H_CHAMBER: return temp_chamber.soft_pwm_amount; #endif + default: + #if HOTENDS + return temp_hotend[heater_id].soft_pwm_amount; + #else + return 0; + #endif } } @@ -681,11 +680,11 @@ int16_t Temperature::getHeaterPower(const heater_ind_t heater_id) { uint8_t fanState = 0; HOTEND_LOOP() - if (temp_hotend[e].current >= EXTRUDER_AUTO_FAN_TEMPERATURE) + if (temp_hotend[e].celsius >= EXTRUDER_AUTO_FAN_TEMPERATURE) SBI(fanState, pgm_read_byte(&fanBit[e])); #if HAS_AUTO_CHAMBER_FAN - if (temp_chamber.current >= CHAMBER_AUTO_FAN_TEMPERATURE) + if (temp_chamber.celsius >= CHAMBER_AUTO_FAN_TEMPERATURE) SBI(fanState, pgm_read_byte(&fanBit[CHAMBER_FAN_INDEX])); #endif @@ -812,114 +811,119 @@ void Temperature::min_temp_error(const heater_ind_t heater) { _temp_error(heater, PSTR(MSG_T_MINTEMP), TEMP_ERR_PSTR(MSG_ERR_MINTEMP, heater)); } -float Temperature::get_pid_output_hotend(const uint8_t e) { - #if HOTENDS == 1 - #define _HOTEND_TEST true - #else - #define _HOTEND_TEST (e == active_extruder) - #endif - E_UNUSED(); - const uint8_t ee = HOTEND_INDEX; - float pid_output; - #if ENABLED(PIDTEMP) - #if DISABLED(PID_OPENLOOP) - static hotend_pid_t work_pid[HOTENDS]; - static float temp_iState[HOTENDS] = { 0 }, - temp_dState[HOTENDS] = { 0 }; - static bool pid_reset[HOTENDS] = { false }; - const float pid_error = temp_hotend[ee].target - temp_hotend[ee].current; +#if HOTENDS - if (temp_hotend[ee].target == 0 - || pid_error < -(PID_FUNCTIONAL_RANGE) - #if HEATER_IDLE_HANDLER - || hotend_idle[ee].timed_out - #endif - ) { - pid_output = 0; - pid_reset[ee] = true; - } - else if (pid_error > PID_FUNCTIONAL_RANGE) { - pid_output = BANG_MAX; - pid_reset[ee] = true; - } - else { - if (pid_reset[ee]) { - temp_iState[ee] = 0.0; - work_pid[ee].Kd = 0.0; - pid_reset[ee] = false; - } - - work_pid[ee].Kd = work_pid[ee].Kd + PID_K2 * (PID_PARAM(Kd, ee) * (temp_dState[ee] - temp_hotend[ee].current) - work_pid[ee].Kd); - const float max_power_over_i_gain = float(PID_MAX) / PID_PARAM(Ki, ee) - float(MIN_POWER); - temp_iState[ee] = constrain(temp_iState[ee] + pid_error, 0, max_power_over_i_gain); - work_pid[ee].Kp = PID_PARAM(Kp, ee) * pid_error; - work_pid[ee].Ki = PID_PARAM(Ki, ee) * temp_iState[ee]; - - pid_output = work_pid[ee].Kp + work_pid[ee].Ki + work_pid[ee].Kd + float(MIN_POWER); - - #if ENABLED(PID_EXTRUSION_SCALING) - work_pid[ee].Kc = 0; - if (_HOTEND_TEST) { - const long e_position = stepper.position(E_AXIS); - if (e_position > last_e_position) { - lpq[lpq_ptr] = e_position - last_e_position; - last_e_position = e_position; - } - else - lpq[lpq_ptr] = 0; - - if (++lpq_ptr >= lpq_len) lpq_ptr = 0; - work_pid[ee].Kc = (lpq[lpq_ptr] * planner.steps_to_mm[E_AXIS]) * PID_PARAM(Kc, ee); - pid_output += work_pid[ee].Kc; - } - #endif // PID_EXTRUSION_SCALING - - LIMIT(pid_output, 0, PID_MAX); - } - temp_dState[ee] = temp_hotend[ee].current; - - #else // PID_OPENLOOP - - const float pid_output = constrain(temp_hotend[ee].target, 0, PID_MAX); - - #endif // PID_OPENLOOP - - #if ENABLED(PID_DEBUG) - if (e == active_extruder) { - SERIAL_ECHO_START(); - SERIAL_ECHOPAIR( - MSG_PID_DEBUG, ee, - MSG_PID_DEBUG_INPUT, temp_hotend[ee].current, - MSG_PID_DEBUG_OUTPUT, pid_output - ); - #if DISABLED(PID_OPENLOOP) - SERIAL_ECHOPAIR( - MSG_PID_DEBUG_PTERM, work_pid[ee].Kp, - MSG_PID_DEBUG_ITERM, work_pid[ee].Ki, - MSG_PID_DEBUG_DTERM, work_pid[ee].Kd - #if ENABLED(PID_EXTRUSION_SCALING) - , MSG_PID_DEBUG_CTERM, work_pid[ee].Kc - #endif - ); - #endif - SERIAL_EOL(); - } - #endif // PID_DEBUG - - #else // No PID enabled - - #if HEATER_IDLE_HANDLER - #define _TIMED_OUT_TEST hotend_idle[ee].timed_out + float Temperature::get_pid_output_hotend(const uint8_t e) { + #if HOTENDS == 1 + #define _HOTEND_TEST true #else - #define _TIMED_OUT_TEST false + #define _HOTEND_TEST (e == active_extruder) #endif - pid_output = (!_TIMED_OUT_TEST && temp_hotend[ee].current < temp_hotend[ee].target) ? BANG_MAX : 0; - #undef _TIMED_OUT_TEST + E_UNUSED(); + const uint8_t ee = HOTEND_INDEX; + #if ENABLED(PIDTEMP) + #if DISABLED(PID_OPENLOOP) + static hotend_pid_t work_pid[HOTENDS]; + static float temp_iState[HOTENDS] = { 0 }, + temp_dState[HOTENDS] = { 0 }; + static bool pid_reset[HOTENDS] = { false }; + const float pid_error = temp_hotend[ee].target - temp_hotend[ee].celsius; - #endif + float pid_output; - return pid_output; -} + if (temp_hotend[ee].target == 0 + || pid_error < -(PID_FUNCTIONAL_RANGE) + #if HEATER_IDLE_HANDLER + || hotend_idle[ee].timed_out + #endif + ) { + pid_output = 0; + pid_reset[ee] = true; + } + else if (pid_error > PID_FUNCTIONAL_RANGE) { + pid_output = BANG_MAX; + pid_reset[ee] = true; + } + else { + if (pid_reset[ee]) { + temp_iState[ee] = 0.0; + work_pid[ee].Kd = 0.0; + pid_reset[ee] = false; + } + + work_pid[ee].Kd = work_pid[ee].Kd + PID_K2 * (PID_PARAM(Kd, ee) * (temp_dState[ee] - temp_hotend[ee].celsius) - work_pid[ee].Kd); + const float max_power_over_i_gain = float(PID_MAX) / PID_PARAM(Ki, ee) - float(MIN_POWER); + temp_iState[ee] = constrain(temp_iState[ee] + pid_error, 0, max_power_over_i_gain); + work_pid[ee].Kp = PID_PARAM(Kp, ee) * pid_error; + work_pid[ee].Ki = PID_PARAM(Ki, ee) * temp_iState[ee]; + + pid_output = work_pid[ee].Kp + work_pid[ee].Ki + work_pid[ee].Kd + float(MIN_POWER); + + #if ENABLED(PID_EXTRUSION_SCALING) + work_pid[ee].Kc = 0; + if (_HOTEND_TEST) { + const long e_position = stepper.position(E_AXIS); + if (e_position > last_e_position) { + lpq[lpq_ptr] = e_position - last_e_position; + last_e_position = e_position; + } + else + lpq[lpq_ptr] = 0; + + if (++lpq_ptr >= lpq_len) lpq_ptr = 0; + work_pid[ee].Kc = (lpq[lpq_ptr] * planner.steps_to_mm[E_AXIS]) * PID_PARAM(Kc, ee); + pid_output += work_pid[ee].Kc; + } + #endif // PID_EXTRUSION_SCALING + + LIMIT(pid_output, 0, PID_MAX); + } + temp_dState[ee] = temp_hotend[ee].celsius; + + #else // PID_OPENLOOP + + const float pid_output = constrain(temp_hotend[ee].target, 0, PID_MAX); + + #endif // PID_OPENLOOP + + #if ENABLED(PID_DEBUG) + if (e == active_extruder) { + SERIAL_ECHO_START(); + SERIAL_ECHOPAIR( + MSG_PID_DEBUG, ee, + MSG_PID_DEBUG_INPUT, temp_hotend[ee].celsius, + MSG_PID_DEBUG_OUTPUT, pid_output + ); + #if DISABLED(PID_OPENLOOP) + SERIAL_ECHOPAIR( + MSG_PID_DEBUG_PTERM, work_pid[ee].Kp, + MSG_PID_DEBUG_ITERM, work_pid[ee].Ki, + MSG_PID_DEBUG_DTERM, work_pid[ee].Kd + #if ENABLED(PID_EXTRUSION_SCALING) + , MSG_PID_DEBUG_CTERM, work_pid[ee].Kc + #endif + ); + #endif + SERIAL_EOL(); + } + #endif // PID_DEBUG + + #else // No PID enabled + + #if HEATER_IDLE_HANDLER + #define _TIMED_OUT_TEST hotend_idle[ee].timed_out + #else + #define _TIMED_OUT_TEST false + #endif + const float pid_output = (!_TIMED_OUT_TEST && temp_hotend[ee].celsius < temp_hotend[ee].target) ? BANG_MAX : 0; + #undef _TIMED_OUT_TEST + + #endif + + return pid_output; + } + +#endif // HOTENDS #if ENABLED(PIDTEMPBED) @@ -927,12 +931,12 @@ float Temperature::get_pid_output_hotend(const uint8_t e) { #if DISABLED(PID_OPENLOOP) - static PID_t work_pid = { 0 }; + static PID_t work_pid{0}; static float temp_iState = 0, temp_dState = 0; static bool pid_reset = true; float pid_output = 0; const float max_power_over_i_gain = float(MAX_BED_POWER) / temp_bed.pid.Ki - float(MIN_BED_POWER), - pid_error = temp_bed.target - temp_bed.current; + pid_error = temp_bed.target - temp_bed.celsius; if (!temp_bed.target || pid_error < -(PID_FUNCTIONAL_RANGE)) { pid_output = 0; @@ -953,9 +957,9 @@ float Temperature::get_pid_output_hotend(const uint8_t e) { work_pid.Kp = temp_bed.pid.Kp * pid_error; work_pid.Ki = temp_bed.pid.Ki * temp_iState; - work_pid.Kd = work_pid.Kd + PID_K2 * (temp_bed.pid.Kd * (temp_dState - temp_bed.current) - work_pid.Kd); + work_pid.Kd = work_pid.Kd + PID_K2 * (temp_bed.pid.Kd * (temp_dState - temp_bed.celsius) - work_pid.Kd); - temp_dState = temp_bed.current; + temp_dState = temp_bed.celsius; pid_output = constrain(work_pid.Kp + work_pid.Ki + work_pid.Kd + float(MIN_BED_POWER), 0, MAX_BED_POWER); } @@ -969,7 +973,7 @@ float Temperature::get_pid_output_hotend(const uint8_t e) { #if ENABLED(PID_BED_DEBUG) SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR( - " PID_BED_DEBUG : Input ", temp_bed.current, " Output ", pid_output, + " PID_BED_DEBUG : Input ", temp_bed.celsius, " Output ", pid_output, #if DISABLED(PID_OPENLOOP) MSG_PID_DEBUG_PTERM, work_pid.Kp, MSG_PID_DEBUG_ITERM, work_pid.Ki, @@ -1012,53 +1016,55 @@ void Temperature::manage_heater() { updateTemperaturesFromRawValues(); // also resets the watchdog #if ENABLED(HEATER_0_USES_MAX6675) - if (temp_hotend[0].current > _MIN(HEATER_0_MAXTEMP, HEATER_0_MAX6675_TMAX - 1.0)) max_temp_error(H_E0); - if (temp_hotend[0].current < _MAX(HEATER_0_MINTEMP, HEATER_0_MAX6675_TMIN + .01)) min_temp_error(H_E0); + if (temp_hotend[0].celsius > _MIN(HEATER_0_MAXTEMP, HEATER_0_MAX6675_TMAX - 1.0)) max_temp_error(H_E0); + if (temp_hotend[0].celsius < _MAX(HEATER_0_MINTEMP, HEATER_0_MAX6675_TMIN + .01)) min_temp_error(H_E0); #endif #if ENABLED(HEATER_1_USES_MAX6675) - if (temp_hotend[1].current > _MIN(HEATER_1_MAXTEMP, HEATER_1_MAX6675_TMAX - 1.0)) max_temp_error(H_E1); - if (temp_hotend[1].current < _MAX(HEATER_1_MINTEMP, HEATER_1_MAX6675_TMIN + .01)) min_temp_error(H_E1); + if (temp_hotend[1].celsius > _MIN(HEATER_1_MAXTEMP, HEATER_1_MAX6675_TMAX - 1.0)) max_temp_error(H_E1); + if (temp_hotend[1].celsius < _MAX(HEATER_1_MINTEMP, HEATER_1_MAX6675_TMIN + .01)) min_temp_error(H_E1); #endif - #if HAS_THERMAL_PROTECTION || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN || HEATER_IDLE_HANDLER - millis_t ms = millis(); - #endif + millis_t ms = millis(); - HOTEND_LOOP() { - #if ENABLED(THERMAL_PROTECTION_HOTENDS) - if (degHotend(e) > temp_range[e].maxtemp) - _temp_error((heater_ind_t)e, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, e)); - #endif + #if HOTENDS - #if HEATER_IDLE_HANDLER - hotend_idle[e].update(ms); - #endif + HOTEND_LOOP() { + #if ENABLED(THERMAL_PROTECTION_HOTENDS) + if (degHotend(e) > temp_range[e].maxtemp) + _temp_error((heater_ind_t)e, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, e)); + #endif - #if ENABLED(THERMAL_PROTECTION_HOTENDS) - // Check for thermal runaway - thermal_runaway_protection(tr_state_machine[e], temp_hotend[e].current, temp_hotend[e].target, (heater_ind_t)e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS); - #endif + #if HEATER_IDLE_HANDLER + hotend_idle[e].update(ms); + #endif - temp_hotend[e].soft_pwm_amount = (temp_hotend[e].current > temp_range[e].mintemp || is_preheating(e)) && temp_hotend[e].current < temp_range[e].maxtemp ? (int)get_pid_output_hotend(e) >> 1 : 0; + #if ENABLED(THERMAL_PROTECTION_HOTENDS) + // Check for thermal runaway + thermal_runaway_protection(tr_state_machine[e], temp_hotend[e].celsius, temp_hotend[e].target, (heater_ind_t)e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS); + #endif - #if WATCH_HOTENDS - // Make sure temperature is increasing - if (watch_hotend[e].next_ms && ELAPSED(ms, watch_hotend[e].next_ms)) { // Time to check this extruder? - if (degHotend(e) < watch_hotend[e].target) // Failed to increase enough? - _temp_error((heater_ind_t)e, PSTR(MSG_T_HEATING_FAILED), TEMP_ERR_PSTR(MSG_HEATING_FAILED_LCD, e)); - else // Start again if the target is still far off - start_watching_hotend(e); - } - #endif + temp_hotend[e].soft_pwm_amount = (temp_hotend[e].celsius > temp_range[e].mintemp || is_preheating(e)) && temp_hotend[e].celsius < temp_range[e].maxtemp ? (int)get_pid_output_hotend(e) >> 1 : 0; - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - // Make sure measured temperatures are close together - if (ABS(temp_hotend[0].current - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) - _temp_error(H_E0, PSTR(MSG_REDUNDANCY), PSTR(MSG_ERR_REDUNDANT_TEMP)); - #endif + #if WATCH_HOTENDS + // Make sure temperature is increasing + if (watch_hotend[e].next_ms && ELAPSED(ms, watch_hotend[e].next_ms)) { // Time to check this extruder? + if (degHotend(e) < watch_hotend[e].target) // Failed to increase enough? + _temp_error((heater_ind_t)e, PSTR(MSG_T_HEATING_FAILED), TEMP_ERR_PSTR(MSG_HEATING_FAILED_LCD, e)); + else // Start again if the target is still far off + start_watching_hotend(e); + } + #endif - } // HOTEND_LOOP + #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) + // Make sure measured temperatures are close together + if (ABS(temp_hotend[0].celsius - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) + _temp_error(H_E0, PSTR(MSG_REDUNDANCY), PSTR(MSG_ERR_REDUNDANT_TEMP)); + #endif + + } // HOTEND_LOOP + + #endif // HOTENDS #if HAS_AUTO_FAN if (ELAPSED(ms, next_auto_fan_check_ms)) { // only need to check fan state very infrequently @@ -1069,16 +1075,11 @@ void Temperature::manage_heater() { #if ENABLED(FILAMENT_WIDTH_SENSOR) /** - * Filament Width Sensor dynamically sets the volumetric multiplier - * based on a delayed measurement of the filament diameter. + * Dynamically set the volumetric multiplier based + * on the delayed Filament Width measurement. */ - if (filament_sensor) { - meas_shift_index = filwidth_delay_index[0] - meas_delay_cm; - if (meas_shift_index < 0) meas_shift_index += MAX_MEASUREMENT_DELAY + 1; //loop around buffer if needed - LIMIT(meas_shift_index, 0, MAX_MEASUREMENT_DELAY); - planner.calculate_volumetric_for_width_sensor(measurement_delay[meas_shift_index]); - } - #endif // FILAMENT_WIDTH_SENSOR + filwidth.update_volumetric(); + #endif #if HAS_HEATED_BED @@ -1116,7 +1117,7 @@ void Temperature::manage_heater() { #endif #if HAS_THERMALLY_PROTECTED_BED - thermal_runaway_protection(tr_state_machine_bed, temp_bed.current, temp_bed.target, H_BED, THERMAL_PROTECTION_BED_PERIOD, THERMAL_PROTECTION_BED_HYSTERESIS); + thermal_runaway_protection(tr_state_machine_bed, temp_bed.celsius, temp_bed.target, H_BED, THERMAL_PROTECTION_BED_PERIOD, THERMAL_PROTECTION_BED_HYSTERESIS); #endif #if HEATER_IDLE_HANDLER @@ -1130,17 +1131,17 @@ void Temperature::manage_heater() { #endif { #if ENABLED(PIDTEMPBED) - temp_bed.soft_pwm_amount = WITHIN(temp_bed.current, BED_MINTEMP, BED_MAXTEMP) ? (int)get_pid_output_bed() >> 1 : 0; + temp_bed.soft_pwm_amount = WITHIN(temp_bed.celsius, BED_MINTEMP, BED_MAXTEMP) ? (int)get_pid_output_bed() >> 1 : 0; #else // Check if temperature is within the correct band - if (WITHIN(temp_bed.current, BED_MINTEMP, BED_MAXTEMP)) { + if (WITHIN(temp_bed.celsius, BED_MINTEMP, BED_MAXTEMP)) { #if ENABLED(BED_LIMIT_SWITCHING) - if (temp_bed.current >= temp_bed.target + BED_HYSTERESIS) + if (temp_bed.celsius >= temp_bed.target + BED_HYSTERESIS) temp_bed.soft_pwm_amount = 0; - else if (temp_bed.current <= temp_bed.target - (BED_HYSTERESIS)) + else if (temp_bed.celsius <= temp_bed.target - (BED_HYSTERESIS)) temp_bed.soft_pwm_amount = MAX_BED_POWER >> 1; #else // !PIDTEMPBED && !BED_LIMIT_SWITCHING - temp_bed.soft_pwm_amount = temp_bed.current < temp_bed.target ? MAX_BED_POWER >> 1 : 0; + temp_bed.soft_pwm_amount = temp_bed.celsius < temp_bed.target ? MAX_BED_POWER >> 1 : 0; #endif } else { @@ -1178,14 +1179,14 @@ void Temperature::manage_heater() { if (ELAPSED(ms, next_chamber_check_ms)) { next_chamber_check_ms = ms + CHAMBER_CHECK_INTERVAL; - if (WITHIN(temp_chamber.current, CHAMBER_MINTEMP, CHAMBER_MAXTEMP)) { + if (WITHIN(temp_chamber.celsius, CHAMBER_MINTEMP, CHAMBER_MAXTEMP)) { #if ENABLED(CHAMBER_LIMIT_SWITCHING) - if (temp_chamber.current >= temp_chamber.target + TEMP_CHAMBER_HYSTERESIS) + if (temp_chamber.celsius >= temp_chamber.target + TEMP_CHAMBER_HYSTERESIS) temp_chamber.soft_pwm_amount = 0; - else if (temp_chamber.current <= temp_chamber.target - (TEMP_CHAMBER_HYSTERESIS)) + else if (temp_chamber.celsius <= temp_chamber.target - (TEMP_CHAMBER_HYSTERESIS)) temp_chamber.soft_pwm_amount = MAX_CHAMBER_POWER >> 1; #else - temp_chamber.soft_pwm_amount = temp_chamber.current < temp_chamber.target ? MAX_CHAMBER_POWER >> 1 : 0; + temp_chamber.soft_pwm_amount = temp_chamber.celsius < temp_chamber.target ? MAX_CHAMBER_POWER >> 1 : 0; #endif } else { @@ -1194,14 +1195,16 @@ void Temperature::manage_heater() { } #if ENABLED(THERMAL_PROTECTION_CHAMBER) - thermal_runaway_protection(tr_state_machine_chamber, temp_chamber.current, temp_chamber.target, H_CHAMBER, THERMAL_PROTECTION_CHAMBER_PERIOD, THERMAL_PROTECTION_CHAMBER_HYSTERESIS); + thermal_runaway_protection(tr_state_machine_chamber, temp_chamber.celsius, temp_chamber.target, H_CHAMBER, THERMAL_PROTECTION_CHAMBER_PERIOD, THERMAL_PROTECTION_CHAMBER_HYSTERESIS); #endif } // TODO: Implement true PID pwm - //temp_bed.soft_pwm_amount = WITHIN(temp_chamber.current, CHAMBER_MINTEMP, CHAMBER_MAXTEMP) ? (int)get_pid_output_chamber() >> 1 : 0; + //temp_bed.soft_pwm_amount = WITHIN(temp_chamber.celsius, CHAMBER_MINTEMP, CHAMBER_MAXTEMP) ? (int)get_pid_output_chamber() >> 1 : 0; #endif // HAS_HEATED_CHAMBER + + UNUSED(ms); } #define TEMP_AD595(RAW) ((RAW) * 5.0 * 100.0 / 1024.0 / (OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET) @@ -1318,13 +1321,14 @@ void Temperature::manage_heater() { if (!WITHIN(t_index, 0, COUNT(user_thermistor) - 1)) return 25; - if (user_thermistor[t_index].pre_calc) { - // pre-calculate some variables - user_thermistor[t_index].pre_calc = false; - user_thermistor[t_index].res_25_recip = 1.0f / user_thermistor[t_index].res_25; - user_thermistor[t_index].res_25_log = logf(user_thermistor[t_index].res_25); - user_thermistor[t_index].beta_recip = 1.0f / user_thermistor[t_index].beta; - user_thermistor[t_index].sh_alpha = (1.0f / (THERMISTOR_RESISTANCE_NOMINAL_C - THERMISTOR_ABS_ZERO_C)) - (user_thermistor[t_index].beta_recip * user_thermistor[t_index].res_25_log) - (user_thermistor[t_index].sh_c_coeff * user_thermistor[t_index].res_25_log * user_thermistor[t_index].res_25_log * user_thermistor[t_index].res_25_log); + user_thermistor_t &t = user_thermistor[t_index]; + if (t.pre_calc) { // pre-calculate some variables + t.pre_calc = false; + t.res_25_recip = 1.0f / t.res_25; + t.res_25_log = logf(t.res_25); + t.beta_recip = 1.0f / t.beta; + t.sh_alpha = RECIPROCAL(THERMISTOR_RESISTANCE_NOMINAL_C - (THERMISTOR_ABS_ZERO_C)) + - (t.beta_recip * t.res_25_log) - (t.sh_c_coeff * cu(t.res_25_log)); } // maximum adc value .. take into account the over sampling @@ -1332,13 +1336,13 @@ void Temperature::manage_heater() { adc_raw = constrain(raw, 1, adc_max - 1); // constrain to prevent divide-by-zero const float adc_inverse = (adc_max - adc_raw) - 0.5f, - resistance = user_thermistor[t_index].series_res * (adc_raw + 0.5f) / adc_inverse, + resistance = t.series_res * (adc_raw + 0.5f) / adc_inverse, log_resistance = logf(resistance); - float value = user_thermistor[t_index].sh_alpha; - value += log_resistance * user_thermistor[t_index].beta_recip; - if (user_thermistor[t_index].sh_c_coeff != 0) - value += user_thermistor[t_index].sh_c_coeff * log_resistance * log_resistance * log_resistance; + float value = t.sh_alpha; + value += log_resistance * t.beta_recip; + if (t.sh_c_coeff != 0) + value += t.sh_c_coeff * cu(log_resistance); value = 1.0f / value; //#if (MOTHERBOARD == BOARD_RAMPS_14_EFB) @@ -1354,98 +1358,100 @@ void Temperature::manage_heater() { } #endif -// Derived from RepRap FiveD extruder::getTemperature() -// For hot end temperature measurement. -float Temperature::analog_to_celsius_hotend(const int raw, const uint8_t e) { - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - if (e > HOTENDS) - #else - if (e >= HOTENDS) - #endif - { - SERIAL_ERROR_START(); - SERIAL_ECHO((int)e); - SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER_NUM); - kill(); - return 0.0; +#if HOTENDS + // Derived from RepRap FiveD extruder::getTemperature() + // For hot end temperature measurement. + float Temperature::analog_to_celsius_hotend(const int raw, const uint8_t e) { + #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) + if (e > HOTENDS) + #else + if (e >= HOTENDS) + #endif + { + SERIAL_ERROR_START(); + SERIAL_ECHO((int)e); + SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER_NUM); + kill(); + return 0.0; + } + + switch (e) { + case 0: + #if ENABLED(HEATER_0_USER_THERMISTOR) + return user_thermistor_to_deg_c(CTI_HOTEND_0, raw); + #elif ENABLED(HEATER_0_USES_MAX6675) + return raw * 0.25; + #elif ENABLED(HEATER_0_USES_AD595) + return TEMP_AD595(raw); + #elif ENABLED(HEATER_0_USES_AD8495) + return TEMP_AD8495(raw); + #else + break; + #endif + case 1: + #if ENABLED(HEATER_1_USER_THERMISTOR) + return user_thermistor_to_deg_c(CTI_HOTEND_1, raw); + #elif ENABLED(HEATER_1_USES_MAX6675) + return raw * 0.25; + #elif ENABLED(HEATER_1_USES_AD595) + return TEMP_AD595(raw); + #elif ENABLED(HEATER_1_USES_AD8495) + return TEMP_AD8495(raw); + #else + break; + #endif + case 2: + #if ENABLED(HEATER_2_USER_THERMISTOR) + return user_thermistor_to_deg_c(CTI_HOTEND_2, raw); + #elif ENABLED(HEATER_2_USES_AD595) + return TEMP_AD595(raw); + #elif ENABLED(HEATER_2_USES_AD8495) + return TEMP_AD8495(raw); + #else + break; + #endif + case 3: + #if ENABLED(HEATER_3_USER_THERMISTOR) + return user_thermistor_to_deg_c(CTI_HOTEND_3, raw); + #elif ENABLED(HEATER_3_USES_AD595) + return TEMP_AD595(raw); + #elif ENABLED(HEATER_3_USES_AD8495) + return TEMP_AD8495(raw); + #else + break; + #endif + case 4: + #if ENABLED(HEATER_4_USER_THERMISTOR) + return user_thermistor_to_deg_c(CTI_HOTEND_4, raw); + #elif ENABLED(HEATER_4_USES_AD595) + return TEMP_AD595(raw); + #elif ENABLED(HEATER_4_USES_AD8495) + return TEMP_AD8495(raw); + #else + break; + #endif + case 5: + #if ENABLED(HEATER_5_USER_THERMISTOR) + return user_thermistor_to_deg_c(CTI_HOTEND_5, raw); + #elif ENABLED(HEATER_5_USES_AD595) + return TEMP_AD595(raw); + #elif ENABLED(HEATER_5_USES_AD8495) + return TEMP_AD8495(raw); + #else + break; + #endif + default: break; } - switch (e) { - case 0: - #if ENABLED(HEATER_0_USER_THERMISTOR) - return user_thermistor_to_deg_c(CTI_HOTEND_0, raw); - #elif ENABLED(HEATER_0_USES_MAX6675) - return raw * 0.25; - #elif ENABLED(HEATER_0_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_0_USES_AD8495) - return TEMP_AD8495(raw); - #else - break; - #endif - case 1: - #if ENABLED(HEATER_1_USER_THERMISTOR) - return user_thermistor_to_deg_c(CTI_HOTEND_1, raw); - #elif ENABLED(HEATER_1_USES_MAX6675) - return raw * 0.25; - #elif ENABLED(HEATER_1_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_1_USES_AD8495) - return TEMP_AD8495(raw); - #else - break; - #endif - case 2: - #if ENABLED(HEATER_2_USER_THERMISTOR) - return user_thermistor_to_deg_c(CTI_HOTEND_2, raw); - #elif ENABLED(HEATER_2_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_2_USES_AD8495) - return TEMP_AD8495(raw); - #else - break; - #endif - case 3: - #if ENABLED(HEATER_3_USER_THERMISTOR) - return user_thermistor_to_deg_c(CTI_HOTEND_3, raw); - #elif ENABLED(HEATER_3_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_3_USES_AD8495) - return TEMP_AD8495(raw); - #else - break; - #endif - case 4: - #if ENABLED(HEATER_4_USER_THERMISTOR) - return user_thermistor_to_deg_c(CTI_HOTEND_4, raw); - #elif ENABLED(HEATER_4_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_4_USES_AD8495) - return TEMP_AD8495(raw); - #else - break; - #endif - case 5: - #if ENABLED(HEATER_5_USER_THERMISTOR) - return user_thermistor_to_deg_c(CTI_HOTEND_5, raw); - #elif ENABLED(HEATER_5_USES_AD595) - return TEMP_AD595(raw); - #elif ENABLED(HEATER_5_USES_AD8495) - return TEMP_AD8495(raw); - #else - break; - #endif - default: break; + #if HOTEND_USES_THERMISTOR + // Thermistor with conversion table? + const short(*tt)[][2] = (short(*)[][2])(heater_ttbl_map[e]); + SCAN_THERMISTOR_TABLE((*tt), heater_ttbllen_map[e]); + #endif + + return 0; } - - #if HOTEND_USES_THERMISTOR - // Thermistor with conversion table? - const short(*tt)[][2] = (short(*)[][2])(heater_ttbl_map[e]); - SCAN_THERMISTOR_TABLE((*tt), heater_ttbllen_map[e]); - #endif - - return 0; -} +#endif // HOTENDS #if HAS_HEATED_BED // Derived from RepRap FiveD extruder::getTemperature() @@ -1496,18 +1502,20 @@ void Temperature::updateTemperaturesFromRawValues() { #if ENABLED(HEATER_1_USES_MAX6675) temp_hotend[1].raw = READ_MAX6675(1); #endif - HOTEND_LOOP() temp_hotend[e].current = analog_to_celsius_hotend(temp_hotend[e].raw, e); + #if HOTENDS + HOTEND_LOOP() temp_hotend[e].celsius = analog_to_celsius_hotend(temp_hotend[e].raw, e); + #endif #if HAS_HEATED_BED - temp_bed.current = analog_to_celsius_bed(temp_bed.raw); + temp_bed.celsius = analog_to_celsius_bed(temp_bed.raw); #endif #if HAS_TEMP_CHAMBER - temp_chamber.current = analog_to_celsius_chamber(temp_chamber.raw); + temp_chamber.celsius = analog_to_celsius_chamber(temp_chamber.raw); #endif #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) redundant_temperature = analog_to_celsius_hotend(redundant_temperature_raw, 1); #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) - filament_width_meas = analog_to_mm_fil_width(); + filwidth.update_measured_mm(); #endif #if ENABLED(USE_WATCHDOG) @@ -1518,30 +1526,6 @@ void Temperature::updateTemperaturesFromRawValues() { temp_meas_ready = false; } - -#if ENABLED(FILAMENT_WIDTH_SENSOR) - - // Convert raw Filament Width to millimeters - float Temperature::analog_to_mm_fil_width() { - return current_raw_filwidth * 5.0f * (1.0f / 16383.0f); - } - - /** - * Convert Filament Width (mm) to a simple ratio - * and reduce to an 8 bit value. - * - * A nominal width of 1.75 and measured width of 1.73 - * gives (100 * 1.75 / 1.73) for a ratio of 101 and - * a return value of 1. - */ - int8_t Temperature::widthFil_to_size_ratio() { - if (ABS(filament_width_nominal - filament_width_meas) <= FILWIDTH_ERROR_MARGIN) - return int(100.0f * filament_width_nominal / filament_width_meas) - 100; - return 0; - } - -#endif - #if MAX6675_SEPARATE_SPI SPIclass max6675_spi; #endif @@ -1685,6 +1669,18 @@ void Temperature::init() { #if HAS_TEMP_ADC_5 HAL_ANALOG_SELECT(TEMP_5_PIN); #endif + #if HAS_JOY_ADC_X + HAL_ANALOG_SELECT(JOY_X_PIN); + #endif + #if HAS_JOY_ADC_Y + HAL_ANALOG_SELECT(JOY_Y_PIN); + #endif + #if HAS_JOY_ADC_Z + HAL_ANALOG_SELECT(JOY_Z_PIN); + #endif + #if HAS_JOY_ADC_EN + SET_INPUT_PULLUP(JOY_EN_PIN); + #endif #if HAS_HEATED_BED HAL_ANALOG_SELECT(TEMP_BED_PIN); #endif @@ -1786,7 +1782,7 @@ void Temperature::init() { #endif // HOTENDS > 2 #endif // HOTENDS > 1 - #endif // HOTENDS > 1 + #endif // HOTENDS #if HAS_HEATED_BED #ifdef BED_MINTEMP @@ -1960,7 +1956,9 @@ void Temperature::disable_all_heaters() { planner.autotemp_enabled = false; #endif - HOTEND_LOOP() setTargetHotend(0, e); + #if HOTENDS + HOTEND_LOOP() setTargetHotend(0, e); + #endif #if HAS_HEATED_BED setTargetBed(0); @@ -2164,23 +2162,23 @@ void Temperature::disable_all_heaters() { void Temperature::set_current_temp_raw() { #if HAS_TEMP_ADC_0 && DISABLED(HEATER_0_USES_MAX6675) - temp_hotend[0].raw = temp_hotend[0].acc; + temp_hotend[0].update(); #endif #if HAS_TEMP_ADC_1 #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) redundant_temperature_raw = temp_hotend[1].acc; #elif DISABLED(HEATER_1_USES_MAX6675) - temp_hotend[1].raw = temp_hotend[1].acc; + temp_hotend[1].update(); #endif #if HAS_TEMP_ADC_2 - temp_hotend[2].raw = temp_hotend[2].acc; + temp_hotend[2].update(); #if HAS_TEMP_ADC_3 - temp_hotend[3].raw = temp_hotend[3].acc; + temp_hotend[3].update(); #if HAS_TEMP_ADC_4 - temp_hotend[4].raw = temp_hotend[4].acc; + temp_hotend[4].update(); #if HAS_TEMP_ADC_5 - temp_hotend[5].raw = temp_hotend[5].acc; + temp_hotend[5].update(); #endif // HAS_TEMP_ADC_5 #endif // HAS_TEMP_ADC_4 #endif // HAS_TEMP_ADC_3 @@ -2188,20 +2186,26 @@ void Temperature::set_current_temp_raw() { #endif // HAS_TEMP_ADC_1 #if HAS_HEATED_BED - temp_bed.raw = temp_bed.acc; + temp_bed.update(); #endif #if HAS_TEMP_CHAMBER - temp_chamber.raw = temp_chamber.acc; + temp_chamber.update(); + #endif + + #if HAS_JOY_ADC_X + joystick.x.update(); + #endif + #if HAS_JOY_ADC_Y + joystick.y.update(); + #endif + #if HAS_JOY_ADC_Z + joystick.z.update(); #endif temp_meas_ready = true; } -#if ENABLED(FILAMENT_WIDTH_SENSOR) - uint32_t raw_filwidth_value; // = 0 -#endif - void Temperature::readings_ready() { // Update the raw values if they've been read. Else we could be updating them during reading. @@ -2209,71 +2213,87 @@ void Temperature::readings_ready() { // Filament Sensor - can be read any time since IIR filtering is used #if ENABLED(FILAMENT_WIDTH_SENSOR) - current_raw_filwidth = raw_filwidth_value >> 10; // Divide to get to 0-16384 range since we used 1/128 IIR filter approach + filwidth.reading_ready(); #endif - HOTEND_LOOP() temp_hotend[e].acc = 0; - #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - temp_hotend[1].acc = 0; + #if HOTENDS + HOTEND_LOOP() temp_hotend[e].reset(); + #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) + temp_hotend[1].reset(); + #endif #endif #if HAS_HEATED_BED - temp_bed.acc = 0; + temp_bed.reset(); #endif #if HAS_TEMP_CHAMBER - temp_chamber.acc = 0; + temp_chamber.reset(); #endif - static constexpr int8_t temp_dir[] = { - #if ENABLED(HEATER_0_USES_MAX6675) - 0 - #else - TEMPDIR(0) - #endif - #if HOTENDS > 1 - #if ENABLED(HEATER_1_USES_MAX6675) - , 0 - #else - , TEMPDIR(1) - #endif - #if HOTENDS > 2 - , TEMPDIR(2) - #if HOTENDS > 3 - , TEMPDIR(3) - #if HOTENDS > 4 - , TEMPDIR(4) - #if HOTENDS > 5 - , TEMPDIR(5) - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - }; + #if HAS_JOY_ADC_X + joystick.x.reset(); + #endif + #if HAS_JOY_ADC_Y + joystick.y.reset(); + #endif + #if HAS_JOY_ADC_Z + joystick.z.reset(); + #endif - for (uint8_t e = 0; e < COUNT(temp_dir); e++) { - const int8_t tdir = temp_dir[e]; - if (tdir) { - const int16_t rawtemp = temp_hotend[e].raw * tdir; // normal direction, +rawtemp, else -rawtemp - const bool heater_on = (temp_hotend[e].target > 0 - #if ENABLED(PIDTEMP) - || temp_hotend[e].soft_pwm_amount > 0 - #endif - ); - if (rawtemp > temp_range[e].raw_max * tdir) max_temp_error((heater_ind_t)e); - if (heater_on && rawtemp < temp_range[e].raw_min * tdir && !is_preheating(e)) { - #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - if (++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED) - #endif - min_temp_error((heater_ind_t)e); - } - #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED - else - consecutive_low_temperature_error[e] = 0; + #if HOTENDS + + static constexpr int8_t temp_dir[] = { + #if ENABLED(HEATER_0_USES_MAX6675) + 0 + #else + TEMPDIR(0) #endif + #if HOTENDS > 1 + #if ENABLED(HEATER_1_USES_MAX6675) + , 0 + #else + , TEMPDIR(1) + #endif + #if HOTENDS > 2 + , TEMPDIR(2) + #if HOTENDS > 3 + , TEMPDIR(3) + #if HOTENDS > 4 + , TEMPDIR(4) + #if HOTENDS > 5 + , TEMPDIR(5) + #endif // HOTENDS > 5 + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 + }; + + for (uint8_t e = 0; e < COUNT(temp_dir); e++) { + const int8_t tdir = temp_dir[e]; + if (tdir) { + const int16_t rawtemp = temp_hotend[e].raw * tdir; // normal direction, +rawtemp, else -rawtemp + const bool heater_on = (temp_hotend[e].target > 0 + #if ENABLED(PIDTEMP) + || temp_hotend[e].soft_pwm_amount > 0 + #endif + ); + if (rawtemp > temp_range[e].raw_max * tdir) max_temp_error((heater_ind_t)e); + if (heater_on && rawtemp < temp_range[e].raw_min * tdir && !is_preheating(e)) { + #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED + if (++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED) + #endif + min_temp_error((heater_ind_t)e); + } + #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED + else + consecutive_low_temperature_error[e] = 0; + #endif + } } - } + + #endif // HOTENDS #if HAS_HEATED_BED #if TEMPDIR(BED) < 0 @@ -2363,12 +2383,10 @@ void Temperature::isr() { static bool ADCKey_pressed = false; #endif - #if ENABLED(SLOW_PWM_HEATERS) - static uint8_t slow_pwm_count = 0; + #if HOTENDS + static SoftPWM soft_pwm_hotend[HOTENDS]; #endif - static SoftPWM soft_pwm_hotend[HOTENDS]; - #if HAS_HEATED_BED static SoftPWM soft_pwm_bed; #endif @@ -2378,40 +2396,46 @@ void Temperature::isr() { #endif #if DISABLED(SLOW_PWM_HEATERS) - constexpr uint8_t pwm_mask = - #if ENABLED(SOFT_PWM_DITHER) - _BV(SOFT_PWM_SCALE) - 1 - #else - 0 - #endif - ; + + #if HOTENDS || HAS_HEATED_BED || HAS_HEATED_CHAMBER + constexpr uint8_t pwm_mask = + #if ENABLED(SOFT_PWM_DITHER) + _BV(SOFT_PWM_SCALE) - 1 + #else + 0 + #endif + ; + #define _PWM_MOD(N,S,T) do{ \ + const bool on = S.add(pwm_mask, T.soft_pwm_amount); \ + WRITE_HEATER_##N(on); \ + }while(0) + #endif /** * Standard heater PWM modulation */ if (pwm_count_tmp >= 127) { pwm_count_tmp -= 127; - #define _PWM_MOD(N,S,T) do{ \ - const bool on = S.add(pwm_mask, T.soft_pwm_amount); \ - WRITE_HEATER_##N(on); \ - }while(0) - #define _PWM_MOD_E(N) _PWM_MOD(N,soft_pwm_hotend[N],temp_hotend[N]) - _PWM_MOD_E(0); - #if HOTENDS > 1 - _PWM_MOD_E(1); - #if HOTENDS > 2 - _PWM_MOD_E(2); - #if HOTENDS > 3 - _PWM_MOD_E(3); - #if HOTENDS > 4 - _PWM_MOD_E(4); - #if HOTENDS > 5 - _PWM_MOD_E(5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 + + #if HOTENDS + #define _PWM_MOD_E(N) _PWM_MOD(N,soft_pwm_hotend[N],temp_hotend[N]) + _PWM_MOD_E(0); + #if HOTENDS > 1 + _PWM_MOD_E(1); + #if HOTENDS > 2 + _PWM_MOD_E(2); + #if HOTENDS > 3 + _PWM_MOD_E(3); + #if HOTENDS > 4 + _PWM_MOD_E(4); + #if HOTENDS > 5 + _PWM_MOD_E(5); + #endif // HOTENDS > 5 + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 + #endif // HOTENDS #if HAS_HEATED_BED _PWM_MOD(BED,soft_pwm_bed,temp_bed); @@ -2502,6 +2526,8 @@ void Temperature::isr() { #define _SLOW_PWM(NR,PWM,SRC) do{ PWM.count = SRC.soft_pwm_amount; _SLOW_SET(NR,PWM,(PWM.count > 0)); }while(0) #define _PWM_OFF(NR,PWM) do{ if (PWM.count < slow_pwm_count) _SLOW_SET(NR,PWM,0); }while(0) + static uint8_t slow_pwm_count = 0; + if (slow_pwm_count == 0) { #if HOTENDS @@ -2598,22 +2624,24 @@ void Temperature::isr() { slow_pwm_count++; slow_pwm_count &= 0x7F; - soft_pwm_hotend[0].dec(); - #if HOTENDS > 1 - soft_pwm_hotend[1].dec(); - #if HOTENDS > 2 - soft_pwm_hotend[2].dec(); - #if HOTENDS > 3 - soft_pwm_hotend[3].dec(); - #if HOTENDS > 4 - soft_pwm_hotend[4].dec(); - #if HOTENDS > 5 - soft_pwm_hotend[5].dec(); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 + #if HOTENDS + soft_pwm_hotend[0].dec(); + #if HOTENDS > 1 + soft_pwm_hotend[1].dec(); + #if HOTENDS > 2 + soft_pwm_hotend[2].dec(); + #if HOTENDS > 3 + soft_pwm_hotend[3].dec(); + #if HOTENDS > 4 + soft_pwm_hotend[4].dec(); + #if HOTENDS > 5 + soft_pwm_hotend[5].dec(); + #endif // HOTENDS > 5 + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 + #endif // HOTENDS #if HAS_HEATED_BED soft_pwm_bed.dec(); #endif @@ -2638,7 +2666,7 @@ void Temperature::isr() { */ #define ACCUMULATE_ADC(obj) do{ \ if (!HAL_ADC_READY()) next_sensor_state = adc_sensor_state; \ - else obj.acc += HAL_READ_ADC(); \ + else obj.sample(HAL_READ_ADC()); \ }while(0) ADCSensorState next_sensor_state = adc_sensor_state < SensorsReady ? (ADCSensorState)(int(adc_sensor_state) + 1) : StartSampling; @@ -2670,95 +2698,72 @@ void Temperature::isr() { break; #if HAS_TEMP_ADC_0 - case PrepareTemp_0: - HAL_START_ADC(TEMP_0_PIN); - break; - case MeasureTemp_0: - ACCUMULATE_ADC(temp_hotend[0]); - break; + case PrepareTemp_0: HAL_START_ADC(TEMP_0_PIN); break; + case MeasureTemp_0: ACCUMULATE_ADC(temp_hotend[0]); break; #endif #if HAS_HEATED_BED - case PrepareTemp_BED: - HAL_START_ADC(TEMP_BED_PIN); - break; - case MeasureTemp_BED: - ACCUMULATE_ADC(temp_bed); - break; + case PrepareTemp_BED: HAL_START_ADC(TEMP_BED_PIN); break; + case MeasureTemp_BED: ACCUMULATE_ADC(temp_bed); break; #endif #if HAS_TEMP_CHAMBER - case PrepareTemp_CHAMBER: - HAL_START_ADC(TEMP_CHAMBER_PIN); - break; - case MeasureTemp_CHAMBER: - ACCUMULATE_ADC(temp_chamber); - break; + case PrepareTemp_CHAMBER: HAL_START_ADC(TEMP_CHAMBER_PIN); break; + case MeasureTemp_CHAMBER: ACCUMULATE_ADC(temp_chamber); break; #endif #if HAS_TEMP_ADC_1 - case PrepareTemp_1: - HAL_START_ADC(TEMP_1_PIN); - break; - case MeasureTemp_1: - ACCUMULATE_ADC(temp_hotend[1]); - break; + case PrepareTemp_1: HAL_START_ADC(TEMP_1_PIN); break; + case MeasureTemp_1: ACCUMULATE_ADC(temp_hotend[1]); break; #endif #if HAS_TEMP_ADC_2 - case PrepareTemp_2: - HAL_START_ADC(TEMP_2_PIN); - break; - case MeasureTemp_2: - ACCUMULATE_ADC(temp_hotend[2]); - break; + case PrepareTemp_2: HAL_START_ADC(TEMP_2_PIN); break; + case MeasureTemp_2: ACCUMULATE_ADC(temp_hotend[2]); break; #endif #if HAS_TEMP_ADC_3 - case PrepareTemp_3: - HAL_START_ADC(TEMP_3_PIN); - break; - case MeasureTemp_3: - ACCUMULATE_ADC(temp_hotend[3]); - break; + case PrepareTemp_3: HAL_START_ADC(TEMP_3_PIN); break; + case MeasureTemp_3: ACCUMULATE_ADC(temp_hotend[3]); break; #endif #if HAS_TEMP_ADC_4 - case PrepareTemp_4: - HAL_START_ADC(TEMP_4_PIN); - break; - case MeasureTemp_4: - ACCUMULATE_ADC(temp_hotend[4]); - break; + case PrepareTemp_4: HAL_START_ADC(TEMP_4_PIN); break; + case MeasureTemp_4: ACCUMULATE_ADC(temp_hotend[4]); break; #endif #if HAS_TEMP_ADC_5 - case PrepareTemp_5: - HAL_START_ADC(TEMP_5_PIN); - break; - case MeasureTemp_5: - ACCUMULATE_ADC(temp_hotend[5]); - break; + case PrepareTemp_5: HAL_START_ADC(TEMP_5_PIN); break; + case MeasureTemp_5: ACCUMULATE_ADC(temp_hotend[5]); break; #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) - case Prepare_FILWIDTH: - HAL_START_ADC(FILWIDTH_PIN); - break; + case Prepare_FILWIDTH: HAL_START_ADC(FILWIDTH_PIN); break; case Measure_FILWIDTH: if (!HAL_ADC_READY()) next_sensor_state = adc_sensor_state; // redo this state - else if (HAL_READ_ADC() > 102) { // Make sure ADC is reading > 0.5 volts, otherwise don't read. - raw_filwidth_value -= raw_filwidth_value >> 7; // Subtract 1/128th of the raw_filwidth_value - raw_filwidth_value += uint32_t(HAL_READ_ADC()) << 7; // Add new ADC reading, scaled by 128 - } + else + filwidth.accumulate(HAL_READ_ADC()); break; #endif + #if HAS_JOY_ADC_X + case PrepareJoy_X: HAL_START_ADC(JOY_X_PIN); break; + case MeasureJoy_X: ACCUMULATE_ADC(joystick.x); break; + #endif + + #if HAS_JOY_ADC_Y + case PrepareJoy_Y: HAL_START_ADC(JOY_Y_PIN); break; + case MeasureJoy_Y: ACCUMULATE_ADC(joystick.y); break; + #endif + + #if HAS_JOY_ADC_Z + case PrepareJoy_Z: HAL_START_ADC(JOY_Z_PIN); break; + case MeasureJoy_Z: ACCUMULATE_ADC(joystick.z); break; + #endif + #if HAS_ADC_BUTTONS - case Prepare_ADC_KEY: - HAL_START_ADC(ADC_KEYPAD_PIN); - break; + case Prepare_ADC_KEY: HAL_START_ADC(ADC_KEYPAD_PIN); break; case Measure_ADC_KEY: if (!HAL_ADC_READY()) next_sensor_state = adc_sensor_state; // redo this state @@ -2925,14 +2930,17 @@ void Temperature::isr() { #endif // AUTO_REPORT_TEMPERATURES - #if HAS_DISPLAY + #if HOTENDS && HAS_DISPLAY void Temperature::set_heating_message(const uint8_t e) { const bool heating = isHeatingHotend(e); - #if HOTENDS > 1 - ui.status_printf_P(0, heating ? PSTR("E%c " MSG_HEATING) : PSTR("E%c " MSG_COOLING), '1' + e); - #else - ui.set_status_P(heating ? PSTR("E " MSG_HEATING) : PSTR("E " MSG_COOLING)); - #endif + ui.status_printf_P(0, + #if HOTENDS > 1 + PSTR("E%c " S_FMT), '1' + e + #else + PSTR("E " S_FMT) + #endif + , heating ? PSTR(MSG_HEATING) : PSTR(MSG_COOLING) + ); } #endif diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 171dee373f..63251cd40f 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -92,44 +92,43 @@ typedef struct { float Kp, Ki, Kd, Kc; } PIDC_t; enum ADCSensorState : char { StartSampling, #if HAS_TEMP_ADC_0 - PrepareTemp_0, - MeasureTemp_0, + PrepareTemp_0, MeasureTemp_0, #endif #if HAS_HEATED_BED - PrepareTemp_BED, - MeasureTemp_BED, + PrepareTemp_BED, MeasureTemp_BED, #endif #if HAS_TEMP_CHAMBER - PrepareTemp_CHAMBER, - MeasureTemp_CHAMBER, + PrepareTemp_CHAMBER, MeasureTemp_CHAMBER, #endif #if HAS_TEMP_ADC_1 - PrepareTemp_1, - MeasureTemp_1, + PrepareTemp_1, MeasureTemp_1, #endif #if HAS_TEMP_ADC_2 - PrepareTemp_2, - MeasureTemp_2, + PrepareTemp_2, MeasureTemp_2, #endif #if HAS_TEMP_ADC_3 - PrepareTemp_3, - MeasureTemp_3, + PrepareTemp_3, MeasureTemp_3, #endif #if HAS_TEMP_ADC_4 - PrepareTemp_4, - MeasureTemp_4, + PrepareTemp_4, MeasureTemp_4, #endif #if HAS_TEMP_ADC_5 - PrepareTemp_5, - MeasureTemp_5, + PrepareTemp_5, MeasureTemp_5, + #endif + #if HAS_JOY_ADC_X + PrepareJoy_X, MeasureJoy_X, + #endif + #if HAS_JOY_ADC_Y + PrepareJoy_Y, MeasureJoy_Y, + #endif + #if HAS_JOY_ADC_Z + PrepareJoy_Z, MeasureJoy_Z, #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) - Prepare_FILWIDTH, - Measure_FILWIDTH, + Prepare_FILWIDTH, Measure_FILWIDTH, #endif #if HAS_ADC_BUTTONS - Prepare_ADC_KEY, - Measure_ADC_KEY, + Prepare_ADC_KEY, Measure_ADC_KEY, #endif SensorsReady, // Temperatures ready. Delay the next round of readings to let ADC pins settle. StartupDelay // Startup, delay initial temp reading a tiny bit so the hardware can settle @@ -159,7 +158,10 @@ enum ADCSensorState : char { typedef struct TempInfo { uint16_t acc; int16_t raw; - float current; + float celsius; + inline void reset() { acc = 0; } + inline void sample(const uint16_t s) { acc += s; } + inline void update() { raw = acc; } } temp_info_t; // A PWM heater with temperature sensor @@ -268,11 +270,14 @@ class Temperature { static volatile bool in_temp_isr; - static hotend_info_t temp_hotend[HOTENDS + #if HOTENDS #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - + 1 + #define HOTEND_TEMPS (HOTENDS + 1) + #else + #define HOTEND_TEMPS HOTENDS #endif - ]; + static hotend_info_t temp_hotend[HOTEND_TEMPS]; + #endif #if HAS_HEATED_BED static bed_info_t temp_bed; @@ -347,7 +352,9 @@ class Temperature { static lpq_ptr_t lpq_ptr; #endif - static temp_range_t temp_range[HOTENDS]; + #if HOTENDS + static temp_range_t temp_range[HOTENDS]; + #endif #if HAS_HEATED_BED #if WATCH_BED @@ -385,18 +392,10 @@ class Temperature { static millis_t preheat_end_time[HOTENDS]; #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - static int8_t meas_shift_index; // Index of a delayed sample in buffer - #endif - #if HAS_AUTO_FAN static millis_t next_auto_fan_check_ms; #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - static uint16_t current_raw_filwidth; // Measured filament diameter - one extruder only - #endif - #if ENABLED(PROBING_HEATERS_OFF) static bool paused; #endif @@ -415,8 +414,6 @@ class Temperature { * Instance Methods */ - Temperature(); - void init(); /** @@ -454,7 +451,9 @@ class Temperature { } #endif - static float analog_to_celsius_hotend(const int raw, const uint8_t e); + #if HOTENDS + static float analog_to_celsius_hotend(const int raw, const uint8_t e); + #endif #if HAS_HEATED_BED static float analog_to_celsius_bed(const int raw); @@ -563,31 +562,37 @@ class Temperature { #define is_preheating(n) (false) #endif - #if ENABLED(FILAMENT_WIDTH_SENSOR) - static float analog_to_mm_fil_width(); // Convert raw Filament Width to millimeters - static int8_t widthFil_to_size_ratio(); // Convert Filament Width (mm) to an extrusion ratio - #endif - - //high level conversion routines, for use outside of temperature.cpp //inline so that there is no performance decrease. //deg=degreeCelsius FORCE_INLINE static float degHotend(const uint8_t e) { E_UNUSED(); - return temp_hotend[HOTEND_INDEX].current; + #if HOTENDS + return temp_hotend[HOTEND_INDEX].celsius; + #else + return 0; + #endif } #if ENABLED(SHOW_TEMP_ADC_VALUES) FORCE_INLINE static int16_t rawHotendTemp(const uint8_t e) { E_UNUSED(); - return temp_hotend[HOTEND_INDEX].raw; + #if HOTENDS + return temp_hotend[HOTEND_INDEX].raw; + #else + return 0; + #endif } #endif FORCE_INLINE static int16_t degTargetHotend(const uint8_t e) { E_UNUSED(); - return temp_hotend[HOTEND_INDEX].target; + #if HOTENDS + return temp_hotend[HOTEND_INDEX].target; + #else + return 0; + #endif } #if WATCH_HOTENDS @@ -596,77 +601,66 @@ class Temperature { static inline void start_watching_hotend(const uint8_t e=0) { UNUSED(e); } #endif - #if HAS_LCD_MENU - static inline void start_watching_E0() { start_watching_hotend(0); } - static inline void start_watching_E1() { start_watching_hotend(1); } - static inline void start_watching_E2() { start_watching_hotend(2); } - static inline void start_watching_E3() { start_watching_hotend(3); } - static inline void start_watching_E4() { start_watching_hotend(4); } - static inline void start_watching_E5() { start_watching_hotend(5); } - #endif + #if HOTENDS - static void setTargetHotend(const int16_t celsius, const uint8_t e) { - E_UNUSED(); - const uint8_t ee = HOTEND_INDEX; - #ifdef MILLISECONDS_PREHEAT_TIME - if (celsius == 0) - reset_preheat_time(ee); - else if (temp_hotend[ee].target == 0) - start_preheat_time(ee); + #if HAS_LCD_MENU + static inline void start_watching_E0() { start_watching_hotend(0); } + static inline void start_watching_E1() { start_watching_hotend(1); } + static inline void start_watching_E2() { start_watching_hotend(2); } + static inline void start_watching_E3() { start_watching_hotend(3); } + static inline void start_watching_E4() { start_watching_hotend(4); } + static inline void start_watching_E5() { start_watching_hotend(5); } #endif - #if ENABLED(AUTO_POWER_CONTROL) - powerManager.power_on(); - #endif - temp_hotend[ee].target = _MIN(celsius, temp_range[ee].maxtemp - 15); - start_watching_hotend(ee); - } - #if WATCH_CHAMBER - static void start_watching_chamber(); - #else - static inline void start_watching_chamber() {} - #endif - - #if HAS_HEATED_CHAMBER - static void setTargetChamber(const int16_t celsius) { - temp_chamber.target = - #ifdef CHAMBER_MAXTEMP - _MIN(celsius, CHAMBER_MAXTEMP) - #else - celsius - #endif - ; - start_watching_chamber(); - } - #endif // HAS_HEATED_CHAMBER - - FORCE_INLINE static bool isHeatingHotend(const uint8_t e) { - E_UNUSED(); - return temp_hotend[HOTEND_INDEX].target > temp_hotend[HOTEND_INDEX].current; - } - - FORCE_INLINE static bool isCoolingHotend(const uint8_t e) { - E_UNUSED(); - return temp_hotend[HOTEND_INDEX].target < temp_hotend[HOTEND_INDEX].current; - } - - #if HAS_TEMP_HOTEND - static bool wait_for_hotend(const uint8_t target_extruder, const bool no_wait_for_cooling=true - #if G26_CLICK_CAN_CANCEL - , const bool click_to_cancel=false + static void setTargetHotend(const int16_t celsius, const uint8_t e) { + E_UNUSED(); + const uint8_t ee = HOTEND_INDEX; + #ifdef MILLISECONDS_PREHEAT_TIME + if (celsius == 0) + reset_preheat_time(ee); + else if (temp_hotend[ee].target == 0) + start_preheat_time(ee); #endif - ); - #endif + #if ENABLED(AUTO_POWER_CONTROL) + powerManager.power_on(); + #endif + temp_hotend[ee].target = _MIN(celsius, temp_range[ee].maxtemp - 15); + start_watching_hotend(ee); + } + + FORCE_INLINE static bool isHeatingHotend(const uint8_t e) { + E_UNUSED(); + return temp_hotend[HOTEND_INDEX].target > temp_hotend[HOTEND_INDEX].celsius; + } + + FORCE_INLINE static bool isCoolingHotend(const uint8_t e) { + E_UNUSED(); + return temp_hotend[HOTEND_INDEX].target < temp_hotend[HOTEND_INDEX].celsius; + } + + #if HAS_TEMP_HOTEND + static bool wait_for_hotend(const uint8_t target_extruder, const bool no_wait_for_cooling=true + #if G26_CLICK_CAN_CANCEL + , const bool click_to_cancel=false + #endif + ); + #endif + + FORCE_INLINE static bool still_heating(const uint8_t e) { + return degTargetHotend(e) > TEMP_HYSTERESIS && ABS(degHotend(e) - degTargetHotend(e)) > TEMP_HYSTERESIS; + } + + #endif // HOTENDS #if HAS_HEATED_BED #if ENABLED(SHOW_TEMP_ADC_VALUES) FORCE_INLINE static int16_t rawBedTemp() { return temp_bed.raw; } #endif - FORCE_INLINE static float degBed() { return temp_bed.current; } + FORCE_INLINE static float degBed() { return temp_bed.celsius; } FORCE_INLINE static int16_t degTargetBed() { return temp_bed.target; } - FORCE_INLINE static bool isHeatingBed() { return temp_bed.target > temp_bed.current; } - FORCE_INLINE static bool isCoolingBed() { return temp_bed.target < temp_bed.current; } + FORCE_INLINE static bool isHeatingBed() { return temp_bed.target > temp_bed.celsius; } + FORCE_INLINE static bool isCoolingBed() { return temp_bed.target < temp_bed.celsius; } #if WATCH_BED static void start_watching_bed(); @@ -700,19 +694,34 @@ class Temperature { #if ENABLED(SHOW_TEMP_ADC_VALUES) FORCE_INLINE static int16_t rawChamberTemp() { return temp_chamber.raw; } #endif - FORCE_INLINE static float degChamber() { return temp_chamber.current; } + FORCE_INLINE static float degChamber() { return temp_chamber.celsius; } #if HAS_HEATED_CHAMBER FORCE_INLINE static int16_t degTargetChamber() { return temp_chamber.target; } - FORCE_INLINE static bool isHeatingChamber() { return temp_chamber.target > temp_chamber.current; } - FORCE_INLINE static bool isCoolingChamber() { return temp_chamber.target < temp_chamber.current; } + FORCE_INLINE static bool isHeatingChamber() { return temp_chamber.target > temp_chamber.celsius; } + FORCE_INLINE static bool isCoolingChamber() { return temp_chamber.target < temp_chamber.celsius; } static bool wait_for_chamber(const bool no_wait_for_cooling=true); #endif #endif // HAS_TEMP_CHAMBER - FORCE_INLINE static bool still_heating(const uint8_t e) { - return degTargetHotend(e) > TEMP_HYSTERESIS && ABS(degHotend(e) - degTargetHotend(e)) > TEMP_HYSTERESIS; - } + #if WATCH_CHAMBER + static void start_watching_chamber(); + #else + static inline void start_watching_chamber() {} + #endif + + #if HAS_HEATED_CHAMBER + static void setTargetChamber(const int16_t celsius) { + temp_chamber.target = + #ifdef CHAMBER_MAXTEMP + _MIN(celsius, CHAMBER_MAXTEMP) + #else + celsius + #endif + ; + start_watching_chamber(); + } + #endif // HAS_HEATED_CHAMBER /** * The software PWM power for a heater @@ -780,7 +789,7 @@ class Temperature { #if ENABLED(AUTO_REPORT_TEMPERATURES) static uint8_t auto_report_temp_interval; static millis_t next_temp_report_ms; - static void auto_report_temperatures(void); + static void auto_report_temperatures(); static inline void set_auto_report_interval(uint8_t v) { NOMORE(v, 60); auto_report_temp_interval = v; diff --git a/Marlin/src/module/thermistor/thermistor_201.h b/Marlin/src/module/thermistor/thermistor_201.h index 44e08d0c2f..21f0e92a41 100644 --- a/Marlin/src/module/thermistor/thermistor_201.h +++ b/Marlin/src/module/thermistor/thermistor_201.h @@ -1,6 +1,6 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm diff --git a/Marlin/src/module/thermistor/thermistor_75.h b/Marlin/src/module/thermistor/thermistor_75.h index a43e1f0b4b..fcc4c60375 100644 --- a/Marlin/src/module/thermistor/thermistor_75.h +++ b/Marlin/src/module/thermistor/thermistor_75.h @@ -51,30 +51,30 @@ const short temptable_75[][2] PROGMEM = { // Generic Silicon Heat Pad with NTC 1 { OV(300.92), 145 }, // v=1.469 r=1956.004 res=0.189 degC/coun #endif - { OV(328.32), 140 }, // v=1.603 r=2218.081 res=0.176 degC/count - { OV(388.65), 130 }, // v=1.898 r=2874.980 res=0.156 degC/count - { OV(421.39), 125 }, // v=2.058 r=3286.644 res=0.149 degC/count - { OV(455.65), 120 }, // v=2.225 r=3768.002 res=0.143 degC/count - { OV(491.17), 115 }, // v=2.398 r=4332.590 res=0.139 degC/count - { OV(527.68), 110 }, // v=2.577 r=4996.905 res=0.136 degC/count - { OV(564.81), 105 }, // v=2.758 r=5781.120 res=0.134 degC/count - { OV(602.19), 100 }, // v=2.940 r=6710.000 res=0.134 degC/count - { OV(676.03), 90 }, // v=3.301 r=9131.018 res=0.138 degC/count - { OV(745.85), 80 }, // v=3.642 r=12602.693 res=0.150 degC/count - { OV(778.31), 75 }, // v=3.800 r=14889.001 res=0.159 degC/count - { OV(808.75), 70 }, // v=3.949 r=17658.700 res=0.171 degC/count - { OV(836.94), 65 }, // v=4.087 r=21028.040 res=0.185 degC/count - { OV(862.74), 60 }, // v=4.213 r=25144.568 res=0.204 degC/count - { OV(886.08), 55 }, // v=4.327 r=30196.449 res=0.227 degC/count - { OV(906.97), 50 }, // v=4.429 r=36424.838 res=0.255 degC/count - { OV(941.65), 40 }, // v=4.598 r=53745.337 res=0.333 degC/count - { OV(967.76), 30 }, // v=4.725 r=80880.630 res=0.452 degC/count - { OV(978.03), 25 }, // v=4.776 r=100000.000 res=0.535 degC/count - { OV(981.68), 23 }, // v=4.793 r=109024.395 res=0.573 degC/count - { OV(983.41), 22 }, // v=4.802 r=113875.430 res=0.594 degC/count - { OV(985.08), 21 }, // v=4.810 r=118968.955 res=0.616 degC/count - { OV(986.70), 20 }, // v=4.818 r=124318.354 res=0.638 degC/count - { OV(993.94), 15 }, // v=4.853 r=155431.302 res=0.768 degC/count - { OV(999.96), 10 }, // v=4.883 r=195480.023 res=0.934 degC/count - { OV(008.95), 0 } // v=4.926 r=314997.575 res=1.418 degC/count + { OV( 328.32), 140 }, // v=1.603 r=2218.081 res=0.176 degC/count + { OV( 388.65), 130 }, // v=1.898 r=2874.980 res=0.156 degC/count + { OV( 421.39), 125 }, // v=2.058 r=3286.644 res=0.149 degC/count + { OV( 455.65), 120 }, // v=2.225 r=3768.002 res=0.143 degC/count + { OV( 491.17), 115 }, // v=2.398 r=4332.590 res=0.139 degC/count + { OV( 527.68), 110 }, // v=2.577 r=4996.905 res=0.136 degC/count + { OV( 564.81), 105 }, // v=2.758 r=5781.120 res=0.134 degC/count + { OV( 602.19), 100 }, // v=2.940 r=6710.000 res=0.134 degC/count + { OV( 676.03), 90 }, // v=3.301 r=9131.018 res=0.138 degC/count + { OV( 745.85), 80 }, // v=3.642 r=12602.693 res=0.150 degC/count + { OV( 778.31), 75 }, // v=3.800 r=14889.001 res=0.159 degC/count + { OV( 808.75), 70 }, // v=3.949 r=17658.700 res=0.171 degC/count + { OV( 836.94), 65 }, // v=4.087 r=21028.040 res=0.185 degC/count + { OV( 862.74), 60 }, // v=4.213 r=25144.568 res=0.204 degC/count + { OV( 886.08), 55 }, // v=4.327 r=30196.449 res=0.227 degC/count + { OV( 906.97), 50 }, // v=4.429 r=36424.838 res=0.255 degC/count + { OV( 941.65), 40 }, // v=4.598 r=53745.337 res=0.333 degC/count + { OV( 967.76), 30 }, // v=4.725 r=80880.630 res=0.452 degC/count + { OV( 978.03), 25 }, // v=4.776 r=100000.000 res=0.535 degC/count + { OV( 981.68), 23 }, // v=4.793 r=109024.395 res=0.573 degC/count + { OV( 983.41), 22 }, // v=4.802 r=113875.430 res=0.594 degC/count + { OV( 985.08), 21 }, // v=4.810 r=118968.955 res=0.616 degC/count + { OV( 986.70), 20 }, // v=4.818 r=124318.354 res=0.638 degC/count + { OV( 993.94), 15 }, // v=4.853 r=155431.302 res=0.768 degC/count + { OV( 999.96), 10 }, // v=4.883 r=195480.023 res=0.934 degC/count + { OV(1008.95), 0 } // v=4.926 r=314997.575 res=1.418 degC/count }; diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 264dd16700..6178a7ce5d 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -133,9 +133,11 @@ #endif // SWITCHING_NOZZLE -inline void fast_line_to_current(const AxisEnum fr_axis) { - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[fr_axis], active_extruder); +inline void _line_to_current(const AxisEnum fr_axis, const float fscale=1.0f) { + planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[fr_axis] * fscale, active_extruder); } +inline void slow_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.5f); } +inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis); } #if ENABLED(MAGNETIC_PARKING_EXTRUDER) @@ -150,15 +152,13 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { const float oldx = current_position[X_AXIS], grabpos = mpe_settings.parking_xpos[new_tool] + (new_tool ? mpe_settings.grab_distance : -mpe_settings.grab_distance), - offsetcompensation = + offsetcompensation = (0 #if HAS_HOTEND_OFFSET - hotend_offset[X_AXIS][active_extruder] * mpe_settings.compensation_factor - #else - 0 + + hotend_offset[X_AXIS][active_extruder] * mpe_settings.compensation_factor #endif - ; + ); - if (axis_unhomed_error(true, false, false)) return; + if (axis_unhomed_error(_BV(X_AXIS))) return; /** * Z Lift and Nozzle Offset shift ar defined in caller method to work equal with any Multi Hotend realization @@ -337,7 +337,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { planner.synchronize(); DEBUG_POS("(5) Unpark extruder", current_position); } - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS] * 0.5, active_extruder); + slow_line_to_current(X_AXIS); // STEP 6 @@ -411,7 +411,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS; if (DEBUGGING(LEVELING)) DEBUG_POS("Move Y SwitchPos", current_position); - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.5f, active_extruder); + slow_line_to_current(Y_AXIS); // Wait for move to complete, then another 0.2s planner.synchronize(); @@ -446,7 +446,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { DEBUG_ECHOLNPGM("(4) Grab and lock new toolhead"); DEBUG_POS("Move Y SwitchPos", current_position); } - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.5, active_extruder); + slow_line_to_current(Y_AXIS); // Wait for move to finish, pause 0.2s, move servo, pause 0.5s planner.synchronize(); @@ -491,21 +491,21 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { SERIAL_ECHOLNPAIR("(1) Place old tool ", int(active_extruder)); DEBUG_POS("Move Y SwitchPos + Security", current_position); } - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS], active_extruder); + fast_line_to_current(Y_AXIS); current_position[X_AXIS] = placexclear; if (DEBUGGING(LEVELING)) { planner.synchronize(); DEBUG_POS("Move X SwitchPos + Security", current_position); } - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS], active_extruder); + fast_line_to_current(X_AXIS); current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS; if (DEBUGGING(LEVELING)) { planner.synchronize(); DEBUG_POS("Move Y SwitchPos", current_position); } - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS], active_extruder); + fast_line_to_current(Y_AXIS); current_position[X_AXIS] = placexpos; if (DEBUGGING(LEVELING)) { @@ -541,7 +541,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { current_position[X_AXIS] = grabxpos; if (DEBUGGING(LEVELING)) DEBUG_POS("Move to new toolhead X", current_position); - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS], active_extruder); + fast_line_to_current(X_AXIS); // 4. Grab the new toolhead and move to security position @@ -559,7 +559,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { planner.synchronize(); DEBUG_POS("Move Y SwitchPos", current_position); } - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.2, active_extruder); + _line_to_current(Y_AXIS, 0.2f); #if ENABLED(PRIME_BEFORE_REMOVE) && (SWITCHING_TOOLHEAD_PRIME_MM || SWITCHING_TOOLHEAD_RETRACT_MM) #if SWITCHING_TOOLHEAD_PRIME_MM @@ -577,13 +577,13 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { current_position[X_AXIS] = grabxclear; if (DEBUGGING(LEVELING)) DEBUG_POS("Move to new toolhead X + Security", current_position); - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS] * 0.1, active_extruder); + _line_to_current(X_AXIS, 0.1f); planner.synchronize(); safe_delay(100); // Give switch time to settle current_position[Y_AXIS] += SWITCHING_TOOLHEAD_Y_CLEAR; if (DEBUGGING(LEVELING)) DEBUG_POS("Move back Y clear", current_position); - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS], active_extruder); // move away from docked toolhead + fast_line_to_current(Y_AXIS); // move away from docked toolhead planner.synchronize(); // Always sync last tool-change move if (DEBUGGING(LEVELING)) DEBUG_POS("MST Tool-Change done.", current_position); @@ -620,7 +620,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { current_position[Z_AXIS] += SWITCHING_TOOLHEAD_Z_HOP; if (DEBUGGING(LEVELING)) DEBUG_POS("(1) Raise Z-Axis ", current_position); - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder); + fast_line_to_current(Z_AXIS); // 2. Move to position near active extruder parking @@ -629,9 +629,9 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { SERIAL_ECHOLNPAIR("(2) Move near active extruder parking", active_extruder); DEBUG_POS("Moving ParkPos", current_position); } - current_position[X_AXIS] = placexpos + hotend_offset[X_AXIS][active_extruder]; - current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR + hotend_offset[Y_AXIS][active_extruder]; - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS], active_extruder); + current_position[X_AXIS] = hotend_offset[X_AXIS][active_extruder] + placexpos; + current_position[Y_AXIS] = hotend_offset[Y_AXIS][active_extruder] + SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR; + fast_line_to_current(X_AXIS); // 3. Move gently to park position of active extruder @@ -642,7 +642,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { } current_position[Y_AXIS] -= SWITCHING_TOOLHEAD_Y_CLEAR; - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.5, active_extruder); + slow_line_to_current(Y_AXIS); // 4. Disengage magnetic field, wait for delay @@ -658,10 +658,11 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { } current_position[Y_AXIS] += SWITCHING_TOOLHEAD_Y_CLEAR; - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.5f, active_extruder); - current_position[X_AXIS] = grabxpos + hotend_offset[X_AXIS][active_extruder]; - current_position[Y_AXIS] = SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR + hotend_offset[Y_AXIS][active_extruder]; - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS], active_extruder); + slow_line_to_current(Y_AXIS); + + current_position[X_AXIS] = hotend_offset[X_AXIS][active_extruder] + grabxpos; + current_position[Y_AXIS] = hotend_offset[Y_AXIS][active_extruder] + SWITCHING_TOOLHEAD_Y_POS + SWITCHING_TOOLHEAD_Y_CLEAR; + fast_line_to_current(X_AXIS); // 6. Move gently to park position of new extruder @@ -670,7 +671,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { planner.synchronize(); DEBUG_ECHOLNPGM("(6) Move near new extruder"); } - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Y_AXIS] * 0.5f, active_extruder); + slow_line_to_current(Y_AXIS); // 7. Engage magnetic field for new extruder parking @@ -682,7 +683,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { current_position[Y_AXIS] += SWITCHING_TOOLHEAD_Y_CLEAR; if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("(8) Unpark extruder"); - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[X_AXIS] * 0.5f, active_extruder); + slow_line_to_current(X_AXIS); planner.synchronize(); // Always sync the final move // 9. Apply Z hotend offset to current position @@ -695,11 +696,13 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { #endif // ELECTROMAGNETIC_SWITCHING_TOOLHEAD -inline void invalid_extruder_error(const uint8_t e) { - SERIAL_ECHO_START(); - SERIAL_CHAR('T'); SERIAL_ECHO(int(e)); - SERIAL_CHAR(' '); SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER); -} +#if EXTRUDERS + inline void invalid_extruder_error(const uint8_t e) { + SERIAL_ECHO_START(); + SERIAL_CHAR('T'); SERIAL_ECHO(int(e)); + SERIAL_CHAR(' '); SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER); + } +#endif #if ENABLED(DUAL_X_CARRIAGE) @@ -788,6 +791,11 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { mmu2.tool_change(new_tool); + #elif EXTRUDERS == 0 + + // Nothing to do + UNUSED(new_tool); UNUSED(no_move); + #elif EXTRUDERS < 2 UNUSED(no_move); diff --git a/Marlin/src/module/tool_change.h b/Marlin/src/module/tool_change.h index 754c720096..42b96e2c6a 100644 --- a/Marlin/src/module/tool_change.h +++ b/Marlin/src/module/tool_change.h @@ -71,12 +71,12 @@ #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) typedef struct MPESettings { - float parking_xpos[2], // M951 L R - grab_distance, // M951 I - slow_feedrate, // M951 J - fast_feedrate, // M951 H - travel_distance, // M951 D - compensation_factor; // M951 C + float parking_xpos[2], // M951 L R + grab_distance; // M951 I + feedRate_t slow_feedrate, // M951 J + fast_feedrate; // M951 H + float travel_distance, // M951 D + compensation_factor; // M951 C } mpe_settings_t; extern mpe_settings_t mpe_settings; diff --git a/Marlin/src/pins/lpc1768/pins_BIGTREE_SKR_V1.1.h b/Marlin/src/pins/lpc1768/pins_BIGTREE_SKR_V1.1.h index 36e7b028b8..cea929be1e 100644 --- a/Marlin/src/pins/lpc1768/pins_BIGTREE_SKR_V1.1.h +++ b/Marlin/src/pins/lpc1768/pins_BIGTREE_SKR_V1.1.h @@ -22,7 +22,7 @@ #pragma once #ifndef TARGET_LPC1768 - #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." + #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif #define BOARD_INFO_NAME "BIGTREE SKR 1.1" diff --git a/Marlin/src/pins/lpc1768/pins_BIGTREE_SKR_V1.3.h b/Marlin/src/pins/lpc1768/pins_BIGTREE_SKR_V1.3.h index 6c86056e36..1febedf2fa 100644 --- a/Marlin/src/pins/lpc1768/pins_BIGTREE_SKR_V1.3.h +++ b/Marlin/src/pins/lpc1768/pins_BIGTREE_SKR_V1.3.h @@ -22,7 +22,7 @@ #pragma once #ifndef TARGET_LPC1768 - #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." + #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif #define BOARD_INFO_NAME "BIGTREE SKR 1.3" diff --git a/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h b/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h index c059045848..8f683074cf 100644 --- a/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h +++ b/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h @@ -31,7 +31,7 @@ */ #ifndef TARGET_LPC1768 - #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." + #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h index 20385bab4e..45ab77b312 100644 --- a/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h +++ b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h @@ -28,7 +28,7 @@ #define BOARD_INFO_NAME "GMARSH X6 REV1" // Ignore temp readings during develpment. -//#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 // // Enable 12MHz clock output on P1.27 pin to sync TMC2208 chip clocks diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index 4eead57e77..36b558ec19 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -215,9 +215,8 @@ #if ENABLED(FYSETC_MINI_12864) #define DOGLCD_CS P0_18 #define DOGLCD_A0 P0_16 - #define DOGLCD_SCK P0_7 + #define DOGLCD_SCK P0_07 #define DOGLCD_MOSI P1_20 - #define FORCE_SOFT_SPI #define LCD_BACKLIGHT_PIN -1 @@ -231,7 +230,7 @@ #define RGB_LED_R_PIN P0_17 #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN P1_0 + #define RGB_LED_G_PIN P1_00 #endif #ifndef RGB_LED_B_PIN #define RGB_LED_B_PIN P1_22 @@ -244,12 +243,12 @@ #if ENABLED(MKS_MINI_12864) #define DOGLCD_CS P0_17 - #define DOGLCD_A0 P1_0 + #define DOGLCD_A0 P1_00 #endif #if ENABLED(ULTIPANEL) #define LCD_PINS_D5 P0_17 - #define LCD_PINS_D6 P1_0 + #define LCD_PINS_D6 P1_00 #define LCD_PINS_D7 P1_22 #endif diff --git a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h index 8e4bfeb8b9..bc8037da07 100644 --- a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h @@ -128,7 +128,7 @@ // P2_08 E1-Step // P2_13 E1-Dir - #ifndef X_SERIAL_TX_PIN + #ifndef X_SERIAL_TX_PIN #define X_SERIAL_TX_PIN P0_01 #endif #ifndef X_SERIAL_RX_PIN diff --git a/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h index f1af6d1fbd..83e7482807 100644 --- a/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h @@ -169,4 +169,6 @@ #define LCD_PINS_ENABLE P0_18 #define LCD_PINS_D4 P0_15 #define KILL_PIN P2_11 +#elif HAS_SPI_LCD + #error "Only the CR10_STOCKDISPLAY is supported with TH3D EZBoard." #endif diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h index 681ce65e35..3915c1cfed 100644 --- a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h @@ -54,7 +54,10 @@ #define TEMP_2_PIN 2 // Analog Input. 9 for tool3 -> 2 for chambertemp #define TEMP_3_PIN 11 // Analog Input. 11 for tool4 -> 2 for chambertemp #define TEMP_BED_PIN 1 // Analog Input -//#define TEMP_CHAMBER_PIN 2 // Analog Input + +#ifndef TEMP_CHAMBER_PIN + //#define TEMP_CHAMBER_PIN 2 // Analog Input +#endif // // Heaters / Fans diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h index 585c048e49..b9a96c410b 100644 --- a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h @@ -54,7 +54,10 @@ #define TEMP_2_PIN 13 // Analog Input. 10 for tool3 -> 13 for chambertemp #define TEMP_3_PIN 11 // Analog Input. 11 for tool4 -> 13 for chambertemp #define TEMP_BED_PIN 14 // Analog Input -//#define TEMP_CHAMBER_PIN 13 // Analog Input + +#ifndef TEMP_CHAMBER_PIN + //#define TEMP_CHAMBER_PIN 13 // Analog Input +#endif // // Heaters / Fans diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_15.h b/Marlin/src/pins/mega/pins_CNCONTROLS_15.h index 6d7325996f..2fad8d576e 100644 --- a/Marlin/src/pins/mega/pins_CNCONTROLS_15.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_15.h @@ -49,7 +49,10 @@ // #define TEMP_0_PIN 2 // Analog Input #define TEMP_BED_PIN 4 // Analog Input -#define TEMP_CHAMBER_PIN 5 // Analog Input + +#ifndef TEMP_CHAMBER_PIN + #define TEMP_CHAMBER_PIN 5 // Analog Input +#endif // // Heaters diff --git a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h index 9ad3a4a04b..a39162dded 100644 --- a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h +++ b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h @@ -29,7 +29,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define DEFAULT_MACHINE_NAME "ADIMLab Granty v2" +#define DEFAULT_MACHINE_NAME "ADIMLab Gantry v2" #define BOARD_INFO_NAME "HJC2560-C" // diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 9f4b6d5533..4058c72836 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -442,18 +442,18 @@ // STM32 ARM Cortex-M3 // -#elif MB(STM32F1R) - #include "stm32/pins_STM32F1R.h" // STM32F1 env:STM32F1 +#elif MB(STM32F103R) + #include "stm32/pins_STM32F1R.h" // STM32F1 env:STM32F103R #elif MB(MALYAN_M200) #include "stm32/pins_MALYAN_M200.h" // STM32F1 env:malyanm200 #elif MB(STM3R_MINI) - #include "stm32/pins_STM3R_MINI.h" // STM32F1 env:STM32F1 + #include "stm32/pins_STM3R_MINI.h" // STM32F1 env:STM32F103R #elif MB(GTM32_PRO_VB) - #include "stm32/pins_GTM32_PRO_VB.h" // STM32F1 env:STM32F1 + #include "stm32/pins_GTM32_PRO_VB.h" // STM32F1 env:STM32F103R #elif MB(MORPHEUS) - #include "stm32/pins_MORPHEUS.h" // STM32F1 env:STM32F1 + #include "stm32/pins_MORPHEUS.h" // STM32F1 env:STM32F103R #elif MB(CHITU3D) - #include "stm32/pins_CHITU3D.h" // STM32F1 env:STM32F1 + #include "stm32/pins_CHITU3D.h" // STM32F1 env:STM32F103R #elif MB(MKS_ROBIN) #include "stm32/pins_MKS_ROBIN.h" // STM32F1 env:mks_robin #elif MB(MKS_ROBIN_MINI) @@ -463,21 +463,21 @@ #elif MB(MKS_ROBIN_LITE) #include "stm32/pins_MKS_ROBIN_LITE.h" // STM32F1 env:mks_robin_lite #elif MB(BIGTREE_SKR_MINI_V1_1) - #include "stm32/pins_BIGTREE_SKR_MINI_V1_1.h" // STM32F1 env:BIGTREE_SKR_MINI + #include "stm32/pins_BIGTREE_SKR_MINI_V1_1.h" // STM32F1 env:STM32F103R_bigtree #elif MB(BIGTREE_SKR_MINI_E3) - #include "stm32/pins_BIGTREE_SKR_MINI_E3.h" // STM32F1 env:BIGTREE_SKR_MINI + #include "stm32/pins_BIGTREE_SKR_MINI_E3.h" // STM32F1 env:STM32F103R_bigtree #elif MB(BIGTREE_SKR_E3_DIP) - #include "stm32/pins_BIGTREE_SKR_E3_DIP.h" // STM32F1 env:BIGTREE_SKR_MINI + #include "stm32/pins_BIGTREE_SKR_E3_DIP.h" // STM32F1 env:STM32F103R_bigtree #elif MB(JGAURORA_A5S_A1) #include "stm32/pins_JGAURORA_A5S_A1.h" // STM32F1 env:jgaurora_a5s_a1 #elif MB(FYSETC_AIO_II) - #include "stm32/pins_FYSETC_AIO_II.h" // STM32F1 env:fysetc_STM32F1 + #include "stm32/pins_FYSETC_AIO_II.h" // STM32F1 env:STM32F103R_fysetc #elif MB(FYSETC_CHEETAH) - #include "stm32/pins_FYSETC_CHEETAH.h" // STM32F1 env:fysetc_STM32F1 + #include "stm32/pins_FYSETC_CHEETAH.h" // STM32F1 env:STM32F103R_fysetc #elif MB(FYSETC_CHEETAH_V12) - #include "stm32/pins_FYSETC_CHEETAH_V12.h" // STM32F1 env:fysetc_STM32F1 + #include "stm32/pins_FYSETC_CHEETAH_V12.h" // STM32F1 env:STM32F103R_fysetc #elif MB(LONGER3D_LK) - #include "stm32/pins_LONGER3D_LK.h" // STM32F1 env:alfawise_U20 + #include "stm32/pins_LONGER3D_LK.h" // STM32F1 env:STM32F103V_longer // // ARM Cortex-M4F @@ -501,13 +501,17 @@ #elif MB(RUMBA32) #include "stm32/pins_RUMBA32.h" // STM32F4 env:RUMBA32 #elif MB(BLACK_STM32F407VE) - #include "stm32/pins_BLACK_STM32F407VE.h" // STM32F4 env:black_stm32f407ve + #include "stm32/pins_BLACK_STM32F407VE.h" // STM32F4 env:STM32F407VE_black #elif MB(STEVAL) #include "stm32/pins_STEVAL.h" // STM32F4 env:STM32F4 #elif MB(BIGTREE_SKR_PRO_V1_1) #include "stm32/pins_BIGTREE_SKR_PRO_V1.1.h" // STM32F4 env:BIGTREE_SKR_PRO #elif MB(BIGTREE_BTT002_V1_0) #include "stm32/pins_BIGTREE_BTT002_V1.0.h" // STM32F4 env:BIGTREE_BTT002 +#elif MB(LERDGE_K) + #include "stm32/pins_LERDGE_K.h" // STM32F4 env:STM32F4 +#elif MB(LERDGE_X) + #include "stm32/pins_LERDGE_X.h" // STM32F4 env:STM32F4 // // ARM Cortex M7 @@ -525,13 +529,6 @@ #elif MB(ESP32) #include "esp32/pins_ESP32.h" // ESP32 env:esp32 -// -// Adafruit Grand Central M4 (SAMD51 ARM Cortex-M4) -// - -#elif MB(AGCM4_RURAMPS4D_13) - #include "samd/pins_AGCM4_RURAMPS4D_13.h" // SAMD51 env:adafruit_grandcentral_m4 - // // Linux Native Debug board // @@ -954,10 +951,6 @@ #ifndef LCD_PINS_D7 #define LCD_PINS_D7 -1 #endif -#else - #undef LCD_PINS_D5 - #undef LCD_PINS_D6 - #undef LCD_PINS_D7 #endif /** diff --git a/Marlin/src/pins/pinsDebug_list.h b/Marlin/src/pins/pinsDebug_list.h index 1bbc926e23..7e2241c099 100644 --- a/Marlin/src/pins/pinsDebug_list.h +++ b/Marlin/src/pins/pinsDebug_list.h @@ -26,6 +26,247 @@ #line 28 // set __LINE__ to a known value for both passes +// Undefine pins to suppress warnings +#if !PIN_EXISTS(X_MS1) + #undef X_MS1_PIN +#endif +#if !PIN_EXISTS(X_MS2) + #undef X_MS2_PIN +#endif +#if !PIN_EXISTS(X_MS3) + #undef X_MS3_PIN +#endif +#if !PIN_EXISTS(Y_MS1) + #undef Y_MS1_PIN +#endif +#if !PIN_EXISTS(Y_MS2) + #undef Y_MS2_PIN +#endif +#if !PIN_EXISTS(Y_MS3) + #undef Y_MS3_PIN +#endif +#if !PIN_EXISTS(Z_MS1) + #undef Z_MS1_PIN +#endif +#if !PIN_EXISTS(Z_MS2) + #undef Z_MS2_PIN +#endif +#if !PIN_EXISTS(Z_MS3) + #undef Z_MS3_PIN +#endif +#if !PIN_EXISTS(E0_MS1) + #undef E0_MS1_PIN +#endif +#if !PIN_EXISTS(E0_MS2) + #undef E0_MS2_PIN +#endif +#if !PIN_EXISTS(E0_MS3) + #undef E0_MS3_PIN +#endif +#if !PIN_EXISTS(E1_MS1) + #undef E1_MS1_PIN +#endif +#if !PIN_EXISTS(E1_MS2) + #undef E1_MS2_PIN +#endif +#if !PIN_EXISTS(E1_MS3) + #undef E1_MS3_PIN +#endif +#if !PIN_EXISTS(E2_MS1) + #undef E2_MS1_PIN +#endif +#if !PIN_EXISTS(E2_MS2) + #undef E2_MS2_PIN +#endif +#if !PIN_EXISTS(E2_MS3) + #undef E2_MS3_PIN +#endif +#if !PIN_EXISTS(E3_MS1) + #undef E3_MS1_PIN +#endif +#if !PIN_EXISTS(E3_MS2) + #undef E3_MS2_PIN +#endif +#if !PIN_EXISTS(E3_MS3) + #undef E3_MS3_PIN +#endif +#if !PIN_EXISTS(E4_MS1) + #undef E4_MS1_PIN +#endif +#if !PIN_EXISTS(E4_MS2) + #undef E4_MS2_PIN +#endif +#if !PIN_EXISTS(E4_MS3) + #undef E4_MS3_PIN +#endif +#if !PIN_EXISTS(E5_MS1) + #undef E5_MS1_PIN +#endif +#if !PIN_EXISTS(E5_MS2) + #undef E5_MS2_PIN +#endif +#if !PIN_EXISTS(E5_MS3) + #undef E5_MS3_PIN +#endif + +#if !PIN_EXISTS(E0_STEP) + #undef E0_STEP_PIN +#endif +#if !PIN_EXISTS(E0_DIR) + #undef E0_DIR_PIN +#endif +#if !PIN_EXISTS(E0_ENABLE) + #undef E0_ENABLE_PIN +#endif +#if !PIN_EXISTS(E1_STEP) + #undef E1_STEP_PIN +#endif +#if !PIN_EXISTS(E1_DIR) + #undef E1_DIR_PIN +#endif +#if !PIN_EXISTS(E1_ENABLE) + #undef E1_ENABLE_PIN +#endif +#if !PIN_EXISTS(E2_STEP) + #undef E2_STEP_PIN +#endif +#if !PIN_EXISTS(E2_DIR) + #undef E2_DIR_PIN +#endif +#if !PIN_EXISTS(E2_ENABLE) + #undef E2_ENABLE_PIN +#endif +#if !PIN_EXISTS(E3_STEP) + #undef E3_STEP_PIN +#endif +#if !PIN_EXISTS(E3_DIR) + #undef E3_DIR_PIN +#endif +#if !PIN_EXISTS(E3_ENABLE) + #undef E3_ENABLE_PIN +#endif +#if !PIN_EXISTS(E4_STEP) + #undef E4_STEP_PIN +#endif +#if !PIN_EXISTS(E4_DIR) + #undef E4_DIR_PIN +#endif +#if !PIN_EXISTS(E4_ENABLE) + #undef E4_ENABLE_PIN +#endif +#if !PIN_EXISTS(E5_STEP) + #undef E5_STEP_PIN +#endif +#if !PIN_EXISTS(E5_DIR) + #undef E5_DIR_PIN +#endif +#if !PIN_EXISTS(E5_ENABLE) + #undef E5_ENABLE_PIN +#endif + +#if !PIN_EXISTS(X_CS) + #undef X_CS_PIN +#endif +#if !PIN_EXISTS(Y_CS) + #undef Y_CS_PIN +#endif +#if !PIN_EXISTS(Z_CS) + #undef Z_CS_PIN +#endif +#if !PIN_EXISTS(E0_CS) + #undef E0_CS_PIN +#endif +#if !PIN_EXISTS(E1_CS) + #undef E1_CS_PIN +#endif +#if !PIN_EXISTS(E2_CS) + #undef E2_CS_PIN +#endif +#if !PIN_EXISTS(E3_CS) + #undef E3_CS_PIN +#endif +#if !PIN_EXISTS(E4_CS) + #undef E4_CS_PIN +#endif +#if !PIN_EXISTS(E5_CS) + #undef E5_CS_PIN +#endif + +#if !PIN_EXISTS(FAN) + #undef FAN_PIN +#endif +#define FAN0_PIN FAN_PIN +#if !PIN_EXISTS(FAN1) + #undef FAN1_PIN +#endif +#if !PIN_EXISTS(FAN2) + #undef FAN2_PIN +#endif +#if !PIN_EXISTS(CONTROLLER_FAN) + #undef CONTROLLER_FAN_PIN +#endif + +#if !PIN_EXISTS(FANMUX0) + #undef FANMUX0_PIN +#endif +#if !PIN_EXISTS(FANMUX1) + #undef FANMUX1_PIN +#endif +#if !PIN_EXISTS(FANMUX2) + #undef FANMUX2_PIN +#endif + +#if !PIN_EXISTS(HEATER_0) + #undef HEATER_0_PIN +#endif +#if !PIN_EXISTS(HEATER_1) + #undef HEATER_1_PIN +#endif +#if !PIN_EXISTS(HEATER_2) + #undef HEATER_2_PIN +#endif +#if !PIN_EXISTS(HEATER_3) + #undef HEATER_3_PIN +#endif +#if !PIN_EXISTS(HEATER_4) + #undef HEATER_4_PIN +#endif +#if !PIN_EXISTS(HEATER_5) + #undef HEATER_5_PIN +#endif +#if !PIN_EXISTS(HEATER_BED) + #undef HEATER_BED_PIN +#endif + +#if !PIN_EXISTS(TEMP_0) + #undef TEMP_0_PIN +#endif +#if !PIN_EXISTS(TEMP_1) + #undef TEMP_1_PIN +#endif +#if !PIN_EXISTS(TEMP_2) + #undef TEMP_2_PIN +#endif +#if !PIN_EXISTS(TEMP_3) + #undef TEMP_3_PIN +#endif +#if !PIN_EXISTS(TEMP_4) + #undef TEMP_4_PIN +#endif +#if !PIN_EXISTS(TEMP_5) + #undef TEMP_5_PIN +#endif +#if !PIN_EXISTS(TEMP_BED) + #undef TEMP_BED_PIN +#endif + +#if !PIN_EXISTS(SD_DETECT) + #undef SD_DETECT_PIN +#endif +#if !PIN_EXISTS(SDPOWER) + #undef SDPOWER_PIN +#endif + // // Analog Pin Assignments // diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h index bf88dca2cf..431d4370ba 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h @@ -47,7 +47,7 @@ #define SPINDLE_LASER_PWM_PIN 4 // Hardware PWM #define SPINDLE_DIR_PIN 5 #elif !GREEDY_PANEL // Try to use AUX2 - #define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown! + #define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown! #define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM #define SPINDLE_DIR_PIN 65 #endif diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index 1ed9e32d24..0c40709625 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -45,7 +45,7 @@ * 7 | 11 */ -#if ENABLED(TARGET_LPC1768) +#ifdef TARGET_LPC1768 #error "Oops! Set MOTHERBOARD to an LPC1768-based board when building for LPC1768." #elif defined(__STM32F1__) #error "Oops! Set MOTHERBOARD to an STM32F1-based board when building for STM32F1." diff --git a/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h b/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h index 9be7bdef32..379d2b4716 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h @@ -39,7 +39,8 @@ #define FIL_RUNOUT2_PIN 15 // Creality CR-X can use dual runout sensors #endif -#define SD_DETECT_PIN 49 // Always define onboard SD detect +#define SD_DETECT_PIN 49 // Always define onboard SD detect +#define BEEPER_PIN 37 // Always define beeper pin so Play Tone works with ExtUI #include "pins_RAMPS.h" diff --git a/Marlin/src/pins/ramps/pins_RUMBA.h b/Marlin/src/pins/ramps/pins_RUMBA.h index 2f934b3a42..a4add5d40b 100644 --- a/Marlin/src/pins/ramps/pins_RUMBA.h +++ b/Marlin/src/pins/ramps/pins_RUMBA.h @@ -120,7 +120,10 @@ // Optional for extruder 4 or chamber: //#define TEMP_X_PIN 12 // Analog Input (default connector for thermistor *T3* on rumba board is used) -//#define TEMP_CHAMBER_PIN 12 // Analog Input (default connector for thermistor *T3* on rumba board is used) + +#ifndef TEMP_CHAMBER_PIN + //#define TEMP_CHAMBER_PIN 12 // Analog Input (default connector for thermistor *T3* on rumba board is used) +#endif #if TEMP_SENSOR_BED == -1 #define TEMP_BED_PIN 7 // Analog Input (connector *K3* on RUMBA thermocouple ADD ON is used <-- this can't be used when TEMP_SENSOR_2 is defined as thermocouple) diff --git a/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h b/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h index aa80818577..8545dc488a 100644 --- a/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h +++ b/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h @@ -25,7 +25,7 @@ * Z-Bolt X Series board – based on Arduino Mega2560 */ -#if !defined(__AVR_ATmega2560__) +#ifndef __AVR_ATmega2560__ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #elif HOTENDS > 4 || E_STEPPERS > 4 #error "Z-Bolt X Series board supports up to 4 hotends / E-steppers." diff --git a/Marlin/src/pins/sam/pins_RAMPS_DUO.h b/Marlin/src/pins/sam/pins_RAMPS_DUO.h index 4f9053b8ca..d63d9a32a8 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_DUO.h +++ b/Marlin/src/pins/sam/pins_RAMPS_DUO.h @@ -50,7 +50,7 @@ #define BOARD_INFO_NAME "RAMPS Duo" #define IS_RAMPS_DUO -#include "pins_RAMPS.h" +#include "../ramps/pins_RAMPS.h" // // Temperature Sensors diff --git a/Marlin/src/pins/sam/pins_RAMPS_SMART.h b/Marlin/src/pins/sam/pins_RAMPS_SMART.h index f1f593991f..619b2d594d 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_SMART.h +++ b/Marlin/src/pins/sam/pins_RAMPS_SMART.h @@ -67,7 +67,7 @@ #define BOARD_INFO_NAME "RAMPS-SMART" #define IS_RAMPS_SMART -#include "pins_RAMPS.h" +#include "../ramps/pins_RAMPS.h" // I2C EEPROM with 4K of space #define I2C_EEPROM diff --git a/Marlin/src/pins/samd/pins_AGCM4_RURAMPS4D_13.h b/Marlin/src/pins/samd/pins_AGCM4_RURAMPS4D_13.h deleted file mode 100644 index dfd8113a0d..0000000000 --- a/Marlin/src/pins/samd/pins_AGCM4_RURAMPS4D_13.h +++ /dev/null @@ -1,259 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2019 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 . - */ - -/** - * Adafruit Grand Central M4 pin assignments ported by Giuliano Zaro - */ -#ifndef ARDUINO_GRAND_CENTRAL_M4 - #error "Oops! Select 'Adafruit Grand Central M4' in 'Tools > Board.'" -#endif - -#define BOARD_INFO_NAME "RuRAMPS4AGCM4 v1.3" - -// -// Servos -// -#define SERVO0_PIN 5 -#define SERVO1_PIN 3 - -// -// Limit Switches -// -#define X_MIN_PIN 45 -#define X_MAX_PIN 39 -#define Y_MIN_PIN 46 -#define Y_MAX_PIN 41 -#define Z_MIN_PIN 47 -#define Z_MAX_PIN 43 - -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 49 -#endif - -// -// Steppers -// -#define X_STEP_PIN 37 // Support Extension Board -#define X_DIR_PIN 36 -#define X_ENABLE_PIN 31 -#ifndef X_CS_PIN - #define X_CS_PIN 38 -#endif - -#define Y_STEP_PIN 32 // Support Extension Board -#define Y_DIR_PIN 35 -#define Y_ENABLE_PIN 31 -#ifndef Y_CS_PIN - #define Y_CS_PIN 34 -#endif - -#define Z_STEP_PIN 30 // Support Extension Board -#define Z_DIR_PIN 2 -#define Z_ENABLE_PIN 31 -#ifndef Z_CS_PIN - #define Z_CS_PIN 10 -#endif - -#define E0_STEP_PIN 29 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 33 -#ifndef E0_CS_PIN - #define E0_CS_PIN 14 -#endif - -#define E1_STEP_PIN 22 -#define E1_DIR_PIN 24 -#define E1_ENABLE_PIN 26 -#ifndef E1_CS_PIN - #define E1_CS_PIN 15 -#endif - -#define E2_STEP_PIN 25 -#define E2_DIR_PIN 23 -#define E2_ENABLE_PIN 27 -#ifndef E2_CS_PIN - #define E2_CS_PIN 74 -#endif - -#if USES_Z_MIN_PROBE_ENDSTOP - #define Z_MIN_PROBE_PIN 49 -#endif - -#if HAS_FILAMENT_SENSOR - #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN Y_MIN_PIN - #endif -#endif - -// -// Heaters / Fans -// -#define HEATER_0_PIN 13 -#define HEATER_1_PIN 12 -#define HEATER_2_PIN 11 -#define HEATER_BED_PIN 7 // BED H1 - -#define FAN_PIN 9 -#define FAN1_PIN 8 -#define CONTROLLER_FAN_PIN -1 - -// -// Temperature Sensors -// -#define TEMP_0_PIN 0 // ANALOG A0 -#define TEMP_1_PIN 1 // ANALOG A1 -#define TEMP_2_PIN 2 // ANALOG A2 -#define TEMP_3_PIN 3 // ANALOG A3 -#define TEMP_BED_PIN 4 // ANALOG A4 - -// The thermocouple uses Analog pins -#if ENABLED(VER_WITH_THERMOCOUPLE) // Must be defined in Configuration.h - #define TEMP_4_PIN 5 // A5 - #define TEMP_5_PIN 6 // A6 (Marlin 2.0 not support) -#endif - -// SPI for Max6675 or Max31855 Thermocouple -/* -#if DISABLED(SDSUPPORT) - #define MAX6675_SS_PIN 53 -#else - #define MAX6675_SS_PIN 49 -#endif -*/ - -// -// Misc. Functions -// -#define SDSS 4 -#define LED_PIN -1 // 13 - HEATER_0_PIN -#define PS_ON_PIN -1 // 57 - -// MKS TFT / Nextion Use internal USART-1 -#define TFT_LCD_MODULE_COM 1 -#define TFT_LCD_MODULE_BAUDRATE 115200 - -// ESP WiFi Use internal USART-2 -#define ESP_WIFI_MODULE_COM 2 -#define ESP_WIFI_MODULE_BAUDRATE 115200 -#define ESP_WIFI_MODULE_RESET_PIN -1 -#define PIGGY_GPIO_PIN -1 - -// -// EEPROM -// -#define E2END 0x7FFF // 32Kb (24lc256) -#define I2C_EEPROM // EEPROM on I2C - -// -// LCD / Controller -// -#if HAS_SPI_LCD - - #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) - - #define BEEPER_PIN 54 - #define LCD_PINS_D4 48 - #define SD_DETECT_PIN -1 // 51 can't be used, it's MOSI - #define LCD_PINS_RS 55 - #define LCD_PINS_ENABLE 56 - - #elif EITHER(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER) - - #error "Pin compatibility check needed!" - #define BEEPER_PIN 54 - #define LCD_PINS_D4 48 - #define LCD_PINS_D5 -1 // 50 can't be used, it's MISO - #define LCD_PINS_D6 -1 // 52 can't be used, it's SCK - #define LCD_PINS_D7 53 - #define SD_DETECT_PIN -1 // 51 can't be used, it's MOSI - #define LCD_PINS_RS 55 - #define LCD_PINS_ENABLE 56 - - #elif HAS_SSD1306_OLED_I2C - - #error "Pin compatibility check needed!" - #define BEEPER_PIN 54 - #define LCD_SDSS 10 - #define SD_DETECT_PIN -1 // 51 can't be used, it's MOSI - - #elif ENABLED(FYSETC_MINI_12864) - - #define BEEPER_PIN 54 - #define DOGLCD_CS 56 - #define DOGLCD_A0 55 - - //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems - // results in LCD soft SPI mode 3, SD soft SPI mode 0 - - #define LCD_RESET_PIN 48 // Must be high or open for LCD to operate normally. - - #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) - #error "Pin compatibility check needed!" - #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN 50 // 50 can't be used, it's MISO - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN 52 // 52 can't be used, it's SCK - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN 53 - #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #error "Pin compatibility check needed!" - #define NEOPIXEL_PIN 50 // 50 can't be used, it's MISO - #endif - - #elif ENABLED(MKS_MINI_12864) - - #error "Pin compatibility check needed!" - #define ORIG_BEEPER_PIN 75 - - #define DOGLCD_A0 52 // 52 can't be used, it's SCK - #define DOGLCD_CS 50 // 50 can't be used, it's MISO - - #define SD_DETECT_PIN -1 // 51 can't be used, it's MOSI - - #endif - - #if ENABLED(NEWPANEL) - #define BTN_EN1 44 - #define BTN_EN2 42 - #define BTN_ENC 40 - #endif - -#endif // HAS_SPI_LCD - -// -// SD Support -// -#ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION ONBOARD -#endif - -#if SD_CONNECTION_IS(ONBOARD) - #undef SDSS - #define SDSS 83 - #undef SD_DETECT_PIN - #define SD_DETECT_PIN 95 -#endif diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h index 3052daba94..8d15c7c31a 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h @@ -53,8 +53,9 @@ #define LCD_PINS_ENABLE 17 // ST9720 DAT #define LCD_PINS_D4 30 // ST9720 CLK -#if DISABLED(SPEAKER) && ENABLED(BLTOUCH) +#if ENABLED(BLTOUCH) #define SERVO0_PIN 27 + #undef BEEPER_PIN #endif // Alter timing for graphical display diff --git a/Marlin/src/pins/stm32/pins_BIGTREE_SKR_E3_DIP.h b/Marlin/src/pins/stm32/pins_BIGTREE_SKR_E3_DIP.h index 0c5d88354c..1e8e605abb 100644 --- a/Marlin/src/pins/stm32/pins_BIGTREE_SKR_E3_DIP.h +++ b/Marlin/src/pins/stm32/pins_BIGTREE_SKR_E3_DIP.h @@ -33,6 +33,12 @@ // Ignore temp readings during development. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 +#define FLASH_EEPROM_EMULATION +#define EEPROM_PAGE_SIZE uint16(0x800) // 2KB +#define EEPROM_START_ADDRESS uint32(0x8000000 + 256 * 1024 - 2 * EEPROM_PAGE_SIZE) +#undef E2END +#define E2END (EEPROM_PAGE_SIZE - 1) // 2KB + // // Servos // @@ -181,3 +187,15 @@ #endif #endif // HAS_SPI_LCD + +// +// SD Support +// +#define HAS_ONBOARD_SD + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#define ON_BOARD_SPI_DEVICE 1 //SPI1 +#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card diff --git a/Marlin/src/pins/stm32/pins_BIGTREE_SKR_MINI_E3.h b/Marlin/src/pins/stm32/pins_BIGTREE_SKR_MINI_E3.h index 56dc841188..b0039b109c 100644 --- a/Marlin/src/pins/stm32/pins_BIGTREE_SKR_MINI_E3.h +++ b/Marlin/src/pins/stm32/pins_BIGTREE_SKR_MINI_E3.h @@ -33,6 +33,12 @@ // Ignore temp readings during development. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 +#define FLASH_EEPROM_EMULATION +#define EEPROM_PAGE_SIZE uint16(0x800) // 2KB +#define EEPROM_START_ADDRESS uint32(0x8000000 + 256 * 1024 - 2 * EEPROM_PAGE_SIZE) +#undef E2END +#define E2END (EEPROM_PAGE_SIZE - 1) // 2KB + // // Servos // @@ -136,3 +142,15 @@ #endif #endif // HAS_SPI_LCD + +// +// SD Support +// +#define HAS_ONBOARD_SD + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#define ON_BOARD_SPI_DEVICE 1 //SPI1 +#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card diff --git a/Marlin/src/pins/stm32/pins_BIGTREE_SKR_MINI_V1_1.h b/Marlin/src/pins/stm32/pins_BIGTREE_SKR_MINI_V1_1.h index 3d7f8d98d4..181773c6b1 100644 --- a/Marlin/src/pins/stm32/pins_BIGTREE_SKR_MINI_V1_1.h +++ b/Marlin/src/pins/stm32/pins_BIGTREE_SKR_MINI_V1_1.h @@ -106,43 +106,55 @@ #if HAS_SPI_LCD #define BEEPER_PIN PC10 #define BTN_ENC PC11 - #define LCD_PINS_RS PC12 - #define BTN_EN1 PD2 - #define BTN_EN2 PB8 + #if ENABLED(CR10_STOCKDISPLAY) + #define LCD_PINS_RS PC15 - #define LCD_PINS_ENABLE PB6 + #define BTN_EN1 PB6 + #define BTN_EN2 PC13 - #if ENABLED(FYSETC_MINI_12864) + #define LCD_PINS_ENABLE PC14 + #define LCD_PINS_D4 PB7 - #define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN PC13 - #define DOGLCD_A0 PC12 - #define DOGLCD_CS PB6 - #define DOGLCD_SCK PB3 - #define DOGLCD_MOSI PB5 + #else - #define FORCE_SOFT_SPI // SPI MODE3 + #define LCD_PINS_RS PC12 - #define LED_PIN PB7 // red pwm - //#define LED_PIN PC15 // green - //#define LED_PIN PC14 // blue + #define BTN_EN1 PD2 + #define BTN_EN2 PB8 - //#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) - // #ifndef RGB_LED_R_PIN - // #define RGB_LED_R_PIN PB7 - // #endif - // #ifndef RGB_LED_G_PIN - // #define RGB_LED_G_PIN PC15 - // #endif - // #ifndef RGB_LED_B_PIN - // #define RGB_LED_B_PIN PC14 - // #endif - //#elif ENABLED(FYSETC_MINI_12864_2_1) - // #define NEOPIXEL_PIN PB7 - //#endif + #define LCD_PINS_ENABLE PB6 - #else // !FYSETC_MINI_12864 + #if ENABLED(FYSETC_MINI_12864) + + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN PC13 + #define DOGLCD_A0 PC12 + #define DOGLCD_CS PB6 + #define DOGLCD_SCK PB3 + #define DOGLCD_MOSI PB5 + + #define FORCE_SOFT_SPI // SPI MODE3 + + #define LED_PIN PB7 // red pwm + //#define LED_PIN PC15 // green + //#define LED_PIN PC14 // blue + + //#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + // #ifndef RGB_LED_R_PIN + // #define RGB_LED_R_PIN PB7 + // #endif + // #ifndef RGB_LED_G_PIN + // #define RGB_LED_G_PIN PC15 + // #endif + // #ifndef RGB_LED_B_PIN + // #define RGB_LED_B_PIN PC14 + // #endif + //#elif ENABLED(FYSETC_MINI_12864_2_1) + // #define NEOPIXEL_PIN PB7 + //#endif + + #else // !FYSETC_MINI_12864 #define LCD_PINS_D4 PC13 #if ENABLED(ULTIPANEL) @@ -151,7 +163,9 @@ #define LCD_PINS_D7 PC14 #endif - #endif // !FYSETC_MINI_12864 + #endif // !FYSETC_MINI_12864 + + #endif #endif // HAS_SPI_LCD @@ -160,20 +174,20 @@ // // By default the onboard SD is enabled. -// To disable it and use an external SD (connected to LCD) -// enable STM32_SD_LCD. +// set SDCARD_CONNECTION form 'ONBOARD' to 'LCD' and use an external SD (connected to LCD) +#define HAS_ONBOARD_SD +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif -//#define STM32_SD_LCD - -#if ENABLED(STM32_SD_LCD) +#if SD_CONNECTION_IS(LCD) #define ENABLE_SPI3 #define SD_DETECT_PIN PB9 #define SCK_PIN PB3 #define MISO_PIN PB4 #define MOSI_PIN PB5 #define SS_PIN PA15 -#else - #define SDCARD_CONNECTION ONBOARD +#elif SD_CONNECTION_IS(ONBOARD) #define ENABLE_SPI1 #define SD_DETECT_PIN PA3 #define SCK_PIN PA5 @@ -181,6 +195,8 @@ #define MOSI_PIN PA7 #define SS_PIN PA4 #endif +#define ON_BOARD_SPI_DEVICE 1 //SPI1 +#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card #ifndef ST7920_DELAY_1 #define ST7920_DELAY_1 DELAY_NS(125) diff --git a/Marlin/src/pins/stm32/pins_BIGTREE_SKR_PRO_V1.1.h b/Marlin/src/pins/stm32/pins_BIGTREE_SKR_PRO_V1.1.h index 89e7fe73e3..807b366dad 100644 --- a/Marlin/src/pins/stm32/pins_BIGTREE_SKR_PRO_V1.1.h +++ b/Marlin/src/pins/stm32/pins_BIGTREE_SKR_PRO_V1.1.h @@ -220,6 +220,26 @@ #define LCD_PINS_ENABLE PD11 #define LCD_PINS_D4 PG2 + #if ENABLED(FYSETC_MINI_12864) + #define DOGLCD_CS PD11 + #define DOGLCD_A0 PD10 + //#define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN PG2 // Must be high or open for LCD to operate normally. + #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PG3 + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PG6 + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PG7 + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN PG3 + #endif + #endif // !FYSETC_MINI_12864 + #if ENABLED(ULTIPANEL) #define LCD_PINS_D5 PG3 #define LCD_PINS_D6 PG6 diff --git a/Marlin/src/pins/stm32/pins_BLACK_STM32F407VE.h b/Marlin/src/pins/stm32/pins_BLACK_STM32F407VE.h index 0e405608da..74a715a8d2 100644 --- a/Marlin/src/pins/stm32/pins_BLACK_STM32F407VE.h +++ b/Marlin/src/pins/stm32/pins_BLACK_STM32F407VE.h @@ -88,7 +88,10 @@ #define TEMP_0_PIN PC0 // T0 #define TEMP_1_PIN PC1 // T1 #define TEMP_BED_PIN PC2 // TB -#define TEMP_CHAMBER_PIN PC3 // TC + +#ifndef TEMP_CHAMBER_PIN + #define TEMP_CHAMBER_PIN PC3 // TC +#endif // // Heaters / Fans diff --git a/Marlin/src/pins/stm32/pins_FYSETC_AIO_II.h b/Marlin/src/pins/stm32/pins_FYSETC_AIO_II.h index 5d30aaec31..d55bdcc150 100644 --- a/Marlin/src/pins/stm32/pins_FYSETC_AIO_II.h +++ b/Marlin/src/pins/stm32/pins_FYSETC_AIO_II.h @@ -35,6 +35,14 @@ // Ignore temp readings during development. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 +// +// Flash EEPROM Emulation +// +#define FLASH_EEPROM_EMULATION +#define EEPROM_PAGE_SIZE uint16(0x800) // 2KB +#define EEPROM_START_ADDRESS uint32(0x8000000 + 256 * 1024 - 2 * EEPROM_PAGE_SIZE) +#undef E2END +#define E2END (EEPROM_PAGE_SIZE - 1) // 2KB // // Limit Switches // diff --git a/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH.h b/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH.h index 8fee5d23bb..28b37cc841 100644 --- a/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH.h +++ b/Marlin/src/pins/stm32/pins_FYSETC_CHEETAH.h @@ -118,7 +118,7 @@ //#define LCD_SCREEN_ROT_180 //#define LCD_SCREEN_ROT_270 - #if ENABLED(FYSETC_MINI_12864) || ENABLED(U8GLIB_ST7920) + #if EITHER(FYSETC_MINI_12864, U8GLIB_ST7920) #define FORCE_SOFT_SPI #endif #endif diff --git a/Marlin/src/pins/stm32/pins_LERDGE_K.h b/Marlin/src/pins/stm32/pins_LERDGE_K.h new file mode 100644 index 0000000000..a9d20f5d0e --- /dev/null +++ b/Marlin/src/pins/stm32/pins_LERDGE_K.h @@ -0,0 +1,181 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 . + * + */ +#pragma once + +#if !defined(STM32F4) && !defined(STM32F4xx) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "LERDGE K supports up to 2 hotends / E-steppers." +#endif + +#define BOARD_INFO_NAME "Lerdge K" +#define DEFAULT_MACHINE_NAME "LERDGE" + +#define I2C_EEPROM + +// Ignore temp readings during develpment. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +// +// Servos +// +//#define SERVO0_PIN PD12 + +// +// Limit Switches +// +#define X_STOP_PIN PG3 +#define Y_STOP_PIN PG4 +#define Z_STOP_PIN PG5 + +// +// Z Probe (when not Z_MIN_PIN) +// +//#ifndef Z_MIN_PROBE_PIN +// #define Z_MIN_PROBE_PIN PB15 +//#endif + +// +// Filament runout +// +#define FIL_RUNOUT_PIN PE6 +#define FIL_RUNOUT2_PIN PE7 + +// +// Steppers +// +#define X_STEP_PIN PG1 +#define X_DIR_PIN PB10 +#define X_ENABLE_PIN PG0 +//#ifndef X_CS_PIN +// #define X_CS_PIN PE0 +//#endif + +#define Y_STEP_PIN PF14 +#define Y_DIR_PIN PF15 +#define Y_ENABLE_PIN PF13 +//#ifndef Y_CS_PIN +// #define Y_CS_PIN PE1 +//#endif + +#define Z_STEP_PIN PF11 +#define Z_DIR_PIN PF12 +#define Z_ENABLE_PIN PC5 +//#ifndef Z_CS_PIN +// #define Z_CS_PIN PE2 +//#endif + +#define E0_STEP_PIN PC14 +#define E0_DIR_PIN PC13 +#define E0_ENABLE_PIN PC15 +//#ifndef E0_CS_PIN +// #define E0_CS_PIN PE3 +//#endif + +#define E1_STEP_PIN PF1 +#define E1_DIR_PIN PF0 +#define E1_ENABLE_PIN PF2 +//#ifndef E1_CS_PIN +// #define E1_CS_PIN PE4 +//#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC1 // Analog Input +#define TEMP_1_PIN PC2 // Analog Input +#define TEMP_BED_PIN PC0 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN PA1 +#define HEATER_1_PIN PA0 +#define HEATER_BED_PIN PA2 + +#ifndef FAN_PIN + #define FAN_PIN PC15 +#endif +#define FAN1_PIN PF6 +#define FAN2_PIN PF7 + +#define ORIG_E0_AUTO_FAN_PIN FAN1_PIN // Use this by NOT overriding E0_AUTO_FAN_PIN + +// +// LED / Lighting +// +//#define CASE_LIGHT_PIN_CI -1 +//#define CASE_LIGHT_PIN_DO -1 +//#define NEOPIXEL_PIN -1 + +// +// Prusa i3 MK2 Multi-Material Multiplexer Support +// +//#define E_MUX0_PIN -1 +//#define E_MUX1_PIN -1 + +// +// SD support +// +#define SDIO_SUPPORT + +// +// Misc. Functions +// +#define SDSS PC11 +#define LED_PIN PC7 // Alive +#define PS_ON_PIN -1 +#define KILL_PIN -1 +#define POWER_LOSS_PIN -1 // Power-loss / nAC_FAULT + +#define SCK_PIN PC12 +#define MISO_PIN PC8 +#define MOSI_PIN PD2 +#define SS_PIN PC11 + +// +// LCD / Controller +// + +// TODO: Replace these with the correct FSMC pins, once known +#define SD_DETECT_PIN -1 +#define BEEPER_PIN PD12 +#define LCD_PINS_RS -1 +#define LCD_PINS_ENABLE -1 +#define LCD_PINS_D4 -1 +#define LCD_PINS_D5 -1 +#define LCD_PINS_D6 -1 +#define LCD_PINS_D7 -1 + +#define BTN_EN1 PE3 +#define BTN_EN2 PE4 +#define BTN_ENC PE2 + +// +// ST7920 Delays +// +#ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_NS(96) +#endif +#ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_NS(48) +#endif +#ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_NS(715) +#endif diff --git a/Marlin/src/pins/stm32/pins_LERDGE_X.h b/Marlin/src/pins/stm32/pins_LERDGE_X.h new file mode 100644 index 0000000000..3b5cf63ab8 --- /dev/null +++ b/Marlin/src/pins/stm32/pins_LERDGE_X.h @@ -0,0 +1,178 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 . + * + */ +#pragma once + +#if !defined(STM32F4) && !defined(STM32F4xx) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 2 || E_STEPPERS > 2 + #error "LERDGE X supports up to 2 hotends / E-steppers." +#endif + +#define BOARD_INFO_NAME "Lerdge X" +#define DEFAULT_MACHINE_NAME "LERDGE" + +//#define I2C_EEPROM + +// +// Servos +// +//#define SERVO0_PIN PD12 +//#define SERVO1_PIN -1 + +// +// Limit Switches +// +#define X_STOP_PIN PB12 +#define Y_STOP_PIN PB13 +#define Z_STOP_PIN PB14 + +// +// Filament runout +// +#define FIL_RUNOUT_PIN PE1 + +// +// Z Probe (when not Z_MIN_PIN) +// +//#ifndef Z_MIN_PROBE_PIN +// #define Z_MIN_PROBE_PIN PB15 +//#endif + +// +// Steppers +// +#define X_STEP_PIN PB10 +#define X_DIR_PIN PB2 +#define X_ENABLE_PIN PB11 +//#ifndef X_CS_PIN +// #define X_CS_PIN PD1 +//#endif + +#define Y_STEP_PIN PB0 +#define Y_DIR_PIN PC5 +#define Y_ENABLE_PIN PB1 +//#ifndef Y_CS_PIN +// #define Y_CS_PIN PE12 +//#endif + +#define Z_STEP_PIN PA7 +#define Z_DIR_PIN PA6 +#define Z_ENABLE_PIN PC4 +//#ifndef Z_CS_PIN +// #define Z_CS_PIN PD5 +//#endif + +#define E0_STEP_PIN PA4 +#define E0_DIR_PIN PA3 +#define E0_ENABLE_PIN PA5 +//#ifndef E0_CS_PIN +// #define E0_CS_PIN PB4 +//#endif + +#define E1_STEP_PIN -1 +#define E1_DIR_PIN -1 +#define E1_ENABLE_PIN -1 +//#ifndef E1_CS_PIN +// #define E1_CS_PIN PE5 +//#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC0 // Analog Input +#define TEMP_1_PIN -1 // Analog Input +#define TEMP_BED_PIN PC1 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN PA1 +#define HEATER_1_PIN -1 +#define HEATER_BED_PIN PA2 + +#ifndef FAN_PIN +// #define FAN_PIN PC15 +#endif +#define FAN1_PIN PC15 +#define FAN2_PIN PA0 + +#define ORIG_E0_AUTO_FAN_PIN PC15 // Use this by NOT overriding E0_AUTO_FAN_PIN + +// +// Prusa i3 MK2 Multi Material Multiplexer Support +// +//#define E_MUX0_PIN -1 +//#define E_MUX1_PIN -1 + +// +// LED / Lighting +// +//#define CASE_LIGHT_PIN_CI -1 +//#define CASE_LIGHT_PIN_DO -1 +//#define NEOPIXEL_PIN -1 + +// +// Misc. Functions +// +#define SDSS PC11 +#define LED_PIN PC7 // Alive +#define PS_ON_PIN -1 +#define KILL_PIN -1 +#define POWER_LOSS_PIN -1 // Power-loss / nAC_FAULT + +#define SCK_PIN PC12 +#define MISO_PIN PC8 +#define MOSI_PIN PD2 +#define SS_PIN PC11 + +// +// SD support +// +#define SDIO_SUPPORT + +// +// LCD / Controller +// + +// The LCD is initialized in FSMC mode +#define SD_DETECT_PIN -1 +#define BEEPER_PIN PD12 + +#define BTN_EN1 PE3 +#define BTN_EN2 PE4 +#define BTN_ENC PE2 + +#define LCD_RESET_PIN PD6 +#define LCD_BACKLIGHT_PIN PD3 +#define FSMC_CS_PIN PD4 +#define FSMC_RS_PIN PD11 +#define TOUCH_CS PB6 + +// +// ST7920 Delays +// +#ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_NS(96) +#endif +#ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_NS(48) +#endif +#ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_NS(715) +#endif diff --git a/Marlin/src/pins/stm32/pins_MALYAN_M200.h b/Marlin/src/pins/stm32/pins_MALYAN_M200.h index 646cb0b374..302df62a45 100644 --- a/Marlin/src/pins/stm32/pins_MALYAN_M200.h +++ b/Marlin/src/pins/stm32/pins_MALYAN_M200.h @@ -25,8 +25,8 @@ * MALYAN M200 pin assignments */ -#if !defined(__STM32F1__) && !defined(STM32F1xx) && !defined(STM32F0xx) - #error "Oops! You must be compiling for STM32." +#if NONE(__STM32F1__, STM32F1xx, STM32F0xx) + #error "Oops! Select an STM32 board in your IDE." #endif #define BOARD_INFO_NAME "Malyan M200" diff --git a/Marlin/src/pins/stm32/pins_STM32F4.h b/Marlin/src/pins/stm32/pins_STM32F4.h index 43875ac3b4..39ccf57dff 100644 --- a/Marlin/src/pins/stm32/pins_STM32F4.h +++ b/Marlin/src/pins/stm32/pins_STM32F4.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * To build with Arduino IDE use "Discovery F407VG" + * To build with PlatformIO use environment "STM32F4" + */ #if !defined(STM32F4) && !defined(STM32F4xx) #error "Oops! Select an STM32F4 board in 'Tools > Board.'" #elif HOTENDS > 2 || E_STEPPERS > 2 @@ -32,7 +36,9 @@ //#define I2C_EEPROM -#define E2END 0xFFF // 4KB +#ifndef E2END + #define E2END 0xFFF // 4KB +#endif // Ignore temp readings during development. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 diff --git a/Marlin/src/sd/Sd2Card_sdio.h b/Marlin/src/sd/Sd2Card_sdio.h index 990194eeea..2aa2e86c03 100644 --- a/Marlin/src/sd/Sd2Card_sdio.h +++ b/Marlin/src/sd/Sd2Card_sdio.h @@ -25,7 +25,7 @@ #if ENABLED(SDIO_SUPPORT) -bool SDIO_Init(void); +bool SDIO_Init(); bool SDIO_ReadBlock(uint32_t block, uint8_t *dst); bool SDIO_WriteBlock(uint32_t block, const uint8_t *src); diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index 08eb864095..2969208838 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -273,7 +273,7 @@ int16_t SdBaseFile::fgets(char* str, int16_t num, char* delim) { * * \return true for success, false for failure. */ -bool SdBaseFile::getFilename(char * const name) { +bool SdBaseFile::getDosName(char * const name) { if (!isOpen()) return false; if (isRoot()) { @@ -957,7 +957,7 @@ void SdBaseFile::printFatTime(uint16_t fatTime) { */ bool SdBaseFile::printName() { char name[FILENAME_LENGTH]; - if (!getFilename(name)) return false; + if (!getDosName(name)) return false; SERIAL_ECHO(name); return true; } diff --git a/Marlin/src/sd/SdBaseFile.h b/Marlin/src/sd/SdBaseFile.h index 494b4f6bee..4d4062b1cd 100644 --- a/Marlin/src/sd/SdBaseFile.h +++ b/Marlin/src/sd/SdBaseFile.h @@ -286,7 +286,7 @@ class SdBaseFile { */ bool isRoot() const { return type_ == FAT_FILE_TYPE_ROOT_FIXED || type_ == FAT_FILE_TYPE_ROOT32; } - bool getFilename(char * const name); + bool getDosName(char * const name); void ls(uint8_t flags = 0, uint8_t indent = 0); bool mkdir(SdBaseFile* dir, const char* path, bool pFlag = true); diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 76fe43d09b..98a03af168 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -123,7 +123,7 @@ CardReader::CardReader() { //sort_reverse = false; #endif #endif - flag.sdprinting = flag.detected = flag.saving = flag.logging = false; + flag.sdprinting = flag.mounted = flag.saving = flag.logging = false; filesize = sdpos = 0; file_subcall_ctr = 0; @@ -192,8 +192,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m if (!dir.open(&parent, dosFilename, O_READ)) { if (lsAction == LS_SerialPrint) { SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR); - SERIAL_ECHOLN(dosFilename); + SERIAL_ECHOLNPAIR(MSG_SD_CANT_OPEN_SUBDIR, dosFilename); } } lsDive(path, dir); @@ -292,8 +291,7 @@ void CardReader::ls() { if (!dir.open(&diveDir, segment, O_READ)) { SERIAL_EOL(); SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR); - SERIAL_ECHO(segment); + SERIAL_ECHOPAIR(MSG_SD_CANT_OPEN_SUBDIR, segment); break; } @@ -313,7 +311,7 @@ void CardReader::ls() { void CardReader::printFilename() { if (file.isOpen()) { char dosFilename[FILENAME_LENGTH]; - file.getFilename(dosFilename); + file.getDosName(dosFilename); SERIAL_ECHO(dosFilename); #if ENABLED(LONG_FILENAME_HOST_SUPPORT) getfilename(0, dosFilename); @@ -329,8 +327,8 @@ void CardReader::printFilename() { SERIAL_EOL(); } -void CardReader::initsd() { - flag.detected = false; +void CardReader::mount() { + flag.mounted = false; if (root.isOpen()) root.close(); #ifndef SPI_SPEED @@ -350,7 +348,7 @@ void CardReader::initsd() { else if (!root.openRoot(&volume)) SERIAL_ERROR_MSG(MSG_SD_OPENROOT_FAIL); else { - flag.detected = true; + flag.mounted = true; SERIAL_ECHO_MSG(MSG_SD_CARD_OK); #if ENABLED(EEPROM_SETTINGS) && NONE(FLASH_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM) settings.first_load(); @@ -363,7 +361,7 @@ void CardReader::initsd() { void CardReader::release() { stopSDPrint(); - flag.detected = false; + flag.mounted = false; } void CardReader::openAndPrintFile(const char *name) { @@ -375,7 +373,7 @@ void CardReader::openAndPrintFile(const char *name) { } void CardReader::startFileprint() { - if (isDetected()) { + if (isMounted()) { flag.sdprinting = true; #if SD_RESORT flush_presort(); @@ -404,7 +402,7 @@ void CardReader::openLogFile(char * const path) { } void appendAtom(SdFile &file, char *& dst, uint8_t &cnt) { - file.getFilename(dst); + file.getDosName(dst); while (*dst && cnt < MAXPATHNAMELENGTH) { dst++; cnt++; } if (cnt < MAXPATHNAMELENGTH) { *dst = '/'; dst++; cnt++; } } @@ -425,7 +423,7 @@ void CardReader::getAbsFilename(char *t) { void CardReader::openFile(char * const path, const bool read, const bool subcall/*=false*/) { - if (!isDetected()) return; + if (!isMounted()) return; uint8_t doing = 0; if (isFileOpen()) { // Replacing current file or doing a subroutine @@ -499,7 +497,7 @@ void CardReader::openFile(char * const path, const bool read, const bool subcall } void CardReader::removeFile(const char * const name) { - if (!isDetected()) return; + if (!isMounted()) return; //stopSDPrint(); @@ -558,12 +556,12 @@ void CardReader::checkautostart() { if (autostart_index < 0 || flag.sdprinting) return; - if (!isDetected()) initsd(); + if (!isMounted()) mount(); #if ENABLED(EEPROM_SETTINGS) && NONE(FLASH_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM) else settings.first_load(); #endif - if (isDetected() + if (isMounted() #if ENABLED(POWER_LOSS_RECOVERY) && !recovery.valid() // Don't run auto#.g when a resume file exists #endif @@ -629,7 +627,7 @@ void CardReader::getfilename(uint16_t nr, const char * const match/*=nullptr*/) lsDive(nullptr, workDir, match); } -uint16_t CardReader::getnrfilenames() { +uint16_t CardReader::countFilesInWorkDir() { lsAction = LS_Count; nrFiles = 0; workDir.rewind(); @@ -707,6 +705,7 @@ void CardReader::chdir(const char * relpath) { if (newDir.open(parent, relpath, O_READ)) { workDir = newDir; + flag.workDirIsRoot = false; if (workDirDepth < MAX_DIR_DEPTH) workDirParents[workDirDepth++] = workDir; #if ENABLED(SDCARD_SORT_ALPHA) @@ -726,14 +725,13 @@ int8_t CardReader::updir() { presort(); #endif } + if (!workDirDepth) flag.workDirIsRoot = true; return workDirDepth; } void CardReader::setroot() { - /*if (!workDir.openRoot(&volume)) { - SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL); - }*/ workDir = root; + flag.workDirIsRoot = true; #if ENABLED(SDCARD_SORT_ALPHA) presort(); #endif @@ -801,7 +799,7 @@ void CardReader::setroot() { #endif // If there are files, sort up to the limit - uint16_t fileCnt = getnrfilenames(); + uint16_t fileCnt = countFilesInWorkDir(); if (fileCnt > 0) { // Never sort more than the max allowed @@ -981,7 +979,7 @@ uint16_t CardReader::get_num_Files() { #if ENABLED(SDCARD_SORT_ALPHA) && SDSORT_USES_RAM && SDSORT_CACHE_NAMES nrFiles // no need to access the SD card for filenames #else - getnrfilenames() + countFilesInWorkDir() #endif ; } @@ -1049,7 +1047,7 @@ void CardReader::printingHasFinished() { } void CardReader::openJobRecoveryFile(const bool read) { - if (!isDetected()) return; + if (!isMounted()) return; if (recovery.file.isOpen()) return; if (!recovery.file.open(&root, recovery.filename, read ? O_READ : O_CREAT | O_WRITE | O_TRUNC | O_SYNC)) SERIAL_ECHOLNPAIR(MSG_SD_OPEN_FILE_FAIL, recovery.filename, "."); diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 8eedfc384e..629efb2966 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -39,8 +39,9 @@ typedef struct { bool saving:1, logging:1, sdprinting:1, - detected:1, + mounted:1, filenameIsDir:1, + workDirIsRoot:1, abort_sd_printing:1 #if ENABLED(BINARY_FILE_TRANSFER) , binary_mode:1 @@ -52,7 +53,7 @@ class CardReader { public: CardReader(); - static void initsd(); + static void mount(); static void write_command(char *buf); static void beginautostart(); @@ -79,7 +80,7 @@ public: #endif static void getfilename(uint16_t nr, const char* const match=nullptr); - static uint16_t getnrfilenames(); + static uint16_t countFilesInWorkDir(); static void getAbsFilename(char *t); @@ -111,8 +112,8 @@ public: #endif static inline void pauseSDPrint() { flag.sdprinting = false; } - static inline bool isDetected() { return flag.detected; } - static inline bool isFileOpen() { return isDetected() && file.isOpen(); } + static inline bool isMounted() { return flag.mounted; } + static inline bool isFileOpen() { return isMounted() && file.isOpen(); } static inline bool isPaused() { return isFileOpen() && !flag.sdprinting; } static inline bool isPrinting() { return flag.sdprinting; } static inline bool eof() { return sdpos >= filesize; } @@ -120,14 +121,14 @@ public: static inline void setIndex(const uint32_t index) { sdpos = index; file.seekSet(index); } static inline uint32_t getIndex() { return sdpos; } static inline uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; } - static inline char* getWorkDirName() { workDir.getFilename(filename); return filename; } + static inline char* getWorkDirName() { workDir.getDosName(filename); return filename; } static inline int16_t read(void* buf, uint16_t nbyte) { return file.isOpen() ? file.read(buf, nbyte) : -1; } static inline int16_t write(void* buf, uint16_t nbyte) { return file.isOpen() ? file.write(buf, nbyte) : -1; } static Sd2Card& getSd2Card() { return sd2card; } #if ENABLED(AUTO_REPORT_SD_STATUS) - static void auto_report_sd_status(void); + static void auto_report_sd_status(); static inline void set_auto_report_interval(uint8_t v) { #if NUM_SERIAL > 1 auto_report_port = serial_port_index; diff --git a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp index a50d874eb0..12f02c19f0 100644 --- a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp +++ b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp @@ -117,7 +117,7 @@ bool Sd2Card::usbStartup() { if (!UHS_START) { SERIAL_ECHOLNPGM(" failed."); #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) - LCD_MESSAGEPGM("USB start failed"); + LCD_MESSAGEPGM(MSG_MEDIA_USB_FAILED); #endif return false; } @@ -214,7 +214,7 @@ void Sd2Card::idle() { SERIAL_ECHOLNPGM("Waiting for media"); #endif #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) - LCD_MESSAGEPGM("Waiting for media"); + LCD_MESSAGEPGM(MSG_MEDIA_WAITING); #endif GOTO_STATE_AFTER_DELAY(state, 2000); } @@ -231,7 +231,7 @@ void Sd2Card::idle() { #endif #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) if (state != MEDIA_READY) - LCD_MESSAGEPGM("USB device removed"); + LCD_MESSAGEPGM(MSG_MEDIA_USB_REMOVED); #endif GOTO_STATE_AFTER_DELAY( WAIT_FOR_DEVICE, 0 ); } @@ -242,14 +242,14 @@ void Sd2Card::idle() { SERIAL_ECHOLNPGM("Media removed"); #endif #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) - LCD_MESSAGEPGM("Media removed"); + LCD_MESSAGEPGM(MSG_MEDIA_REMOVED); #endif GOTO_STATE_AFTER_DELAY( WAIT_FOR_DEVICE, 0 ); } else if (task_state == UHS_STATE(ERROR)) { #if EITHER(ULTRA_LCD, EXTENSIBLE_UI) - LCD_MESSAGEPGM("Media read error"); + LCD_MESSAGEPGM(MSG_MEDIA_READ_ERROR); #endif GOTO_STATE_AFTER_DELAY( MEDIA_ERROR, 0 ); } diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp index 11d54b2844..9092633b84 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp @@ -45,7 +45,7 @@ void USB::init() { bmHubPre = 0; } -uint8_t USB::getUsbTaskState(void) { +uint8_t USB::getUsbTaskState() { return usb_task_state; } @@ -424,7 +424,7 @@ uint8_t USB::dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit) { } /* USB main task. Performs enumeration/cleanup */ -void USB::Task(void) { //USB state machine +void USB::Task() { //USB state machine uint8_t rcode; uint8_t tmpdata; static uint32_t delay = 0; diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h index 063de843f7..472fed59cf 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h @@ -216,7 +216,7 @@ class USB : public MAX3421E { uint8_t bmHubPre; public: - USB(void); + USB(); void SetHubPreMask() { bmHubPre |= bmHUBPRE; @@ -243,7 +243,7 @@ public: void ForEachUsbDevice(UsbDeviceHandleFunc pfunc) { addrPool.ForEachUsbDevice(pfunc); }; - uint8_t getUsbTaskState(void); + uint8_t getUsbTaskState(); void setUsbTaskState(uint8_t state); EpInfo* getEpInfoEntry(uint8_t addr, uint8_t ep); @@ -265,7 +265,7 @@ public: uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data); uint8_t dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit); - void Task(void); + void Task(); uint8_t DefaultAddressing(uint8_t parent, uint8_t port, bool lowspeed); uint8_t Configuring(uint8_t parent, uint8_t port, bool lowspeed); diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/confdescparser.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/confdescparser.h index 69f2a96457..5d4ddaf175 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/confdescparser.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/confdescparser.h @@ -69,7 +69,7 @@ class ConfigDescParser : public USBReadParser { public: - void SetOR(void) { UseOr = true; } + void SetOR() { UseOr = true; } ConfigDescParser(UsbConfigXtracter *xtractor); void Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset); }; diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp index 8e2d40d3d3..78a9ba1fd7 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp @@ -74,19 +74,19 @@ void E_Notify(double d, int lvl) { #ifdef DEBUG_USB_HOST - void NotifyFailGetDevDescr(void) { + void NotifyFailGetDevDescr() { Notify(PSTR("\r\ngetDevDescr "), 0x80); } - void NotifyFailSetDevTblEntry(void) { + void NotifyFailSetDevTblEntry() { Notify(PSTR("\r\nsetDevTblEn "), 0x80); } - void NotifyFailGetConfDescr(void) { + void NotifyFailGetConfDescr() { Notify(PSTR("\r\ngetConf "), 0x80); } - void NotifyFailSetConfDescr(void) { + void NotifyFailSetConfDescr() { Notify(PSTR("\r\nsetConf "), 0x80); } diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.h index 087a4bf501..960120d18d 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.h @@ -43,10 +43,10 @@ void E_Notifyc(char c, int lvl); void NotifyFailSetDevTblEntry(uint8_t reason); void NotifyFailGetConfDescr(uint8_t reason); void NotifyFailSetConfDescr(uint8_t reason); - void NotifyFailGetDevDescr(void); - void NotifyFailSetDevTblEntry(void); - void NotifyFailGetConfDescr(void); - void NotifyFailSetConfDescr(void); + void NotifyFailGetDevDescr(); + void NotifyFailSetDevTblEntry(); + void NotifyFailGetConfDescr(); + void NotifyFailSetConfDescr(); void NotifyFailUnknownDevice(uint16_t VID, uint16_t PID); void NotifyFail(uint8_t rcode); #else diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h index dc7782f2a2..41821173d3 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h @@ -153,7 +153,7 @@ // define XMEM_ACQUIRE_SPI and XMEM_RELEASE_SPI to point to your lock and unlock. // NOTE: NO argument is passed. You have to do this within your routine for // whatever you are using to lock and unlock. -#if !defined(XMEM_ACQUIRE_SPI) +#ifndef XMEM_ACQUIRE_SPI #if USE_XMEM_SPI_LOCK || defined(USE_MULTIPLE_APP_API) #include #else diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp index e37da93ad2..16051b34c3 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp @@ -194,7 +194,7 @@ void MAX3421e::busprobe() { } // MAX3421 state change task and interrupt handler -uint8_t MAX3421e::Task(void) { +uint8_t MAX3421e::Task() { return READ(USB_INTR_PIN) ? 0 : IntHandler(); } diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h index f5e8651556..8fdad47ac2 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.h @@ -44,7 +44,7 @@ class MAX3421e { uint8_t gpioRd(); bool reset(); - uint8_t getVbusState(void) {return vbusState;}; + uint8_t getVbusState() {return vbusState;}; void busprobe(); diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h index 54458d116e..6ad9cb5c8d 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h @@ -24,7 +24,7 @@ Web : http://www.circuitsathome.com e-mail : support@circuitsathome.com */ -#if !defined(__UHS_BULK_STORAGE_H__) +#ifndef __UHS_BULK_STORAGE_H__ #define __UHS_BULK_STORAGE_H__ @@ -98,7 +98,7 @@ struct UHS_BULK_CommandBlockWrapperBase { volatile uint8_t bmCBWFlags; public: - UHS_BULK_CommandBlockWrapperBase(void) { + UHS_BULK_CommandBlockWrapperBase() { } UHS_BULK_CommandBlockWrapperBase(uint32_t tag, uint32_t xflen, uint8_t flgs) : @@ -181,11 +181,11 @@ public: volatile UHS_EpInfo epInfo[MASS_MAX_ENDPOINTS]; - uint8_t GetbMaxLUN(void) { + uint8_t GetbMaxLUN() { return bMaxLUN; // Max LUN } - uint8_t GetbTheLUN(void) { + uint8_t GetbTheLUN() { return bTheLUN; // Active LUN } @@ -203,23 +203,23 @@ public: // Configure and internal methods, these should never be called by a user's sketch. - uint8_t Start(void); + uint8_t Start(); bool OKtoEnumerate(ENUMERATION_INFO *ei); uint8_t SetInterface(ENUMERATION_INFO *ei); - uint8_t GetAddress(void) { + uint8_t GetAddress() { return bAddress; }; - void Poll(void); + void Poll(); - void DriverDefaults(void); + void DriverDefaults(); private: - void Reset(void); - void CheckMedia(void); + void Reset(); + void CheckMedia(); bool IsValidCBW(uint8_t size, uint8_t *pcbw); bool IsMeaningfulCBW(uint8_t size, uint8_t *pcbw); diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h index 5cf45ce53c..a171b13818 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h @@ -378,7 +378,7 @@ uint8_t UHS_NI UHS_Bulk_Storage::SetInterface(ENUMERATION_INFO *ei) { * * @return 0 for success */ -uint8_t UHS_NI UHS_Bulk_Storage::Start(void) { +uint8_t UHS_NI UHS_Bulk_Storage::Start() { uint8_t rcode; // Serial.print("Bulk Start from USB Host @ 0x"); // Serial.println((uint32_t)pUsb, HEX); @@ -541,7 +541,7 @@ Fail: * * @return */ -//void UHS_NI UHS_Bulk_Storage::Release(void) { +//void UHS_NI UHS_Bulk_Storage::Release() { // pUsb->DisablePoll(); // OnRelease(); // DriverDefaults(); @@ -602,7 +602,7 @@ bool UHS_NI UHS_Bulk_Storage::CheckLUN(uint8_t lun) { * * Scan for media change on all LUNs */ -void UHS_NI UHS_Bulk_Storage::CheckMedia(void) { +void UHS_NI UHS_Bulk_Storage::CheckMedia() { if(!bAddress) return; for(uint8_t lun = 0; lun <= bMaxLUN; lun++) { if(TestUnitReady(lun)) { @@ -630,7 +630,7 @@ void UHS_NI UHS_Bulk_Storage::CheckMedia(void) { * For driver use only. * */ -void UHS_NI UHS_Bulk_Storage::Poll(void) { +void UHS_NI UHS_Bulk_Storage::Poll() { if((long)(millis() - qNextPollTime) >= 0L) { CheckMedia(); @@ -841,7 +841,7 @@ uint8_t UHS_NI UHS_Bulk_Storage::ClearEpHalt(uint8_t index) { * For driver use only. * */ -void UHS_NI UHS_Bulk_Storage::Reset(void) { +void UHS_NI UHS_Bulk_Storage::Reset() { if(!bAddress) return; while(pUsb->ctrlReq(bAddress, mkSETUP_PKT16(UHS_BULK_bmREQ_OUT, UHS_BULK_REQ_BOMSR, 0x0000U, bIface, 0), 0, NULL) == 0x01) { @@ -858,7 +858,7 @@ void UHS_NI UHS_Bulk_Storage::Reset(void) { * * @return 0 if successful */ -uint8_t UHS_NI UHS_Bulk_Storage::ResetRecovery(void) { +uint8_t UHS_NI UHS_Bulk_Storage::ResetRecovery() { if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED; Notify(PSTR("\r\nResetRecovery\r\n"), 0x80); Notify(PSTR("-----------------\r\n"), 0x80); @@ -883,7 +883,7 @@ uint8_t UHS_NI UHS_Bulk_Storage::ResetRecovery(void) { * * Clear all EP data and clear all LUN status */ -void UHS_NI UHS_Bulk_Storage::DriverDefaults(void) { +void UHS_NI UHS_Bulk_Storage::DriverDefaults() { pUsb->DeviceDefaults(MASS_MAX_ENDPOINTS, this); diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h index 3655d8183f..9ebefab5d1 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h @@ -325,4 +325,3 @@ struct SCSI_Request_Sense_Response { } __attribute__((packed)); #endif /* UHS_SCSI_H */ - diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_USB_IDs.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_USB_IDs.h index 68d7885c6b..417c9f6e69 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_USB_IDs.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_USB_IDs.h @@ -77,7 +77,7 @@ #define UHS_VID_OPTI 0x03fbU // OPTi, Inc. #define UHS_VID_ELITEGROUP_COMPUTER_SYSTEMS 0x03fcU // Elitegroup Computer Systems #define UHS_VID_XILINX 0x03fdU // Xilinx, Inc. -#define UHS_VID_FARALLON_COMUNICATIONS 0x03feU // Farallon Comunications +#define UHS_VID_FARALLON_COMUNICATIONS 0x03feU // Farallon Communications #define UHS_VID_NATIONAL_SEMICONDUCTOR 0x0400U // National Semiconductor Corp. #define UHS_VID_NATIONAL_REGISTRY 0x0401U // National Registry, Inc. #define UHS_VID_ALI 0x0402U // ALi Corp. @@ -2991,5 +2991,3 @@ #define UHS_VID_FNK_TECH 0xffeeU // FNK Tech #endif - - diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h index cad84fba11..190077d17c 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h @@ -33,11 +33,11 @@ e-mail : support@circuitsathome.com #define UHS_HOST_MAX_INTERFACE_DRIVERS 0x10U // Default maximum number of USB interface drivers #endif -#if !defined(SYSTEM_OR_SPECIAL_YIELD) +#ifndef SYSTEM_OR_SPECIAL_YIELD #define SYSTEM_OR_SPECIAL_YIELD(...) VOID0 #endif -#if !defined(SYSTEM_OR_SPECIAL_YIELD_FROM_ISR) +#ifndef SYSTEM_OR_SPECIAL_YIELD_FROM_ISR #define SYSTEM_OR_SPECIAL_YIELD_FROM_ISR(...) SYSTEM_OR_SPECIAL_YIELD #endif diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h index ce60e44ec5..1c8b791910 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h @@ -158,7 +158,7 @@ class AddressPool { InitEntry(index); } - void InitAllAddresses(void) { + void InitAllAddresses() { for(uint8_t i = 1; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) InitEntry(i); hubCounter = 0; }; @@ -226,7 +226,7 @@ public: } thePool[index].address = addr; #if DEBUG_PRINTF_EXTRA_HUGE -#if defined(UHS_DEBUG_USB_ADDRESS) +#ifdef UHS_DEBUG_USB_ADDRESS printf("Address: %x (%x.%x.%x)\r\n", addr.devAddress, addr.bmHub, addr.bmParent, addr.bmAddress); #endif #endif diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h index 1e12908a89..bc111f7b61 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h @@ -40,7 +40,7 @@ public: HexDumper() : byteCount(0), byteTotal(0) { }; - void Initialize(void) { + void Initialize() { byteCount = 0; byteTotal = 0; }; diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h index 36ca2bfc4d..7f7d18116c 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h @@ -58,7 +58,7 @@ e-mail : support@circuitsathome.com #include "UHS_host_INLINE.h" #include "UHS_printf_HELPER.h" -#if defined(LOAD_USB_HOST_SHIELD) +#ifdef LOAD_USB_HOST_SHIELD #include "USB_HOST_SHIELD/USB_HOST_SHIELD.h" #endif @@ -72,24 +72,24 @@ e-mail : support@circuitsathome.com // Load USB drivers and multiplexers -#if defined(LOAD_UHS_HUB) +#ifdef LOAD_UHS_HUB #include "UHS_HUB/UHS_HUB.h" #endif // HUB loaded -#if defined(LOAD_UHS_BULK_STORAGE) +#ifdef LOAD_UHS_BULK_STORAGE #include "UHS_BULK_STORAGE/UHS_BULK_STORAGE.h" #endif -#if defined(LOAD_GENERIC_STORAGE) +#ifdef LOAD_GENERIC_STORAGE #include "../UHS_FS/UHS_FS.h" #endif // Add BT and optionally HID if directed to do so -#if defined(LOAD_UHS_BT) +#ifdef LOAD_UHS_BT #include "UHS_BT/UHS_BT.h" #endif // BT and optionally HID loaded // Add HID -#if defined(LOAD_UHS_HID) +#ifdef LOAD_UHS_HID #include "UHS_HID/UHS_HID.h" #endif // HID loaded @@ -98,11 +98,11 @@ e-mail : support@circuitsathome.com #include "UHS_CDC/UHS_CDC.h" #endif // CDC loaded -#if defined(LOAD_UHS_ADK) +#ifdef LOAD_UHS_ADK #include "UHS_ADK/UHS_ADK.h" #endif -#if defined(LOAD_UHS_MIDI) +#ifdef LOAD_UHS_MIDI #include "UHS_MIDI/UHS_MIDI.h" #endif diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h index afa20f30d4..9c94e4d0ee 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h @@ -24,7 +24,7 @@ Web : http://www.circuitsathome.com e-mail : support@circuitsathome.com */ -#if !defined(MACROS_H) +#ifndef MACROS_H #define MACROS_H #include "macro_logic.h" /* @@ -49,18 +49,18 @@ e-mail : support@circuitsathome.com // Nuke screwed up macro junk from the IDE. #ifdef __cplusplus -#if defined(true) +#ifdef true #undef true #endif -#if defined(false) +#ifdef false #undef false #endif #endif -#if !defined(UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE) +#ifndef UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE -#if !defined(UHS_BIG_FLASH) +#ifndef UHS_BIG_FLASH #if defined(FLASHEND) && defined(FLASHSTART) #if (FLASHEND - FLASHSTART) > 0x0FFFFU @@ -122,10 +122,10 @@ e-mail : support@circuitsathome.com // TODO: Fast inline code for AVR and SAM based microcontrollers // This can be done pretty easily. // For now, this will just work out-of-the-box. -#if !defined(UHS_PIN_WRITE) +#ifndef UHS_PIN_WRITE #define UHS_PIN_WRITE(p, v) digitalWrite(p, v) #endif -#if !defined(UHS_PIN_READ) +#ifndef UHS_PIN_READ #define UHS_PIN_READ(p) digitalRead(p) #endif @@ -134,8 +134,8 @@ e-mail : support@circuitsathome.com #edfine noInterrupts() __builtin_disable_interrupts() #endif -#if !defined(ARDUINO_SAMD_ZERO) -#if defined(ARDUINO_AVR_ADK) +#ifndef ARDUINO_SAMD_ZERO +#ifdef ARDUINO_AVR_ADK #define UHS_GET_DPI(x) (x == 54 ? 6 : digitalPinToInterrupt(x)) #else #define UHS_GET_DPI(x) digitalPinToInterrupt(x) @@ -386,8 +386,7 @@ e-mail : support@circuitsathome.com #define USBTRACE2X(s,r) (USBTRACE3X((s),(r),0x80)); USB_HOST_SERIAL.flush() #define VOID0 ((void)0) -#if !defined(NOTUSED) +#ifndef NOTUSED #define NOTUSED(...) __VA_ARGS__ __attribute__((unused)) #endif #endif /* MACROS_H */ - diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h index 93a3de2e0f..f5ed3d8b40 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h @@ -43,10 +43,10 @@ void NotifyFailGetDevDescr(uint8_t reason); void NotifyFailSetDevTblEntry(uint8_t reason); void NotifyFailGetConfDescr(uint8_t reason); void NotifyFailSetConfDescr(uint8_t reason); -void NotifyFailGetDevDescr(void); -void NotifyFailSetDevTblEntry(void); -void NotifyFailGetConfDescr(void); -void NotifyFailSetConfDescr(void); +void NotifyFailGetDevDescr(); +void NotifyFailSetDevTblEntry(); +void NotifyFailGetConfDescr(); +void NotifyFailSetConfDescr(); void NotifyFailUnknownDevice(uint16_t VID, uint16_t PID); void NotifyFail(uint8_t rcode); #else diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h index c5f87739c8..87f156db5c 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h @@ -27,7 +27,7 @@ e-mail : support@circuitsathome.com #ifndef UHS_PRINTF_HELPER_H #define UHS_PRINTF_HELPER_H -#if defined(LOAD_UHS_PRINTF_HELPER) +#ifdef LOAD_UHS_PRINTF_HELPER #include #ifdef true #undef true @@ -36,14 +36,14 @@ e-mail : support@circuitsathome.com #undef false #endif -#if !defined(STDIO_IS_OK_TO_USE_AS_IS) +#ifndef STDIO_IS_OK_TO_USE_AS_IS #if defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAM_DUE) || defined(ARDUINO_spresense_ast) // STDIO patching not required. #define STDIO_IS_OK_TO_USE_AS_IS #endif #endif -#if !defined(STDIO_IS_OK_TO_USE_AS_IS) +#ifndef STDIO_IS_OK_TO_USE_AS_IS // We need to patch STDIO so it can be used. #ifndef SERIAL_PORT_MONITOR @@ -64,7 +64,7 @@ e-mail : support@circuitsathome.com #endif #endif -#if !defined(NOTUSED) +#ifndef NOTUSED #define NOTUSED(...) __VA_ARGS__ __attribute__((unused)) #endif @@ -74,7 +74,7 @@ e-mail : support@circuitsathome.com #endif #endif -#if defined(ARDUINO_ARCH_PIC32) +#ifdef ARDUINO_ARCH_PIC32 /* * For printf() output with pic32 Arduino */ @@ -169,9 +169,9 @@ extern "C" { -#if defined(__AVR__) +#ifdef __AVR__ // The only wierdo in the bunch... -void UHS_AVR_printf_HELPER_init(void) { +void UHS_AVR_printf_HELPER_init() { // Set up stdio/stderr tty_stdio.put = tty_std_putc; tty_stdio.get = tty_std_getc; @@ -194,8 +194,7 @@ void UHS_AVR_printf_HELPER_init(void) { #endif /* STDIO_IS_OK_TO_USE_AS_IS */ #endif /* load.... */ -#if !defined(UHS_printf_HELPER_init) +#ifndef UHS_printf_HELPER_init #define UHS_printf_HELPER_init() (void(0)) #endif #endif /* UHS_PRINTF_HELPER_H */ - diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h index 6db65c00a0..9a6b110a15 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h @@ -24,19 +24,19 @@ Web : http://www.circuitsathome.com e-mail : support@circuitsathome.com */ -#if !defined(_UHS_host_h_) +#ifndef _UHS_host_h_ #error "Never include UHS_usbhost.h directly; include UHS_host.h instead" #else -#if !defined(_USBHOST_H_) +#ifndef _USBHOST_H_ #define _USBHOST_H_ // Very early prototypes -#if defined(UHS_LOAD_BT) +#ifdef UHS_LOAD_BT void UHS_BT_SetUSBInterface(UHS_USB_HOST_BASE *host, ENUMERATION_INFO *ei); void UHS_BT_ScanUninitialized(UHS_USB_HOST_BASE *host); void UHS_BT_Poll(UHS_USB_HOST_BASE *host); #endif -#if defined(UHS_LOAD_HID) +#ifdef UHS_LOAD_HID void UHS_HID_SetUSBInterface(UHS_USB_HOST_BASE *host, ENUMERATION_INFO *ei); void UHS_HID_ScanUninitialized(UHS_USB_HOST_BASE *host); void UHS_HID_Poll(UHS_USB_HOST_BASE *host); @@ -69,7 +69,7 @@ public: volatile uint8_t usb_host_speed; volatile uint8_t hub_present; - UHS_USB_HOST_BASE(void) { + UHS_USB_HOST_BASE() { for(uint16_t i = 0; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) { devConfig[i] = NULL; } @@ -110,7 +110,7 @@ public: virtual void UHS_NI vbusPower(NOTUSED(VBUS_t state)) { }; - virtual void UHS_NI Task(void) { + virtual void UHS_NI Task() { }; virtual uint8_t UHS_NI SetAddress(NOTUSED(uint8_t addr), NOTUSED(uint8_t ep), NOTUSED(UHS_EpInfo **ppep), NOTUSED(uint16_t &nak_limit)) { @@ -137,27 +137,27 @@ public: return UHS_HOST_ERROR_NOT_IMPLEMENTED; }; - virtual uint8_t UHS_NI init(void) { + virtual uint8_t UHS_NI init() { return 0; }; - virtual void UHS_NI doHostReset(void) { + virtual void UHS_NI doHostReset() { }; virtual int16_t UHS_NI Init(NOTUSED(int16_t mseconds)) { return -1; }; - virtual int16_t UHS_NI Init(void) { + virtual int16_t UHS_NI Init() { return Init(INT16_MIN); }; - virtual uint8_t hwlPowerUp(void) { + virtual uint8_t hwlPowerUp() { /* This is for machine specific support to enable/power up the USB HW to operate*/ return UHS_HOST_ERROR_NOT_IMPLEMENTED; }; - virtual uint8_t hwPowerDown(void) { + virtual uint8_t hwPowerDown() { /* This is for machine specific support to disable/powerdown the USB Hw */ return UHS_HOST_ERROR_NOT_IMPLEMENTED; }; @@ -166,13 +166,13 @@ public: return (klass == UHS_USB_CLASS_HUB); }; - virtual void UHS_NI suspend_host(void) { + virtual void UHS_NI suspend_host() { // Used on MCU that lack control of IRQ priority (AVR). // Suspends ISRs, for critical code. IRQ will be serviced after it is resumed. // NOTE: you must track the state yourself! }; - virtual void UHS_NI resume_host(void) { + virtual void UHS_NI resume_host() { // Used on MCU that lack control of IRQ priority (AVR). // Resumes ISRs. // NOTE: you must track the state yourself! @@ -184,23 +184,23 @@ public: // ///////////////////////////////////////////// // these two probably will go away, and won't be used, TBD - inline void Poll_Others(void) { -#if defined(UHS_LOAD_BT) + inline void Poll_Others() { +#ifdef UHS_LOAD_BT UHS_BT_Poll(this); #endif -#if defined(UHS_LOAD_HID) +#ifdef UHS_LOAD_HID UHS_HID_Poll(this); #endif } - inline void DisablePoll(void) { + inline void DisablePoll() { noInterrupts(); usb_task_polling_disabled++; DDSB(); interrupts(); } - inline void EnablePoll(void) { + inline void EnablePoll() { noInterrupts(); usb_task_polling_disabled--; DDSB(); @@ -233,11 +233,11 @@ public: UHS_EpInfo* UHS_NI getEpInfoEntry(uint8_t addr, uint8_t ep); - inline uint8_t getUsbTaskState(void) { + inline uint8_t getUsbTaskState() { return ( usb_task_state); }; - inline AddressPool* GetAddressPool(void) { + inline AddressPool* GetAddressPool() { return &addrPool; }; @@ -289,7 +289,7 @@ public: * Resets interface driver to unused state. You should override this in * your driver if it requires extra class variable cleanup. */ - virtual void DriverDefaults(void) { + virtual void DriverDefaults() { printf("Default driver defaults.\r\n"); pUsb->DeviceDefaults(bNumEP, this); }; @@ -325,7 +325,7 @@ public: * * @return zero on success */ - virtual uint8_t Finalize(void) { + virtual uint8_t Finalize() { return 0; }; @@ -334,7 +334,7 @@ public: * * @return 0 on success */ - virtual uint8_t OnStart(void) { + virtual uint8_t OnStart() { return 0; }; @@ -342,7 +342,7 @@ public: * Start interface polling * @return */ - virtual uint8_t Start(void) { + virtual uint8_t Start() { uint8_t rcode = OnStart(); if(!rcode) bPollEnable = true; return rcode; @@ -352,7 +352,7 @@ public: * Executed before anything else in Release(). * */ - virtual void OnRelease(void) { + virtual void OnRelease() { return; }; @@ -360,7 +360,7 @@ public: * Release resources when device is disconnected. * Normally this does not need to be overridden. */ - virtual void Release(void) { + virtual void Release() { OnRelease(); DriverDefaults(); return; @@ -375,7 +375,7 @@ public: * Button state/joystick position/etc changes on a HID device. * Flow control status change on a communication device, e.g. CTS on serial */ - virtual void OnPoll(void) { + virtual void OnPoll() { return; }; @@ -389,7 +389,7 @@ public: qNextPollTime = millis() + 100; }; - virtual bool UHS_NI Polling(void) { + virtual bool UHS_NI Polling() { return bPollEnable; } @@ -434,10 +434,10 @@ public: UHS_VSI(UHS_USB_HOST_BASE *p); bool OKtoEnumerate(ENUMERATION_INFO *ei); uint8_t SetInterface(ENUMERATION_INFO *ei); - virtual void DriverDefaults(void); - virtual void Release(void); + virtual void DriverDefaults(); + virtual void Release(); - uint8_t GetAddress(void) { + uint8_t GetAddress() { return bAddress; }; diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h index 04cfb61430..4f53443fb0 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h @@ -74,19 +74,19 @@ void E_Notify(double d, int lvl) { #ifdef DEBUG_USB_HOST -void NotifyFailGetDevDescr(void) { +void NotifyFailGetDevDescr() { Notify(PSTR("\r\ngetDevDescr "), 0x80); } -void NotifyFailSetDevTblEntry(void) { +void NotifyFailSetDevTblEntry() { Notify(PSTR("\r\nsetDevTblEn "), 0x80); } -void NotifyFailGetConfDescr(void) { +void NotifyFailGetConfDescr() { Notify(PSTR("\r\ngetConf "), 0x80); } -void NotifyFailSetConfDescr(void) { +void NotifyFailSetConfDescr() { Notify(PSTR("\r\nsetConf "), 0x80); } diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h index ab80f65417..f0cdae2b6b 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h @@ -28,10 +28,10 @@ e-mail : support@circuitsathome.com #include -#if !defined(SPI_HAS_TRANSACTION) +#ifndef SPI_HAS_TRANSACTION #error "Your SPI library installation is too old." #else -#if !defined(SPI_ATOMIC_VERSION) +#ifndef SPI_ATOMIC_VERSION #warning "Your SPI library installation lacks 'SPI_ATOMIC_VERSION'. Please complain to the maintainer." #elif SPI_ATOMIC_VERSION < 1 #error "Your SPI library installation is too old." @@ -48,8 +48,8 @@ e-mail : support@circuitsathome.com #define MAX_HOST_DEBUG(...) VOID0 #endif -#if !defined(USB_HOST_SHIELD_USE_ISR) -#if defined(USE_MULTIPLE_APP_API) +#ifndef USB_HOST_SHIELD_USE_ISR +#ifdef USE_MULTIPLE_APP_API #define USB_HOST_SHIELD_USE_ISR 0 #else #define USB_HOST_SHIELD_USE_ISR 1 @@ -66,7 +66,7 @@ e-mail : support@circuitsathome.com // // Polled defaults // -#if defined(BOARD_BLACK_WIDDOW) +#ifdef BOARD_BLACK_WIDDOW #define UHS_MAX3421E_SS_ 6 #define UHS_MAX3421E_INT_ 3 #elif defined(CORE_TEENSY) && (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)) @@ -91,7 +91,7 @@ e-mail : support@circuitsathome.com #endif #else -#if defined(ARDUINO_ARCH_PIC32) +#ifdef ARDUINO_ARCH_PIC32 // PIC32 only allows edge interrupts, isn't that lovely? We'll emulate it... #if CHANGE < 2 #error core too old. @@ -113,8 +113,8 @@ e-mail : support@circuitsathome.com #endif // More stupidity from our friends @ Sony... -#if defined(ARDUINO_spresense_ast) -#if !defined(NOT_AN_INTERRUPT) +#ifdef ARDUINO_spresense_ast +#ifndef NOT_AN_INTERRUPT #define NOT_AN_INTERRUPT -1 #endif #endif @@ -158,7 +158,7 @@ e-mail : support@circuitsathome.com #else #define UHS_MAX3421E_SS_ 10 #ifdef __AVR__ -#if defined(__AVR_ATmega32U4__) +#ifdef __AVR_ATmega32U4__ #define INT_FOR_PIN2 1 #define INT_FOR_PIN3 0 #else @@ -169,7 +169,7 @@ e-mail : support@circuitsathome.com #define UHS_MAX3421E_INT_ 3 #else // Non-avr -#if defined(ARDUINO_ARCH_PIC32) +#ifdef ARDUINO_ARCH_PIC32 // UNO32 External Interrupts: // Pin 38 (INT0), Pin 2 (INT1), Pin 7 (INT2), Pin 8 (INT3), Pin 35 (INT4) #define UHS_MAX3421E_INT_ 7 @@ -182,7 +182,7 @@ e-mail : support@circuitsathome.com -#if defined(NO_AUTO_SPEED) +#ifdef NO_AUTO_SPEED // Ugly details section... // MAX3421E characteristics // SPI Serial - Clock Input. An external SPI master supplies SCLK with frequencies up to 26MHz. The @@ -195,8 +195,8 @@ e-mail : support@circuitsathome.com // Theoretical deadline for reply 17.7ns // 26MHz 38.4615ns period <-- MAX3421E theoretical maximum -#if !defined(UHS_MAX3421E_SPD) -#if defined(ARDUINO_SAMD_ZERO) +#ifndef UHS_MAX3421E_SPD +#ifdef ARDUINO_SAMD_ZERO // Zero violates spec early, needs a long setup time, or doesn't like high latency. #define UHS_MAX3421E_SPD 10000000 #elif defined(ARDUINO_ARCH_PIC32) @@ -225,7 +225,7 @@ e-mail : support@circuitsathome.com // Why not 26MHz? Because I have not found any MCU board that // can actually go that fast without problems. // Could be a shield limitation too. -#if !defined(UHS_MAX3421E_SPD) +#ifndef UHS_MAX3421E_SPD #define UHS_MAX3421E_SPD 25000000 #endif #endif @@ -271,7 +271,7 @@ e-mail : support@circuitsathome.com // |______| |______| |______| |______________| // #define IRQ_SENSE FALLING -#if defined(ARDUINO_ARCH_PIC32) +#ifdef ARDUINO_ARCH_PIC32 //#define bmPULSEWIDTH PUSLEWIDTH10_6 #define bmPULSEWIDTH 0 #define bmIRQ_SENSE 0 @@ -280,20 +280,20 @@ e-mail : support@circuitsathome.com #define bmIRQ_SENSE 0 #endif #else -#if !defined(IRQ_SENSE) +#ifndef IRQ_SENSE #define IRQ_SENSE LOW #endif -#if !defined(bmPULSEWIDTH) +#ifndef bmPULSEWIDTH #define bmPULSEWIDTH 0 #endif -#if !defined(bmIRQ_SENSE) +#ifndef bmIRQ_SENSE #define bmIRQ_SENSE bmINTLEVEL #endif #endif class MAX3421E_HOST : public UHS_USB_HOST_BASE -#if defined(SWI_IRQ_NUM) +#ifdef SWI_IRQ_NUM , public dyn_SWI #endif { @@ -330,7 +330,7 @@ public: uint8_t irq_pin; // Will use the defaults UHS_MAX3421E_SS, UHS_MAX3421E_INT and speed - UHS_NI MAX3421E_HOST(void) { + UHS_NI MAX3421E_HOST() { sof_countdown = 0; busevent = false; doingreset = false; @@ -394,7 +394,7 @@ public: regWr(rPINCTL, (bmFDUPSPI | bmIRQ_SENSE) | (uint8_t)(state)); }; - void UHS_NI Task(void); + void UHS_NI Task(); virtual uint8_t SetAddress(uint8_t addr, uint8_t ep, UHS_EpInfo **ppep, uint16_t &nak_limit); virtual uint8_t OutTransfer(UHS_EpInfo *pep, uint16_t nak_limit, uint16_t nbytes, uint8_t *data); @@ -403,7 +403,7 @@ public: virtual uint8_t ctrlReqRead(UHS_EpInfo *pep, uint16_t *left, uint16_t *read, uint16_t nbytes, uint8_t *dataptr); virtual uint8_t dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit); - void UHS_NI ReleaseChildren(void) { + void UHS_NI ReleaseChildren() { for(uint8_t i = 0; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) if(devConfig[i]) devConfig[i]->Release(); @@ -418,9 +418,9 @@ public: return false; }; - virtual void VBUS_changed(void); + virtual void VBUS_changed(); - virtual void UHS_NI doHostReset(void) { + virtual void UHS_NI doHostReset() { #if USB_HOST_SHIELD_USE_ISR // Enable interrupts noInterrupts(); @@ -469,48 +469,48 @@ public: int16_t UHS_NI Init(int16_t mseconds); - int16_t UHS_NI Init(void) { + int16_t UHS_NI Init() { return Init(INT16_MIN); }; - void ISRTask(void); - void ISRbottom(void); - void busprobe(void); - uint16_t reset(void); + void ISRTask(); + void ISRbottom(); + void busprobe(); + uint16_t reset(); // MAX3421e specific void regWr(uint8_t reg, uint8_t data); void gpioWr(uint8_t data); uint8_t regRd(uint8_t reg); - uint8_t gpioRd(void); + uint8_t gpioRd(); uint8_t* bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* data_p); uint8_t* bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p); // ARM/NVIC specific, used to emulate reentrant ISR. -#if defined(SWI_IRQ_NUM) +#ifdef SWI_IRQ_NUM - void dyn_SWISR(void) { + void dyn_SWISR() { ISRbottom(); }; #endif - virtual void UHS_NI suspend_host(void) { + virtual void UHS_NI suspend_host() { // Used on MCU that lack control of IRQ priority (AVR). // Suspends ISRs, for critical code. IRQ will be serviced after it is resumed. // NOTE: you must track the state yourself! -#if defined(__AVR__) +#ifdef __AVR__ noInterrupts(); detachInterrupt(UHS_GET_DPI(irq_pin)); interrupts(); #endif }; - virtual void UHS_NI resume_host(void); + virtual void UHS_NI resume_host(); }; -#if !defined(SPIclass) +#ifndef SPIclass #define SPIclass SPI #endif -#if !defined(USB_HOST_SHIELD_LOADED) +#ifndef USB_HOST_SHIELD_LOADED #include "USB_HOST_SHIELD_INLINE.h" #endif #else diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h index 78669305d9..ef2dfe0137 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h @@ -21,7 +21,7 @@ e-mail : support@circuitsathome.com #define USB_HOST_SHIELD_LOADED #include -#if !defined(digitalPinToInterrupt) +#ifndef digitalPinToInterrupt #error digitalPinToInterrupt not defined, complain to your board maintainer. #endif @@ -34,22 +34,22 @@ e-mail : support@circuitsathome.com static MAX3421E_HOST *ISReven; static MAX3421E_HOST *ISRodd; -static void UHS_NI call_ISReven(void) { +static void UHS_NI call_ISReven() { ISReven->ISRTask(); } -static void UHS_NI call_ISRodd(void) { +static void UHS_NI call_ISRodd() { UHS_PIN_WRITE(LED_BUILTIN, HIGH); ISRodd->ISRTask(); } #endif -void UHS_NI MAX3421E_HOST::resume_host(void) { +void UHS_NI MAX3421E_HOST::resume_host() { // Used on MCU that lack control of IRQ priority (AVR). // Resumes ISRs. // NOTE: you must track the state yourself! -#if defined(__AVR__) +#ifdef __AVR__ noInterrupts(); if(irq_pin & 1) { ISRodd = this; @@ -133,7 +133,7 @@ uint8_t* UHS_NI MAX3421E_HOST::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* dat /* GPIO read. See gpioWr for explanation */ /* GPIN pins are in high nibbles of IOPINS1, IOPINS2 */ -uint8_t UHS_NI MAX3421E_HOST::gpioRd(void) { +uint8_t UHS_NI MAX3421E_HOST::gpioRd() { uint8_t gpin = 0; gpin = regRd(rIOPINS2); //pins 4-7 gpin &= 0xf0; //clean lower nibble @@ -143,7 +143,7 @@ uint8_t UHS_NI MAX3421E_HOST::gpioRd(void) { /* reset MAX3421E. Returns number of microseconds it took for PLL to stabilize after reset or zero if PLL haven't stabilized in 65535 cycles */ -uint16_t UHS_NI MAX3421E_HOST::reset(void) { +uint16_t UHS_NI MAX3421E_HOST::reset() { uint16_t i = 0; // Initiate chip reset @@ -167,7 +167,7 @@ uint16_t UHS_NI MAX3421E_HOST::reset(void) { return (i); } -void UHS_NI MAX3421E_HOST::VBUS_changed(void) { +void UHS_NI MAX3421E_HOST::VBUS_changed() { /* modify USB task state because Vbus changed or unknown */ uint8_t speed = 1; //printf("\r\n\r\n\r\n\r\nSTATE %2.2x -> ", usb_task_state); @@ -214,7 +214,7 @@ void UHS_NI MAX3421E_HOST::VBUS_changed(void) { * Probe bus to determine device presence and speed, * then switch host to detected speed. */ -void UHS_NI MAX3421E_HOST::busprobe(void) { +void UHS_NI MAX3421E_HOST::busprobe() { uint8_t bus_sample; uint8_t tmpdata; bus_sample = regRd(rHRSL); //Get J,K status @@ -314,7 +314,7 @@ int16_t UHS_NI MAX3421E_HOST::Init(int16_t mseconds) { #if USB_HOST_SHIELD_USE_ISR int intr = digitalPinToInterrupt(irq_pin); if(intr == NOT_AN_INTERRUPT) { -#if defined(ARDUINO_AVR_ADK) +#ifdef ARDUINO_AVR_ADK if(irq_pin == 54) intr = 6; else @@ -325,7 +325,7 @@ int16_t UHS_NI MAX3421E_HOST::Init(int16_t mseconds) { #else SPIclass.usingInterrupt(255); #endif -#if !defined(NO_AUTO_SPEED) +#ifndef NO_AUTO_SPEED // test to get to reset acceptance. uint32_t spd = UHS_MAX3421E_SPD; again: @@ -760,7 +760,7 @@ uint8_t UHS_NI MAX3421E_HOST::ctrlReqClose(UHS_EpInfo *pep, uint8_t bmReqType, u /** * Bottom half of the ISR task */ -void UHS_NI MAX3421E_HOST::ISRbottom(void) { +void UHS_NI MAX3421E_HOST::ISRbottom() { uint8_t x; // Serial.print("Enter "); // Serial.print((uint32_t)this,HEX); @@ -879,12 +879,12 @@ void UHS_NI MAX3421E_HOST::ISRbottom(void) { /* USB main task. Services the MAX3421e */ #if !USB_HOST_SHIELD_USE_ISR -void UHS_NI MAX3421E_HOST::ISRTask(void) { +void UHS_NI MAX3421E_HOST::ISRTask() { } -void UHS_NI MAX3421E_HOST::Task(void) +void UHS_NI MAX3421E_HOST::Task() #else -void UHS_NI MAX3421E_HOST::Task(void) { +void UHS_NI MAX3421E_HOST::Task() { #ifdef USB_HOST_MANUAL_POLL if(usb_task_state == UHS_USB_HOST_STATE_RUNNING) { noInterrupts(); @@ -896,12 +896,12 @@ void UHS_NI MAX3421E_HOST::Task(void) { #endif } -void UHS_NI MAX3421E_HOST::ISRTask(void) +void UHS_NI MAX3421E_HOST::ISRTask() #endif { DDSB(); -#if !defined(SWI_IRQ_NUM) +#ifndef SWI_IRQ_NUM suspend_host(); #if USB_HOST_SHIELD_USE_ISR // Enable interrupts @@ -965,7 +965,7 @@ void UHS_NI MAX3421E_HOST::ISRTask(void) // usb_task_polling_disabled? "T" : "F"); DDSB(); regWr(rHIRQ, HIRQ_sendback); -#if !defined(SWI_IRQ_NUM) +#ifndef SWI_IRQ_NUM resume_host(); #if USB_HOST_SHIELD_USE_ISR // Disable interrupts @@ -981,7 +981,7 @@ void UHS_NI MAX3421E_HOST::ISRTask(void) UHS_PIN_WRITE(USB_HOST_SHIELD_TIMING_PIN, HIGH); #endif -#if defined(SWI_IRQ_NUM) +#ifdef SWI_IRQ_NUM // MAX_HOST_DEBUG(PSTR("--------------- Doing SWI ----------------")); exec_SWI(this); #else diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h index 9b2b5a3746..f368604a9a 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h @@ -139,7 +139,7 @@ AJK_IIF(AJK_BITAND(AJK_IS_COMPARABLE(x))(AJK_IS_COMPARABLE(y)) ) \ #define AJK_FUN(AJK_count, AJK_v, AJK_args, AJK_body) AJK_v ## AJK_count (AJK_args) { AJK_body(AJK_count) } #define AJK_MAKE_FUNS(AJK_v, AJK_args, AJK_count, AJK_body) AJK_EVAL(AJK_REPEAT(AJK_count, AJK_FUN, AJK_v, AJK_args, AJK_body)) -#if defined(AJK_TEST_MACRO_LOGIC) +#ifdef AJK_TEST_MACRO_LOGIC #define BODY(AJKindex) some(C, statement); contaning(a, test[AJKindex]); #define ZERO_TIMES_TEST 0 diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h index 5516fbf126..f23d281e28 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h @@ -35,19 +35,19 @@ static char dyn_SWI_initied = 0; static dyn_SWI* dyn_SWI_LIST[SWI_MAXIMUM_ALLOWED]; static dyn_SWI* dyn_SWI_EXEC[SWI_MAXIMUM_ALLOWED]; -#if defined(__arm__) -#if defined(__USE_CMSIS_VECTORS__) +#ifdef __arm__ +#ifdef __USE_CMSIS_VECTORS__ extern "C" { void (*_VectorsRam[VECTORTABLE_SIZE])(void)__attribute__((aligned(VECTORTABLE_ALIGNMENT))); } #else -__attribute__((always_inline)) static inline void __DSB(void) { +__attribute__((always_inline)) static inline void __DSB() { __asm__ volatile ("dsb"); } #endif // defined(__USE_CMSIS_VECTORS__) #else // defined(__arm__) -__attribute__((always_inline)) static inline void __DSB(void) { +__attribute__((always_inline)) static inline void __DSB() { __asm__ volatile ("sync" : : : "memory"); } #endif // defined(__arm__) @@ -55,23 +55,23 @@ __attribute__((always_inline)) static inline void __DSB(void) { /** * Execute queued class ISR routines. */ -#if defined(ARDUINO_ARCH_PIC32) +#ifdef ARDUINO_ARCH_PIC32 static p32_regset *ifs = ((p32_regset *) & IFS0) + (SWI_IRQ_NUM / 32); //interrupt flag register set static p32_regset *iec = ((p32_regset *) & IEC0) + (SWI_IRQ_NUM / 32); //interrupt enable control reg set static uint32_t swibit = 1 << (SWI_IRQ_NUM % 32); void -#if defined(__PIC32MZXX__) +#ifdef __PIC32MZXX__ __attribute__((nomips16,at_vector(SWI_VECTOR),interrupt(SWI_IPL))) #else __attribute__((interrupt(),nomips16)) #endif - softISR(void) { + softISR() { #else -#if defined(ARDUINO_spresense_ast) -unsigned int softISR(void) { +#ifdef ARDUINO_spresense_ast +unsigned int softISR() { #else -void softISR(void) { +void softISR() { #endif #endif @@ -82,7 +82,7 @@ void softISR(void) { // Make a working copy, while clearing the queue. noInterrupts(); -#if defined(ARDUINO_ARCH_PIC32) +#ifdef ARDUINO_ARCH_PIC32 //ifs->clr = swibit; #endif for(int i = 0; i < SWI_MAXIMUM_ALLOWED; i++) { @@ -95,21 +95,21 @@ void softISR(void) { // Execute each class SWI for(int i = 0; i < SWI_MAXIMUM_ALLOWED; i++) { if(dyn_SWI_EXEC[i]) { -#if defined(__DYN_SWI_DEBUG_LED__) +#ifdef __DYN_SWI_DEBUG_LED__ digitalWrite(__DYN_SWI_DEBUG_LED__, HIGH); #endif dyn_SWI_EXEC[i]->dyn_SWISR(); -#if defined(__DYN_SWI_DEBUG_LED__) +#ifdef __DYN_SWI_DEBUG_LED__ digitalWrite(__DYN_SWI_DEBUG_LED__, LOW); #endif } } -#if defined(ARDUINO_ARCH_PIC32) +#ifdef ARDUINO_ARCH_PIC32 noInterrupts(); if(!dyn_SWI_EXEC[0]) ifs->clr = swibit; interrupts(); #endif -#if defined(ARDUINO_spresense_ast) +#ifdef ARDUINO_spresense_ast return 0; #endif } @@ -118,12 +118,12 @@ void softISR(void) { #endif -#if defined(__arm__) +#ifdef __arm__ #ifndef interruptsStatus #define interruptsStatus() __interruptsStatus() -static inline unsigned char __interruptsStatus(void) __attribute__((always_inline, unused)); +static inline unsigned char __interruptsStatus() __attribute__((always_inline, unused)); -static inline unsigned char __interruptsStatus(void) { +static inline unsigned char __interruptsStatus() { unsigned int primask; asm volatile ("mrs %0, primask" : "=r" (primask)); if(primask) return 0; @@ -134,9 +134,9 @@ static inline unsigned char __interruptsStatus(void) { /** * Initialize the Dynamic (class) Software Interrupt */ -static void Init_dyn_SWI(void) { +static void Init_dyn_SWI() { if(!dyn_SWI_initied) { -#if defined(__USE_CMSIS_VECTORS__) +#ifdef __USE_CMSIS_VECTORS__ uint32_t *X_Vectors = (uint32_t*)SCB->VTOR; for(int i = 0; i < VECTORTABLE_SIZE; i++) { _VectorsRam[i] = reinterpret_cast(X_Vectors[i]); /* copy vector table to RAM */ @@ -147,7 +147,7 @@ static void Init_dyn_SWI(void) { DDSB(); interrupts(); #endif -#if !defined(ARDUINO_spresense_ast) +#ifndef ARDUINO_spresense_ast for(int i = 0; i < SWI_MAXIMUM_ALLOWED; i++) dyn_SWI_LIST[i] = NULL; noInterrupts(); _VectorsRam[SWI_IRQ_NUM + 16] = reinterpret_cast(softISR); @@ -156,7 +156,7 @@ static void Init_dyn_SWI(void) { NVIC_SET_PRIORITY(SWI_IRQ_NUM, 255); NVIC_ENABLE_IRQ(SWI_IRQ_NUM); #endif -#if defined(__DYN_SWI_DEBUG_LED__) +#ifdef __DYN_SWI_DEBUG_LED__ pinMode(__DYN_SWI_DEBUG_LED__, OUTPUT); digitalWrite(__DYN_SWI_DEBUG_LED__, LOW); #endif @@ -180,7 +180,7 @@ int exec_SWI(const dyn_SWI* klass) { if(!dyn_SWI_LIST[i]) { rc = 1 + i; // Success! dyn_SWI_LIST[i] = (dyn_SWI*)klass; -#if !defined(ARDUINO_spresense_ast) +#ifndef ARDUINO_spresense_ast if(!NVIC_GET_PENDING(SWI_IRQ_NUM)) NVIC_SET_PENDING(SWI_IRQ_NUM); #else // Launch 1-shot timer as an emulated SWI @@ -201,7 +201,7 @@ int exec_SWI(const dyn_SWI* klass) { /** * Initialize the Dynamic (class) Software Interrupt */ -static void Init_dyn_SWI(void) { +static void Init_dyn_SWI() { if(!dyn_SWI_initied) { uint32_t sreg = disableInterrupts(); @@ -211,7 +211,7 @@ static void Init_dyn_SWI(void) { iec->clr = swibit; iec->set = swibit; restoreInterrupts(sreg); -#if defined(__DYN_SWI_DEBUG_LED__) +#ifdef __DYN_SWI_DEBUG_LED__ pinMode(__DYN_SWI_DEBUG_LED__, OUTPUT); UHS_PIN_WRITE(__DYN_SWI_DEBUG_LED__, LOW); #endif diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h index 93118a6d75..2738c8c6ff 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h @@ -24,26 +24,26 @@ #if defined(__arm__) || defined(ARDUINO_ARCH_PIC32) -#if defined(ARDUINO_ARCH_PIC32) +#ifdef ARDUINO_ARCH_PIC32 #include #endif #ifdef __cplusplus -#if defined(true) +#ifdef true #undef true #endif -#if defined(false) +#ifdef false #undef false #endif #endif -#if defined(ARDUINO_spresense_ast) +#ifdef ARDUINO_spresense_ast #define SWI_IRQ_NUM 666 // because this board is totally evil. #elif defined(ARDUINO_ARCH_PIC32) #ifndef SWI_IRQ_NUM -#if defined(_DSPI0_IPL_ISR) +#ifdef _DSPI0_IPL_ISR #define SWI_IPL _DSPI0_IPL_ISR #define SWI_VECTOR _DSPI0_ERR_IRQ #define SWI_IRQ_NUM _DSPI0_ERR_IRQ @@ -57,19 +57,19 @@ extern "C" { void -#if defined(__PIC32MZXX__) +#ifdef __PIC32MZXX__ __attribute__((nomips16,at_vector(SWI_VECTOR),interrupt(SWI_IPL))) #else __attribute__((interrupt(),nomips16)) #endif - softISR(void); + softISR(); } #endif #endif #elif !defined(NVIC_NUM_INTERRUPTS) // Assume CMSIS #define __USE_CMSIS_VECTORS__ -#if defined(NUMBER_OF_INT_VECTORS) +#ifdef NUMBER_OF_INT_VECTORS #define NVIC_NUM_INTERRUPTS (NUMBER_OF_INT_VECTORS-16) #else #define NVIC_NUM_INTERRUPTS ((int)PERIPH_COUNT_IRQn) @@ -114,7 +114,7 @@ extern "C" #ifndef NVIC_GET_PENDING #define NVIC_GET_PENDING(n) (*((volatile uint32_t *)0xE000E200 + ((n) >> 5)) & (1 << ((n) & 31))) #ifndef SWI_IRQ_NUM -#if defined(__MK20DX256__) +#ifdef __MK20DX256__ #define SWI_IRQ_NUM 17 #elif defined(__MK20DX128__) #define SWI_IRQ_NUM 5 @@ -149,7 +149,7 @@ public: /** * Override this method with your code. */ - virtual void dyn_SWISR(void) { + virtual void dyn_SWISR() { }; }; @@ -165,7 +165,7 @@ extern int exec_SWI(const dyn_SWI* klass); // if no SWI for CPU (e.g. AVR) make a void stub. #ifndef SWI_NO_STUB #define Init_dyn_SWI() (void(0)) -#if !defined(DDSB) +#ifndef DDSB #define DDSB() (void(0)) #endif #endif diff --git a/README.md b/README.md index fe59dbe304..19cc7adb8e 100644 --- a/README.md +++ b/README.md @@ -1,81 +1,69 @@ -## Formbot / Vivedino Raptor / Raptor 2 +# Marlin 3D Printer Firmware -This branch supports the original Formbot Raptor with the varying bed and driver options as well as runout kits from Tiny Machines. The Raptor 2 incorporates all of these stock. +[![Build Status](https://travis-ci.org/MarlinFirmware/Marlin.svg?branch=bugfix-2.0.x)](https://travis-ci.org/MarlinFirmware/Marlin) +![GitHub](https://img.shields.io/github/license/marlinfirmware/marlin.svg) +![GitHub contributors](https://img.shields.io/github/contributors/marlinfirmware/marlin.svg) +![GitHub Release Date](https://img.shields.io/github/release-date/marlinfirmware/marlin.svg) -## About Our Branches + -The firmware branches maintained here are made possible by the support of sponsors like [Tiny Machines 3D](https://tinymachines3d.com/) as well as our customer base through our 3D printing Services. Maintaining and developing these branches takes a significant investment, made up of time and machines. To support continued development, please consider your next 3D Printer related purchase from Tiny Machines 3D and thank them for supporting open source development. Or, consider us for printing services outside of your machine’s capabilities. Print service requests can be sent to d.menzel@insanityautomation.com and we will respond typically within 1 working day. If you do not need anything printed or a 3D Printer but still want to contribute, you can support us through [Patreon](https://www.patreon.com/InsanityAutomation). +Additional documentation can be found at the [Marlin Home Page](http://marlinfw.org/). +Please test this firmware and let us know if it misbehaves in any way. Volunteers are standing by! -## Setup +## Marlin 2.0 Bugfix Branch -All configuration options intended to be adjusted by end users have been placed in the top section of Configuration.h and have been documented there. There is typically a break line to segregate the standard configuration below. Anything aside from the upper options is intended for advanced users only. +__Not for production use. Use with caution!__ -## Support +Marlin 2.0 takes this popular RepRap firmware to the next level by adding support for much faster 32-bit and ARM-based boards while improving support for 8-bit AVR boards. Read about Marlin's decision to use a "Hardware Abstraction Layer" below. -This firmware is provided to the public as-is with no warranty or guarantee. It's based on a large open source project and there is no entitlement to support. That said, Tiny Machines 3D customers may obtain support through their normal support queue. I will provide support to Patreons as I am able. If you require more immediate support and are not a Tiny Machines customer, you may contact them at support@tinymachines3d.com about purchasing support hours. Aside from this, we are active many Facebook groups as well as several discord channels and typically help anyone we can when we come across them. +This branch is for patches to the latest 2.0.x release version. Periodically this branch will form the basis for the next minor 2.0.x release. -3D Printing Discord - https://discord.gg/MZrsgVU -Marlin Discord - https://discord.gg/n5NJ59y - -## Firmware Branches - - 1.1.9 Firmware (Stable, EOL) [TM_CR10](https://github.com/InsanityAutomation/Marlin/tree/TM_CR10) - - 2.0 Firmware [Creality_Marlin2.0.x](https://github.com/InsanityAutomation/Marlin/tree/Creality_Marlin2.0.x) - - 2.0 Development Branch (Beta, but well tested) [Creality_2.0_Devel](https://github.com/InsanityAutomation/Marlin/tree/Creality_2.0_Devel) - - 2.0 Bleeding edge Branch (Here there be dragons!) [Creality_2.0_Bleeding](https://github.com/InsanityAutomation/Marlin/tree/Creality_2.0_Bleeding) - - Touchscreen Firmware (10SPro and CR-X 1.1.9 Stable) [Creality_DWINTest](https://github.com/InsanityAutomation/Marlin/tree/Creality_DWINTest) - - Touchscreen Firmware (10SPro and CR-X 2.0 Active Development) [CrealityDwin_2.0](https://github.com/InsanityAutomation/Marlin/tree/CrealityDwin_2.0) -## Formbot / Vivedino Firmware Branches - - Raptor 1 1.1.9 Firmware [TM_Raptor](https://github.com/InsanityAutomation/Marlin/tree/TM_Raptor) - - Raptor 1/2 2.0 Firmware [Raptor_2.0.X](https://github.com/InsanityAutomation/Marlin/tree/Raptor_2.0.X) - - Trex 2+/3 1.1.9 Firmware [Trex3_1.1.9](https://github.com/InsanityAutomation/Marlin/tree/Trex3_1.1.9) - - Trex 2+/3 2.0 Firmware (Be warned of layer shift issue below!) [TM_Trex2+_2.0.x](https://github.com/InsanityAutomation/Marlin/tree/TM_Trex2+_2.0.x) -## Mamorubot / HieHa Firmware Branches - - SX4 1.1.9 Firmware (Stable, EOL) [Mamorubot_SX4]( https://github.com/InsanityAutomation/Marlin/tree/Mamorubot_SX4) - - SX4 2.0 Firmware (Beta, but well tested) [TM_SX4_2.0](https://github.com/InsanityAutomation/Marlin/tree/TM_SX4_2.0) - - SX4 Development Branch [TM_SX4_2.0_Devel](https://github.com/InsanityAutomation/Marlin/tree/TM_SX4_2.0_Devel) -## Other Firmware - - Raise 3D N2+ (Dual) 2.0 [Raise3D-N2+-Dual](https://github.com/InsanityAutomation/Marlin/tree/Raise3D-N2+-Dual) - - Evnovo Artillery Sidewinder X1 2.0 [Evnovo X1](https://github.com/InsanityAutomation/Marlin/tree/ArtilleryX1_2.0_Devel) - -[Marlin Commit History](https://github.com/MarlinFirmware/Marlin/pulls?q=is%3Apr+is%3Aclosed+author%3AInsanityAutomation) - -## Active Projects - - [Tracing Marlin 2.0 Planner bug causing layer Shifting](https://github.com/MarlinFirmware/Marlin/issues/12403) - - Creality Dwin Touchscreen rewrite to ExtUI - DONE - - [IDEX drifting z offset on tool change with UBL](https://github.com/MarlinFirmware/Marlin/issues/13817) - - [Multiple touch homing](https://github.com/MarlinFirmware/Marlin/issues/9802) - - [Tool change offset changes](https://github.com/MarlinFirmware/Marlin/issues/12568) - - [Hotend offset adjustment clamping](https://github.com/MarlinFirmware/Marlin/pull/13669) - - [Filament width sensor hang on 32 bit](https://github.com/MarlinFirmware/Marlin/issues/13701) - - Probe point output for all leveling types matching incomplete ubl implementation - DONE - - SKR1.1 Pro integration to Trex2 with TMC2209 Drivers - Mostly done, blew an output... - - SKR1.3 Integration to Mamorubot SX4 - DONE - - Mosquito BMG-M integration to Raptor - - Porting Chithu Touchscreen board to Marlin 2.0 with ExtUI - - Anet A10 Delta STM32F103 board analysis - - Smoothing integration and vendor components of Marlin 2.0 (Revision to version.h handling, limit clamping, usability enhancements ect) - - Consolidate more probing functions, improve G33/4 and G28/29 handling - - G34 Z stepper reordering and automatic detection / adjustment of reversed stepper connections - - Video documentation of firmware branch configuration options and flashing with platformio -## Planned Projects - - Implement Virtual Tools - - Port Duet2 Wifi with Duex5 to Marlin 2.0 - - Further Gcode Parity with RRF - - Extend Host Prompt Support for Power Loss Recovery - - Improve native ESP32 web support - - Port M425 Auto backlash and offset calibration to IDEX - - Integrate 12 stepper LPC1778 PCB to configure ideXY quad head system as well as integrate 3 extruder mixing to IDEX - - Video walkthrough of each bed leveling system usage and all functions - -## Marlin -This is just one of many forks of Marlin. We don't try to bury that behind fancy marmarketingketting or anything else. As you can see from the links above, most of the work done here is submitted back to the mainstream Marlin branches. The end goal of every project is to get it to the point where it is merged and maintained there. See marlin resources, including how to contribute to the Marlin Project as well, down below. +Download earlier versions of Marlin on the [Releases page](https://github.com/MarlinFirmware/Marlin/releases). ## Building Marlin 2.0 To build Marlin 2.0 you'll need [Arduino IDE 1.8.8 or newer](https://www.arduino.cc/en/main/software) or [PlatformIO](http://docs.platformio.org/en/latest/ide.html#platformio-ide). We've posted detailed instructions on [Building Marlin with Arduino](http://marlinfw.org/docs/basics/install_arduino.html) and [Building Marlin with PlatformIO for ReArm](http://marlinfw.org/docs/basics/install_rearm.html) (which applies well to other 32-bit boards). +## Hardware Abstraction Layer (HAL) -## The current Marlin dev team consists of: +Marlin 2.0 introduces a layer of abstraction so that all the existing high-level code can be built for 32-bit platforms while still retaining full 8-bit AVR compatibility. Retaining AVR compatibility and a single code-base is important to us, because we want to make sure that features and patches get as much testing and attention as possible, and that all platforms always benefit from the latest improvements. + +### Current HALs + + name|processor|speed|flash|sram|logic|fpu + ----|---------|-----|-----|----|-----|--- + [Arduino AVR](https://www.arduino.cc/)|ATmega, ATTiny, etc.|16-20MHz|64-256k|2-16k|5V|no + [Teensy++ 2.0](http://www.microchip.com/wwwproducts/en/AT90USB1286)|[AT90USB1286](http://www.microchip.com/wwwproducts/en/AT90USB1286)|16MHz|128k|8k|5V|no + [Arduino STM32](https://github.com/rogerclarkmelbourne/Arduino_STM32)|[STM32F1](https://www.st.com/en/microcontrollers-microprocessors/stm32f103.html) ARM-Cortex M3|72MHz|256-512k|48-64k|3.3V|no + [Due](https://www.arduino.cc/en/Guide/ArduinoDue), [RAMPS-FD](http://www.reprap.org/wiki/RAMPS-FD), etc.|[SAM3X8E ARM-Cortex M3](http://www.microchip.com/wwwproducts/en/ATsam3x8e)|84MHz|512k|64+32k|3.3V|no + [Re-ARM](https://www.kickstarter.com/projects/1245051645/re-arm-for-ramps-simple-32-bit-upgrade)|[LPC1768 ARM-Cortex M3](http://www.nxp.com/products/microcontrollers-and-processors/arm-based-processors-and-mcus/lpc-cortex-m-mcus/lpc1700-cortex-m3/512kb-flash-64kb-sram-ethernet-usb-lqfp100-package:LPC1768FBD100)|100MHz|512k|32+16+16k|3.3-5V|no + [MKS SBASE](http://forums.reprap.org/read.php?13,499322)|LPC1768 ARM-Cortex M3|100MHz|512k|32+16+16k|3.3-5V|no + [Azteeg X5 GT](https://www.panucatt.com/azteeg_X5_GT_reprap_3d_printer_controller_p/ax5gt.htm)|LPC1769 ARM-Cortex M3|120MHz|512k|32+16+16k|3.3-5V|no + [Selena Compact](https://github.com/Ales2-k/Selena)|LPC1768 ARM-Cortex M3|100MHz|512k|32+16+16k|3.3-5V|no + [Teensy 3.5](https://www.pjrc.com/store/teensy35.html)|ARM-Cortex M4|120MHz|512k|192k|3.3-5V|yes + [Teensy 3.6](https://www.pjrc.com/store/teensy36.html)|ARM-Cortex M4|180MHz|1M|256k|3.3V|yes + +### HALs in Development + + name|processor|speed|flash|sram|logic|fpu + ----|---------|-----|-----|----|-----|--- + [STEVAL-3DP001V1](http://www.st.com/en/evaluation-tools/steval-3dp001v1.html)|[STM32F401VE Arm-Cortex M4](http://www.st.com/en/microcontrollers/stm32f401ve.html)|84MHz|512k|64+32k|3.3-5V|yes + [Smoothieboard](http://reprap.org/wiki/Smoothieboard)|LPC1769 ARM-Cortex M3|120MHz|512k|64k|3.3-5V|no + [Adafruit Grand Central M4](https://www.adafruit.com/product/4064)|ARM-Cortex M4|120MHz|1M|256k|3.3V|yes + +## Submitting Patches + +Proposed patches should be submitted as a Pull Request against the ([bugfix-2.0.x](https://github.com/MarlinFirmware/Marlin/tree/bugfix-2.0.x)) branch. + +- This branch is for fixing bugs and integrating any new features for the duration of the Marlin 2.0.x life-cycle. +- Follow the [Coding Standards](http://marlinfw.org/docs/development/coding_standards.html) to gain points with the maintainers. +- Please submit your questions and concerns to the [Issue Queue](https://github.com/MarlinFirmware/Marlin/issues). + +### [RepRap.org Wiki Page](http://reprap.org/wiki/Marlin) + +## Credits + +The current Marlin dev team consists of: - Scott Lahteine [[@thinkyhead](https://github.com/thinkyhead)] - USA   [![Flattr Scott](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=thinkyhead&url=https://github.com/MarlinFirmware/Marlin&title=Marlin&language=&tags=github&category=software) - Roxanne Neufeld [[@Roxy-3D](https://github.com/Roxy-3D)] - USA diff --git a/buildroot/bin/generate_version_header_for_marlin b/buildroot/bin/generate_version_header_for_marlin deleted file mode 100755 index 4310084618..0000000000 --- a/buildroot/bin/generate_version_header_for_marlin +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env bash -# generate_version_header_for_marlin - -DIR="${1}" - -BUILDATE=$(date '+%s') -DISTDATE=$(date '+%Y-%m-%d %H:%M') - -BRANCH=$(git -C "${DIR}" symbolic-ref -q --short HEAD) -VERSION=$(git -C "${DIR}" describe --tags --first-parent 2>/dev/null) - -if [ -z "${BRANCH}" ]; then - BRANCH=$(echo "${TRAVIS_BRANCH}") -fi - -if [ -z "${VERSION}" ]; then - VERSION=$(git -C "${DIR}" describe --tags --first-parent --always 2>/dev/null) -fi - -SHORT_BUILD_VERSION=$(echo "${BRANCH}") -DETAILED_BUILD_VERSION=$(echo "${BRANCH}-${VERSION}") - -# Gets some misc options from their defaults -DEFAULT_MACHINE_UUID=$(awk -F'"' \ - '/#define DEFAULT_MACHINE_UUID/{ print $2 }' < "${DIR}/Version.h") -MACHINE_NAME=$(awk -F'"' \ - '/#define MACHINE_NAME/{ print $2 }' < "${DIR}/Version.h") -PROTOCOL_VERSION=$(awk -F'"' \ - '/#define PROTOCOL_VERSION/{ print $2 }' < "${DIR}/Version.h") -SOURCE_CODE_URL=$(awk -F'"' \ - '/#define SOURCE_CODE_URL/{ print $2 }' < "${DIR}/Version.h") -WEBSITE_URL=$(awk -F'"' \ - '/#define WEBSITE_URL/{ print $2 }' < "${DIR}/Version.h") - -cat > "${DIR}/_Version.h" <>Marlin/Configuration_adv.h" diff --git a/buildroot/bin/opt_disable_adv b/buildroot/bin/opt_disable_adv deleted file mode 100755 index bbb7ca5ae5..0000000000 --- a/buildroot/bin/opt_disable_adv +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -SED=$(which gsed || which sed) - -for opt in "$@" ; do - eval "${SED} -i 's/\([[:blank:]]*\)\(#define \b${opt}\b\)/\1\/\/\2/g' Marlin/Configuration_adv.h" -done diff --git a/buildroot/bin/opt_enable_adv b/buildroot/bin/opt_enable_adv deleted file mode 100755 index 73a9d95415..0000000000 --- a/buildroot/bin/opt_enable_adv +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -SED=$(which gsed || which sed) - -for opt in "$@" ; do - eval "${SED} -i 's/\/\/[[:blank:]]*\(#define \b${opt}\b\)/\1/g' Marlin/Configuration_adv.h" -done diff --git a/buildroot/bin/opt_set_adv b/buildroot/bin/opt_set_adv deleted file mode 100755 index 4c72c4a831..0000000000 --- a/buildroot/bin/opt_set_adv +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -SED=$(which gsed || which sed) - -eval "${SED} -i 's/\(#define \b${1}\b\).*$/\1 ${2}/g' Marlin/Configuration_adv.h" diff --git a/buildroot/share/PlatformIO/boards/BigTree_Btt002.json b/buildroot/share/PlatformIO/boards/BigTree_Btt002.json index 95de3a6bcb..d325747ef7 100644 --- a/buildroot/share/PlatformIO/boards/BigTree_Btt002.json +++ b/buildroot/share/PlatformIO/boards/BigTree_Btt002.json @@ -2,7 +2,7 @@ "build": { "core": "stm32", "cpu": "cortex-m4", - "extra_flags": "-DSTM32F407xx", + "extra_flags": "-DSTM32F4 -DSTM32F407xx -DSTM32F40_41xxx", "f_cpu": "168000000L", "hwids": [ [ @@ -21,34 +21,17 @@ "debug": { "jlink_device": "STM32F407VE", "openocd_target": "stm32f4x", - "svd_path": "STM32F40x.svd", - "tools": { - "stlink": { - "server": { - "arguments": [ - "-f", - "scripts/interface/stlink.cfg", - "-c", - "transport select hla_swd", - "-f", - "scripts/target/stm32f4x.cfg", - "-c", - "reset_config none" - ], - "executable": "bin/openocd", - "package": "tool-openocd" - } - } - } + "svd_path": "STM32F40x.svd" }, "frameworks": [ "arduino", + "cmsis", "stm32cube" ], - "name": "STM32F407VE (64k RAM. 512k Flash)", + "name": "STM32F407VE (192k RAM. 512k Flash)", "upload": { "disable_flushing": false, - "maximum_ram_size": 65536, + "maximum_ram_size": 131072, "maximum_size": 524288, "protocol": "stlink", "protocols": [ @@ -60,6 +43,6 @@ "use_1200bps_touch": false, "wait_for_upload_port": false }, - "url": "http://www.st.com/en/microcontrollers/stm32f407zg.html", + "url": "http://www.st.com/en/microcontrollers/stm32f407ve.html", "vendor": "Generic" } diff --git a/buildroot/share/PlatformIO/boards/BigTree_SKR_Pro.json b/buildroot/share/PlatformIO/boards/BigTree_SKR_Pro.json index ac558fa44c..9a03f3b159 100644 --- a/buildroot/share/PlatformIO/boards/BigTree_SKR_Pro.json +++ b/buildroot/share/PlatformIO/boards/BigTree_SKR_Pro.json @@ -2,7 +2,7 @@ "build": { "core": "stm32", "cpu": "cortex-m4", - "extra_flags": "-DSTM32F407xx", + "extra_flags": "-DSTM32F4 -DSTM32F407xx -DSTM32F40_41xxx", "f_cpu": "168000000L", "hwids": [ [ @@ -21,28 +21,11 @@ "debug": { "jlink_device": "STM32F407ZG", "openocd_target": "stm32f4x", - "svd_path": "STM32F40x.svd", - "tools": { - "stlink": { - "server": { - "arguments": [ - "-f", - "scripts/interface/stlink.cfg", - "-c", - "transport select hla_swd", - "-f", - "scripts/target/stm32f4x.cfg", - "-c", - "reset_config none" - ], - "executable": "bin/openocd", - "package": "tool-openocd" - } - } - } + "svd_path": "STM32F40x.svd" }, "frameworks": [ "arduino", + "cmsis", "stm32cube" ], "name": "STM32F407ZG (192k RAM. 1024k Flash)", diff --git a/buildroot/share/PlatformIO/ldscripts/alfawise_Ux0.ld b/buildroot/share/PlatformIO/ldscripts/longer_STM32.ld similarity index 100% rename from buildroot/share/PlatformIO/ldscripts/alfawise_Ux0.ld rename to buildroot/share/PlatformIO/ldscripts/longer_STM32.ld diff --git a/buildroot/share/PlatformIO/scripts/fysetc_STM32F1.py b/buildroot/share/PlatformIO/scripts/STM32F103R_fysetc.py similarity index 100% rename from buildroot/share/PlatformIO/scripts/fysetc_STM32F1.py rename to buildroot/share/PlatformIO/scripts/STM32F103R_fysetc.py diff --git a/buildroot/share/PlatformIO/scripts/common-cxxflags.py b/buildroot/share/PlatformIO/scripts/common-cxxflags.py new file mode 100644 index 0000000000..3e75434ee7 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/common-cxxflags.py @@ -0,0 +1,12 @@ +# +# common-cxxflags.py +# Convenience script to apply customizations to CPP flags +# +Import("env") +env.Append(CXXFLAGS=[ + "-Wno-register" + #"-Wno-incompatible-pointer-types", + #"-Wno-unused-const-variable", + #"-Wno-maybe-uninitialized", + #"-Wno-sign-compare" +]) diff --git a/buildroot/share/PlatformIO/scripts/alfawise_Ux0.py b/buildroot/share/PlatformIO/scripts/longer_STM32.py similarity index 97% rename from buildroot/share/PlatformIO/scripts/alfawise_Ux0.py rename to buildroot/share/PlatformIO/scripts/longer_STM32.py index e2716a76be..77df4825c1 100644 --- a/buildroot/share/PlatformIO/scripts/alfawise_Ux0.py +++ b/buildroot/share/PlatformIO/scripts/longer_STM32.py @@ -5,7 +5,7 @@ for define in env['CPPDEFINES']: if define[0] == "VECT_TAB_ADDR": env['CPPDEFINES'].remove(define) env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08010000")) -env.Replace(LDSCRIPT_PATH="buildroot/share/PlatformIO/ldscripts/alfawise_Ux0.ld") +env.Replace(LDSCRIPT_PATH="buildroot/share/PlatformIO/ldscripts/longer_STM32.ld") # Rename ${PROGNAME}.bin and save it as 'project.bin' (No encryption on the Longer3D) def encrypt(source, target, env): diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/stm32f4xx_hal_conf.h b/buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/stm32f4xx_hal_conf.h deleted file mode 100644 index 36d69b64c9..0000000000 --- a/buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,481 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf.h - * @brief HAL configuration file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ - /** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ -#define HAL_CRC_MODULE_ENABLED -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -#define HAL_DMA_MODULE_ENABLED -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -#define HAL_FLASH_MODULE_ENABLED -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -/* #define HAL_SMBUS_MODULE_ENABLED */ -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -#define HAL_PWR_MODULE_ENABLED -/* #define HAL_QSPI_MODULE_ENABLED */ -#define HAL_RCC_MODULE_ENABLED -/* #define HAL_RNG_MODULE_ENABLED */ -#define HAL_RTC_MODULE_ENABLED -/* #define HAL_SAI_MODULE_ENABLED */ -#define HAL_SD_MODULE_ENABLED -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -/* #define HAL_UART_MODULE_ENABLED */ -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_CORTEX_MODULE_ENABLED -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ - -/* ########################## HSE/HSI Values adaptation ##################### */ - /** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) -#define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) -#define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - - /** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) -#define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - - /** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) -#define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz -The real value may vary depending on the variations -in voltage and temperature.*/ - /** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) -#define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) -#define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - /** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) -#define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ - /** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ -#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ -#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ -#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ -#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ -#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ -#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ -#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ -#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ -#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ -#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ -#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ -#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */ -#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ -#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ -#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ -#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ -#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ -#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ -#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ -#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ -#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ -#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ -#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ -#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ -#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ -#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ -#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ -#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ -#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ -#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ -#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ -#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ - -/* ########################## Assert Selection ############################## */ - /** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ - /** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED -#include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED -#include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED -#include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED -#include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED -#include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED -#include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED -#include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CAN_LEGACY_MODULE_ENABLED -#include "stm32f4xx_hal_can_legacy.h" -#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED -#include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED -#include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED -#include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED -#include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED -#include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED -#include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED -#include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED -#include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED -#include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED -#include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED -#include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED -#include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED -#include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED -#include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED -#include "stm32f4xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED -#include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED -#include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED -#include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED -#include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED -#include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED -#include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED -#include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED -#include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED -#include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED -#include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED -#include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED -#include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED -#include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED -#include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED -#include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED -#include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED -#include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED -#include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED -#include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED -#include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED -#include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED -#include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED -#include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED -#include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED -#include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT - /** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ -#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ -void assert_failed(uint8_t *file, uint32_t line); -#else -#define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/variant.cpp b/buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/variant.cpp index 167fea510f..1486b21830 100644 --- a/buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/variant.cpp +++ b/buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/variant.cpp @@ -28,7 +28,7 @@ ******************************************************************************* */ -#include "variant.h" +#include "pins_arduino.h" #ifdef __cplusplus extern "C" { @@ -205,8 +205,7 @@ extern "C" { * @param None * @retval None */ -WEAK void SystemClock_Config(void) -{ +WEAK void SystemClock_Config() { RCC_OscInitTypeDef RCC_OscInitStruct; RCC_ClkInitTypeDef RCC_ClkInitStruct; diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/variant.h b/buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/variant.h index 44155d9b02..9b62bb6775 100644 --- a/buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/variant.h +++ b/buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/variant.h @@ -29,11 +29,6 @@ */ #pragma once -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ -#include - #ifdef __cplusplus extern "C" { #endif // __cplusplus @@ -41,21 +36,20 @@ extern "C" { /*---------------------------------------------------------------------------- * Pins *----------------------------------------------------------------------------*/ -extern const PinName digitalPin[]; #ifdef STM32F405RX #define STM32F4X_PIN_NUM 64 //64 pins mcu, 51 gpio #define STM32F4X_GPIO_NUM 51 #define STM32F4X_ADC_NUM 16 -#elif defined STM32F407_5VX +#elif defined(STM32F407_5VX) #define STM32F4X_PIN_NUM 100 //100 pins mcu, 82 gpio #define STM32F4X_GPIO_NUM 82 #define STM32F4X_ADC_NUM 16 -#elif defined STM32F407_5ZX +#elif defined(STM32F407_5ZX) #define STM32F4X_PIN_NUM 144 //144 pins mcu, 114 gpio #define STM32F4X_GPIO_NUM 114 #define STM32F4X_ADC_NUM 24 -#elif defined STM32F407IX +#elif defined(STM32F407IX) #define STM32F4X_PIN_NUM 176 //176 pins mcu, 140 gpio #define STM32F4X_GPIO_NUM 140 #define STM32F4X_ADC_NUM 24 @@ -266,6 +260,9 @@ extern const PinName digitalPin[]; #define PIN_SERIAL_RX PA10 #define PIN_SERIAL_TX PA9 +/* Extra HAL modules */ +#define HAL_PCD_MODULE_ENABLED + #ifdef __cplusplus } // extern "C" #endif diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/stm32f4xx_hal_conf.h b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/stm32f4xx_hal_conf.h index 36d69b64c9..50d59af3bf 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/stm32f4xx_hal_conf.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/stm32f4xx_hal_conf.h @@ -87,11 +87,11 @@ extern "C" { * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#ifndef HSE_VALUE #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ -#if !defined (HSE_STARTUP_TIMEOUT) +#ifndef HSE_STARTUP_TIMEOUT #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ #endif /* HSE_STARTUP_TIMEOUT */ @@ -100,14 +100,14 @@ extern "C" { * This value is used by the RCC HAL module to compute the system frequency * (when HSI is used as system clock source, directly or through the PLL). */ -#if !defined (HSI_VALUE) +#ifndef HSI_VALUE #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ #endif /* HSI_VALUE */ /** * @brief Internal Low Speed oscillator (LSI) value. */ -#if !defined (LSI_VALUE) +#ifndef LSI_VALUE #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz The real value may vary depending on the variations @@ -115,11 +115,11 @@ in voltage and temperature.*/ /** * @brief External Low Speed oscillator (LSE) value. */ -#if !defined (LSE_VALUE) +#ifndef LSE_VALUE #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ #endif /* LSE_VALUE */ -#if !defined (LSE_STARTUP_TIMEOUT) +#ifndef LSE_STARTUP_TIMEOUT #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ #endif /* LSE_STARTUP_TIMEOUT */ @@ -128,7 +128,7 @@ in voltage and temperature.*/ * This value is used by the I2S HAL module to compute the I2S clock source * frequency, this source is inserted directly through I2S_CKIN pad. */ -#if !defined (EXTERNAL_CLOCK_VALUE) +#ifndef EXTERNAL_CLOCK_VALUE #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ #endif /* EXTERNAL_CLOCK_VALUE */ @@ -455,7 +455,7 @@ in voltage and temperature.*/ #endif /* HAL_MMC_MODULE_ENABLED */ /* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT +#ifdef USE_FULL_ASSERT /** * @brief The assert_param macro is used for function's parameters check. * @param expr: If expr is false, it calls assert_failed function diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.cpp index 82a69bcc5a..66190c629d 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.cpp +++ b/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.cpp @@ -109,8 +109,7 @@ extern "C" { * @param None * @retval None */ -WEAK void SystemClock_Config(void) -{ +WEAK void SystemClock_Config() { RCC_OscInitTypeDef RCC_OscInitStruct; RCC_ClkInitTypeDef RCC_ClkInitStruct; diff --git a/buildroot/share/atom/auto_build.py b/buildroot/share/atom/auto_build.py index 0faa8ca0c4..3586676619 100644 --- a/buildroot/share/atom/auto_build.py +++ b/buildroot/share/atom/auto_build.py @@ -95,12 +95,7 @@ print('\nWorking\n') python_ver = sys.version_info[0] # major version - 2 or 3 -if python_ver == 2: - print("python version " + str(sys.version_info[0]) + "." + str(sys.version_info[1]) + "." + str(sys.version_info[2])) -else: - print("python version " + str(sys.version_info[0])) - print("This script only runs under python 2") - exit() +print("python version " + str(sys.version_info[0]) + "." + str(sys.version_info[1]) + "." + str(sys.version_info[2])) import platform current_OS = platform.system() @@ -135,9 +130,9 @@ def get_answer(board_name, cpu_label_txt, cpu_a_txt, cpu_b_txt): if python_ver == 2: - import Tkinter as tk + import Tkinter as tk else: - import tkinter as tk + import tkinter as tk def CPU_exit_3(): # forward declare functions @@ -149,6 +144,7 @@ def get_answer(board_name, cpu_label_txt, cpu_a_txt, cpu_b_txt): kill_session_() root_get_answer = tk.Tk() + root_get_answer.attributes("-topmost", True) root_get_answer.chk_state_1 = 1 # declare variables used by TK and enable @@ -614,9 +610,12 @@ def get_env(board_name, ver_Marlin): # end - get_env # puts screen text into queue so that the parent thread can fetch the data from this thread -import Queue -IO_queue = Queue.Queue() -PIO_queue = Queue.Queue() +if python_ver == 2: + import Queue as queue +else: + import queue as queue +IO_queue = queue.Queue() +#PIO_queue = queue.Queue() not used! def write_to_screen_queue(text, format_tag = 'normal'): double_in = [text, format_tag] IO_queue.put(double_in, block = False) @@ -653,9 +652,6 @@ def line_print(line_input): global warning_continue global line_counter - - - # all '0' elements must precede all '1' elements or they'll be skipped platformio_highlights = [ ['Environment', 0, 'highlight_blue'], @@ -714,7 +710,6 @@ def line_print(line_input): # end - write_to_screen_with_replace - # scan the line line_counter = line_counter + 1 max_search = len(line_input) @@ -809,26 +804,77 @@ def line_print(line_input): # end - line_print +########################################################################## +# # +# run Platformio # +# # +########################################################################## + + +# build platformio run -e target_env +# clean platformio run --target clean -e target_env +# upload platformio run --target upload -e target_env +# traceback platformio run --target upload -e target_env +# program platformio run --target program -e target_env +# test platformio test upload -e target_env +# remote platformio remote run --target upload -e target_env +# debug platformio debug -e target_env + + +def sys_PIO(): + + ########################################################################## + # # + # run Platformio inside the same shell as this Python script # + # # + ########################################################################## + + global build_type + global target_env + + import os + + print('build_type: ', build_type) + print('starting platformio') + + if build_type == 'build': + # pio_result = os.system("echo -en '\033c'") + pio_result = os.system('platformio run -e ' + target_env) + elif build_type == 'clean': + pio_result = os.system('platformio run --target clean -e ' + target_env) + elif build_type == 'upload': + pio_result = os.system('platformio run --target upload -e ' + target_env) + elif build_type == 'traceback': + pio_result = os.system('platformio run --target upload -e ' + target_env) + elif build_type == 'program': + pio_result = os.system('platformio run --target program -e ' + target_env) + elif build_type == 'test': + pio_result = os.system('platformio test upload -e ' + target_env) + elif build_type == 'remote': + pio_result = os.system('platformio remote run --target program -e ' + target_env) + elif build_type == 'debug': + pio_result = os.system('platformio debug -e ' + target_env) + else: + print('ERROR - unknown build type: ', build_type) + raise SystemExit(0) # kill everything + + # stream output from subprocess and split it into lines + #for line in iter(pio_subprocess.stdout.readline, ''): + # line_print(line.replace('\n', '')) + + + # append info used to run PlatformIO + # write_to_screen_queue('\nBoard name: ' + board_name + '\n') # put build info at the bottom of the screen + # write_to_screen_queue('Build type: ' + build_type + '\n') + # write_to_screen_queue('Environment used: ' + target_env + '\n') + # write_to_screen_queue(str(datetime.now()) + '\n') + +# end - sys_PIO + + def run_PIO(dummy): - ########################################################################## - # # - # run Platformio # - # # - ########################################################################## - - - # build platformio run -e target_env - # clean platformio run --target clean -e target_env - # upload platformio run --target upload -e target_env - # traceback platformio run --target upload -e target_env - # program platformio run --target program -e target_env - # test platformio test upload -e target_env - # remote platformio remote run --target upload -e target_env - # debug platformio debug -e target_env - - global build_type global target_env global board_name @@ -892,9 +938,13 @@ def run_PIO(dummy): raise SystemExit(0) # kill everything # stream output from subprocess and split it into lines - for line in iter(pio_subprocess.stdout.readline, ''): - line_print(line.replace('\n', '')) - + if python_ver == 2: + for line in iter(pio_subprocess.stdout.readline, ''): + line_print(line.replace('\n', '')) + else: + for line in iter(pio_subprocess.stdout.readline, b''): + line = line.decode('utf-8') + line_print(line.replace('\n', '')) # append info used to run PlatformIO write_to_screen_queue('\nBoard name: ' + board_name + '\n') # put build info at the bottom of the screen @@ -905,26 +955,27 @@ def run_PIO(dummy): # end - run_PIO + ######################################################################## import time import threading -import Tkinter as tk -import ttk -import Queue +if python_ver == 2: + import Tkinter as tk + import Queue as queue + import ttk + from Tkinter import Tk, Frame, Text, Scrollbar, Menu + #from tkMessageBox import askokcancel this is not used: removed + import tkFileDialog as fileDialog +else: + import tkinter as tk + import queue as queue + from tkinter import ttk, Tk, Frame, Text, Scrollbar, Menu + from tkinter import filedialog import subprocess import sys -que = Queue.Queue() -#IO_queue = Queue.Queue() - -from Tkinter import Tk, Frame, Text, Scrollbar, Menu -from tkMessageBox import askokcancel - -import tkFileDialog -from tkMessageBox import askokcancel -import tkFileDialog - - +que = queue.Queue() +#IO_queue = queue.Queue() class output_window(Text): # based on Super Text @@ -942,6 +993,7 @@ class output_window(Text): self.root = tk.Tk() + self.root.attributes("-topmost", True) self.frame = tk.Frame(self.root) self.frame.pack(fill='both', expand=True) @@ -1128,7 +1180,7 @@ class output_window(Text): def _file_save_as(self): - self.filename = tkFileDialog.asksaveasfilename(defaultextension = '.txt') + self.filename = fileDialog.asksaveasfilename(defaultextension = '.txt') f = open(self.filename, 'w') f.write(self.get('1.0', 'end')) f.close() @@ -1218,24 +1270,24 @@ class output_window(Text): def main(): - ########################################################################## - # # - # main program # - # # - ########################################################################## + ########################################################################## + # # + # main program # + # # + ########################################################################## - global build_type - global target_env - global board_name + global build_type + global target_env + global board_name - board_name, Marlin_ver = get_board_name() + board_name, Marlin_ver = get_board_name() - target_env = get_env(board_name, Marlin_ver) - - os.environ["BUILD_TYPE"] = build_type # let sub processes know what is happening - os.environ["TARGET_ENV"] = target_env - os.environ["BOARD_NAME"] = board_name + target_env = get_env(board_name, Marlin_ver) + # Re-use the VSCode terminal, if possible + if os.environ.get('PLATFORMIO_CALLER', '') == 'vscode': + sys_PIO() + else: auto_build = output_window() auto_build.start_thread() # executes the "run_PIO" function @@ -1243,7 +1295,6 @@ def main(): - if __name__ == '__main__': main() diff --git a/buildroot/share/git/mftest b/buildroot/share/git/mftest index bb08c1976e..a585ae3266 100644 --- a/buildroot/share/git/mftest +++ b/buildroot/share/git/mftest @@ -19,13 +19,19 @@ TESTENV=${1:-'-'} # Allow shorthand for test name case $TESTENV in + tree) platformio run --project-dir . -e include_tree ; exit 1 ;; due) TESTENV='DUE' ;; esp) TESTENV='esp32' ;; lin*) TESTENV='linux_native' ;; lpc?(8)) TESTENV='LPC1768' ;; lpc9) TESTENV='LPC1769' ;; + m128) TESTENV='megaatmega1280' ;; + m256) TESTENV='megaatmega2560' ;; mega) TESTENV='megaatmega2560' ;; - stm) TESTENV='STM32F1' ;; + stm) TESTENV='STM32F103R' ;; + f1) TESTENV='STM32F103R' ;; + f4) TESTENV='STM32F4' ;; + f7) TESTENV='STM32F7' ;; teensy) TESTENV='teensy31' ;; t31) TESTENV='teensy31' ;; t32) TESTENV='teensy31' ;; diff --git a/buildroot/share/sublime/auto_build_sublime_menu/Main.sublime-menu b/buildroot/share/sublime/auto_build_sublime_menu/Main.sublime-menu index b1c34930b4..cd9718bfb7 100644 --- a/buildroot/share/sublime/auto_build_sublime_menu/Main.sublime-menu +++ b/buildroot/share/sublime/auto_build_sublime_menu/Main.sublime-menu @@ -63,4 +63,4 @@ "id": "AutoBuild", "mnemonic": "A" } -] \ No newline at end of file +] diff --git a/buildroot/share/tests/ARMED-tests b/buildroot/share/tests/ARMED-tests new file mode 100644 index 0000000000..44af749a48 --- /dev/null +++ b/buildroot/share/tests/ARMED-tests @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F1 ARMED +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +use_example_configs ArmEd +exec_test $1 $2 "ArmEd Example Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/BIGTREE_BTT002-tests b/buildroot/share/tests/BIGTREE_BTT002-tests new file mode 100644 index 0000000000..45366e3f5a --- /dev/null +++ b/buildroot/share/tests/BIGTREE_BTT002-tests @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F407VET6 BigTreeTech BTT002 +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_BIGTREE_BTT002_V1_0 +opt_set SERIAL_PORT 1 +exec_test $1 $2 "BigTreeTech BTT002 Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/BIGTREE_SKR_PRO-tests b/buildroot/share/tests/BIGTREE_SKR_PRO-tests new file mode 100644 index 0000000000..ef4dc60610 --- /dev/null +++ b/buildroot/share/tests/BIGTREE_SKR_PRO-tests @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F407ZG BigTreeTech SKR Pro +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_BIGTREE_SKR_PRO_V1_1 +opt_set SERIAL_PORT 1 +exec_test $1 $2 "BigTreeTech SKR Pro Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/DUE-tests b/buildroot/share/tests/DUE-tests index bd4263f262..609790b5b8 100644 --- a/buildroot/share/tests/DUE-tests +++ b/buildroot/share/tests/DUE-tests @@ -6,14 +6,34 @@ # exit on first failure set -e -backup_ramps +backup_ramps # pins_set is used below... restore_configs -opt_set MOTHERBOARD BOARD_RAMPS4DUE_EFB EXTENSIBLE_UI EXTUI_EXAMPLE -opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS GCODE_MACROS +opt_set MOTHERBOARD BOARD_RAMPS4DUE_EFB +opt_set TEMP_SENSOR_0 -2 +opt_set TEMP_SENSOR_BED 2 +opt_set GRID_MAX_POINTS_X 16 +opt_set FANMUX0_PIN 53 +opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS GCODE_MACROS \ + PIDTEMPBED FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING \ + EEPROM_SETTINGS SDSUPPORT BINARY_FILE_TRANSFER \ + BLINKM PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \ + NEOPIXEL_LED CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CASE_LIGHT_MENU \ + NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE FILAMENT_RUNOUT_DISTANCE_MM FILAMENT_RUNOUT_SENSOR \ + AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ + SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE CALIBRATION_GCODE \ + BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE BEZIER_CURVE_SUPPORT \ + FWRETRACT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \ + PSU_CONTROL AUTO_POWER_CONTROL \ + SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER \ + PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL \ + EXTENSIBLE_UI +opt_add EXTUI_EXAMPLE opt_set E0_AUTO_FAN_PIN 8 opt_set EXTRUDER_AUTO_FAN_SPEED 100 -exec_test $1 $2 "RAMPS4DUE_EFB with S_CURVE_ACCELERATION, EEPROM_SETTINGS, GCODE_MACROS" +opt_set TEMP_SENSOR_CHAMBER 3 +opt_set HEATER_CHAMBER_PIN 45 +exec_test $1 $2 "RAMPS4DUE_EFB with ABL (Bilinear), EXTENSIBLE_UI, S-Curve, many options." restore_configs opt_set MOTHERBOARD BOARD_RADDS @@ -25,7 +45,7 @@ pins_set ramps/RAMPS X_MAX_PIN -1 pins_set ramps/RAMPS Y_MAX_PIN -1 opt_add Z2_MAX_PIN 2 opt_add Z3_MAX_PIN 3 -exec_test $1 $2 "RADDS with Z_TRIPLE_STEPPER_DRIVERS and Z_STEPPER_AUTO_ALIGN" +exec_test $1 $2 "RADDS with ABL (Bilinear), Z_TRIPLE_STEPPER_DRIVERS and Z_STEPPER_AUTO_ALIGN" # # Test SWITCHING_EXTRUDER diff --git a/buildroot/share/tests/DUE_tests b/buildroot/share/tests/DUE_tests deleted file mode 100644 index a9b4a13598..0000000000 --- a/buildroot/share/tests/DUE_tests +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash -# -# Build tests for DUE (Atmel SAM3X8E ARM Cortex-M3) -# - -# exit on first failure -set -e - -restore_configs -opt_set MOTHERBOARD BOARD_RAMPS4DUE_EFB -opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS -opt_set E0_AUTO_FAN_PIN 8 -opt_set EXTRUDER_AUTO_FAN_SPEED 100 -exec_test $1 $2 "RAMPS4DUE_EFB S_CURVE_ACCELERATION EEPROM_SETTINGS" - -restore_configs -opt_set MOTHERBOARD BOARD_RADDS -opt_enable USE_XMAX_PLUG USE_YMAX_PLUG FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR \ - Z_TRIPLE_STEPPER_DRIVERS Z_TRIPLE_ENDSTOPS Z_STEPPER_AUTO_ALIGN -opt_add Z2_MAX_ENDSTOP_INVERTING false -opt_add Z3_MAX_ENDSTOP_INVERTING false -pins_set RAMPS X_MAX_PIN -1 -pins_set RAMPS Y_MAX_PIN -1 -opt_add Z2_MAX_PIN 2 -opt_add Z3_MAX_PIN 3 -exec_test $1 $2 "Test RADDS with Z_TRIPLE_STEPPER_DRIVERS and Z_STEPPER_AUTO_ALIGN" - -# -# Test SWITCHING_EXTRUDER -# -restore_configs -opt_set MOTHERBOARD BOARD_RAMPS4DUE_EEF -opt_set EXTRUDERS 2 -opt_set NUM_SERVOS 1 -opt_enable SWITCHING_EXTRUDER ULTIMAKERCONTROLLER BEEP_ON_FEEDRATE_CHANGE -exec_test $1 $2 "Test RAMPS4DUE with SWITCHING_EXTRUDER" diff --git a/buildroot/share/tests/LPC1768-tests b/buildroot/share/tests/LPC1768-tests index 26dcf8f70e..e66087a00c 100644 --- a/buildroot/share/tests/LPC1768-tests +++ b/buildroot/share/tests/LPC1768-tests @@ -6,9 +6,12 @@ # exit on first failure set -e -restore_configs -opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB -exec_test $1 $2 "Build Re-ARM Default Configuration" +# +# Build with the default configurations +# +#restore_configs +#opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB +#exec_test $1 $2 "Default Configuration" restore_configs opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB @@ -16,9 +19,9 @@ opt_enable VIKI2 SDSUPPORT SERIAL_PORT2 NEOPIXEL_LED BAUD_RATE_GCODE opt_set NEOPIXEL_PIN P1_16 exec_test $1 $2 "ReARM EFB VIKI2, SDSUPPORT, 2 Serial ports (USB CDC + UART0), NeoPixel" -restore_configs -use_example_configs Mks/Sbase -exec_test $1 $2 "MKS SBASE Example Config" +#restore_configs +#use_example_configs Mks/Sbase +#exec_test $1 $2 "MKS SBASE Example Config" restore_configs opt_set MOTHERBOARD BOARD_MKS_SBASE @@ -44,21 +47,5 @@ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT ADAPTIVE_FAN_ opt_set GRID_MAX_POINTS_X 16 exec_test $1 $2 "Re-ARM with Many Features" -restore_configs -opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB -opt_enable COREYX USE_XMAX_PLUG DAC_MOTOR_CURRENT_DEFAULT \ - REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING \ - AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 EEPROM_SETTINGS \ - FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR FAN_SOFT_PWM \ - SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER FAN_KICKSTART_TIME \ - SD_ABORT_ON_ENDSTOP_HIT ADVANCED_OK GCODE_MACROS \ - VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL \ - EXTRA_FAN_SPEED FWRETRACT Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS \ - MENU_ADDAUTOSTART SDCARD_SORT_ALPHA -opt_set FAN_MIN_PWM 50 -opt_set FAN_KICKSTART_TIME 100 -opt_set XY_FREQUENCY_LIMIT 15 -exec_test $1 $2 "Re-ARM with Many less common options" - # clean up restore_configs diff --git a/buildroot/share/tests/LPC1768_tests b/buildroot/share/tests/LPC1768_tests deleted file mode 100644 index 371619b04d..0000000000 --- a/buildroot/share/tests/LPC1768_tests +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env bash -# -# Build tests for LPC1768 (NXP ARM Cortex-M3) -# - -# exit on first failure -set -e - -restore_configs -opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB -exec_test $1 $2 "Build Re-ARM Default Configuration" - -restore_configs -opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB -opt_enable VIKI2 SDSUPPORT -exec_test $1 $2 "ReARM EFB VIKI2 and SDSUPPORT" - -restore_configs -use_example_configs Mks/Sbase -exec_test $1 $2 "MKS SBASE Example Config" - -restore_configs -use_example_configs Azteeg/X5GT -exec_test $1 $2 "Azteeg X5GT Example Config" - -restore_configs -opt_set MOTHERBOARD BOARD_MKS_SBASE -opt_set EXTRUDERS 2 -opt_set NUM_SERVOS 1 -opt_enable SWITCHING_EXTRUDER ULTIMAKERCONTROLLER -exec_test $1 $2 "MKS_SBASE SWITCHING_EXTRUDER" - -restore_configs -opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EEB -opt_set EXTRUDERS 2 -opt_set TEMP_SENSOR_0 1 -opt_set TEMP_SENSOR_1 5 -opt_set TEMP_SENSOR_BED 1 -opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT \ - FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY \ - FIX_MOUNTED_PROBE Z_SAFE_HOMING AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ - BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ - PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ - ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \ - LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA -opt_set GRID_MAX_POINTS_X 16 -exec_test $1 $2 "MKS SBASE Many Features" - -restore_configs -opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB -opt_enable COREYX USE_XMAX_PLUG DAC_MOTOR_CURRENT_DEFAULT \ - REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING \ - AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 EEPROM_SETTINGS \ - FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR FAN_SOFT_PWM \ - SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER FAN_KICKSTART_TIME \ - ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED ADVANCED_OK \ - VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL \ - EXTRA_FAN_SPEED FWRETRACT Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS \ - MENU_ADDAUTOSTART SDCARD_SORT_ALPHA -opt_set FAN_MIN_PWM 50 -opt_set FAN_KICKSTART_TIME 100 -opt_set XY_FREQUENCY_LIMIT 15 -exec_test $1 $2 "MKS SBASE Many less common options" - -restore_configs -use_example_configs delta/generic -opt_set MOTHERBOARD BOARD_COHESION3D_REMIX -opt_enable AUTO_BED_LEVELING_BILINEAR EEPROM_SETTINGS EEPROM_CHITCHAT -opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -opt_set X_DRIVER_TYPE TMC2130 -opt_set Y_DRIVER_TYPE TMC2130 -opt_set Z_DRIVER_TYPE TMC2130 -opt_enable TMC_USE_SW_SPI MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD TMC_DEBUG \ - SENSORLESS_PROBING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY Z_STALL_SENSITIVITY -exec_test $1 $2 "Delta Config (generic) + BOARD_COHESION3D_REMIX + UBL + EEPROM_SETTINGS + SENSORLESS_PROBING" - -# clean up -restore_configs diff --git a/buildroot/share/tests/LPC1769-tests b/buildroot/share/tests/LPC1769-tests index 831df54f40..8e23551dd4 100644 --- a/buildroot/share/tests/LPC1769-tests +++ b/buildroot/share/tests/LPC1769-tests @@ -6,9 +6,11 @@ # exit on first failure set -e -restore_configs +# +# Build with the default configurations +# use_example_configs Azteeg/X5GT -exec_test $1 $2 "Azteeg X5GT Example Config" +exec_test $1 $2 "Azteeg X5GT Example Configuration" restore_configs opt_set MOTHERBOARD BOARD_SMOOTHIEBOARD @@ -22,34 +24,34 @@ opt_enable VIKI2 SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \ Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE BAUD_RATE_GCODE \ LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA opt_set GRID_MAX_POINTS_X 16 -exec_test $1 $2 "Smoothieboard Many Features" +exec_test $1 $2 "Smoothieboard with many features" -restore_configs -opt_set MOTHERBOARD BOARD_AZTEEG_X5_MINI_WIFI -opt_enable COREYX USE_XMAX_PLUG DAC_MOTOR_CURRENT_DEFAULT \ - REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING \ - AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 EEPROM_SETTINGS \ - FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR FAN_SOFT_PWM \ - SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER FAN_KICKSTART_TIME \ - SD_ABORT_ON_ENDSTOP_HIT ADVANCED_OK GCODE_MACROS BAUD_RATE_GCODE \ - VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL \ - EXTRA_FAN_SPEED FWRETRACT MENU_ADDAUTOSTART SDCARD_SORT_ALPHA -opt_set FAN_MIN_PWM 50 -opt_set FAN_KICKSTART_TIME 100 -opt_set XY_FREQUENCY_LIMIT 15 -exec_test $1 $2 "Azteeg X5 MINI WIFI Many less common options" +#restore_configs +#opt_set MOTHERBOARD BOARD_AZTEEG_X5_MINI_WIFI +#opt_enable COREYX USE_XMAX_PLUG DAC_MOTOR_CURRENT_DEFAULT \ +# REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING \ +# AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 EEPROM_SETTINGS \ +# FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR FAN_SOFT_PWM \ +# SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER FAN_KICKSTART_TIME \ +# SD_ABORT_ON_ENDSTOP_HIT ADVANCED_OK GCODE_MACROS BAUD_RATE_GCODE \ +# VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL \ +# EXTRA_FAN_SPEED FWRETRACT MENU_ADDAUTOSTART SDCARD_SORT_ALPHA +#opt_set FAN_MIN_PWM 50 +#opt_set FAN_KICKSTART_TIME 100 +#opt_set XY_FREQUENCY_LIMIT 15 +#exec_test $1 $2 "Azteeg X5 MINI WIFI Many less common options" restore_configs use_example_configs delta/generic opt_set MOTHERBOARD BOARD_COHESION3D_REMIX -opt_enable AUTO_BED_LEVELING_BILINEAR EEPROM_SETTINGS EEPROM_CHITCHAT BAUD_RATE_GCODE -opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN opt_set X_DRIVER_TYPE TMC2130 opt_set Y_DRIVER_TYPE TMC2130 opt_set Z_DRIVER_TYPE TMC2130 -opt_enable TMC_USE_SW_SPI MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z HYBRID_THRESHOLD TMC_DEBUG \ - SENSORLESS_PROBING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY Z_STALL_SENSITIVITY -exec_test $1 $2 "Delta Config (generic) + BOARD_COHESION3D_REMIX + UBL + EEPROM_SETTINGS + SENSORLESS_PROBING" +opt_enable AUTO_BED_LEVELING_BILINEAR EEPROM_SETTINGS EEPROM_CHITCHAT BAUD_RATE_GCODE \ + TMC_USE_SW_SPI MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z HYBRID_THRESHOLD \ + SENSORLESS_PROBING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY Z_STALL_SENSITIVITY TMC_DEBUG +opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN +exec_test $1 $2 "Cohesion3D Remix DELTA + ABL Bilinear + EEPROM + SENSORLESS_PROBING" # clean up restore_configs diff --git a/buildroot/share/tests/adafruit_grandcentral_m4-tests b/buildroot/share/tests/SAMD51_grandcentral_m4-tests similarity index 54% rename from buildroot/share/tests/adafruit_grandcentral_m4-tests rename to buildroot/share/tests/SAMD51_grandcentral_m4-tests index 453cefc6ce..898a585604 100644 --- a/buildroot/share/tests/adafruit_grandcentral_m4-tests +++ b/buildroot/share/tests/SAMD51_grandcentral_m4-tests @@ -6,9 +6,5 @@ # exit on first failure set -e -restore_configs -opt_set MOTHERBOARD BOARD_AGCM4_RURAMPS4D_13 -exec_test $1 $2 "Build Grand Central M4 Default Configuration" - # clean up restore_configs diff --git a/buildroot/share/tests/STM32F1-tests b/buildroot/share/tests/STM32F103R-tests similarity index 87% rename from buildroot/share/tests/STM32F1-tests rename to buildroot/share/tests/STM32F103R-tests index 30cb4e4fce..519957c470 100644 --- a/buildroot/share/tests/STM32F1-tests +++ b/buildroot/share/tests/STM32F103R-tests @@ -6,8 +6,11 @@ # exit on first failure set -e +# +# Build with the default configurations +# restore_configs -opt_set MOTHERBOARD BOARD_STM32F1R +opt_set MOTHERBOARD BOARD_STM32F103R opt_set EXTRUDERS 2 opt_set SERIAL_PORT -1 opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT \ diff --git a/buildroot/share/tests/STM32F103R_bigtree-tests b/buildroot/share/tests/STM32F103R_bigtree-tests new file mode 100644 index 0000000000..11479feb0d --- /dev/null +++ b/buildroot/share/tests/STM32F103R_bigtree-tests @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F1 Bigtreetech (SKR Mini v1.1) +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_BIGTREE_SKR_MINI_V1_1 +opt_set SERIAL_PORT 1 +opt_set SERIAL_PORT_2 -1 +exec_test $1 $2 "Bigtreetech SKR Mini v1.1 - Basic Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/STM32F103R_fysetc-tests b/buildroot/share/tests/STM32F103R_fysetc-tests new file mode 100644 index 0000000000..ad0f5ea81b --- /dev/null +++ b/buildroot/share/tests/STM32F103R_fysetc-tests @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F1 FYSETC +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +use_example_configs "FYSETC/Cheetah 1.2/base" +exec_test $1 $2 "Cheetah 1.2 Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/alfawise_U20-tests b/buildroot/share/tests/STM32F103V_longer-tests similarity index 100% rename from buildroot/share/tests/alfawise_U20-tests rename to buildroot/share/tests/STM32F103V_longer-tests diff --git a/buildroot/share/tests/STM32F1_tests b/buildroot/share/tests/STM32F1_tests deleted file mode 100644 index 1a503ef114..0000000000 --- a/buildroot/share/tests/STM32F1_tests +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -# -# Build tests for STM32F103RE -# - -# exit on first failure -set -e - -restore_configs -opt_set MOTHERBOARD BOARD_STM32F1R -opt_set EXTRUDERS 2 -opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT \ - PAREN_COMMENTS GCODE_MOTION_MODES SINGLENOZZLE TOOLCHANGE_FILAMENT_SWAP TOOLCHANGE_PARK -exec_test $1 $2 "STM32F1R EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT PAREN_COMMENTS GCODE_MOTION_MODES" - -# cleanup -restore_configs diff --git a/buildroot/share/tests/STM32F4-tests b/buildroot/share/tests/STM32F4-tests new file mode 100644 index 0000000000..b5beb73663 --- /dev/null +++ b/buildroot/share/tests/STM32F4-tests @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F4 disco_f407vg +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +use_example_configs STM32/STM32F4 +exec_test $1 $2 "STM32F4 Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/black_stm32f407ve-tests b/buildroot/share/tests/STM32F407VE_black-tests similarity index 100% rename from buildroot/share/tests/black_stm32f407ve-tests rename to buildroot/share/tests/STM32F407VE_black-tests diff --git a/buildroot/share/tests/STM32F7-tests b/buildroot/share/tests/STM32F7-tests new file mode 100644 index 0000000000..281222f156 --- /dev/null +++ b/buildroot/share/tests/STM32F7-tests @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F7 +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_REMRAM_V1 +opt_set SERIAL_PORT 1 +exec_test $1 $2 "Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/at90usb1286_cdc-tests b/buildroot/share/tests/at90usb1286_cdc-tests new file mode 100644 index 0000000000..812e2ebcae --- /dev/null +++ b/buildroot/share/tests/at90usb1286_cdc-tests @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Build tests for AT90USB1286 ARMED +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_BRAINWAVE_PRO +exec_test $1 $2 "Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/at90usb1286_dfu-tests b/buildroot/share/tests/at90usb1286_dfu-tests new file mode 100644 index 0000000000..7571994ec4 --- /dev/null +++ b/buildroot/share/tests/at90usb1286_dfu-tests @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Build tests for AT90USB1286 ARMED +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_PRINTRBOARD +exec_test $1 $2 "Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/esp32-tests b/buildroot/share/tests/esp32-tests index 42466fddf6..361750141b 100644 --- a/buildroot/share/tests/esp32-tests +++ b/buildroot/share/tests/esp32-tests @@ -6,6 +6,9 @@ # exit on first failure set -e +# +# Build with the default configurations +# restore_configs opt_set MOTHERBOARD BOARD_ESP32 opt_enable WIFISUPPORT GCODE_MACROS BAUD_RATE_GCODE diff --git a/buildroot/share/tests/fysetc_f6_13-tests b/buildroot/share/tests/fysetc_f6_13-tests new file mode 100644 index 0000000000..5ddbac554e --- /dev/null +++ b/buildroot/share/tests/fysetc_f6_13-tests @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Build tests for AVR ATmega FYSETC F6 1.3 +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_FYSETC_F6_13 +exec_test $1 $2 "Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/jgaurora_a5s_a1-tests b/buildroot/share/tests/jgaurora_a5s_a1-tests new file mode 100644 index 0000000000..c6cc9e3f9c --- /dev/null +++ b/buildroot/share/tests/jgaurora_a5s_a1-tests @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F103ZE JGAurora A5S A1 +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +use_example_configs JGAurora/A5S +exec_test $1 $2 "JGAurora/A5S Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/linux_native-tests b/buildroot/share/tests/linux_native-tests index 1ea3fd5bb6..38f531dadc 100644 --- a/buildroot/share/tests/linux_native-tests +++ b/buildroot/share/tests/linux_native-tests @@ -6,6 +6,9 @@ # exit on first failure set -e +# +# Build with the default configurations +# restore_configs opt_set MOTHERBOARD BOARD_LINUX_RAMPS opt_set TEMP_SENSOR_BED 1 diff --git a/buildroot/share/tests/malyanm200-tests b/buildroot/share/tests/malyanm200-tests new file mode 100644 index 0000000000..3856d05866 --- /dev/null +++ b/buildroot/share/tests/malyanm200-tests @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F1 malyanM200 +# + +# exit on first failure +set -e + +use_example_configs Malyan/M200 +exec_test $1 $2 "Default Configuration" + +# cleanup +restore_configs diff --git a/buildroot/share/tests/megaatmega1280-tests b/buildroot/share/tests/megaatmega1280-tests new file mode 100644 index 0000000000..c4ab0f4a71 --- /dev/null +++ b/buildroot/share/tests/megaatmega1280-tests @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +# Build tests for AVR ATmega1280 +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +#restore_configs +#exec_test $1 $2 "Default Configuration" + +# +# Test MESH_BED_LEVELING feature, with LCD +# +restore_configs +opt_enable SPINDLE_FEATURE ULTIMAKERCONTROLLER LCD_BED_LEVELING \ + MESH_BED_LEVELING ENABLE_LEVELING_FADE_HEIGHT MESH_G28_REST_ORIGIN \ + G26_MESH_VALIDATION MESH_EDIT_MENU +exec_test $1 $2 "Spindle, MESH_BED_LEVELING, and LCD" + + +# clean up +restore_configs diff --git a/buildroot/share/tests/megaatmega2560-tests b/buildroot/share/tests/megaatmega2560-tests index 740c17e8b7..fcab51b349 100644 --- a/buildroot/share/tests/megaatmega2560-tests +++ b/buildroot/share/tests/megaatmega2560-tests @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Build tests for AVR +# Build tests for AVR ATmega2560 # # exit on first failure @@ -9,14 +9,15 @@ set -e # # Build with the default configurations # -restore_configs -exec_test $1 $2 "Default Configuration" +#restore_configs +#exec_test $1 $2 "Default Configuration" # # Test 2 extruders (one MAX6675) and heated bed on basic RAMPS 1.4 # Test a "Fix Mounted" Probe with Safe Homing, some arc options, # linear bed leveling, M48, leveling debug, and firmware retraction. # +restore_configs opt_set MOTHERBOARD BOARD_RAMPS_14_EEB opt_set EXTRUDERS 2 opt_set TEMP_SENSOR_0 -2 @@ -30,13 +31,13 @@ opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TE BLINKM PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \ NEOPIXEL_LED CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CASE_LIGHT_MENU \ NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE FILAMENT_RUNOUT_DISTANCE_MM FILAMENT_RUNOUT_SENSOR \ - AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ + AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE \ - BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE \ + BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE BEZIER_CURVE_SUPPORT \ FWRETRACT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \ PSU_CONTROL AUTO_POWER_CONTROL POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE \ SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER \ - PINS_DEBUGGING MAX7219_DEBUG + PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL opt_set TEMP_SENSOR_CHAMBER 3 opt_set HEATER_CHAMBER_PIN 45 exec_test $1 $2 "RAMPS with 2 extruders, RepRap LCD, Linear ABL, LEDs, and many options" @@ -53,12 +54,12 @@ opt_set TEMP_SENSOR_2 5 opt_set TEMP_SENSOR_3 20 opt_set TEMP_SENSOR_4 1000 opt_set TEMP_SENSOR_BED 1 -opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_EDITING ENABLE_LEVELING_FADE_HEIGHT SKEW_CORRECTION \ - REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER LIGHTWEIGHT_UI STATUS_MESSAGE_SCROLLING BOOT_MARLIN_LOGO_SMALL BOOT_MARLIN_LOGO_ANIMATED \ +opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_VALIDATION ENABLE_LEVELING_FADE_HEIGHT SKEW_CORRECTION \ + REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER LIGHTWEIGHT_UI STATUS_MESSAGE_SCROLLING BOOT_MARLIN_LOGO_SMALL \ SDSUPPORT SDCARD_SORT_ALPHA USB_FLASH_DRIVE_SUPPORT SCROLL_LONG_FILENAMES \ EEPROM_SETTINGS EEPROM_CHITCHAT GCODE_MACROS CUSTOM_USER_MENUS \ MULTI_NOZZLE_DUPLICATION JUNCTION_DEVIATION LIN_ADVANCE QUICK_HOME \ - BABYSTEPPING BABYSTEP_XY NANODLP_Z_SYNC I2C_POSITION_ENCODERS + BABYSTEPPING BABYSTEP_XY NANODLP_Z_SYNC I2C_POSITION_ENCODERS M114_DETAIL exec_test $1 $2 "Azteeg X3 Pro with 5 extruders, RRDFGSC, probeless UBL, Linear Advance, and more" # @@ -67,7 +68,7 @@ exec_test $1 $2 "Azteeg X3 Pro with 5 extruders, RRDFGSC, probeless UBL, Linear opt_enable Z_PROBE_SLED SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE opt_set LCD_LANGUAGE jp-kana opt_disable SEGMENT_LEVELED_MOVES -opt_enable BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET DOUBLECLICK_FOR_Z_BABYSTEPPING BABYSTEP_HOTEND_Z_OFFSET BABYSTEP_DISPLAY_TOTAL +opt_enable BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET DOUBLECLICK_FOR_Z_BABYSTEPPING BABYSTEP_HOTEND_Z_OFFSET BABYSTEP_DISPLAY_TOTAL M114_DETAIL exec_test $1 $2 "... Sled Z Probe, Skew, UBL Cartesian moves, Japanese, and Z probe BABYSTEPPING" # @@ -75,19 +76,12 @@ exec_test $1 $2 "... Sled Z Probe, Skew, UBL Cartesian moves, Japanese, and Z pr # ...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES # restore_configs -opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE \ - AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT +opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE BOOT_MARLIN_LOGO_ANIMATED \ + AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL opt_set NUM_SERVOS 1 -opt_enable NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET +opt_enable NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK exec_test $1 $2 "RAMPS with ZONESTAR_LCD, Servo Probe, 3-Point ABL, DEBUG_LEVELING_FEATURE, EEPROM, G38, and more" -# -# Test MESH_BED_LEVELING feature, with LCD -# -restore_configs -opt_enable SPINDLE_FEATURE MESH_BED_LEVELING G26_MESH_EDITING MESH_G28_REST_ORIGIN LCD_BED_LEVELING MESH_EDIT_MENU ULTIMAKERCONTROLLER -exec_test $1 $2 "Spindle, MESH_BED_LEVELING, and LCD" - # # Test MINIRAMBO with PWM_MOTOR_CURRENT and many features # @@ -95,9 +89,9 @@ restore_configs opt_set MOTHERBOARD BOARD_MINIRAMBO opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT \ ULTIMAKERCONTROLLER SDSUPPORT PCA9632 LCD_INFO_MENU \ - AUTO_BED_LEVELING_BILINEAR PROBE_MANUALLY LCD_BED_LEVELING G26_MESH_EDITING MESH_EDIT_MENU \ + AUTO_BED_LEVELING_BILINEAR PROBE_MANUALLY LCD_BED_LEVELING G26_MESH_VALIDATION MESH_EDIT_MENU \ M100_FREE_MEMORY_WATCHER M100_FREE_MEMORY_DUMPER M100_FREE_MEMORY_CORRUPTOR \ - INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS \ + INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT EXPERIMENTAL_I2CBUS \ NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE \ ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE ADVANCED_PAUSE_CONTINUOUS_PURGE FILAMENT_LOAD_UNLOAD_GCODES \ PRINTCOUNTER SERVICE_NAME_1 SERVICE_INTERVAL_1 M114_DETAIL @@ -155,7 +149,7 @@ opt_enable COREYX USE_XMAX_PLUG \ ENDSTOP_INTERRUPTS_FEATURE ENDSTOP_NOISE_THRESHOLD FAN_SOFT_PWM SDSUPPORT \ SWITCHING_TOOLHEAD NUM_SERVOS DEBUG_LEVELING_FEATURE \ SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER \ - SD_ABORT_ON_ENDSTOP_HIT ADVANCED_OK \ + SD_ABORT_ON_ENDSTOP_HIT ADVANCED_OK M114_DETAIL \ VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL \ EXTRA_FAN_SPEED FWRETRACT MENU_ADDAUTOSTART SDCARD_SORT_ALPHA opt_set FAN_MIN_PWM 50 @@ -299,7 +293,7 @@ exec_test $1 $2 "Delta Config (FLSUN AC because it's complex)" # use_example_configs SCARA opt_enable USE_ZMIN_PLUG FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR PAUSE_BEFORE_DEPLOY_STOW \ - EEPROM_SETTINGS EEPROM_CHITCHAT ULTIMAKERCONTROLLER \ + EEPROM_SETTINGS EEPROM_CHITCHAT ULTIMAKERCONTROLLER M114_DETAIL \ MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD SENSORLESS_HOMING SQUARE_WAVE_STEPPING opt_set X_MAX_ENDSTOP_INVERTING false opt_set X_DRIVER_TYPE TMC2209 @@ -321,7 +315,7 @@ opt_set Y_MIN_ENDSTOP_INVERTING true opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER \ MARLIN_BRICKOUT MARLIN_INVADERS MARLIN_SNAKE \ MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD \ - USE_ZMIN_PLUG SENSORLESS_HOMING TMC_DEBUG + USE_ZMIN_PLUG SENSORLESS_HOMING TMC_DEBUG M114_DETAIL exec_test $1 $2 "Mixed TMC configuration, with games!" # diff --git a/buildroot/share/tests/megaatmega2560_tests b/buildroot/share/tests/megaatmega2560_tests deleted file mode 100644 index 6a962796b2..0000000000 --- a/buildroot/share/tests/megaatmega2560_tests +++ /dev/null @@ -1,325 +0,0 @@ -#!/usr/bin/env bash -# -# Build tests for AVR -# - -# exit on first failure -set -e - -# -# Backup pins_RAMPS.h -# -cp Marlin/src/pins/pins_RAMPS.h Marlin/src/pins/pins_RAMPS.h.backup - -# -# Build with the default configurations -# -restore_configs -exec_test $1 $2 "Default Configuration" - -# -# Test 2 extruders (one MAX6675) and heated bed on basic RAMPS 1.4 -# Test a "Fix Mounted" Probe with Safe Homing, some arc options, -# linear bed leveling, M48, leveling debug, and firmware retraction. -# -opt_set MOTHERBOARD BOARD_RAMPS_14_EEB -opt_set EXTRUDERS 2 -opt_set TEMP_SENSOR_0 -2 -opt_set TEMP_SENSOR_1 1 -opt_set TEMP_SENSOR_BED 1 -opt_set POWER_SUPPLY 1 -opt_set GRID_MAX_POINTS_X 16 -opt_enable PIDTEMPBED FIX_MOUNTED_PROBE Z_SAFE_HOMING \ - SDSUPPORT EEPROM_SETTINGS REPRAP_DISCOUNT_SMART_CONTROLLER \ - BLINKM PCA9632 RGB_LED NEOPIXEL_LED AUTO_POWER_CONTROL \ - NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR FILAMENT_RUNOUT_DISTANCE_MM \ - AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ - SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE \ - FWRETRACT ARC_P_CIRCLES ADVANCED_PAUSE_FEATURE CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \ - POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE FAST_FILE_TRANSFER \ - LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST PINS_DEBUGGING \ - MAX7219_DEBUG LED_CONTROL_MENU CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CODEPENDENT_XY_HOMING BACKLASH_COMPENSATION BACKLASH_GCODE -opt_set FANMUX0_PIN 53 -exec_test $1 $2 "RAMPS with 2 extruders, RRDFGSC, Linear ABL, LEDs, and many options" - -# -# Test a probeless build of AUTO_BED_LEVELING_UBL, with lots of extruders -# -use_example_configs AnimationExample -opt_set SHOW_CUSTOM_BOOTSCREEN -opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO -opt_set EXTRUDERS 5 -opt_set TEMP_SENSOR_1 1 -opt_set TEMP_SENSOR_2 5 -opt_set TEMP_SENSOR_3 20 -opt_set TEMP_SENSOR_4 999 -opt_set TEMP_SENSOR_BED 1 -opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_EDITING ENABLE_LEVELING_FADE_HEIGHT SKEW_CORRECTION \ - EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT \ - USB_FLASH_DRIVE_SUPPORT SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES LIGHTWEIGHT_UI \ - CUSTOM_USER_MENUS I2C_POSITION_ENCODERS BABYSTEPPING BABYSTEP_XY LIN_ADVANCE NANODLP_Z_SYNC QUICK_HOME JUNCTION_DEVIATION -exec_test $1 $2 "Azteeg X3 with 5 extruders, RRDFGSC, probeless UBL, Linear Advance, and more" - -# -# Add a Sled Z Probe, use UBL Cartesian moves, use Japanese language -# -opt_enable Z_PROBE_SLED SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE -opt_set LCD_LANGUAGE jp-kana -opt_disable SEGMENT_LEVELED_MOVES -opt_enable BABYSTEP_ZPROBE_OFFSET DOUBLECLICK_FOR_Z_BABYSTEPPING BABYSTEP_HOTEND_Z_OFFSET -exec_test $1 $2 "... Sled Z Probe, Skew, UBL Cartesian moves, Japanese, and Z probe BABYSTEPPING" - -# -# Test a Servo Probe -# ...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES -# -restore_configs -opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE \ - AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT -opt_set NUM_SERVOS 1 -opt_enable NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET -exec_test $1 $2 "RAMPS with ZONESTAR_LCD, Servo Probe, 3-Point ABL, DEBUG_LEVELING_FEATURE, EEPROM, G38, and more" - -# -# Test MESH_BED_LEVELING feature, with LCD -# -restore_configs -opt_enable MESH_BED_LEVELING G26_MESH_EDITING MESH_G28_REST_ORIGIN LCD_BED_LEVELING MESH_EDIT_MENU ULTIMAKERCONTROLLER -exec_test $1 $2 "MESH_BED_LEVELING feature, with LCD" - -# -# Test MINIRAMBO with PWM_MOTOR_CURRENT and many features -# -restore_configs -opt_set MOTHERBOARD BOARD_MINIRAMBO -opt_enable PROBE_MANUALLY AUTO_BED_LEVELING_BILINEAR G26_MESH_EDITING LCD_BED_LEVELING MESH_EDIT_MENU \ - EEPROM_SETTINGS EEPROM_CHITCHAT \ - M100_FREE_MEMORY_WATCHER M100_FREE_MEMORY_DUMPER M100_FREE_MEMORY_CORRUPTOR \ - INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ - ULTIMAKERCONTROLLER SDSUPPORT \ - PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE PCA9632 \ - BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS \ - ADVANCED_PAUSE_FEATURE ADVANCED_PAUSE_CONTINUOUS_PURGE FILAMENT_LOAD_UNLOAD_GCODES PARK_HEAD_ON_PAUSE \ - LCD_INFO_MENU M114_DETAIL -opt_set PWM_MOTOR_CURRENT "{ 1300, 1300, 1250 }" -opt_set I2C_SLAVE_ADDRESS 63 -exec_test $1 $2 "MINIRAMBO for PWM_MOTOR_CURRENT etc" - -# -# Mixing Extruder with 5 steppers, Cyrillic -# -restore_configs -opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO -opt_enable MIXING_EXTRUDER CR10_STOCKDISPLAY -opt_set MIXING_STEPPERS 5 -opt_set LCD_LANGUAGE ru -exec_test $1 $2 "Mixing Extruder with 5 steppers, Cyrillic" - -# -# Test DUAL_X_CARRIAGE -# -restore_configs -opt_set MOTHERBOARD BOARD_RUMBA -opt_set EXTRUDERS 2 -opt_set TEMP_SENSOR_1 1 -opt_enable USE_XMAX_PLUG DUAL_X_CARRIAGE -exec_test $1 $2 "DUAL_X_CARRIAGE" - -# -# Test SPEAKER with BOARD_BQ_ZUM_MEGA_3D and BQ_LCD_SMART_CONTROLLER -# -#restore_configs -#opt_set MOTHERBOARD BOARD_BQ_ZUM_MEGA_3D -#opt_set LCD_FEEDBACK_FREQUENCY_DURATION_MS 10 -#opt_set LCD_FEEDBACK_FREQUENCY_HZ 100 -#opt_enable BQ_LCD_SMART_CONTROLLER SPEAKER - -# -# Enable COREXY -# -#restore_configs -#opt_enable COREXY -#exec_test $1 $2 "Stuff" - -# -# Test many less common options -# -restore_configs -opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO -opt_set EXTRUDERS 2 -opt_set TEMP_SENSOR_1 -4 -opt_set SERVO_DELAY "{ 300, 300, 300 }" -opt_enable COREYX USE_XMAX_PLUG \ - REPRAP_DISCOUNT_SMART_CONTROLLER BABYSTEPPING DAC_MOTOR_CURRENT_DEFAULT \ - FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR \ - ENDSTOP_INTERRUPTS_FEATURE ENDSTOP_NOISE_THRESHOLD FAN_SOFT_PWM SDSUPPORT \ - SWITCHING_TOOLHEAD NUM_SERVOS DEBUG_LEVELING_FEATURE \ - SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER \ - ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED ADVANCED_OK \ - VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL \ - EXTRA_FAN_SPEED FWRETRACT Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS \ - MENU_ADDAUTOSTART SDCARD_SORT_ALPHA -opt_set FAN_MIN_PWM 50 -opt_set FAN_KICKSTART_TIME 100 -opt_set XY_FREQUENCY_LIMIT 15 -exec_test $1 $2 "Many less common options" - -######## Other Standard LCD/Panels ############## -# -# ULTRA_LCD -# -#restore_configs -#opt_enable ULTRA_LCD -#exec_test $1 $2 "Stuff" -# -# DOGLCD -# -#restore_configs -#opt_enable DOGLCD -#exec_test $1 $2 "Stuff" -# -# MAKRPANEL -# Needs to use Melzi and Sanguino hardware -# -#restore_configs -#opt_enable MAKRPANEL -#exec_test $1 $2 "Stuff" -# -# REPRAP_DISCOUNT_SMART_CONTROLLER, SDSUPPORT, BABYSTEPPING, RIGIDBOARD_V2, and DAC_MOTOR_CURRENT_DEFAULT -# -#restore_configs -#opt_set MOTHERBOARD BOARD_RIGIDBOARD_V2 -#opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING DAC_MOTOR_CURRENT_DEFAULT -#exec_test $1 $2 "Stuff" -# # -# G3D_PANEL with SDCARD_SORT_ALPHA and STATUS_MESSAGE_SCROLLING -# -#restore_configs -#opt_enable G3D_PANEL SDSUPPORT SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES -#opt_set SDSORT_GCODE true -#opt_set SDSORT_USES_RAM true -#opt_set SDSORT_USES_STACK true -#opt_set SDSORT_CACHE_NAMES true -#exec_test $1 $2 "Stuff" -# -# REPRAPWORLD_KEYPAD -# -# Cant find configuration details to get it to compile -#restore_configs -#opt_enable ULTRA_LCD REPRAPWORLD_KEYPAD REPRAPWORLD_KEYPAD_MOVE_STEP -#exec_test $1 $2 "Stuff" -# -# RA_CONTROL_PANEL -# -#restore_configs -#opt_enable RA_CONTROL_PANEL PINS_DEBUGGING -#exec_test $1 $2 "Stuff" - -######## I2C LCD/PANELS ############## -# -# !!!ATTENTION!!! -# Most I2C configurations are failing at the moment because they require -# a different Liquid Crystal library "LiquidTWI2". -# -# LCD_SAINSMART_I2C_1602 -# -#restore_configs -#opt_enable LCD_SAINSMART_I2C_1602 -#exec_test $1 $2 "Stuff" -# -# LCD_I2C_PANELOLU2 -# -#restore_configs -#opt_enable LCD_I2C_PANELOLU2 -#exec_test $1 $2 "Stuff" -# -# LCD_I2C_VIKI -# -#restore_configs -#opt_enable LCD_I2C_VIKI -#exec_test $1 $2 "Stuff" -# -# LCM1602 -# -#restore_configs -#opt_enable LCM1602 -#exec_test $1 $2 "Stuff" - -# -# Language files test with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER -# -#restore_configs -#opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT -#for lang in an bg ca zh_CN zh_TW cz da de el el-gr en es eu fi fr gl hr it jp-kana nl pl pt pt-br ru sk tr uk test; do opt_set LCD_LANGUAGE $lang; echo "compile with language $lang ..."; exec_test $1 $2 "Stuff"; done -# -#restore_configs -#opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT -#for lang in an bg ca zh_CN zh_TW cz da de el el-gr en es eu fi fr gl hr it jp-kana nl pl pt pt-br ru sk tr uk test; do opt_set LCD_LANGUAGE $lang; echo "compile with language $lang ..."; exec_test $1 $2 "Stuff"; done - -######## Example Configurations ############## -# -# Test a full-featured CR-10S config -# -use_example_configs Creality/CR-10S -opt_enable SHOW_CUSTOM_BOOTSCREEN -exec_test $1 $2 "Full-featured CR-10S config" -# -# BQ Hephestos 2 -#restore_configs -#use_example_configs Hephestos_2 -#exec_test $1 $2 "Stuff" -# -# Delta Config (generic) + ABL bilinear + PROBE_MANUALLY -use_example_configs delta/generic -opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER DELTA_CALIBRATION_MENU AUTO_BED_LEVELING_BILINEAR PROBE_MANUALLY -exec_test $1 $2 "Delta Config (generic) + ABL bilinear + PROBE_MANUALLY" -# -# Delta Config (generic) + UBL + ALLEN_KEY + OLED_PANEL_TINYBOY2 + EEPROM_SETTINGS -# -use_example_configs delta/generic -opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 Z_PROBE_ALLEN_KEY EEPROM_SETTINGS EEPROM_CHITCHAT \ - OLED_PANEL_TINYBOY2 MESH_EDIT_GFX_OVERLAY -exec_test $1 $2 "Delta Config (generic) + UBL + ALLEN_KEY + OLED_PANEL_TINYBOY2 + EEPROM_SETTINGS" -# -# Delta Config (FLSUN AC because it's complex) -# -use_example_configs delta/FLSUN/auto_calibrate -exec_test $1 $2 "Delta Config (FLSUN AC because it's complex)" -# -# Makibox Config need to check board type for Teensy++ 2.0 -# -#use_example_configs makibox -#exec_test $1 $2 "Stuff" -# -# SCARA with TMC2130 -# -use_example_configs SCARA -opt_enable USE_ZMIN_PLUG FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR PAUSE_BEFORE_DEPLOY_STOW \ - EEPROM_SETTINGS EEPROM_CHITCHAT ULTIMAKERCONTROLLER \ - MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD SENSORLESS_HOMING -opt_set X_DRIVER_TYPE TMC2130 -opt_set Y_DRIVER_TYPE TMC2130 -opt_set Z_DRIVER_TYPE TMC2130 -opt_set E0_DRIVER_TYPE TMC2130 -exec_test $1 $2 "SCARA with TMC2130" -# -# TMC2208 Config -# -restore_configs -opt_set X_DRIVER_TYPE TMC2208 -opt_set Y_DRIVER_TYPE TMC2208 -opt_set Z_DRIVER_TYPE TMC2208 -opt_set E0_DRIVER_TYPE TMC2208 -opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -opt_enable REPRAPWORLD_KEYPAD MONITOR_DRIVER_STATUS STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD TMC_DEBUG -exec_test $1 $2 "TMC2208 Config" -# -# tvrrug Config need to check board type for sanguino atmega644p -# -#use_example_configs tvrrug/Round2 -#exec_test $1 $2 "Stuff" -# -# - -# clean up -restore_configs diff --git a/buildroot/share/tests/mks_robin-tests b/buildroot/share/tests/mks_robin-tests new file mode 100644 index 0000000000..99d41ef4ad --- /dev/null +++ b/buildroot/share/tests/mks_robin-tests @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F1 genericSTM32F103ZE +# + +# exit on first failure +set -e + +use_example_configs Mks/Robin +exec_test $1 $2 "Default Configuration" + +# cleanup +restore_configs diff --git a/buildroot/share/tests/mks_robin_lite-tests b/buildroot/share/tests/mks_robin_lite-tests new file mode 100644 index 0000000000..a50d7347f5 --- /dev/null +++ b/buildroot/share/tests/mks_robin_lite-tests @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F1 genericSTM32F103RC +# + +# exit on first failure +set -e + +use_example_configs Mks/Robin +opt_set MOTHERBOARD BOARD_MKS_ROBIN_LITE +opt_set EXTRUDERS 1 +opt_set TEMP_SENSOR_1 0 +opt_disable FSMC_GRAPHICAL_TFT +exec_test $1 $2 "Default Configuration" + +# cleanup +restore_configs diff --git a/buildroot/share/tests/mks_robin_mini-tests b/buildroot/share/tests/mks_robin_mini-tests new file mode 100644 index 0000000000..c8ba5a5a48 --- /dev/null +++ b/buildroot/share/tests/mks_robin_mini-tests @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F1 genericSTM32F103VE +# + +# exit on first failure +set -e + +use_example_configs Mks/Robin +opt_set MOTHERBOARD BOARD_MKS_ROBIN_MINI +opt_set EXTRUDERS 1 +opt_set TEMP_SENSOR_1 0 +exec_test $1 $2 "Default Configuration" + +# cleanup +restore_configs diff --git a/buildroot/share/tests/mks_robin_nano-tests b/buildroot/share/tests/mks_robin_nano-tests new file mode 100644 index 0000000000..809fd6e6f5 --- /dev/null +++ b/buildroot/share/tests/mks_robin_nano-tests @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# +# Build tests for STM32F1 genericSTM32F103VE +# + +# exit on first failure +set -e + +use_example_configs Mks/Robin +opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO +exec_test $1 $2 "Default Configuration" + +# cleanup +restore_configs diff --git a/buildroot/share/tests/rambo-tests b/buildroot/share/tests/rambo-tests new file mode 100644 index 0000000000..649a0801dc --- /dev/null +++ b/buildroot/share/tests/rambo-tests @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# +# Build tests for AVR ATmega2560 RAMBo +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_EINSY_RAMBO +opt_set X_DRIVER_TYPE TMC2130 +opt_set Y_DRIVER_TYPE TMC2130 +opt_set Z_DRIVER_TYPE TMC2130 +opt_set E0_DRIVER_TYPE TMC2130 +exec_test $1 $2 "Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/sanguino_atmega1284p-tests b/buildroot/share/tests/sanguino_atmega1284p-tests new file mode 100644 index 0000000000..7181f961c4 --- /dev/null +++ b/buildroot/share/tests/sanguino_atmega1284p-tests @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Build tests for AVR ATmega 1284p +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_SANGUINOLOLU_12 +exec_test $1 $2 "Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/sanguino_atmega644p-tests b/buildroot/share/tests/sanguino_atmega644p-tests new file mode 100644 index 0000000000..41626b23f7 --- /dev/null +++ b/buildroot/share/tests/sanguino_atmega644p-tests @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Build tests for AVR ATmega 644p +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +restore_configs +opt_set MOTHERBOARD BOARD_SANGUINOLOLU_12 +exec_test $1 $2 "Default Configuration" + +# clean up +restore_configs diff --git a/buildroot/share/tests/start_tests b/buildroot/share/tests/start_tests deleted file mode 100644 index 53c24f44d8..0000000000 --- a/buildroot/share/tests/start_tests +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash -export PATH="$PATH:$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )" -export PATH="$PATH:./buildroot/bin" - -# exit on first failure -set -e - -exec_test () { - printf "\033[0;32m[Test $2] \033[0m$3... " - if build_marlin_pio $1 "-e $2"; then - printf "\033[0;32mPassed\033[0m\n" - return 0 - else - env_restore - printf "\033[0;31mFailed!\033[0m\n" - return 1 - fi -} -export -f exec_test - -env_backup -printf "Running \033[0;32m$2\033[0m Tests\n" - -if [[ $3 = "--deep-clean" ]]; then - echo "Deleting all PlatformIO caches, downloads and installed packages..." - env_clean --deep -fi - -if [[ $2 = "ALL" ]]; then - dir_list=("$(dirname "${BASH_SOURCE[0]}")"/*) - declare -a tests=(${dir_list[@]/*start_tests/}) - for f in "${tests[@]}"; do - testenv=$(basename $f | cut -d"_" -f1) - printf "Running \033[0;32m$f\033[0m Tests\n" - exec_test $1 "$testenv --target clean" "Setup Build Environment" - $f $1 $testenv - done -else - exec_test $1 "$2 --target clean" "Setup Build Environment" - $2_tests $1 $2 -fi -printf "\033[0;32mAll tests completed successfully\033[0m\n" -env_restore diff --git a/buildroot/share/tests/teensy35_tests b/buildroot/share/tests/teensy35_tests deleted file mode 100644 index 053ad97a43..0000000000 --- a/buildroot/share/tests/teensy35_tests +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env bash -# -# Build tests for Teensy 3.5/3.6 (ARM Cortex-M4) -# - -# exit on first failure -set -e - -restore_configs -opt_set MOTHERBOARD BOARD_TEENSY35_36 -cp Marlin/src/pins/pins_RAMPS.h Marlin/src/pins/pins_RAMPS.h.backup -exec_test $1 $2 "Teensy3.5 with default config" - -# -# Test as many features together as possible -# -restore_configs -opt_set EXTRUDERS 2 -opt_set TEMP_SENSOR_0 1 -opt_set TEMP_SENSOR_1 5 -opt_set TEMP_SENSOR_BED 1 -opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT \ - FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY \ - FIX_MOUNTED_PROBE Z_SAFE_HOMING AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ - BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ - PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT M100_FREE_MEMORY_WATCHER \ - ADVANCED_PAUSE_FEATURE LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA PARK_HEAD_ON_PAUSE -opt_set I2C_SLAVE_ADDRESS 63 -opt_set GRID_MAX_POINTS_X 16 -exec_test $1 $2 "Teensy3.5 with many features" - -# -# Test a Sled Z Probe with Linear leveling -# -restore_configs -opt_enable EEPROM_SETTINGS Z_PROBE_SLED AUTO_BED_LEVELING_LINEAR DEBUG_LEVELING_FEATURE GCODE_MACROS -exec_test $1 $2 "Sled Z Probe with Linear leveling" - -# -# Test a Servo Probe -# -# restore_configs -# opt_enable Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE \ -# AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS -# opt_set NUM_SERVOS 1 -# exec_test $1 $2 "Servo Probe" -# -# ...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES -# -# opt_enable AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS \ -# EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES -# exec_test $1 $2 "...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES" - -# -# Test MESH_BED_LEVELING feature, with LCD -# -restore_configs -opt_enable MESH_BED_LEVELING MESH_G28_REST_ORIGIN MANUAL_BED_LEVELING ULTIMAKERCONTROLLER -exec_test $1 $2 "MESH_BED_LEVELING feature, with LCD" - -# -# Mixing Extruder -# -restore_configs -opt_enable MIXING_EXTRUDER DIRECT_MIXING_IN_G1 -opt_set MIXING_STEPPERS 2 -exec_test $1 $2 "Mixing Extruder" - -# -# Test SWITCHING_EXTRUDER -# -# restore_configs -# opt_set EXTRUDERS 2 -# opt_set NUM_SERVOS 1 -# opt_enable SWITCHING_EXTRUDER ULTIMAKERCONTROLLER -# exec_test $1 $2 "SWITCHING_EXTRUDER" -# -# Enable COREXY -# -restore_configs -opt_enable COREXY -exec_test $1 $2 "COREXY" - -# -# Enable COREXZ -# -restore_configs -opt_enable COREXZ -exec_test $1 $2 "COREXZ" - -# -# Enable Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS -# -restore_configs -opt_enable Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS -pins_set RAMPS X_MAX_PIN -1 -opt_add Z2_MAX_PIN 2 -opt_enable USE_XMAX_PLUG -exec_test $1 $2 "Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS" - -# Clean up -restore_configs diff --git a/buildroot/share/vscode/AutoBuildMarlin/README.md b/buildroot/share/vscode/AutoBuildMarlin/README.md index e3e9323f52..24123db9db 100644 --- a/buildroot/share/vscode/AutoBuildMarlin/README.md +++ b/buildroot/share/vscode/AutoBuildMarlin/README.md @@ -1,52 +1,40 @@ -# Auto Build support for Visual Studio Code -This `Visual Studio Code` extension provides access to the `Auto Build` script. +# Auto Build Marlin -## Installation +"AutoBuildMarlin" is a *Visual Studio Code* extension that provides a one-button interface to build and upload Marlin Firmware to your selected `MOTHERBOARD`, removing the need to edit your `platformio.ini` file or scroll through a long list of Marlin environments. -Get the MarlinFirmware repository from GitHub. Open the directory `buildroot/share/vscode` and copy the `AutoBuildMarlin` folder to the `Visual Studio Code` extension directory. Relaunch `Visual Studio Code` to complete the installation. +## Get PlatformIO -To find the `Visual Studio Code` extension directory: +Before you install AutoBuildMarlin you'll first need to [Install PlatformIO in VSCode](http://marlinfw.org/docs/basics/install_platformio_vscode.html). Once you have followed these instructions, continue below. -- Windows - Use Windows Explorer's address bar to open `C:/Users/USERNAME/.vscode/extensions`. -- Mac - Use the Finder's `Go` menu to open `~/.vscode/extensions`. -- Linux - In the Terminal type `open ~/.vscode/extensions`. +## Installing This Extension -### 3. Install the PlatformIO extension -Click on `View` > `Command Palette...` +- [Download Marlin Firmware](http://marlinfw.org/meta/download/) and unzip it to your documents folder. +- Open the directory `buildroot/share/vscode` and copy the "`AutoBuildMarlin`" folder to **the *Visual Studio Code* `extensions` directory**. +- Relaunch *Visual Studio Code* to complete the installation. -![](./resources/view_command_palette.png) +### To find your `extensions` directory: -Find and click on `Extensions: Install Extensions` - -![](./resources/install_extensions.png) - -Type `platformio` into the search box and click on `Install` under `PlatformIO IDE`. - -![](./resources/platformio_install.png) +- **Windows** - Use Windows Explorer's address bar to open `C:/Users/USERNAME/.vscode/extensions`. +- **Mac** - Use the Finder's `Go` menu to open `~/.vscode/extensions`. +- **Linux** - In the Terminal type `open ~/.vscode/extensions`. ## Usage -This extension adds the Auto Build icon ![](./media/AB.svg) to the Activities bar. +- Open up the downloaded *Marlin Firmware* project folder (***NOT the "Marlin" folder within***) in *Visual Studio Code*. (You may also use the **Import Project…** option from the "PlaformIO Home" page.) -### 1. Open the Marlin folder -Click on `File` > `Open Folder...` +- With Marlin open, the "File Explorer" should be firmly rooted in your Marlin Firmware folder: -![](./resources/Open_Folder.png) + ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/Activity_bar.png) -This brings up the `Open Folder` dialog. Select the folder that has the `platformio.ini` file in it. +- Click the **Marlin Auto Build** icon ![AutoBuild Icon](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/AB_icon.png) in the Activities Bar (on the left side of *Visual Studio Code* window) to bring up the **Marlin Auto Build** options bar. -![](./resources/Open_Marlin.png) + ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/AB_menu.png) -You should see something like the following. If not, click on the Explorer icon in the Activities bar. +- Click one of the four icons -![](./resources/Activity_bar.png) - -### 2. Click on the Auto Build Icon ![](./media/AB.svg) -This brings up the Auto Build menu icon bar. -![](./resources/AB_menu.png) - -### 3. Click on one of the four icons -- ![](./resources/B_small.svg) - Clicking on it starts `PIO Build` -- ![](./resources/C_small.svg) - Clicking on it starts `PIO Clean` -- ![](./resources/U_small.svg) - Clicking on it starts `PIO Upload` -- ![](./resources/Ut_small.svg) - Clicking on it starts `PIO Upload (traceback)` + Icon|Action + ----|------ + ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/B_small.png)|Start **PIO Build** to test your Marlin build + ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/C_small.png)|Start **PIO Clean** to delete old build files + ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/U_small.png)|Start **PIO Upload** to install Marlin on your board + ![](https://github.com/MarlinFirmware/Marlin/raw/bugfix-2.0.x/buildroot/share/vscode/AutoBuildMarlin/img/T_small.png)|Start **PIO Upload (traceback)** to install Marlin with debugging diff --git a/buildroot/share/vscode/AutoBuildMarlin/img/AB_icon.png b/buildroot/share/vscode/AutoBuildMarlin/img/AB_icon.png new file mode 100644 index 0000000000..951fee8db6 Binary files /dev/null and b/buildroot/share/vscode/AutoBuildMarlin/img/AB_icon.png differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/img/AB_menu.png b/buildroot/share/vscode/AutoBuildMarlin/img/AB_menu.png new file mode 100644 index 0000000000..39afa92261 Binary files /dev/null and b/buildroot/share/vscode/AutoBuildMarlin/img/AB_menu.png differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/img/Activity_bar.png b/buildroot/share/vscode/AutoBuildMarlin/img/Activity_bar.png new file mode 100644 index 0000000000..db049a8530 Binary files /dev/null and b/buildroot/share/vscode/AutoBuildMarlin/img/Activity_bar.png differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/img/B_small.png b/buildroot/share/vscode/AutoBuildMarlin/img/B_small.png new file mode 100644 index 0000000000..840d06e11e Binary files /dev/null and b/buildroot/share/vscode/AutoBuildMarlin/img/B_small.png differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/img/C_small.png b/buildroot/share/vscode/AutoBuildMarlin/img/C_small.png new file mode 100644 index 0000000000..9f5630e428 Binary files /dev/null and b/buildroot/share/vscode/AutoBuildMarlin/img/C_small.png differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/img/T_small.png b/buildroot/share/vscode/AutoBuildMarlin/img/T_small.png new file mode 100644 index 0000000000..70af1ca391 Binary files /dev/null and b/buildroot/share/vscode/AutoBuildMarlin/img/T_small.png differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/img/U_small.png b/buildroot/share/vscode/AutoBuildMarlin/img/U_small.png new file mode 100644 index 0000000000..35c87b1c6c Binary files /dev/null and b/buildroot/share/vscode/AutoBuildMarlin/img/U_small.png differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/logo.svg b/buildroot/share/vscode/AutoBuildMarlin/logo.svg new file mode 100644 index 0000000000..54956b4f15 --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/logo.svg @@ -0,0 +1,111 @@ + + + +Marlin Firmware image/svg+xmlMarlin Firmware Ahmet Cem TURANJoão BrázioMarlinFirmwaremarlin-logo-new + + \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/media/AB.svg b/buildroot/share/vscode/AutoBuildMarlin/media/AB.svg deleted file mode 100644 index ac6dbb8a9a..0000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/media/AB.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - VScode view icon - - Layer 2 - AB - - - Layer 1 - - - \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/package-lock.json b/buildroot/share/vscode/AutoBuildMarlin/package-lock.json index 6933834984..9b333093a4 100644 --- a/buildroot/share/vscode/AutoBuildMarlin/package-lock.json +++ b/buildroot/share/vscode/AutoBuildMarlin/package-lock.json @@ -1,6 +1,6 @@ { "name": "auto-build", - "version": "0.1.0", + "version": "2.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/buildroot/share/vscode/AutoBuildMarlin/package.json b/buildroot/share/vscode/AutoBuildMarlin/package.json index 3bff1098d7..ac30b225e3 100644 --- a/buildroot/share/vscode/AutoBuildMarlin/package.json +++ b/buildroot/share/vscode/AutoBuildMarlin/package.json @@ -2,8 +2,9 @@ "name": "auto-build", "displayName": "Auto Build Marlin", "description": "Auto Build Marlin for VS code", - "version": "0.1.0", + "version": "2.0.0", "publisher": "marlinfirmware", + "icon": "logo.svg", "engines": { "vscode": "^1.23.0" }, @@ -24,7 +25,7 @@ { "id": "auto-build", "title": "Auto Build Marlin", - "icon": "media/AB.svg" + "icon": "resources/AB.svg" } ] }, @@ -40,22 +41,34 @@ { "command": "piobuild", "title": "PIO Build", - "icon": "resources/B32x32_white.svg" - }, - { - "command": "pioclean", - "title": "PIO Clean", - "icon": "resources/C32x32_white.svg" + "icon": { + "light": "resources/B48x48_light.svg", + "dark": "resources/B48x48_dark.svg" + } }, { "command": "pioupload", "title": "PIO Upload", - "icon": "resources/U32x32_white.svg" + "icon": { + "light": "resources/U48x48_light.svg", + "dark": "resources/U48x48_dark.svg" + } }, { "command": "piotraceback", "title": "PIO Upload (traceback)", - "icon": "resources/Ut32x32_white.svg" + "icon": { + "light": "resources/T48x48_light.svg", + "dark": "resources/T48x48_dark.svg" + } + }, + { + "command": "pioclean", + "title": "PIO Clean", + "icon": { + "light": "resources/C48x48_light.svg", + "dark": "resources/C48x48_dark.svg" + } } ], "menus": { @@ -65,15 +78,15 @@ "group": "navigation@1" }, { - "command": "pioclean", + "command": "pioupload", "group": "navigation@2" }, { - "command": "pioupload", + "command": "piotraceback", "group": "navigation@3" }, { - "command": "piotraceback", + "command": "pioclean", "group": "navigation@4" } ] diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/AB.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/AB.svg new file mode 100644 index 0000000000..7957276345 --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/AB.svg @@ -0,0 +1,23 @@ + + + + AutoBuildMarlin View + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/AB_menu.png b/buildroot/share/vscode/AutoBuildMarlin/resources/AB_menu.png deleted file mode 100644 index 2cb282c918..0000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/AB_menu.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Activity_bar.png b/buildroot/share/vscode/AutoBuildMarlin/resources/Activity_bar.png deleted file mode 100644 index d78e2c82f4..0000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/Activity_bar.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/B24x24_white.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/B24x24_white.svg deleted file mode 100644 index 1d6c667233..0000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/B24x24_white.svg +++ /dev/null @@ -1 +0,0 @@ -B \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/B32x32_white.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/B32x32_white.svg deleted file mode 100644 index 375b6f5f03..0000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/B32x32_white.svg +++ /dev/null @@ -1 +0,0 @@ -B \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/B48x48_dark.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/B48x48_dark.svg new file mode 100644 index 0000000000..e3b0a4eada --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/B48x48_dark.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/B48x48_light.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/B48x48_light.svg new file mode 100644 index 0000000000..adb6c43add --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/B48x48_light.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/B_small.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/B_small.svg deleted file mode 100644 index c830b2713a..0000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/B_small.svg +++ /dev/null @@ -1 +0,0 @@ -B \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Build.png b/buildroot/share/vscode/AutoBuildMarlin/resources/Build.png deleted file mode 100644 index 86ed4782be..0000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/Build.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/C32x32_white.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/C32x32_white.svg deleted file mode 100644 index 43f93ce040..0000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/C32x32_white.svg +++ /dev/null @@ -1 +0,0 @@ -C \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/C48x48_dark.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/C48x48_dark.svg new file mode 100644 index 0000000000..9cb0e4e0a8 --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/C48x48_dark.svg @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/C48x48_light.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/C48x48_light.svg new file mode 100644 index 0000000000..815ccf2e9a --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/C48x48_light.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/C_small.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/C_small.svg deleted file mode 100644 index f8ee33d7ad..0000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/C_small.svg +++ /dev/null @@ -1 +0,0 @@ -C \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Clean.png b/buildroot/share/vscode/AutoBuildMarlin/resources/Clean.png deleted file mode 100644 index 6ce41877a6..0000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/Clean.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Open_Folder.png b/buildroot/share/vscode/AutoBuildMarlin/resources/Open_Folder.png deleted file mode 100644 index b8ae9ac902..0000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/Open_Folder.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Open_Marlin.png b/buildroot/share/vscode/AutoBuildMarlin/resources/Open_Marlin.png deleted file mode 100644 index aa22232a8e..0000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/Open_Marlin.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/T32x32_white.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/T32x32_white.svg deleted file mode 100644 index fb3e249e8d..0000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/T32x32_white.svg +++ /dev/null @@ -1 +0,0 @@ -T \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/T48x48_dark.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/T48x48_dark.svg new file mode 100644 index 0000000000..b395ac8584 --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/T48x48_dark.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/T48x48_light.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/T48x48_light.svg new file mode 100644 index 0000000000..2b8ade1fa7 --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/T48x48_light.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Traceback.png b/buildroot/share/vscode/AutoBuildMarlin/resources/Traceback.png deleted file mode 100644 index 4ee9f976fb..0000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/Traceback.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/U32x32_white.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/U32x32_white.svg deleted file mode 100644 index 028c9e5474..0000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/U32x32_white.svg +++ /dev/null @@ -1 +0,0 @@ -U \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/U48x48_dark.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/U48x48_dark.svg new file mode 100644 index 0000000000..c1865b7353 --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/U48x48_dark.svg @@ -0,0 +1,26 @@ + + + + + + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/U48x48_light.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/U48x48_light.svg new file mode 100644 index 0000000000..54943240fc --- /dev/null +++ b/buildroot/share/vscode/AutoBuildMarlin/resources/U48x48_light.svg @@ -0,0 +1,26 @@ + + + + + + + + + + diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/U_small.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/U_small.svg deleted file mode 100644 index eb3a431b9d..0000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/U_small.svg +++ /dev/null @@ -1 +0,0 @@ -U \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Upload.png b/buildroot/share/vscode/AutoBuildMarlin/resources/Upload.png deleted file mode 100644 index 8de383e5d1..0000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/Upload.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Ut32x32_white.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/Ut32x32_white.svg deleted file mode 100644 index fc8858ea18..0000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/Ut32x32_white.svg +++ /dev/null @@ -1 +0,0 @@ -Ut \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/Ut_small.svg b/buildroot/share/vscode/AutoBuildMarlin/resources/Ut_small.svg deleted file mode 100644 index accc458a42..0000000000 --- a/buildroot/share/vscode/AutoBuildMarlin/resources/Ut_small.svg +++ /dev/null @@ -1 +0,0 @@ -Ut \ No newline at end of file diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/install_extensions.png b/buildroot/share/vscode/AutoBuildMarlin/resources/install_extensions.png deleted file mode 100644 index 4904c1d758..0000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/install_extensions.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/platformio_install.png b/buildroot/share/vscode/AutoBuildMarlin/resources/platformio_install.png deleted file mode 100644 index e1ff7fd3b3..0000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/platformio_install.png and /dev/null differ diff --git a/buildroot/share/vscode/AutoBuildMarlin/resources/view_command_palette.png b/buildroot/share/vscode/AutoBuildMarlin/resources/view_command_palette.png deleted file mode 100644 index 6fa3e9b016..0000000000 Binary files a/buildroot/share/vscode/AutoBuildMarlin/resources/view_command_palette.png and /dev/null differ diff --git a/config/default/Configuration.h b/config/default/Configuration.h index 84be39dda5..16f1ca6800 100644 --- a/config/default/Configuration.h +++ b/config/default/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/default/Configuration_adv.h b/config/default/Configuration_adv.h index babbb01bc6..bac2acf1bc 100644 --- a/config/default/Configuration_adv.h +++ b/config/default/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/3DFabXYZ/Migbot/Configuration.h b/config/examples/3DFabXYZ/Migbot/Configuration.h index a00efa92bf..02e2735ec0 100644 --- a/config/examples/3DFabXYZ/Migbot/Configuration.h +++ b/config/examples/3DFabXYZ/Migbot/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "AJMartel" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -896,11 +894,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -912,10 +909,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 21 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 61 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 21, 61, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -949,7 +946,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1207,12 +1204,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y 4 - // Set the boundaries for probing (where the probe can reach). - #define LEFT_PROBE_BED_POSITION X_PROBE_OFFSET_FROM_EXTRUDER - #define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (X_PROBE_OFFSET_FROM_EXTRUDER) + MIN_PROBE_EDGE) - #define FRONT_PROBE_BED_POSITION Y_PROBE_OFFSET_FROM_EXTRUDER - #define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1266,19 +1257,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1552,7 +1530,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2082,7 +2060,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2095,6 +2073,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2105,11 +2086,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2237,7 +2215,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/3DFabXYZ/Migbot/Configuration_adv.h b/config/examples/3DFabXYZ/Migbot/Configuration_adv.h index ee2be969aa..1007185a93 100644 --- a/config/examples/3DFabXYZ/Migbot/Configuration_adv.h +++ b/config/examples/3DFabXYZ/Migbot/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2440,10 +2537,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2524,6 +2617,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/ADIMLab/Granty v1/Configuration.h b/config/examples/ADIMLab/Gantry v1/Configuration.h similarity index 97% rename from config/examples/ADIMLab/Granty v1/Configuration.h rename to config/examples/ADIMLab/Gantry v1/Configuration.h index caa9fc7f68..9456800d83 100644 --- a/config/examples/ADIMLab/Granty v1/Configuration.h +++ b/config/examples/ADIMLab/Gantry v1/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. -#define STRING_CONFIG_H_AUTHOR "(ETE-Design, Granty v1)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(ETE-Design, Gantry v1)" // Who made the changes. /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -135,7 +133,7 @@ #endif // Name displayed in the LCD "Ready" message and Info menu -#define CUSTOM_MACHINE_NAME "ADIMLab Granty v1" +#define CUSTOM_MACHINE_NAME "ADIMLab Gantry v1" // Printer's unique ID, used by some programs to differentiate between machines. // Choose your own or use a service like http://www.uuidgenerator.net/version4 @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1202,12 +1199,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1261,19 +1252,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1465,12 +1443,12 @@ * P1 Raise the nozzle always to Z-park height. * P2 Raise the nozzle by Z-park amount, limited to Z_MAX_POS. */ -//#define NOZZLE_PARK_FEATURE +#define NOZZLE_PARK_FEATURE #if ENABLED(NOZZLE_PARK_FEATURE) // Specify a park position as { X, Y, Z_raise } #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } - #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_XY_FEEDRATE 60 // (mm/s) X and Y axes feedrate (also used for delta Z axis) #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) #endif @@ -1522,7 +1500,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2052,7 +2030,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2065,6 +2043,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2075,11 +2056,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2207,7 +2185,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/ADIMLab/Granty v1/Configuration_adv.h b/config/examples/ADIMLab/Gantry v1/Configuration_adv.h similarity index 93% rename from config/examples/ADIMLab/Granty v1/Configuration_adv.h rename to config/examples/ADIMLab/Gantry v1/Configuration_adv.h index 8fd7ab9768..abb62a6962 100644 --- a/config/examples/ADIMLab/Granty v1/Configuration_adv.h +++ b/config/examples/ADIMLab/Gantry v1/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1018,17 +1014,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_CS_PIN SDSS - #define USB_INTR_PIN SD_DETECT_PIN + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1195,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1279,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1339,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1351,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1486,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1543,14 +1638,14 @@ * Requires NOZZLE_PARK_FEATURE. * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. */ -//#define ADVANCED_PAUSE_FEATURE +#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. + #define PAUSE_PARK_RETRACT_LENGTH 4 // (mm) Initial retract. // This short retract is done immediately, before parking the nozzle. #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. + #define FILAMENT_CHANGE_UNLOAD_LENGTH 0 // (mm) The length of filament for a complete unload. // For Bowden, the full length of the tube and nozzle. // For direct drive, the full length of the nozzle. // Set to 0 for manual unloading. @@ -1704,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1914,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1941,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2424,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2508,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/ADIMLab/Granty v2/Configuration.h b/config/examples/ADIMLab/Gantry v2/Configuration.h similarity index 97% rename from config/examples/ADIMLab/Granty v2/Configuration.h rename to config/examples/ADIMLab/Gantry v2/Configuration.h index b378477f2d..9be12ff0ca 100644 --- a/config/examples/ADIMLab/Granty v2/Configuration.h +++ b/config/examples/ADIMLab/Gantry v2/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. -#define STRING_CONFIG_H_AUTHOR "(ETE-Design, Granty v2)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "(ETE-Design, Gantry v2)" // Who made the changes. /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -135,7 +133,7 @@ #endif // Name displayed in the LCD "Ready" message and Info menu -#define CUSTOM_MACHINE_NAME "ADIMLab Granty v2" +#define CUSTOM_MACHINE_NAME "ADIMLab Gantry v2" // Printer's unique ID, used by some programs to differentiate between machines. // Choose your own or use a service like http://www.uuidgenerator.net/version4 @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1202,12 +1199,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1261,19 +1252,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1465,12 +1443,12 @@ * P1 Raise the nozzle always to Z-park height. * P2 Raise the nozzle by Z-park amount, limited to Z_MAX_POS. */ -//#define NOZZLE_PARK_FEATURE +#define NOZZLE_PARK_FEATURE #if ENABLED(NOZZLE_PARK_FEATURE) // Specify a park position as { X, Y, Z_raise } #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } - #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_XY_FEEDRATE 60 // (mm/s) X and Y axes feedrate (also used for delta Z axis) #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) #endif @@ -1522,7 +1500,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2052,7 +2030,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2065,6 +2043,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2075,11 +2056,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2207,7 +2185,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/ADIMLab/Granty v2/Configuration_adv.h b/config/examples/ADIMLab/Gantry v2/Configuration_adv.h similarity index 94% rename from config/examples/ADIMLab/Granty v2/Configuration_adv.h rename to config/examples/ADIMLab/Gantry v2/Configuration_adv.h index 280d41c8b5..e4ef517ca7 100644 --- a/config/examples/ADIMLab/Granty v2/Configuration_adv.h +++ b/config/examples/ADIMLab/Gantry v2/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1025,7 +1021,7 @@ * INT --> SD_DETECT_PIN [1] * SS --> SDSS * - * [1] On AVR an interrupt-capable pin is required for UHS3 compatibility. + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ //#define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/AlephObjects/TAZ4/Configuration.h b/config/examples/AlephObjects/TAZ4/Configuration.h index 0e92e07f30..777eb8e5ff 100644 --- a/config/examples/AlephObjects/TAZ4/Configuration.h +++ b/config/examples/AlephObjects/TAZ4/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Aleph Objects Inc, TAZ)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -910,11 +908,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -926,10 +923,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -963,7 +960,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1221,12 +1218,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1280,19 +1271,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1541,7 +1519,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2071,7 +2049,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2084,6 +2062,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2094,11 +2075,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2226,7 +2204,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/AlephObjects/TAZ4/Configuration_adv.h b/config/examples/AlephObjects/TAZ4/Configuration_adv.h index fe2011e1cc..05ae34b208 100644 --- a/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Alfawise/U20-bltouch/Configuration.h b/config/examples/Alfawise/U20-bltouch/Configuration.h new file mode 100644 index 0000000000..00f1ece40f --- /dev/null +++ b/config/examples/Alfawise/U20-bltouch/Configuration.h @@ -0,0 +1,2290 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * Configuration.h + * + * Basic settings such as: + * + * - Type of electronics + * - Type of temperature sensor + * - Printer geometry + * - Endstop configuration + * - LCD controller + * - Extra features + * + * Advanced settings can be found in Configuration_adv.h + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +//=========================================================================== +//============================= Alfawise Printer ============================ +//=========================================================================== + +// Forum link to help with a tutorial, in French! : +// https://www.lesimprimantes3d.fr/forum/topic/18260-alfawise-u20x-u30-marlin-2x-firmware-alternatif/ +// +// 1 - Select your Alfawise U30 or U20 or U20+ printer (NO MORE REQUIRED HERE) +// and the touchscreen version, either 1.1 or 1.2. Most recent in France are v1.2 (blue pcb) +// These defines are set in platformio.ini build parameters, sample for U20 -DU20 -DTS_V12 +// U20_PLUS was not tested, as we do not have a printer to test. Print bed PID settings MUST be tuned for it. + +// Valid platformio.ini submodel values are U20_PLUS U20 U30 LK1 LK2 LK4 + +// Valid platformio.ini touchscreens are TS_V11 TS_V12 + +// 2 - Select the screen controller type. Most common is ILI9341 - First option. If your screen remains white, +// Try the alternate setting - this should enable ST7789V or ILI9328. For other LCDs... code is needed +// with the proper boot sequence to be developped. + +#define LCD_READ_ID 0xD3 // Read display identification information in reg ID4 0xD3, for ILI9341 screens +//#define LCD_READ_ID 0x04 // Read display identification information in reg ID1 0x04 - ST7789V / ILI9328 or others + +//=========================================================================== + +// @section info + +// Author info of this build printed to the host during boot and M115 +#define STRING_CONFIG_H_AUTHOR "Hobi, tpruvot" // Who made the changes. + +/** + * *** VENDORS PLEASE READ *** + * + * Marlin allows you to add a custom boot image for Graphical LCDs. + * With this option Marlin will first show your custom screen followed + * by the standard Marlin logo with version number and web URL. + * + * We encourage you to take advantage of this new feature and we also + * respectfully request that you retain the unmodified Marlin boot screen. + */ + +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. +#define CUSTOM_STATUS_SCREEN_IMAGE + +// @section machine + +/** + * Select the serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 1 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT_2 2 +#define NUM_SERIAL 2 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// Choose the name from boards.h that matches your setup +#ifndef MOTHERBOARD + #define MOTHERBOARD BOARD_LONGER3D_LK +#endif + +// Name displayed in the LCD "Ready" message and Info menu +//#define CUSTOM_MACHINE_NAME "3D Printer" +#ifdef U20 +#define CUSTOM_MACHINE_NAME "Alfawise U20" +#elif defined(U30) +#define CUSTOM_MACHINE_NAME "Alfawise U30" +#elif defined(U20_PLUS) +#define CUSTOM_MACHINE_NAME "Alfawise U20+" +#elif defined(LK1) +#define CUSTOM_MACHINE_NAME "Longer3D LK1" +#elif defined(LK2) +#define CUSTOM_MACHINE_NAME "Longer3D LK2" +#elif defined(LK4) +#define CUSTOM_MACHINE_NAME "Longer3D LK4" +#endif + +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#define EXTRUDERS 1 + +// Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc. +#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one (or both) of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a solenoid docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism using movements and no solenoid + * + * project : https://www.thingiverse.com/thing:3080893 + * movements : https://youtu.be/0xCEiG9VS3k + * https://youtu.be/Bqbcs0CU2FE + */ +//#define MAGNETIC_PARKING_EXTRUDER + +#if EITHER(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #if ENABLED(PARKING_EXTRUDER) + + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // (ms) Delay for magnetic field. No delay if 0 or not defined. + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 + + #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) + + #define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point + #define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple + #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point + #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling + + #endif + +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD + +/** + * Magnetic Switching Toolhead + * + * Support swappable and dockable toolheads with a magnetic + * docking mechanism using movement and no servo. + */ +//#define MAGNETIC_SWITCHING_TOOLHEAD + +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders + #if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1) + //#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock + #if ENABLED(PRIME_BEFORE_REMOVE) + #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length + #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length + #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate + #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate + #endif + #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching + #endif +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Firmware's 'M164 S' supporting virtual tools. + * - This implementation supports up to two mixing extruders. + * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands + //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD + #if ENABLED(GRADIENT_MIX) + //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias + #endif +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Power Supply Control + * + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. + */ +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" + +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) + + //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + + //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin + #if ENABLED(AUTO_POWER_CONTROL) + #define AUTO_POWER_FANS // Turn on PSU if fans need power + #define AUTO_POWER_E_FANS + #define AUTO_POWER_CONTROLLERFAN + #define AUTO_POWER_CHAMBER_FAN + //#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature + //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature + #define POWER_TIMEOUT 30 + #endif +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -4 : thermocouple with AD8495 + * -3 : thermocouple with MAX31855 (only for sensor 0) + * -2 : thermocouple with MAX6675 (only for sensor 0) + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 331 : (3.3V scaled thermistor 1 table) + * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) + * 3 : Mendel-parts thermistor (4.7k pullup) + * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! + * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 512 : 100k RPW-Ultra hotend thermistor (4.7k pullup) + * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) + * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) + * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 11 : 100k beta 3950 1% thermistor (4.7k pullup) + * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) + * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" + * 15 : 100k thermistor calibration for JGAurora A5 hotend + * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 + * 20 : Pt100 with circuit in the Ultimainboard V2.x + * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 67 : 450C thermistor from SliceEngineering + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * 1000 : Custom - Specify parameters in Configuration_adv.h + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. + * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. + * + * :{ '0':"Not used", '1':"100k / 4.7k - EPCOS", '331':"(3.3V thermistor 1)", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '512':"100k RPW-Ultra hotend thermistor", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '20':"Pt100 (Ultimainboard V2.x)", '201':"Pt100 (Overlord)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595", '998':"Dummy 1", '999':"Dummy 2", '1000':"Custom thermistor params" } + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 0 +#define TEMP_SENSOR_BED 1 +#define TEMP_SENSOR_CHAMBER 0 + +// Dummy thermistor constant temperature readings, for use with 998 and 999 +#define DUMMY_THERMISTOR_998_VALUE 25 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 +#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 +#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer +#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target + +// Below this temperature the heater will be switched off +// because it probably indicates a broken thermistor wire. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// Above this temperature the heater will be switched off. +// This can protect components from overheating, but NOT from shorts and failures. +// (Use MINTEMP for thermistor short/failure protection.) +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + + // Alfawise U30/U20 + // Please refine the PID settings for your own machine to avoid the E1 hotend error. These a basic settings allowing first startups. + // Use the command M303 E0 S200 C8 each time you make any changes to your extruder + + #define DEFAULT_Kp 17.22 + #define DEFAULT_Ki 1.00 + #define DEFAULT_Kd 74.22 + + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//====================== PID > Bed Temperature Control ====================== +//=========================================================================== + +/** + * PID Bed Heating + * + * If this option is enabled set PID constants below. + * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. + * + * The PID frequency will be the same as the extruder PWM. + * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, + * which is fine for driving a square wave into a resistive load and does not significantly + * impact FET heating. This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W + * heater. If your configuration is significantly different than this and you don't understand + * the issues involved, don't use bed PID until someone else verifies that your hardware works. + */ +#define PIDTEMPBED + +//#define BED_LIMIT_SWITCHING + +/** + * Max Bed Power + * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). + * When set to any value below 255, enables a form of PWM to the bed that acts like a divider + * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) + */ +#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current + +#if ENABLED(PIDTEMPBED) + //#define MIN_BED_POWER 0 + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + //#define DEFAULT_bedKp 10.00 + //#define DEFAULT_bedKi .023 + //#define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + +#if defined(U30) || defined(LK2) || defined(LK4) + //From M303 command for Alfawise U30 : + #define DEFAULT_bedKp 338.46 + #define DEFAULT_bedKi 63.96 + #define DEFAULT_bedKd 447.78 +#endif + +#if defined(U20) || defined(LK1) + //From M303 command for Alfawise U20 : + #define DEFAULT_bedKp 841.68 + #define DEFAULT_bedKi 152.12 + #define DEFAULT_bedKd 1164.25 +#endif + +#ifdef U20_PLUS + // These PID setting MUST be updated. + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. + #define DEFAULT_bedKp 841.68 + #define DEFAULT_bedKi 152.12 + #define DEFAULT_bedKd 1164.25 +#endif + +#endif // PIDTEMPBED + +// @section extruder + +/** + * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. + * Add M302 to set the minimum extrusion temperature and/or turn + * cold extrusion prevention on and off. + * + * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** + */ +#define PREVENT_COLD_EXTRUSION +#define EXTRUDE_MINTEMP 170 + +/** + * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. + * Note: For Bowden Extruders make this large enough to allow load/unload. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed +//#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// Enable pullup for all endstops to prevent a floating state +//#define ENDSTOPPULLUPS +#if DISABLED(ENDSTOPPULLUPS) + // Disable ENDSTOPPULLUPS to set pullups individually + //#define ENDSTOPPULLUP_XMAX + //#define ENDSTOPPULLUP_YMAX + //#define ENDSTOPPULLUP_ZMAX + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + #define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the probe. + +/** + * Stepper Drivers + * + * These settings allow Marlin to tune stepper driver timing and enable advanced options for + * stepper drivers that support them. You may also override timing options in Configuration_adv.h. + * + * A4988 is assumed for unspecified drivers. + * + * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, + * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + */ +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 +//#define X2_DRIVER_TYPE A4988 +//#define Y2_DRIVER_TYPE A4988 +//#define Z2_DRIVER_TYPE A4988 +//#define Z3_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 +//#define E1_DRIVER_TYPE A4988 +//#define E2_DRIVER_TYPE A4988 +//#define E3_DRIVER_TYPE A4988 +//#define E4_DRIVER_TYPE A4988 +//#define E5_DRIVER_TYPE A4988 + +// Enable this feature if all enabled endstop pins are interrupt-capable. +// This will remove the need to poll the interrupt pins, saving many CPU cycles. +#define ENDSTOP_INTERRUPTS_FEATURE + +/** + * Endstop Noise Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 98 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + */ +#define DEFAULT_MAX_FEEDRATE { 200, 200, 100, 25 } + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + */ +#define DEFAULT_MAX_ACCELERATION { 200, 200, 100, 3000 } + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 200 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 200 // X, Y, Z acceleration for travel (non printing) moves + +/** + * Junction Deviation + * + * Use Junction Deviation instead of traditional Jerk Limiting + * + * See: + * https://reprap.org/forum/read.php?1,739819 + * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html + */ +//#define JUNCTION_DEVIATION +#if ENABLED(JUNCTION_DEVIATION) + #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge +#endif + +/** + * Default Jerk (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +#if DISABLED(JUNCTION_DEVIATION) + #define DEFAULT_XJERK 10.0 + #define DEFAULT_YJERK 10.0 + #define DEFAULT_ZJERK 0.4 +#endif + +#define DEFAULT_EJERK 5.0 // May be used by Linear Advance + +/** + * S-Curve Acceleration + * + * This option eliminates vibration during printing by fitting a Bézier + * curve to move acceleration, producing much smoother direction changes. + * + * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained + */ +//#define S_CURVE_ACCELERATION + +//=========================================================================== +//============================= Z Probe Options ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_PIN + * + * Define this pin if the probe is not connected to Z_MIN_PIN. + * If not defined the default pin for the selected MOTHERBOARD + * will be used. Most of the time the default is what you want. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + */ +//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ +#define PROBE_MANUALLY +#define MANUAL_PROBE_START_Z 0.2 + +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + */ +//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +#define BLTOUCH + +/** + * Touch-MI Probe by hotends.fr + * + * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed. + * By default, the magnet is assumed to be on the left and activated by a home. If the magnet is + * on the right, enable and set TOUCH_MI_DEPLOY_XPOS to the deploy position. + * + * Also requires: BABYSTEPPING, BABYSTEP_ZPROBE_OFFSET, Z_SAFE_HOMING, + * and a minimum Z_HOMING_HEIGHT of 10. + */ +//#define TOUCH_MI_PROBE +#if ENABLED(TOUCH_MI_PROBE) + #undef PROBE_MANUALLY + #define TOUCH_MI_RETRACT_Z 0.5 // Height at which the probe retracts + //#define TOUCH_MI_DEPLOY_XPOS (X_MAX_BED + 2) // For a magnet on the right side of the bed + //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * + * In the following example the X and Y offsets are both positive: + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + * + * Specify a Probe position as { X, Y, Z } + */ +#define NOZZLE_TO_PROBE_OFFSET { -35, -6, -0.5 } + +// Certain types of probes need to stay away from edges +#define MIN_PROBE_EDGE 10 + +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + +// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +/** + * Multiple Probing + * + * You may get improved results by probing 2 or more times. + * With EXTRA_PROBING the more atypical reading(s) will be disregarded. + * + * A total of 2 does fast/slow probes with a weighted average. + * A total of 3 or more adds more slow probes, taking the average. + */ +#define MULTIPLE_PROBING 2 +//#define EXTRA_PROBING 1 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. + * But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle. + */ +#define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow +#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes +//#define Z_AFTER_PROBING 5 // Z position after probing is done + +#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping + +// For M851 give a range for adjusting the Z probe offset +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW +#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + //#define PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED // For Manual Deploy Allenkey Probe +#endif + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * readings with inductive probes and piezo sensors. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +#if ENABLED(PROBING_HEATERS_OFF) + //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) +#endif +//#define PROBING_FANS_OFF // Turn fans off when probing +//#define PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR true +#define INVERT_Y_DIR false +#define INVERT_Z_DIR true + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed + +//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. + +//#define Z_HOMING_HEIGHT 10 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ... + // Be sure you have this distance over your Z_MAX_POS in case. + +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +#if defined(U30) || defined(LK2) || defined(LK4) +#define X_BED_SIZE 220 +#define Y_BED_SIZE 220 +#define Z_MACHINE_MAX 250 +#endif + +#if defined(U20) || defined(LK1) +#define X_BED_SIZE 300 +#define Y_BED_SIZE 300 +#define Z_MACHINE_MAX 400 +#endif + +#ifdef U20_PLUS +#define X_BED_SIZE 400 +#define Y_BED_SIZE 400 +#define Z_MACHINE_MAX 500 +#endif + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS Z_MACHINE_MAX + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS) + //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD +#endif + +/** + * Filament Runout Sensors + * Mechanical or opto endstops are used to check for the presence of filament. + * + * RAMPS-based boards use SERVO3_PIN for the first runout sensor. + * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. + * By default the firmware assumes HIGH=FILAMENT PRESENT. + */ +#define FILAMENT_RUNOUT_SENSOR +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. + #define FIL_RUNOUT_INVERTING true // Set to true to invert the logic of the sensor. + //#define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + + // Set one or more commands to execute on filament runout. + // (After 'M412 H' Marlin will ask the host to handle the process.) + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +#define AUTO_BED_LEVELING_BILINEAR +//#define AUTO_BED_LEVELING_UBL +//#define MESH_BED_LEVELING + +/** + * Normally G28 leaves leveling disabled on completion. Enable + * this option to have G28 restore the prior leveling state. + */ +//#define RESTORE_LEVELING_AFTER_G28 + +/** + * Enable detailed logging of G28, G29, M48, etc. + * Turn on with the command 'M111 S32'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // For Cartesian machines, instead of dividing moves on mesh boundaries, + // split up moves into short segments like a Delta. This follows the + // contours of the bed more closely than edge-to-edge straight moves. + #define SEGMENT_LEVELED_MOVES + #define LEVELED_SEGMENT_LENGTH 5.0 // (mm) Length of all segments (except the last one) + + /** + * Enable the G26 Mesh Validation Pattern tool. + */ + //#define G26_MESH_VALIDATION + #if ENABLED(G26_MESH_VALIDATION) + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #define G26_XY_FEEDRATE 20 // (mm/s) Feedrate for XY Moves for the G26 Mesh Validation Tool. + #endif + +#endif + +#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 4 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // Probe along the Y axis, advancing X after each column + //#define PROBE_Y_FIRST + + #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + + // Beyond the probed grid, continue the implied tilt? + // Default is to maintain the height of the nearest edge. + //#define EXTRAPOLATE_BEYOND_GRID + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh + + #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle + #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 + + //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used + // as the Z-Height correction value. + +#elif ENABLED(MESH_BED_LEVELING) + + //=========================================================================== + //=================================== Mesh ================================== + //=========================================================================== + + #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// Add a menu item to move between bed corners for manual bed adjustment +#define LEVEL_BED_CORNERS + +#if ENABLED(LEVEL_BED_CORNERS) + #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling + #define LEVEL_CORNERS_Z_HOP 4.0 // (mm) Move nozzle up before moving between corners + #define LEVEL_CORNERS_HEIGHT 0.2 // (mm) Z height of nozzle at leveling points + #define LEVEL_CENTER_TOO // Move to the center after the last corner +#endif + +/** + * Commands to execute at the end of G29 probing. + * Useful to retract or move the Z probe out of the way. + */ +//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + //#define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT 4 +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (40*60) +#define HOMING_FEEDRATE_Z (7*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @section calibrate + +/** + * Bed Skew Compensation + * + * This feature corrects for misalignment in the XYZ axes. + * + * Take the following steps to get the bed skew in the XY plane: + * 1. Print a test square (e.g., https://www.thingiverse.com/thing:2563185) + * 2. For XY_DIAG_AC measure the diagonal A to C + * 3. For XY_DIAG_BD measure the diagonal B to D + * 4. For XY_SIDE_AD measure the edge A to D + * + * Marlin automatically computes skew factors from these measurements. + * Skew factors may also be computed and set manually: + * + * - Compute AB : SQRT(2*AC*AC+2*BD*BD-4*AD*AD)/2 + * - XY_SKEW_FACTOR : TAN(PI/2-ACOS((AC*AC-AB*AB-AD*AD)/(2*AB*AD))) + * + * If desired, follow the same procedure for XZ and YZ. + * Use these diagrams for reference: + * + * Y Z Z + * ^ B-------C ^ B-------C ^ B-------C + * | / / | / / | / / + * | / / | / / | / / + * | A-------D | A-------D | A-------D + * +-------------->X +-------------->X +-------------->Y + * XY_SKEW_FACTOR XZ_SKEW_FACTOR YZ_SKEW_FACTOR + */ +//#define SKEW_CORRECTION + +#if ENABLED(SKEW_CORRECTION) + // Input all length measurements here: + #define XY_DIAG_AC 282.8427124746 + #define XY_DIAG_BD 282.8427124746 + #define XY_SIDE_AD 200 + + // Or, set the default skew factors directly here + // to override the above measurements: + #define XY_SKEW_FACTOR 0.0 + + //#define SKEW_CORRECTION_FOR_Z + #if ENABLED(SKEW_CORRECTION_FOR_Z) + #define XZ_DIAG_AC 282.8427124746 + #define XZ_DIAG_BD 282.8427124746 + #define YZ_DIAG_AC 282.8427124746 + #define YZ_DIAG_BD 282.8427124746 + #define YZ_SIDE_AD 200 + #define XZ_SKEW_FACTOR 0.0 + #define YZ_SKEW_FACTOR 0.0 + #endif + + // Enable this option for M852 to set skew at runtime + //#define SKEW_CORRECTION_GCODE +#endif + +//============================================================================= +//============================= Additional Features =========================== +//============================================================================= + +// @section extras + +/** + * EEPROM + * + * Persistent storage to preserve configurable settings across reboots. + * + * M500 - Store settings to EEPROM. + * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + */ +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#if ENABLED(EEPROM_SETTINGS) + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. +#endif + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 200 +#define PREHEAT_1_TEMP_BED 60 +#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 250 +#define PREHEAT_2_TEMP_BED 100 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * P1 Raise the nozzle always to Z-park height. + * P2 Raise the nozzle by Z-park amount, limited to Z_MAX_POS. + */ +#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z_raise } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #define NOZZLE_CLEAN_TRIANGLES 3 + + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } + #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Move the nozzle to the initial position after cleaning + #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, jp-kana, + * ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT +#define SDIO_SUPPORT // Note from Hobi : Added as was not present in the file... + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * LCD Menu Items + * + * Disable all menus and only display the Status Screen, or + * just remove some extraneous menu items to recover space. + */ +//#define NO_LCD_MENUS +//#define SLIM_LCD_MENUS + +// +// ENCODER SETTINGS +// +// This option overrides the default number of encoder pulses needed to +// produce one step. Should be increased for high-resolution encoders. +// +//#define ENCODER_PULSES_PER_STEP 4 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// This option reverses the encoder direction for Select Screen. +// +// If CLOCKWISE normally moves LEFT this makes it go RIGHT. +// If CLOCKWISE normally moves RIGHT this makes it go LEFT. +// +//#define REVERSE_SELECT_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 250 +//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#define RIGIDBOT_PANEL + +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. + // This LCD is known to be susceptible to electrical interference + // which scrambles the display. Pressing any button clears it up. + // This is a LCD2004 display with 5 analog buttons. + +// +// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. +// +//#define ULTRA_LCD + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// CONTROLLER TYPE: Shift register panels +// + +// +// 2-wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD + +// +// 3-wire SR LCD with strobe using 74HC4094 +// https://github.com/mikeshub/SailfishLCD +// Uses the code directly from Sailfish +// +//#define FF_INTERFACEBOARD + +//============================================================================= +//======================= LCD / Controller Selection ======================= +//========================= (Graphical LCDs) ======================== +//============================================================================= + +// +// CONTROLLER TYPE: Graphical 128x64 (DOGM) +// +// IMPORTANT: The U8glib library is required for Graphical Display! +// https://github.com/olikraus/U8glib_Arduino +// + +// +// RepRapDiscount FULL GRAPHIC Smart Controller +// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller +// +//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER + +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + +// +// Activate one of these if you have a Panucatt Devices +// Viki 2.0 or mini Viki with Graphic LCD +// http://panucatt.com +// +//#define VIKI2 +//#define miniVIKI + +// +// MakerLab Mini Panel with graphic +// controller and SD support - http://reprap.org/wiki/Mini_panel +// +//#define MINIPANEL + +// +// MaKr3d Makr-Panel with graphic controller and SD support. +// http://reprap.org/wiki/MaKr3d_MaKrPanel +// +//#define MAKRPANEL + +// +// Adafruit ST7565 Full Graphic Controller. +// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ +// +//#define ELB_FULL_GRAPHIC_CONTROLLER + +// +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. +// +//#define BQ_LCD_SMART_CONTROLLER + +// +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// MKS MINI12864 with graphic controller and SD support +// https://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// FYSETC variant of the MINI12864 graphic controller with SD support +// https://wiki.fysetc.com/Mini12864_Panel/ +// +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// +//#define CR10_STOCKDISPLAY + +// +// ANET and Tronxy Graphical Controller +// +// Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 +// A clone of the RepRapDiscount full graphics display but with +// different pins/wiring (see pins_ANET_10.h). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + +// +// Overlord OLED display/controller with i2c buzzer and LEDs +// +//#define OVERLORD_OLED + +//============================================================================= +//========================== Extensible UI Displays =========================== +//============================================================================= + +// +// DGUS Touch Display with DWIN OS +// +//#define DGUS_LCD + +// +// Touch-screen LCD for Malyan M200 printers +// +//#define MALYAN_LCD + +// +// LulzBot Color Touch UI for FTDI EVE (FT800/FT810) displays +// See Configuration_adv.h for all configuration options. +// +//#define LULZBOT_TOUCH_UI + +// +// Third-party or vendor-customized controller interfaces. +// Sources should be installed in 'src/lcd/extensible_ui'. +// +//#define EXTENSIBLE_UI + +//============================================================================= +//=============================== Graphical TFTs ============================== +//============================================================================= + +// +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) +// +#define FSMC_GRAPHICAL_TFT + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 +// +#define TOUCH_BUTTONS +#if ENABLED(TOUCH_BUTTONS) + #define TOUCH_CALIBRATION // Include user calibration widget in menus (Alfawise) + + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 100 // (ms) Button repeat delay for menus + + #if ENABLED(TS_V11) + // Alfawise U20 ILI9341 2.8 TP Ver 1.1 / Green PCB on the back of touchscreen + #define XPT2046_X_CALIBRATION 11605 + #define XPT2046_Y_CALIBRATION 9091 + #define XPT2046_X_OFFSET -24 + #define XPT2046_Y_OFFSET -17 + #endif + + #if ENABLED(TS_V12) + // Alfawise U30 ILI9341 2.8 TP Ver 1.2 / Blue PCB on the back of touchscreen + #define XPT2046_X_CALIBRATION 12316 + #define XPT2046_Y_CALIBRATION -8981 + #define XPT2046_X_OFFSET -43 + #define XPT2046_Y_OFFSET 257 + #endif +#endif + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +// :[0,1,2,3,4,5,6,7] +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +// Support for PCA9533 PWM LED driver +// https://github.com/mikeshub/SailfishRGB_LED +//#define PCA9533 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * NOTE: A separate 5V power supply is required! The Neopixel LED needs + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if EITHER(RGB_LED, RGBW_LED) + //#define RGB_LED_R_PIN 34 + //#define RGB_LED_G_PIN 43 + //#define RGB_LED_B_PIN 35 + //#define RGB_LED_W_PIN -1 +#endif + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin + //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE + //#define NEOPIXEL2_PIN 5 + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup + + // Use a single Neopixel LED for static (background) lighting + //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use + //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/config/examples/Alfawise/U20-bltouch/Configuration_adv.h b/config/examples/Alfawise/U20-bltouch/Configuration_adv.h new file mode 100644 index 0000000000..0a5629b873 --- /dev/null +++ b/config/examples/Alfawise/U20-bltouch/Configuration_adv.h @@ -0,0 +1,2771 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 . + * + */ +#pragma once + +/** + * 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 + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Custom Thermistor 1000 parameters +// +#if TEMP_SENSOR_0 == 1000 + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_1 == 1000 + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_2 == 1000 + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_3 == 1000 + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_4 == 1000 + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_5 == 1000 + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_BED == 1000 + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_CHAMBER == 1000 + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value +#endif + +// +// Hephestos 2 24V heated bed upgrade kit. +// https://store.bq.com/en/heated-bed-kit-hephestos2 +// +//#define HEPHESTOS2_HEATED_BED_KIT +#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) + #undef TEMP_SENSOR_BED + #define TEMP_SENSOR_BED 70 + #define HEATER_BED_INVERTING true +#endif + +/** + * Heated Chamber settings + */ +#if TEMP_SENSOR_CHAMBER + #define CHAMBER_MINTEMP 5 + #define CHAMBER_MAXTEMP 60 + #define TEMP_CHAMBER_HYSTERESIS 1 // (°C) Temperature proximity considered "close enough" to the target + //#define CHAMBER_LIMIT_SWITCHING + //#define HEATER_CHAMBER_PIN 44 // Chamber heater on/off pin + //#define HEATER_CHAMBER_INVERTING false +#endif + +#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 provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the 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 60 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 10 // Degrees Celsius + + //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops + #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) + //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #endif + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, 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 set + * below 2. + */ + #define WATCH_TEMP_PERIOD 60 // 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 + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the heated chamber. + */ +#if ENABLED(THERMAL_PROTECTION_CHAMBER) + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + + /** + * Heated chamber watch settings (M141/M191). + */ + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // A well-chosen Kc value should add just enough power to melt the increased material volume. + //#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 B F + * 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 extra position information with 'M114 D' +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values 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 runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #define EXTRUDER_RUNOUT_SPEED 1500 // (mm/m) + #define EXTRUDER_RUNOUT_EXTRUDE 5 // (mm) +#endif + +// @section temperature + +// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. +// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. +#define TEMP_SENSOR_AD595_OFFSET 0.0 +#define TEMP_SENSOR_AD595_GAIN 1.0 +#define TEMP_SENSOR_AD8495_OFFSET 0.0 +#define TEMP_SENSOR_AD8495_GAIN 1.0 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled + #define CONTROLLERFAN_SPEED 255 // 255 == full speed + //#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled +#endif + +// 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 + +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +/** + * FAST PWM FAN Settings + * + * Use to change the FAST FAN PWM frequency (if enabled in Configuration.h) + * Combinations of PWM Modes, prescale values and TOP resolutions are used internally to produce a + * frequency as close as possible to the desired frequency. + * + * FAST_PWM_FAN_FREQUENCY [undefined by default] + * Set this to your desired frequency. + * If left undefined this defaults to F = F_CPU/(2*255*1) + * ie F = 31.4 Khz on 16 MHz microcontrollers or F = 39.2 KHz on 20 MHz microcontrollers + * These defaults are the same as with the old FAST_PWM_FAN implementation - no migration is required + * NOTE: Setting very low frequencies (< 10 Hz) may result in unexpected timer behavior. + * + * USE_OCR2A_AS_TOP [undefined by default] + * Boards that use TIMER2 for PWM have limitations resulting in only a few possible frequencies on TIMER2: + * 16MHz MCUs: [62.5KHz, 31.4KHz (default), 7.8KHz, 3.92KHz, 1.95KHz, 977Hz, 488Hz, 244Hz, 60Hz, 122Hz, 30Hz] + * 20MHz MCUs: [78.1KHz, 39.2KHz (default), 9.77KHz, 4.9KHz, 2.44KHz, 1.22KHz, 610Hz, 305Hz, 153Hz, 76Hz, 38Hz] + * A greater range can be achieved by enabling USE_OCR2A_AS_TOP. But note that this option blocks the use of + * PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.) + * USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies. + */ +#if ENABLED(FAST_PWM_FAN) + //#define FAST_PWM_FAN_FREQUENCY 31400 + //#define USE_OCR2A_AS_TOP +#endif + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * 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 E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 + +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed +#define CHAMBER_AUTO_FAN_TEMPERATURE 30 +#define CHAMBER_AUTO_FAN_SPEED 255 + +/** + * Part-Cooling Fan Multiplexer + * + * This feature allows you to digitally multiplex the fan output. + * The multiplexer is automatically switched at tool-change. + * Set FANMUX[012]_PINs below for up to 2, 4, or 8 multiplexed fans. + */ +#define FANMUX0_PIN -1 +#define FANMUX1_PIN -1 +#define FANMUX2_PIN -1 + +/** + * M355 Case Light on-off / brightness + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on + #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) + //#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu + //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. + //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. + #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) + #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } + #endif +#endif + +// @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. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #endif +#endif + +/** + * Dual X Carriage + * + * This setup has two X carriages that can move independently, each with its own hotend. + * The carriages can be used to print an object with two colors or materials, or in + * "duplication mode" it can print two identical or X-mirrored objects simultaneously. + * The inactive carriage is parked automatically to prevent oozing. + * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. + * By default the X2 stepper is assigned to the first unused E plug on the board. + * + * The following Dual X Carriage modes can be selected with M605 S: + * + * 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) + * + * 1 : (AUTO_PARK) The firmware automatically parks and unparks the X-carriages on tool-change so + * that additional slicer support is not required. (M605 S1) + * + * 2 : (DUPLICATION) The firmware moves the second X-carriage and extruder in synchronization with + * the first X-carriage and extruder, to print 2 copies of the same object at the same time. + * Set the constant X-offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S2 to initiate duplicated movement. + * + * 3 : (MIRRORED) Formbot/Vivedino-inspired mirrored mode in which the second extruder duplicates + * the movement of the first except the second extruder is reversed in the X axis. + * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and + * follow with M605 S3 to initiate mirrored movement. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS + #define X1_MAX_POS X_BED_SIZE // Set a maximum so the first X-carriage can't hit the parked second X-carriage + #define X2_MIN_POS 80 // Set a minimum to ensure the second X-carriage can't hit the parked first X-carriage + #define X2_MAX_POS 353 // Set this to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // Set to 1. The second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. + // 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. + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// Homing hits each endstop, retracts by these distances, then does a slower bump. +#define X_HOME_BUMP_MM 5 +#define Y_HOME_BUMP_MM 5 +#define Z_HOME_BUMP_MM 2 +#define HOMING_BUMP_DIVISOR { 4, 4, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially +//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing + +// When G28 is called, this option will make Y home before X +//#define HOME_Y_BEFORE_X + +// Enable this if X or Y can't home without homing the other axis first. +//#define CODEPENDENT_XY_HOMING + +#if ENABLED(BLTOUCH) + /** + * Either: Use the defaults (recommended) or: For special purposes, use the following DEFINES + * Do not activate settings that the probe might not understand. Clones might misunderstand + * advanced commands. + * + * Note: If the probe is not deploying, check a "Cmd: Reset" and "Cmd: Self-Test" and then + * check the wiring of the BROWN, RED and ORANGE wires. + * + * Note: If the trigger signal of your probe is not being recognized, it has been very often + * because the BLACK and WHITE wires needed to be swapped. They are not "interchangeable" + * like they would be with a real switch. So please check the wiring first. + * + * Settings for all BLTouch and clone probes: + */ + #undef PROBE_MANUALLY + + // Safety: The probe needs time to recognize the command. + // Minimum command delay (ms). Enable and increase if needed. + //#define BLTOUCH_DELAY 500 + + /** + * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: + */ + + // Feature: Switch into SW mode after a deploy. It makes the output pulse longer. Can be useful + // in special cases, like noisy or filtered input configurations. + //#define BLTOUCH_FORCE_SW_MODE + + /** + * Settings for BLTouch Smart 3.0 and 3.1 + * Summary: + * - Voltage modes: 5V and OD (open drain - "logic voltage free") output modes + * - High-Speed mode + * - Disable LCD voltage options + */ + + /** + * Danger: Don't activate 5V mode unless attached to a 5V-tolerant controller! + * V3.0 or 3.1: Set default mode to 5V mode at Marlin startup. + * If disabled, OD mode is the hard-coded default on 3.0 + * On startup, Marlin will compare its eeprom to this vale. If the selected mode + * differs, a mode set eeprom write will be completed at initialization. + * Use the option below to force an eeprom write to a V3.1 probe regardless. + */ + //#define BLTOUCH_SET_5V_MODE + + /** + * Safety: Activate if connecting a probe with an unknown voltage mode. + * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 + * V3.1: Force a probe with unknown mode into selected mode at Marlin startup ( = Probe EEPROM write ) + * To preserve the life of the probe, use this once then turn it off and re-flash. + */ + //#define BLTOUCH_FORCE_MODE_SET + + /** + * Use "HIGH SPEED" mode for probing. + * Danger: Disable if your probe sometimes fails. Only suitable for stable well-adjusted systems. + * This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function + * If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state. + */ + //#define BLTOUCH_HS_MODE + + // Safety: Enable voltage mode settings in the LCD menu. + #define BLTOUCH_LCD_VOLTAGE_MENU + +#endif // BLTOUCH + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + + // On a 300mm bed a 5% grade would give a misalignment of ~1.5cm + #define G34_MAX_GRADE 5 // (%) Maximum incline G34 will handle + + // Use the amplification factor to de-/increase correction step. + // In case the stepper (spindle) position is further out than the test point + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section motion + +#define AXIS_RELATIVE_MODES { false, false, false, false } + +// Add a Duplicate option for well-separated conjoined nozzles +//#define MULTI_NOZZLE_DUPLICATION + +// 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 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// Minimum time that a segment needs to take if the buffer is emptied +#define DEFAULT_MINSEGMENTTIME 20000 // (ms) + +// 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/s) + +// +// Backlash Compensation +// Adds extra movement to axes on direction-changes to account for backlash. +// +//#define BACKLASH_COMPENSATION +#if ENABLED(BACKLASH_COMPENSATION) + // Define values for backlash distance and correction. + // If BACKLASH_GCODE is enabled these values are the defaults. + #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm) + #define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction + + // Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments + // to reduce print artifacts. (Enabling this is costly in memory and computation!) + //#define BACKLASH_SMOOTHING_MM 3 // (mm) + + // Add runtime configuration and tuning of backlash values (M425) + //#define BACKLASH_GCODE + + #if ENABLED(BACKLASH_GCODE) + // Measure the Z backlash when probing (G29) and set with "M425 Z" + #define MEASURE_BACKLASH_WHEN_PROBING + + #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) + // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT + // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION + // increments while checking for the contact to be broken. + #define BACKLASH_MEASUREMENT_LIMIT 0.5 // (mm) + #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 // (mm) + #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_SPEED_SLOW // (mm/m) + #endif + #endif +#endif + +/** + * Automatic backlash, position and hotend offset calibration + * + * Enable G425 to run automatic calibration using an electrically- + * conductive cube, bolt, or washer mounted on the bed. + * + * G425 uses the probe to touch the top and sides of the calibration object + * on the bed and measures and/or correct positional offsets, axis backlash + * and hotend offsets. + * + * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within + * ±5mm of true values for G425 to succeed. + */ +//#define CALIBRATION_GCODE +#if ENABLED(CALIBRATION_GCODE) + + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm + + #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m + #define CALIBRATION_FEEDRATE_FAST 1200 // mm/m + #define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/m + + // The following parameters refer to the conical section of the nozzle tip. + #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm + #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm + + // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + //#define CALIBRATION_REPORTING + + // The true location and dimension the cube/bolt/washer on the bed. + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm + + // Comment out any sides which are unreachable by the probe. For best + // auto-calibration results, all sides must be reachable. + #define CALIBRATION_MEASURE_RIGHT + #define CALIBRATION_MEASURE_FRONT + #define CALIBRATION_MEASURE_LEFT + #define CALIBRATION_MEASURE_BACK + + // Probing at the exact top center only works if the center is flat. If + // probing on a screwhead or hollow washer, probe near the edges. + //#define CALIBRATION_MEASURE_AT_TOP_EDGES + + // Define pin which is read during calibration + #ifndef CALIBRATION_PIN + #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop + #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin + //#define CALIBRATION_PIN_PULLDOWN + #define CALIBRATION_PIN_PULLUP + #endif +#endif + +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis + +// Use an I2C based DIGIPOT (e.g., Azteeg X3 Pro) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. +// These correspond to the physical drivers, so be mindful if the order is changed. +#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Play a beep when the feedrate is changed from the Status Screen +//#define BEEP_ON_FEEDRATE_CHANGE +#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) + #define FEEDRATE_CHANGE_BEEP_DURATION 10 + #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 +#endif + +#if HAS_LCD_MENU + + // Include a page of printer information in the LCD Main Menu + #define LCD_INFO_MENU + #if ENABLED(LCD_INFO_MENU) + //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages + #endif + + // BACK menu items keep the highlight at the top + //#define TURBO_BACK_MENU_ITEM + + /** + * LED Control Menu + * Add LED Control to the LCD menu + */ + //#define LED_CONTROL_MENU + #if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif + #endif + +#endif // HAS_LCD_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// The timeout (in ms) to return to the status screen from sub-menus +//#define LCD_TIMEOUT_TO_STATUS 15000 + +// Add an 'M73' G-code to set the current percentage +#define LCD_SET_PROGRESS_MANUALLY + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing + #if ENABLED(LCD_PROGRESS_BAR) + #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar + #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message + #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) + //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it + //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar + #endif +#endif + +#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 // Disable steppers when SD Print is finished + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the Z enabled so your bed stays in place. + + // Reverse SD sort to show "more recent" files first, according to the card's FAT. + // Since the FAT gets out of order with usage, SDCARD_SORT_ALPHA is recommended. + #define SDCARD_RATHERRECENTFIRST + + #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing + + #define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + + #define EVENT_GCODE_SD_STOP "G28X" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + + /** + * Continue after Power-Loss (Creality3D) + * + * Store the current state to the SD Card at the start of each layer + * during SD printing. If the recovery file is found at boot time, present + * an option on the LCD screen to continue the print from the last-known + * point in the file. + */ + #define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, + // especially with "vase mode" printing. Set too high and vases cannot be continued. + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + + //#define DEBUG_POWER_LOSS_RECOVERY // Debug informations on serial output + //#define SAVE_INFO_INTERVAL_MS 0 // Force SD recov. write interval, on each layer start if 0 + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + #define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE true // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES true // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + #define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN + + /** + * 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 SD_ABORT_ON_ENDSTOP_HIT + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + #define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E can be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN [1] + * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define BINARY_FILE_TRANSFER + + #if HAS_SDCARD_CONNECTION + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD + #endif + +#endif // SDSUPPORT + +/** + * By default an onboard SD card reader may be shared as a USB mass- + * storage device. This option hides the SD card from the host PC. + */ +//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // Show SD percentage next to the progress bar + #define DOGM_SD_PERCENT + + // Enable to save many cycles by drawing a hollow frame on the Info Screen + #define XYZ_HOLLOW_FRAME + + // Enable to save many cycles by drawing a hollow frame on Menu Screens + #define MENU_HOLLOW_FRAME + + // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM. + // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. + //#define USE_BIG_EDIT_FONT + + // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM. + // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. + //#define USE_SMALL_INFOFONT + + // Enable this option and reduce the value to optimize screen updates. + // The normal delay is 10µs. Use the lowest value that still gives a reliable display. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + /** + * ST7920-based LCDs can emulate a 16 x 4 character display using + * the ST7920 character-generator for very fast screen updates. + * Enable LIGHTWEIGHT_UI to use this special display mode. + * + * Since LIGHTWEIGHT_UI has limited space, the position and status + * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the + * length of time to display the status message before clearing. + * + * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. + * This will prevent position updates from being displayed. + */ + #if ENABLED(U8GLIB_ST7920) + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + #define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + + // Frivolous Game Options + //#define MARLIN_BRICKOUT + //#define MARLIN_INVADERS + //#define MARLIN_SNAKE + //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu + +#endif // HAS_GRAPHICAL_LCD + +// +// Lulzbot Touch UI +// +#if ENABLED(LULZBOT_TOUCH_UI) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + // see https://ee-programming-notepad.blogspot.com/2016/10/16-bit-color-generator-picker.html + #define TFT_MARLINUI_COLOR COLOR_WHITE + #define TFT_MARLINBG_COLOR COLOR_BLACK + #define TFT_DISABLED_COLOR 0x10A2 // almost black + #define TFT_BTCANCEL_COLOR COLOR_RED + #define TFT_BTARROWS_COLOR COLOR_WHITE + #define TFT_BTOKMENU_COLOR COLOR_BLUE +#endif + +// @section safety + +/** + * The watchdog hardware timer will do a reset and disable all outputs + * if the firmware gets too overloaded to read the temperature sensors. + * + * If you find that watchdog reboot causes your AVR board to hang forever, + * enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO. + * NOTE: This method is less reliable as it can only catch hangups while + * interrupts are enabled. + */ +#define USE_WATCHDOG +#if ENABLED(USE_WATCHDOG) + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#define BABYSTEPPING +#if ENABLED(BABYSTEPPING) + //#define BABYSTEP_WITHOUT_HOMING + //#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA! + #define BABYSTEP_INVERT_Z false // Change if Z babysteps should go the other way + #define BABYSTEP_MULTIPLICATOR 1 // Babysteps are very small. Increase for faster motion. + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) + #define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: Extra time may be added to mitigate controller latency. + //#define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + #endif + + //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * K=0 means advance disabled. + * + * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! + * + * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. + * Larger K values will be needed for flexible filament and greater distances. + * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) + * print acceleration will be reduced during the affected moves to keep within the limit. + * + * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. + * Mention @Sebastianv650 on GitHub to alert the author of any issues. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants + #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed + //#define LA_DEBUG // If enabled, this will generate debug information output over USB. +#endif + +// @section leveling + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + +#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#define ARC_SUPPORT // Disable this feature to save ~3226 bytes +#if ENABLED(ARC_SUPPORT) + #define MM_PER_ARC_SEGMENT 1 // Length of each arc segment + #define MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle + #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +/** + * G38 Probe Target + * + * This option adds G38.2 and G38.3 (probe towards target) + * and optionally G38.4 and G38.5 (probe away from target). + * Set MULTIPLE_PROBING for G38 to probe more than once. + */ +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + //#define G38_PROBE_AWAY // Include G38.4 and G38.5 to probe away from target + #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay before and after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 400 : Minimum for A5984 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 0 : Minimum 500ns for LV8729, adjusted in stepper.h + * 1 : Minimum for A4988 and A5984 stepper drivers + * 2 : Minimum for DRV8825 stepper drivers + * 3 : Minimum for TB6600 stepper drivers + * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_PULSE 2 + +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 200000 : Maximum for LV8729 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MAXIMUM_STEPPER_RATE 250000 + +// @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 (e.g. 8, 16, 32) because shifts and ors are used to do the ring-buffering. +#if ENABLED(SDSUPPORT) + #define BLOCK_BUFFER_SIZE 32 +#else + #define BLOCK_BUFFER_SIZE 16 // Marlin default +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 8 + +// Transmission to Host 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 + +// Host Receive Buffer Size +// Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough. +// To use flow control, set this buffer size to at least 1024 bytes. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048] +//#define RX_BUFFER_SIZE 1024 + +#if RX_BUFFER_SIZE >= 1024 + // Enable to have the controller send XON/XOFF control characters to + // the host to signal the RX buffer is becoming full. + //#define SERIAL_XON_XOFF +#endif + +// Add M575 G-code to change the baud rate +//#define BAUD_RATE_GCODE + +#if ENABLED(SDSUPPORT) + // Enable this option to collect and display the maximum + // RX queue usage after transferring a file to SD. + //#define SERIAL_STATS_MAX_RX_QUEUED + + // Enable this option to collect and display the number + // of dropped bytes after a file transfer to SD. + //#define SERIAL_STATS_DROPPED_RX +#endif + +// 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 + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // Override slicer retractions + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length + #endif + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + //#define TOOLCHANGE_NO_RETURN // Never return to the previous position on tool-change + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_EXTRA_PRIME 2 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +#define ADVANCED_PAUSE_FEATURE +#if ENABLED(ADVANCED_PAUSE_FEATURE) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. + #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. + // This short retract is done immediately, before parking the nozzle. + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. + #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. + // For Bowden, the full length of the tube and nozzle. + // For direct drive, the full length of the nozzle. + // Set to 0 for manual unloading. + #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. + #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. + // 0 to disable start loading and skip to fast load only + #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. + #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. + #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. + // For Bowden, the full length of the tube and nozzle. + // For direct drive, the full length of the nozzle. + //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. + #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. + #define ADVANCED_PAUSE_PURGE_LENGTH 25 // (mm) Length to extrude after loading. + // Set to 0 for manual extrusion. + // Filament can be extruded repeatedly from the Filament Change menu + // until extrusion is consistent, and to purge old filament. + #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. + //#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. + #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. + + #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. + #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. + + //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change + + #define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. + //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #if AXIS_DRIVER_TYPE_X(TMC26X) + #define X_MAX_CURRENT 1000 // (mA) + #define X_SENSE_RESISTOR 91 // (mOhms) + #define X_MICROSTEPS 16 // Number of microsteps + #endif + + #if AXIS_DRIVER_TYPE_X2(TMC26X) + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y(TMC26X) + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Y2(TMC26X) + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z(TMC26X) + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z2(TMC26X) + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_Z3(TMC26X) + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E0(TMC26X) + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E1(TMC26X) + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E2(TMC26X) + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E3(TMC26X) + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E4(TMC26X) + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E5(TMC26X) + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + #endif + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130, TMC2160, TMC2660, TMC5130, TMC5160 stepper drivers in SPI mode + * connect your SPI pins to the hardware SPI interface on your board and define + * the required CS pins in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 + * pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + * You may also use software SPI if you wish to use general purpose IO pins. + * + * To use TMC2208 stepper UART-configurable stepper drivers connect #_SERIAL_TX_PIN + * to the driver side PDN_UART pin with a 1K resistor. + * To use the reading capabilities, also connect #_SERIAL_RX_PIN to PDN_UART without + * a resistor. + * The drivers can also be used with hardware serial. + * + * TMCStepper library is required to use TMC stepper drivers. + * https://github.com/teemuatlut/TMCStepper + */ +#if HAS_TRINAMIC + + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #if AXIS_IS_TMC(X) + #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_MICROSTEPS 16 // 0..256 + #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... + #endif + + #if AXIS_IS_TMC(X2) + #define X2_CURRENT 800 + #define X2_MICROSTEPS 16 + #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 + #endif + + #if AXIS_IS_TMC(Y) + #define Y_CURRENT 800 + #define Y_MICROSTEPS 16 + #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 + #endif + + #if AXIS_IS_TMC(Y2) + #define Y2_CURRENT 800 + #define Y2_MICROSTEPS 16 + #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 + #endif + + #if AXIS_IS_TMC(Z) + #define Z_CURRENT 800 + #define Z_MICROSTEPS 16 + #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 + #endif + + #if AXIS_IS_TMC(Z2) + #define Z2_CURRENT 800 + #define Z2_MICROSTEPS 16 + #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 + #endif + + #if AXIS_IS_TMC(Z3) + #define Z3_CURRENT 800 + #define Z3_MICROSTEPS 16 + #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 + #endif + + #if AXIS_IS_TMC(E0) + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 + #endif + + #if AXIS_IS_TMC(E1) + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 + #endif + + #if AXIS_IS_TMC(E2) + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 + #endif + + #if AXIS_IS_TMC(E3) + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 + #endif + + #if AXIS_IS_TMC(E4) + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 + #endif + + #if AXIS_IS_TMC(E5) + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 + #endif + + /** + * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. + * The default pins can be found in your board's pins file. + */ + //#define X_CS_PIN -1 + //#define Y_CS_PIN -1 + //#define Z_CS_PIN -1 + //#define X2_CS_PIN -1 + //#define Y2_CS_PIN -1 + //#define Z2_CS_PIN -1 + //#define Z3_CS_PIN -1 + //#define E0_CS_PIN -1 + //#define E1_CS_PIN -1 + //#define E2_CS_PIN -1 + //#define E3_CS_PIN -1 + //#define E4_CS_PIN -1 + //#define E5_CS_PIN -1 + + /** + * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). + * The default SW SPI pins are defined the respective pins files, + * but you can override or define them here. + */ + //#define TMC_USE_SW_SPI + //#define TMC_SW_MOSI -1 + //#define TMC_SW_MISO -1 + //#define TMC_SW_SCK -1 + + /** + * Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses. + * Set the address using jumpers on pins MS1 and MS2. + * Address | MS1 | MS2 + * 0 | LOW | LOW + * 1 | HIGH | LOW + * 2 | LOW | HIGH + * 3 | HIGH | HIGH + * + * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers + * on the same serial port, either here or in your board's pins file. + */ + #define X_SLAVE_ADDRESS 0 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 + #define X2_SLAVE_ADDRESS 0 + #define Y2_SLAVE_ADDRESS 0 + #define Z2_SLAVE_ADDRESS 0 + #define Z3_SLAVE_ADDRESS 0 + #define E0_SLAVE_ADDRESS 0 + #define E1_SLAVE_ADDRESS 0 + #define E2_SLAVE_ADDRESS 0 + #define E3_SLAVE_ADDRESS 0 + #define E4_SLAVE_ADDRESS 0 + #define E5_SLAVE_ADDRESS 0 + + /** + * Software enable + * + * Use for drivers that do not use a dedicated enable pin, but rather handle the same + * function through a communication line such as SPI or UART. + */ + //#define SOFTWARE_DRIVER_ENABLE + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP_XY + #define STEALTHCHOP_Z + #define STEALTHCHOP_E + + /** + * Optimize spreadCycle chopper parameters by using predefined parameter sets + * or with the help of an example included in the library. + * Provided parameter sets are + * CHOPPER_DEFAULT_12V + * CHOPPER_DEFAULT_19V + * CHOPPER_DEFAULT_24V + * CHOPPER_DEFAULT_36V + * CHOPPER_PRUSAMK3_24V // Imported parameters from the official Prusa firmware for MK3 (24V) + * CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9 + * + * Define you own with + * { , , hysteresis_start[1..8] } + */ + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + + /** + * Monitor Trinamic drivers for error conditions, + * like overtemperature and short to ground. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * TMC2130, TMC2160, TMC2208, TMC2209, TMC5130 and TMC5160 only + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to home / probe X, Y, Z. + * + * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) + * + * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. + * + * SPI_ENDSTOPS *** Beta feature! *** TMC2130 Only *** + * Poll the driver through SPI to determine load when homing. + * Removes the need for a wire from DIAG1 to an endstop pin. + * + * IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when + * homing and adds a guard period for endstop triggering. + */ + //#define SENSORLESS_HOMING // StallGuard capable drivers only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // StallGuard capable drivers only + + #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) + // TMC2209: 0...255. TMC2130: -64...63 + #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + //#define SPI_ENDSTOPS // TMC2130 only + //#define IMPROVE_HOMING_RELIABILITY + #endif + + /** + * Beta feature! + * Create a 50/50 square wave step pulse optimal for stepper drivers. + */ + //#define SQUARE_WAVE_STEPPING + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * You can set your own advanced settings by filling in predefined functions. + * A list of available functions can be found on the library github page + * https://github.com/teemuatlut/TMCStepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_temp_prewarn(1); \ + * stepperY.interpolate(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + * + * Requires the following to be defined in your pins_YOUR_BOARD file + * L6470_CHAIN_SCK_PIN + * L6470_CHAIN_MISO_PIN + * L6470_CHAIN_MOSI_PIN + * L6470_CHAIN_SS_PIN + * L6470_RESET_CHAIN_PIN (optional) + */ +#if HAS_DRIVER(L6470) + + //#define L6470_CHITCHAT // Display additional status info + + #if AXIS_DRIVER_TYPE_X(L6470) + #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) + #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down) + #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) + #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper + #define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI + #endif + + #if AXIS_DRIVER_TYPE_X2(L6470) + #define X2_MICROSTEPS 128 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + #define X2_MAX_VOLTAGE 127 + #define X2_CHAIN_POS 0 + #endif + + #if AXIS_DRIVER_TYPE_Y(L6470) + #define Y_MICROSTEPS 128 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + #define Y_MAX_VOLTAGE 127 + #define Y_CHAIN_POS 0 + #endif + + #if AXIS_DRIVER_TYPE_Y2(L6470) + #define Y2_MICROSTEPS 128 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + #define Y2_MAX_VOLTAGE 127 + #define Y2_CHAIN_POS 0 + #endif + + #if AXIS_DRIVER_TYPE_Z(L6470) + #define Z_MICROSTEPS 128 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + #define Z_MAX_VOLTAGE 127 + #define Z_CHAIN_POS 0 + #endif + + #if AXIS_DRIVER_TYPE_Z2(L6470) + #define Z2_MICROSTEPS 128 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + #define Z2_MAX_VOLTAGE 127 + #define Z2_CHAIN_POS 0 + #endif + + #if AXIS_DRIVER_TYPE_Z3(L6470) + #define Z3_MICROSTEPS 128 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + #define Z3_MAX_VOLTAGE 127 + #define Z3_CHAIN_POS 0 + #endif + + #if AXIS_DRIVER_TYPE_E0(L6470) + #define E0_MICROSTEPS 128 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + #define E0_MAX_VOLTAGE 127 + #define E0_CHAIN_POS 0 + #endif + + #if AXIS_DRIVER_TYPE_E1(L6470) + #define E1_MICROSTEPS 128 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + #define E1_MAX_VOLTAGE 127 + #define E1_CHAIN_POS 0 + #endif + + #if AXIS_DRIVER_TYPE_E2(L6470) + #define E2_MICROSTEPS 128 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + #define E2_MAX_VOLTAGE 127 + #define E2_CHAIN_POS 0 + #endif + + #if AXIS_DRIVER_TYPE_E3(L6470) + #define E3_MICROSTEPS 128 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + #define E3_MAX_VOLTAGE 127 + #define E3_CHAIN_POS 0 + #endif + + #if AXIS_DRIVER_TYPE_E4(L6470) + #define E4_MICROSTEPS 128 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + #define E4_MAX_VOLTAGE 127 + #define E4_CHAIN_POS 0 + #endif + + #if AXIS_DRIVER_TYPE_E5(L6470) + #define E5_MICROSTEPS 128 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + #define E5_MAX_VOLTAGE 127 + #define E5_CHAIN_POS 0 + #endif + + /** + * Monitor L6470 drivers for error conditions like over temperature and over current. + * In the case of over temperature Marlin can decrease the drive until the error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. + * I not present or I0 or I1 - X, Y, Z or E0 + * I2 - X2, Y2, Z2 or E1 + * I3 - Z3 or E3 + * I4 - E4 + * I5 - E5 + * M916 - Increase drive level until get thermal warning + * M917 - Find minimum current thresholds + * M918 - Increase speed until max or error + * M122 S0/1 - Report driver parameters + */ + //#define MONITOR_L6470_DRIVER_STATUS + + #if ENABLED(MONITOR_L6470_DRIVER_STATUS) + #define KVAL_HOLD_STEP_DOWN 1 + //#define L6470_STOP_ON_ERROR + #endif + +#endif // L6470 + +/** + * 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 M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Photo G-code + * Add the M240 G-code to take a photo. + * The photo can be triggered by a digital pin or a physical movement. + */ +//#define PHOTO_GCODE +#if ENABLED(PHOTO_GCODE) + // A position to move to (and raise Z) before taking the photo + //#define PHOTO_POSITION { X_MAX_POS - 5, Y_MAX_POS, 0 } // { xpos, ypos, zraise } (M240 X Y Z) + //#define PHOTO_DELAY_MS 100 // (ms) Duration to pause before moving back (M240 P) + //#define PHOTO_RETRACT_MM 6.5 // (mm) E retract/recover for the photo move (M240 R S) + + // Canon RC-1 or homebrew digital camera trigger + // Data from: http://www.doc-diy.net/photo/rc-1_hacked/ + //#define PHOTOGRAPH_PIN 23 + + // Canon Hack Development Kit + // http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + //#define CHDK_PIN 4 + + // Optional second move with delay to trigger the camera shutter + //#define PHOTO_SWITCH_POSITION { X_MAX_POS, Y_MAX_POS } // { xpos, ypos } (M240 I J) + + // Duration to hold the switch or keep CHDK_PIN high + //#define PHOTO_SWITCH_MS 50 // (ms) (M240 D) +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop + + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif +#endif + +/** + * Coolant Control + * + * Add the M7, M8, and M9 commands to turn mist or flood coolant on and off. + * + * Note: COOLANT_MIST_PIN and/or COOLANT_FLOOD_PIN must also be defined. + */ +//#define COOLANT_CONTROL +#if ENABLED(COOLANT_CONTROL) + #define COOLANT_MIST // Enable if mist coolant is present + #define COOLANT_FLOOD // Enable if flood coolant is present + #define COOLANT_MIST_INVERT false // Set "true" if the on/off function is reversed + #define COOLANT_FLOOD_INVERT false // Set "true" if the on/off function is reversed +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Expected Printer Check + * Add the M16 G-code to compare a string to the MACHINE_NAME. + * M16 with a non-matching string causes the printer to halt. + */ +//#define EXPECTED_PRINTER_CHECK + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * Startup commands + * + * Execute certain G-code commands immediately after power-on. + */ +//#define STARTUP_COMMANDS "M17 Z" + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Host Action Commands + * + * Define host streamer action commands in compliance with the standard. + * + * See https://reprap.org/wiki/G-code#Action_commands + * Common commands ........ poweroff, pause, paused, resume, resumed, cancel + * G29_RETRY_AND_RECOVER .. probe_rewipe, probe_failed + * + * Some features add reason codes to extend these commands. + * + * Host Prompt Support enables Marlin to use the host for user prompts so + * filament runout and other processes can be managed from the host side. + */ +//#define HOST_ACTION_COMMANDS +#if ENABLED(HOST_ACTION_COMMANDS) + //#define HOST_PROMPT_SUPPORT +#endif + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reliabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper + // steps per full revolution (motor steps/rev * microstepping) + //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the + // printer will attempt to correct the error; errors + // smaller than this are ignored to minimize effects of + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_ENC_2_TICKS_UNIT 2048 + //#define I2CPE_ENC_2_TICKS_REV (16 * 200) + //#define I2CPE_ENC_2_INVERT + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behavior. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * this setting determines the minimum update time between checks. A value of 100 works well with + * error rolling average when attempting to correct only for skips and not for vibration. + */ + #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + +/** + * MAX7219 Debug Matrix + * + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. + * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + //#define MAX7219_SIDE_BY_SIDE // Big chip+matrix boards can be chained side-by-side + + /** + * Sample debug features + * If you add more debug displays, be careful to avoid conflicts! + */ + #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning + #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + + #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + // If you experience stuttering, reboots, etc. this option can reveal how + // tweaks made to the configuration are affecting the printer in real-time. +#endif + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behavior is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" + //#define WEBSUPPORT // Start a webserver with auto-discovery + //#define OTASUPPORT // Support over-the-air firmware updates +#endif + +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + +/** + * Advanced Print Counter settings + */ +#if ENABLED(PRINTCOUNTER) + #define SERVICE_WARNING_BUZZES 3 + // Activate up to 3 service interval watchdogs + //#define SERVICE_NAME_1 "Service S" + //#define SERVICE_INTERVAL_1 100 // print hours + //#define SERVICE_NAME_2 "Service L" + //#define SERVICE_INTERVAL_2 200 // print hours + //#define SERVICE_NAME_3 "Service 3" + //#define SERVICE_INTERVAL_3 1 // print hours +#endif + +// @section develop + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/config/examples/Alfawise/U20-bltouch/_Statusscreen.h b/config/examples/Alfawise/U20-bltouch/_Statusscreen.h new file mode 100644 index 0000000000..519c0d06f4 --- /dev/null +++ b/config/examples/Alfawise/U20-bltouch/_Statusscreen.h @@ -0,0 +1,77 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * 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 . + * + */ + +/** + * Custom Status Screen bitmap + * + * Place this file in the root with your configuration files + * and enable CUSTOM_STATUS_SCREEN_IMAGE in Configuration.h. + * + * Use the Marlin Bitmap Converter to make your own: + * http://marlinfw.org/tools/u8glib/converter.html + */ + +#pragma once + +// +// Status Screen Logo bitmap +// +#define STATUS_LOGO_Y 0 +#define STATUS_LOGO_WIDTH 38 + +static unsigned char status_logo_bmp[] PROGMEM = { + B11111111,B11111111,B11111111,B11111111,B11111100, + B10000000,B00000000,B00010000,B00000111,B11111100, + B10000000,B00000000,B00010000,B00000000,B11111100, + B10000000,B00000000,B00110000,B00000000,B01111100, + B10000000,B00000000,B00110000,B00000000,B00111100, + B10000000,B00000000,B01110000,B00000000,B00011100, + B11111111,B10000000,B01110000,B00000000,B00001100, + B11111111,B10000000,B11110000,B11100000,B00001100, + B11111111,B00000000,B11110000,B11111000,B00001100, + B11111111,B00000001,B11110000,B11111100,B00000100, + B11111110,B00000001,B11110000,B11010010,B00000100, + B11111110,B00000011,B11110000,B10101110,B00000100, + B11111100,B00000000,B11110000,B10101111,B00000100, + B11111100,B00000000,B00110000,B10000011,B00000100, + B11111000,B00000000,B00110000,B11111111,B00000100, + B11111000,B00000000,B00010000,B11111111,B00000100, + B11111111,B11100000,B00010000,B10111111,B00000100, + B11111111,B11110000,B00010000,B10101111,B00000100, + B11111111,B11110000,B00010000,B10101110,B00000100, + B11111111,B11110000,B00010000,B10000010,B00000100, + B10000011,B11110000,B00010000,B11111100,B00000100, + B10000001,B11110000,B00010000,B11111000,B00001100, + B10000001,B11100000,B00010000,B11100000,B00001100, + B10000000,B00000000,B00010000,B00000000,B00001100, + B10000000,B00000000,B00110000,B00000000,B00011100, + B11000000,B00000000,B00110000,B00000000,B00111100, + B11000000,B00000000,B01110000,B00000000,B01111100, + B11100000,B00000000,B11110000,B00000000,B11111100, + B11111000,B00000011,B11110000,B00000111,B11111100 +}; + +// +// Use default bitmaps +// +#define STATUS_HOTEND_ANIM +#define STATUS_BED_ANIM +#define STATUS_LOGO_X 0 +#define STATUS_HEATERS_X 50 +#define STATUS_BED_X 74 diff --git a/config/examples/Alfawise/U20/Configuration.h b/config/examples/Alfawise/U20/Configuration.h index 128e3962bd..9186d0c843 100644 --- a/config/examples/Alfawise/U20/Configuration.h +++ b/config/examples/Alfawise/U20/Configuration.h @@ -75,50 +75,28 @@ // Forum link to help with a tutorial, in French! : // https://www.lesimprimantes3d.fr/forum/topic/18260-alfawise-u20x-u30-marlin-2x-firmware-alternatif/ // -// 1 - Select your Alfawise U30 or U20 or U20+ printer (NO MORE REQUIRED HERE), +// 1 - Select your Alfawise U30 or U20 or U20+ printer (NO MORE REQUIRED HERE) +// and the touchscreen version, either 1.1 or 1.2. Most recent in France are v1.2 (blue pcb) // These defines are set in platformio.ini build parameters, sample for U20 -DU20 -DTS_V12 -// U20_PLUS is not tested, as we do not have a printer to test. -// Print bed PID settings MUST be tuned +// U20_PLUS was not tested, as we do not have a printer to test. Print bed PID settings MUST be tuned for it. -//#define U20_PLUS -//#define U20 -//#define U30 +// Valid platformio.ini submodel values are U20_PLUS U20 U30 LK1 LK2 LK4 + +// Valid platformio.ini touchscreens are TS_V11 TS_V12 // 2 - Select the screen controller type. Most common is ILI9341 - First option. If your screen remains white, // Try the alternate setting - this should enable ST7789V or ILI9328. For other LCDs... code is needed // with the proper boot sequence to be developped. -#define LCD_READ_ID 0xD3 // Read display identification information in reg ID4 0xD3, for ILI9341 screens -//#define LCD_READ_ID 0x04 // Read display identification information in reg ID1 0x04 - ST7789V / ILI9328 or others - -// 3 - Select the touch panel version, either 1.1 or 1.2. Most recent touch panel in France are V 1.2. Blue PCB -// V1.1 panels seem to be older, and came with green PCB. This selection only influence the calibration data -// Should calibration need to be redone, please follow the French Tutorial! (NO MORE REQUIRED HERE) - -//#define TS_V11 -//#define TS_V12 - -// 4 - If you want to tune the UI colors, define custom ones here. RGB 16 bits 5-6-5 format -// see https://ee-programming-notepad.blogspot.com/2016/10/16-bit-color-generator-picker.html - -//#define TFT_MARLINUI_COLOR 0xFFFF // White -//#define TFT_MARLINBG_COLOR 0x0000 // Black -//#define TFT_TOPICONS_COLOR 0x21DD // Blue -//#define TFT_DISABLED_COLOR 0x0003 // Almost black -//#define TFT_BTSLEFT_COLOR 0xDEE6 // 11011 110111 00110 Yellow -//#define TFT_BTRIGHT_COLOR 0x145F // 00010 100010 11111 Cyan +#define LCD_READ_ID 0xD3 // Read display identification information in reg ID4 0xD3, for ILI9341 screens +//#define LCD_READ_ID 0x04 // Read display identification information in reg ID1 0x04 - ST7789V / ILI9328 or others //=========================================================================== // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "Hobi, tpruvot" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -131,10 +109,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -185,6 +166,12 @@ #define CUSTOM_MACHINE_NAME "Alfawise U30" #elif defined(U20_PLUS) #define CUSTOM_MACHINE_NAME "Alfawise U20+" +#elif defined(LK1) +#define CUSTOM_MACHINE_NAME "Longer3D LK1" +#elif defined(LK2) +#define CUSTOM_MACHINE_NAME "Longer3D LK2" +#elif defined(LK4) +#define CUSTOM_MACHINE_NAME "Longer3D LK4" #endif // Printer's unique ID, used by some programs to differentiate between machines. @@ -591,27 +578,28 @@ //#define DEFAULT_bedKi 1.41 //#define DEFAULT_bedKd 1675.16 -#if ENABLED(U30) +#if defined(U30) || defined(LK2) || defined(LK4) //From M303 command for Alfawise U30 : #define DEFAULT_bedKp 338.46 #define DEFAULT_bedKi 63.96 #define DEFAULT_bedKd 447.78 #endif -#if ENABLED(U20) +#if defined(U20) || defined(LK1) //From M303 command for Alfawise U20 : #define DEFAULT_bedKp 841.68 #define DEFAULT_bedKi 152.12 #define DEFAULT_bedKd 1164.25 #endif -#if ENABLED(U20_PLUS) // The PID setting MUST be updated. - //From M303 command for Alfawise U20 : +#ifdef U20_PLUS + // These PID setting MUST be updated. + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. #define DEFAULT_bedKp 841.68 #define DEFAULT_bedKi 152.12 #define DEFAULT_bedKd 1164.25 #endif - // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. + #endif // PIDTEMPBED // @section extruder @@ -965,11 +953,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -981,10 +968,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1018,7 +1005,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1114,19 +1101,19 @@ // @section machine -#if ENABLED(U30) +#if defined(U30) || defined(LK2) || defined(LK4) #define X_BED_SIZE 220 #define Y_BED_SIZE 220 #define Z_MACHINE_MAX 250 #endif -#if ENABLED(U20) +#if defined(U20) || defined(LK1) #define X_BED_SIZE 300 #define Y_BED_SIZE 300 #define Z_MACHINE_MAX 400 #endif -#if ENABLED(U20_PLUS) +#ifdef U20_PLUS #define X_BED_SIZE 400 #define Y_BED_SIZE 400 #define Z_MACHINE_MAX 500 @@ -1290,12 +1277,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1349,19 +1330,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1415,7 +1383,7 @@ #if ENABLED(Z_SAFE_HOMING) #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT 4 // Y point for Z homing when homing all axes (G28). #endif // Homing speeds (mm/m) @@ -1610,7 +1578,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2141,7 +2109,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // #define FSMC_GRAPHICAL_TFT @@ -2156,6 +2124,9 @@ #if ENABLED(TOUCH_BUTTONS) #define TOUCH_CALIBRATION // Include user calibration widget in menus (Alfawise) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 100 // (ms) Button repeat delay for menus + #if ENABLED(TS_V11) // Alfawise U20 ILI9341 2.8 TP Ver 1.1 / Green PCB on the back of touchscreen #define XPT2046_X_CALIBRATION 11605 @@ -2177,11 +2148,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2309,7 +2277,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Alfawise/U20/Configuration_adv.h b/config/examples/Alfawise/U20/Configuration_adv.h index b52184f430..278fd67095 100644 --- a/config/examples/Alfawise/U20/Configuration_adv.h +++ b/config/examples/Alfawise/U20/Configuration_adv.h @@ -138,7 +138,7 @@ */ #if ENABLED(THERMAL_PROTECTION_HOTENDS) #define THERMAL_PROTECTION_PERIOD 60 // Seconds - #define THERMAL_PROTECTION_HYSTERESIS 10 // Degrees Celsius + #define THERMAL_PROTECTION_HYSTERESIS 10 // Degrees Celsius //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -922,9 +918,9 @@ #define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing - #define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files + #define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files - #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + #define EVENT_GCODE_SD_STOP "G28X" // G-code to run on Stop Print (e.g., "G28XY" or "G27") /** * Continue after Power-Loss (Creality3D) @@ -979,10 +975,10 @@ #if ENABLED(SDCARD_SORT_ALPHA) #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. #define FOLDER_SORTING -1 // -1=above 0=none 1=below - #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. - #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_GCODE true // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting. #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) - #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_CACHE_NAMES true // Keep sorted items in RAM longer for speedy performance. Most expensive option. #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. @@ -1212,9 +1208,58 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + // see https://ee-programming-notepad.blogspot.com/2016/10/16-bit-color-generator-picker.html + #define TFT_MARLINUI_COLOR COLOR_WHITE + #define TFT_MARLINBG_COLOR COLOR_BLACK + #define TFT_DISABLED_COLOR 0x10A2 // almost black + #define TFT_BTCANCEL_COLOR COLOR_RED + #define TFT_BTARROWS_COLOR COLOR_WHITE + #define TFT_BTOKMENU_COLOR COLOR_BLUE #endif // @section safety @@ -1296,6 +1341,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1356,7 +1437,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1368,7 +1449,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1411,9 +1493,9 @@ // 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 (e.g. 8, 16, 32) because shifts and ors are used to do the ring-buffering. #if ENABLED(SDSUPPORT) - #define BLOCK_BUFFER_SIZE 32 // SD,LCD,Buttons take more memory, block buffer needs to be smaller + #define BLOCK_BUFFER_SIZE 32 #else - #define BLOCK_BUFFER_SIZE 16 // maximize block buffer + #define BLOCK_BUFFER_SIZE 16 // Marlin default #endif // @section serial @@ -1503,19 +1585,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1721,78 +1803,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1931,10 +2026,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1958,6 +2055,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2441,10 +2539,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2525,6 +2619,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/AliExpress/CL-260/Configuration.h b/config/examples/AliExpress/CL-260/Configuration.h index 9fc03556f6..342b6b94ee 100644 --- a/config/examples/AliExpress/CL-260/Configuration.h +++ b/config/examples/AliExpress/CL-260/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, CL-260)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/AliExpress/UM2pExt/Configuration.h b/config/examples/AliExpress/UM2pExt/Configuration.h index c71de650a1..d24c75cdc9 100644 --- a/config/examples/AliExpress/UM2pExt/Configuration.h +++ b/config/examples/AliExpress/UM2pExt/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -901,11 +899,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -917,10 +914,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -954,7 +951,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1212,12 +1209,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1271,19 +1262,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1532,7 +1510,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2062,7 +2040,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2075,6 +2053,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2085,11 +2066,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2217,7 +2195,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/AliExpress/UM2pExt/Configuration_adv.h b/config/examples/AliExpress/UM2pExt/Configuration_adv.h index e52af82287..74bf6ea7fb 100644 --- a/config/examples/AliExpress/UM2pExt/Configuration_adv.h +++ b/config/examples/AliExpress/UM2pExt/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ #define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1720,78 +1801,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1930,10 +2024,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1957,6 +2053,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2440,10 +2537,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2524,6 +2617,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Anet/A2/Configuration.h b/config/examples/Anet/A2/Configuration.h index 13d30125ae..1a6c4b37f0 100644 --- a/config/examples/Anet/A2/Configuration.h +++ b/config/examples/Anet/A2/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Modmike, Anet A2)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -//#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -//#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -//#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +//#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges //#define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2053,7 +2031,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2066,6 +2044,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2076,11 +2057,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2208,7 +2186,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Anet/A2/Configuration_adv.h b/config/examples/Anet/A2/Configuration_adv.h index 58b94932d2..a3fb3c5c56 100644 --- a/config/examples/Anet/A2/Configuration_adv.h +++ b/config/examples/Anet/A2/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Anet/A2plus/Configuration.h b/config/examples/Anet/A2plus/Configuration.h index b30f4510d0..8ef0e7b11b 100644 --- a/config/examples/Anet/A2plus/Configuration.h +++ b/config/examples/Anet/A2plus/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Modmike, Anet A2 Plus)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -//#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -//#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -//#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +//#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges //#define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2053,7 +2031,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2066,6 +2044,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2076,11 +2057,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2208,7 +2186,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Anet/A2plus/Configuration_adv.h b/config/examples/Anet/A2plus/Configuration_adv.h index 58b94932d2..a3fb3c5c56 100644 --- a/config/examples/Anet/A2plus/Configuration_adv.h +++ b/config/examples/Anet/A2plus/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Anet/A6/Configuration.h b/config/examples/Anet/A6/Configuration.h index 3d0e5e10d4..8122d4cd19 100644 --- a/config/examples/Anet/A6/Configuration.h +++ b/config/examples/Anet/A6/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Ralf_E, ANET A6 config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -937,11 +935,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -953,31 +950,23 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -//#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -//#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -//#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +//#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // ANET A8: FRONT-MOUNTED SENSOR WITH 3D PRINTED MOUNT -//#define X_PROBE_OFFSET_FROM_EXTRUDER -28 // X offset: -left +right [of the nozzle] -//#define Y_PROBE_OFFSET_FROM_EXTRUDER -45 // Y offset: -front +behind [the nozzle] -//#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +//#define NOZZLE_TO_PROBE_OFFSET { -28, -45, 0 } // THESE ARE FOR THE OFFICIAL ANET REAR-MOUNTED SENSOR -//#define X_PROBE_OFFSET_FROM_EXTRUDER -1 // X offset: -left +right [of the nozzle] -//#define Y_PROBE_OFFSET_FROM_EXTRUDER 3 // Y offset: -front +behind [the nozzle] -//#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +//#define NOZZLE_TO_PROBE_OFFSET { -1, 3, 0 } // ANET A6 with BLTouch/3D-Touch mounted right to the nozzle -#define X_PROBE_OFFSET_FROM_EXTRUDER 39 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 39, 0, 0 } //ANET A6 with BLTouch/3D-Touch betwen Fan and Belt // (mount: https://github.com/ralf-e/ANET_A6_modifications/tree/master/A6_X-Axis) -//#define X_PROBE_OFFSET_FROM_EXTRUDER -30 // X offset: -left +right [of the nozzle] -//#define Y_PROBE_OFFSET_FROM_EXTRUDER 15 // Y offset: -front +behind [the nozzle] -//#define Z_PROBE_OFFSET_FROM_EXTRUDER 0.75 // Z offset: -below +above [the nozzle] +//#define NOZZLE_TO_PROBE_OFFSET { -30, 15, 0.75 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1012,7 +1001,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1314,36 +1303,6 @@ #define GRID_MAX_POINTS_X 4 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION 15 - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - 15) - //#define FRONT_PROBE_BED_POSITION 15 - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - 15) - - // ANET A6 - //#define LEFT_PROBE_BED_POSITION 20 - //#define RIGHT_PROBE_BED_POSITION 190 - //#define FRONT_PROBE_BED_POSITION 20 - //#define BACK_PROBE_BED_POSITION 190 - - // ANET A6 BLTOUCH right (39mm) to the nozzle - //#define LEFT_PROBE_BED_POSITION 36 - //#define RIGHT_PROBE_BED_POSITION 190 - //#define FRONT_PROBE_BED_POSITION 20 - //#define BACK_PROBE_BED_POSITION 190 - - // ANET A6 with new X-Axis and modded Y-Axis - //#define LEFT_PROBE_BED_POSITION 20 - //#define RIGHT_PROBE_BED_POSITION 205 - //#define FRONT_PROBE_BED_POSITION 20 - //#define BACK_PROBE_BED_POSITION 205 - - // ANET A6 with new X-Axis and modded Y-Axis, X0/Y0 front left bed edge - //#define LEFT_PROBE_BED_POSITION 20 - //#define RIGHT_PROBE_BED_POSITION 194 - //#define FRONT_PROBE_BED_POSITION 20 - //#define BACK_PROBE_BED_POSITION 194 - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1397,19 +1356,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1672,7 +1618,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2204,7 +2150,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2217,6 +2163,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2227,11 +2176,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2359,7 +2305,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Anet/A6/Configuration_adv.h b/config/examples/Anet/A6/Configuration_adv.h index c0430d7c06..26835659ff 100644 --- a/config/examples/Anet/A6/Configuration_adv.h +++ b/config/examples/Anet/A6/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Anet/A8/Configuration.h b/config/examples/Anet/A8/Configuration.h index 283d9f4942..eeae0493e3 100644 --- a/config/examples/Anet/A8/Configuration.h +++ b/config/examples/Anet/A8/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Bob Kuhn, Anet config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -903,11 +901,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -919,10 +916,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -956,7 +953,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1214,12 +1211,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1534,7 +1525,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2066,7 +2057,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2079,6 +2070,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2089,11 +2083,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2221,7 +2212,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Anet/A8/Configuration_adv.h b/config/examples/Anet/A8/Configuration_adv.h index c5862c1c73..7c66ebfbc3 100644 --- a/config/examples/Anet/A8/Configuration_adv.h +++ b/config/examples/Anet/A8/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Anet/A8plus/Configuration.h b/config/examples/Anet/A8plus/Configuration.h index 046175691e..06aee7111b 100644 --- a/config/examples/Anet/A8plus/Configuration.h +++ b/config/examples/Anet/A8plus/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Martin Zeman - Zemistr, Anet A8 Plus)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -901,11 +899,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -917,10 +914,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -954,7 +951,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1212,12 +1209,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1271,19 +1262,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1532,7 +1510,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2062,7 +2040,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2075,6 +2053,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2085,11 +2066,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2217,7 +2195,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Anet/A8plus/Configuration_adv.h b/config/examples/Anet/A8plus/Configuration_adv.h index 1cb72e327e..2617928545 100644 --- a/config/examples/Anet/A8plus/Configuration_adv.h +++ b/config/examples/Anet/A8plus/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Anet/E16/Configuration.h b/config/examples/Anet/E16/Configuration.h index a0be7a2d1e..487ab36a57 100644 --- a/config/examples/Anet/E16/Configuration.h +++ b/config/examples/Anet/E16/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "InsanityAutomation" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -902,11 +900,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -918,10 +915,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -955,7 +952,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1213,12 +1210,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1272,19 +1263,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1533,7 +1511,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2063,7 +2041,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2076,6 +2054,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2086,11 +2067,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2218,7 +2196,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Anet/E16/Configuration_adv.h b/config/examples/Anet/E16/Configuration_adv.h index e0f4e74cfc..de6d2d8cad 100644 --- a/config/examples/Anet/E16/Configuration_adv.h +++ b/config/examples/Anet/E16/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ #define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/AnimationExample/_Bootscreen.h b/config/examples/AnimationExample/_Bootscreen.h index 69fdca6f75..07d1d7ffd2 100644 --- a/config/examples/AnimationExample/_Bootscreen.h +++ b/config/examples/AnimationExample/_Bootscreen.h @@ -28,312 +28,166 @@ #define CUSTOM_BOOTSCREEN_ANIMATED #define CUSTOM_BOOTSCREEN_FRAME_TIME 100 // (ms) -#define CUSTOM_BOOTSCREEN_BMPWIDTH 128 +#define CUSTOM_BOOTSCREEN_BMPWIDTH 120 const unsigned char custom_start_bmp[] PROGMEM = { - B00011111,B11111111,B11111111,B11111111,B11111111,B11001111,B11111111,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B11011000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B10010000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000100,B00000000,B00000000,B00000000,B00000001,B10100000,B00000000,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000110,B00000000,B00000000,B00000000,B00000001,B01100000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000010,B00000000,B00000000,B00000000,B00000010,B01000000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000001,B11111111,B10000000,B01111111,B11111110,B11000000,B00000000,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B11111111,B11000000,B01111111,B00001000,B10000001,B11100000,B00111000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00100000,B01000000,B00000001,B00000011,B01000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B11111111,B10110000,B00100111,B11111001,B00000010,B01000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B01000000,B11010000,B00110110,B00001101,B10000110,B10000000,B10100000,B00100010,B00010000,B00000010,B10000000,B11110000,B00000000,B00000000,B00000000, - B00000000,B01100000,B01001000,B00010010,B00000100,B10000101,B10000001,B00100000,B01000011,B00110000,B00000010,B00000000,B00111000,B00000000,B00000000,B00000000, - B00000000,B00100000,B00101000,B00001011,B00000010,B11001001,B00000011,B01000000,B11000011,B00110011,B10011010,B10111000,B00011000,B10001000,B00100010,B00000000, - B00000000,B00110000,B00100100,B00001001,B00000011,B01001011,B00000010,B11000000,B10000011,B00110000,B10010010,B10100100,B00011000,B01110000,B00011100,B00000000, - B00000000,B00010000,B00010110,B00000100,B10000001,B00110010,B00000110,B10000001,B10000010,B11010011,B10010010,B10100100,B00110000,B00100000,B00001000,B00000000, - B00000000,B00001000,B00011010,B00000110,B10000001,B10110100,B00000101,B10000001,B00000010,B11010100,B10010010,B10100100,B01110000,B01110000,B00011100,B00000000, - B00000000,B00001100,B00001011,B00000010,B01000000,B10000100,B00001001,B00000010,B00000010,B00010011,B10010010,B10100100,B11111010,B10001010,B10100010,B00000000, - B00000000,B00000100,B00001101,B00000011,B01100000,B01001000,B00001010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000110,B00000100,B10000001,B00100000,B01111000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000010,B00000010,B10000000,B10110000,B00110000,B00110100,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000001,B00000010,B01000000,B10010000,B00000000,B00101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000001,B00000001,B01100000,B01001000,B00000000,B01001000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B10000001,B10100000,B01101000,B00000000,B01011000,B00010001,B11110000,B00000000,B00000000,B00010000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B11000000,B10110000,B00100100,B00000000,B10010000,B00100000,B01000000,B00000000,B00000000,B00010000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B01000000,B11010000,B00110110,B00000001,B10100000,B01100000,B01000011,B00110111,B00011100,B11110011,B10000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B01100000,B01001000,B00010010,B00000001,B01100000,B01000000,B01000100,B10100100,B10000101,B10010100,B01000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00100000,B00101100,B00001011,B00000001,B01000000,B11000000,B01000100,B10100100,B10011101,B00010100,B01000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00010000,B00110100,B00001001,B00000001,B01000000,B10000000,B01000100,B10100100,B10100101,B00010100,B01000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00011000,B00010110,B00000100,B10000001,B00100001,B00000000,B01000011,B00100100,B10011100,B11110011,B10000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00001000,B00011010,B00000110,B10000001,B10100011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00001100,B00001001,B00000010,B01000000,B10010010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000100,B00000101,B00000011,B01100000,B01011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000010,B00000100,B10000001,B00100000,B01101100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000010,B00000010,B11000000,B10110000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000001,B00000011,B01000000,B10010000,B00110000,B11110000,B10010000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000001,B10000001,B01100000,B01011000,B00010000,B10000000,B10000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B10000001,B10100000,B11010000,B00110000,B10000111,B10011110,B10111001,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B11000000,B10010000,B10010000,B00100000,B11101100,B10010100,B11000101,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B01000000,B01011001,B00100000,B01000000,B10001000,B10010100,B11000101,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00100000,B01001011,B01100000,B01000000,B10001100,B10010100,B11000101,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00110000,B00101110,B01000000,B10000000,B11110111,B10010110,B10111001,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00010000,B00110110,B11000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00011000,B00010000,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001000,B00001001,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001100,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000100,B00000110,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000010,B00000110,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000011,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000001,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000001,B10000000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B10000000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B01000000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B01000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00110000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00011001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111, + B10000011,B11001111,B00000000,B00000000,B00001100,B00110000,B00111111, + B10000111,B11111111,B10000000,B00000000,B00001100,B00110000,B00011111, + B10000110,B01111001,B10000000,B00000000,B00001100,B00000000,B00001111, + B10001100,B00110000,B11000111,B10000011,B10001100,B00110000,B11100111, + B10001100,B00110000,B11001111,B11000111,B11001100,B00110001,B11110011, + B10001100,B00110000,B11011100,B11101100,B11101100,B00110011,B10111001, + B10001100,B00110000,B11011000,B01101100,B01101100,B00110011,B00011001, + B10001100,B00110000,B11010000,B01101100,B00001100,B00110011,B00011001, + B10001100,B00110000,B11011000,B01101100,B00001100,B00110011,B00011001, + B10001100,B00110000,B11011100,B01101100,B00001110,B00111011,B00011001, + B10001100,B00110000,B11001111,B01111100,B00000111,B10011111,B00011001, + B10001100,B00110000,B11000111,B01111100,B00000011,B10001111,B00011001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 }; #if ENABLED(CUSTOM_BOOTSCREEN_ANIMATED) const unsigned char custom_start_bmp1[] PROGMEM = { - B11111001,B11111111,B11111111,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00011011,B00000000,B00000000,B00000000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00010010,B00000000,B00000000,B00000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00110100,B00000000,B00000000,B00000000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00101100,B00000000,B00000000,B00000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B01001000,B00000000,B00000000,B00000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B11011000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00010000,B00111100,B00000111,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00100000,B01101000,B00001011,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00100000,B01001000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B10110000,B11010000,B00010100,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B10010000,B10110000,B00100100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B01011001,B00100000,B01101000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B01101001,B01100000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00100110,B01000000,B11010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00110110,B10000000,B10110000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00010000,B10000001,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001001,B00000001,B01000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001111,B00000010,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000110,B00000110,B10000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000101,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00001011,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B10000000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B11000000,B00110100,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B01000000,B00101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B01100000,B00101000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00100000,B00101000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B10010000,B00100100,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B11010000,B00110100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B01001000,B00010010,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B01101100,B00001011,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00100100,B00001101,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00010110,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00010010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001011,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00011010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00100100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B01101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B11001000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B11011000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00100000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B11000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B11000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 }; const unsigned char custom_start_bmp2[] PROGMEM = { - B00011111,B11111111,B11111111,B11111111,B11111111,B11001111,B11111111,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B11011000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B10010000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000100,B00000000,B00000000,B00000000,B00000001,B10100000,B00000000,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000110,B00000000,B00000000,B00000000,B00000001,B01100000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000010,B00000000,B00000000,B00000000,B00000010,B01000000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000001,B11111111,B10000000,B01111111,B11111110,B11000000,B00000000,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B11111111,B11000000,B01111111,B00001000,B10000001,B11100000,B00111000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00100000,B01000000,B00000001,B00000011,B01000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B11111111,B10110000,B00100111,B11111001,B00000010,B01000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B01000000,B11010000,B00110110,B00001101,B10000110,B10000000,B10100000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B01100000,B01001000,B00010010,B00000100,B10000101,B10000001,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00100000,B00101000,B00001011,B00000010,B11001001,B00000011,B01000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00110000,B00100100,B00001001,B00000011,B01001011,B00000010,B11000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00010000,B00010110,B00000100,B10000001,B00110010,B00000110,B10000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00001000,B00011010,B00000110,B10000001,B10110100,B00000101,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00001100,B00001011,B00000010,B01000000,B10000100,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000100,B00001101,B00000011,B01100000,B01001000,B00001010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000110,B00000100,B10000001,B00100000,B01111000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000010,B00000010,B10000000,B10110000,B00110000,B00110100,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000001,B00000010,B01000000,B10010000,B00000000,B00101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000001,B00000001,B01100000,B01001000,B00000000,B01001000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B10000001,B10100000,B01101000,B00000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B11000000,B10110000,B00100100,B00000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B01000000,B11010000,B00110110,B00000001,B10100000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B01100000,B01001000,B00010010,B00000001,B01100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00100000,B00101100,B00001011,B00000001,B01000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00010000,B00110100,B00001001,B00000001,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00011000,B00010110,B00000100,B10000001,B00100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00001000,B00011010,B00000110,B10000001,B10100011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00001100,B00001001,B00000010,B01000000,B10010010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000100,B00000101,B00000011,B01100000,B01011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000010,B00000100,B10000001,B00100000,B01101100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000010,B00000010,B11000000,B10110000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000001,B00000011,B01000000,B10010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000001,B10000001,B01100000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B10000001,B10100000,B11010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B11000000,B10010000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B01000000,B01011001,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00100000,B01001011,B01100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00110000,B00101110,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00010000,B00110110,B11000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00011000,B00010000,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001000,B00001001,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001100,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000100,B00000110,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000010,B00000110,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000011,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000001,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000001,B10000000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B10000000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B01000000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B01000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00110000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00011001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111, + B10000011,B11001111,B00000000,B00000000,B00000000,B00000000,B00111111, + B10000111,B11111111,B10000000,B00000000,B00000000,B00000000,B00011111, + B10000110,B01111001,B10000000,B00000000,B00000000,B00000000,B00001111, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000111, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000011, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000000,B00000000,B00000000,B00000000,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 }; const unsigned char custom_start_bmp3[] PROGMEM = { - B00011111,B11111111,B11111111,B11111111,B11111111,B11001111,B11111111,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B11011000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B10010000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000100,B00000000,B00000000,B00000000,B00000001,B10100000,B00000000,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000110,B00000000,B00000000,B00000000,B00000001,B01100000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000010,B00000000,B00000000,B00000000,B00000010,B01000000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000001,B11111111,B10000000,B01111111,B11111110,B11000000,B00000000,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B11111111,B11000000,B01111111,B00001000,B10000001,B11100000,B00111000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00100000,B01000000,B00000001,B00000011,B01000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B11111111,B10110000,B00100111,B11111001,B00000010,B01000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B01000000,B11010000,B00110110,B00001101,B10000110,B10000000,B10100000,B00100010,B00010000,B00000010,B10000000,B11110000,B00000000,B00000000,B00000000, - B00000000,B01100000,B01001000,B00010010,B00000100,B10000101,B10000001,B00100000,B01000011,B00110000,B00000010,B00000000,B00111000,B00000000,B00000000,B00000000, - B00000000,B00100000,B00101000,B00001011,B00000010,B11001001,B00000011,B01000000,B11000011,B00110011,B10011010,B10111000,B00011000,B10001000,B00100010,B00000000, - B00000000,B00110000,B00100100,B00001001,B00000011,B01001011,B00000010,B11000000,B10000011,B00110000,B10010010,B10100100,B00011000,B01110000,B00011100,B00000000, - B00000000,B00010000,B00010110,B00000100,B10000001,B00110010,B00000110,B10000001,B10000010,B11010011,B10010010,B10100100,B00110000,B00100000,B00001000,B00000000, - B00000000,B00001000,B00011010,B00000110,B10000001,B10110100,B00000101,B10000001,B00000010,B11010100,B10010010,B10100100,B01110000,B01110000,B00011100,B00000000, - B00000000,B00001100,B00001011,B00000010,B01000000,B10000100,B00001001,B00000010,B00000010,B00010011,B10010010,B10100100,B11111010,B10001010,B10100010,B00000000, - B00000000,B00000100,B00001101,B00000011,B01100000,B01001000,B00001010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000110,B00000100,B10000001,B00100000,B01111000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000010,B00000010,B10000000,B10110000,B00110000,B00110100,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000001,B00000010,B01000000,B10010000,B00000000,B00101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000001,B00000001,B01100000,B01001000,B00000000,B01001000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B10000001,B10100000,B01101000,B00000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B11000000,B10110000,B00100100,B00000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B01000000,B11010000,B00110110,B00000001,B10100000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B01100000,B01001000,B00010010,B00000001,B01100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00100000,B00101100,B00001011,B00000001,B01000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00010000,B00110100,B00001001,B00000001,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00011000,B00010110,B00000100,B10000001,B00100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00001000,B00011010,B00000110,B10000001,B10100011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00001100,B00001001,B00000010,B01000000,B10010010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000100,B00000101,B00000011,B01100000,B01011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000010,B00000100,B10000001,B00100000,B01101100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000010,B00000010,B11000000,B10110000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000001,B00000011,B01000000,B10010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000001,B10000001,B01100000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B10000001,B10100000,B11010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B11000000,B10010000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B01000000,B01011001,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00100000,B01001011,B01100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00110000,B00101110,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00010000,B00110110,B11000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00011000,B00010000,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001000,B00001001,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001100,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000100,B00000110,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000010,B00000110,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000011,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000001,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000001,B10000000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B10000000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B01000000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B01000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00110000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00011001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111, + B10000011,B11001111,B00000000,B00000000,B00000000,B00000000,B00111111, + B10000111,B11111111,B10000000,B00000000,B00000000,B00000000,B00011111, + B10000110,B01111001,B10000000,B00000000,B00000000,B00000000,B00001111, + B10001100,B00110000,B11000111,B10000000,B00000000,B00000000,B00000111, + B10001100,B00110000,B11001111,B11000000,B00000000,B00000000,B00000011, + B10001100,B00110000,B11011100,B11100000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11011000,B01100000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11010000,B01100000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11011000,B01100000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11011100,B01100000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11001111,B01110000,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000111,B01110000,B00000000,B00000000,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 }; const unsigned char custom_start_bmp4[] PROGMEM = { - B00011111,B11111111,B11111111,B11111111,B11111111,B11001111,B11111111,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B11011000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00001000,B00000000,B00000000,B00000000,B00000000,B10010000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000100,B00000000,B00000000,B00000000,B00000001,B10100000,B00000000,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000110,B00000000,B00000000,B00000000,B00000001,B01100000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000010,B00000000,B00000000,B00000000,B00000010,B01000000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000001,B11111111,B10000000,B01111111,B11111110,B11000000,B00000000,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B11111111,B11000000,B01111111,B00001000,B10000001,B11100000,B00111000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00100000,B01000000,B00000001,B00000011,B01000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B11111111,B10110000,B00100111,B11111001,B00000010,B01000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B01000000,B11010000,B00110110,B00001101,B10000110,B10000000,B10100000,B00100010,B00010000,B00000010,B10000000,B11110000,B00000000,B00000000,B00000000, - B00000000,B01100000,B01001000,B00010010,B00000100,B10000101,B10000001,B00100000,B01000011,B00110000,B00000010,B00000000,B00111000,B00000000,B00000000,B00000000, - B00000000,B00100000,B00101000,B00001011,B00000010,B11001001,B00000011,B01000000,B11000011,B00110011,B10011010,B10111000,B00011000,B10001000,B00100010,B00000000, - B00000000,B00110000,B00100100,B00001001,B00000011,B01001011,B00000010,B11000000,B10000011,B00110000,B10010010,B10100100,B00011000,B01110000,B00011100,B00000000, - B00000000,B00010000,B00010110,B00000100,B10000001,B00110010,B00000110,B10000001,B10000010,B11010011,B10010010,B10100100,B00110000,B00100000,B00001000,B00000000, - B00000000,B00001000,B00011010,B00000110,B10000001,B10110100,B00000101,B10000001,B00000010,B11010100,B10010010,B10100100,B01110000,B01110000,B00011100,B00000000, - B00000000,B00001100,B00001011,B00000010,B01000000,B10000100,B00001001,B00000010,B00000010,B00010011,B10010010,B10100100,B11111010,B10001010,B10100010,B00000000, - B00000000,B00000100,B00001101,B00000011,B01100000,B01001000,B00001010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000110,B00000100,B10000001,B00100000,B01111000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000010,B00000010,B10000000,B10110000,B00110000,B00110100,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000001,B00000010,B01000000,B10010000,B00000000,B00101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000001,B00000001,B01100000,B01001000,B00000000,B01001000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B10000001,B10100000,B01101000,B00000000,B01011000,B00010001,B11110000,B00000000,B00000000,B00010000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B11000000,B10110000,B00100100,B00000000,B10010000,B00100000,B01000000,B00000000,B00000000,B00010000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B01000000,B11010000,B00110110,B00000001,B10100000,B01100000,B01000011,B00110111,B00011100,B11110011,B10000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B01100000,B01001000,B00010010,B00000001,B01100000,B01000000,B01000100,B10100100,B10000101,B10010010,B01000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00100000,B00101100,B00001011,B00000001,B01000000,B11000000,B01000100,B10100100,B10011101,B00010100,B01000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00010000,B00110100,B00001001,B00000001,B01000000,B10000000,B01000100,B10100100,B10100101,B00010010,B01000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00011000,B00010110,B00000100,B10000001,B00100001,B00000000,B01000011,B00100100,B10011100,B11110011,B10000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00001000,B00011010,B00000110,B10000001,B10100011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00001100,B00001001,B00000010,B01000000,B10010010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000100,B00000101,B00000011,B01100000,B01011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000010,B00000100,B10000001,B00100000,B01101100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000010,B00000010,B11000000,B10110000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000001,B00000011,B01000000,B10010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000001,B10000001,B01100000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B10000001,B10100000,B11010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B11000000,B10010000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B01000000,B01011001,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00100000,B01001011,B01100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00110000,B00101110,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00010000,B00110110,B11000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00011000,B00010000,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001000,B00001001,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00001100,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000100,B00000110,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000010,B00000110,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000011,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000001,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000001,B10000000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B10000000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B01000000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B01000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00110000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00011001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, - B00000000,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111, + B10000011,B11001111,B00000000,B00000000,B00000000,B00000000,B00111111, + B10000111,B11111111,B10000000,B00000000,B00000000,B00000000,B00011111, + B10000110,B01111001,B10000000,B00000000,B00000000,B00000000,B00001111, + B10001100,B00110000,B11000111,B10000011,B10000000,B00000000,B00000111, + B10001100,B00110000,B11001111,B11000111,B11000000,B00000000,B00000011, + B10001100,B00110000,B11011100,B11101100,B11100000,B00000000,B00000001, + B10001100,B00110000,B11011000,B01101100,B01100000,B00000000,B00000001, + B10001100,B00110000,B11010000,B01101100,B00000000,B00000000,B00000001, + B10001100,B00110000,B11011000,B01101100,B00000000,B00000000,B00000001, + B10001100,B00110000,B11011100,B01101100,B00000000,B00000000,B00000001, + B10001100,B00110000,B11001111,B01111100,B00000000,B00000000,B00000001, + B10001100,B00110000,B11000111,B01111100,B00000000,B00000000,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 + }; + + const unsigned char custom_start_bmp5[] PROGMEM = { + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111, + B10000011,B11001111,B00000000,B00000000,B00001100,B00000000,B00111111, + B10000111,B11111111,B10000000,B00000000,B00001100,B00000000,B00011111, + B10000110,B01111001,B10000000,B00000000,B00001100,B00000000,B00001111, + B10001100,B00110000,B11000111,B10000011,B10001100,B00000000,B00000111, + B10001100,B00110000,B11001111,B11000111,B11001100,B00000000,B00000011, + B10001100,B00110000,B11011100,B11101100,B11101100,B00000000,B00000001, + B10001100,B00110000,B11011000,B01101100,B01101100,B00000000,B00000001, + B10001100,B00110000,B11010000,B01101100,B00001100,B00000000,B00000001, + B10001100,B00110000,B11011000,B01101100,B00001100,B00000000,B00000001, + B10001100,B00110000,B11011100,B01101100,B00001110,B00000000,B00000001, + B10001100,B00110000,B11001111,B01111100,B00000111,B10000000,B00000001, + B10001100,B00110000,B11000111,B01111100,B00000011,B10000000,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 + }; + + const unsigned char custom_start_bmp6[] PROGMEM = { + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111, + B10000011,B11001111,B00000000,B00000000,B00001100,B00110000,B00111111, + B10000111,B11111111,B10000000,B00000000,B00001100,B00110000,B00011111, + B10000110,B01111001,B10000000,B00000000,B00001100,B00000000,B00001111, + B10001100,B00110000,B11000111,B10000011,B10001100,B00110000,B00000111, + B10001100,B00110000,B11001111,B11000111,B11001100,B00110000,B00000011, + B10001100,B00110000,B11011100,B11101100,B11101100,B00110000,B00000001, + B10001100,B00110000,B11011000,B01101100,B01101100,B00110000,B00000001, + B10001100,B00110000,B11010000,B01101100,B00001100,B00110000,B00000001, + B10001100,B00110000,B11011000,B01101100,B00001100,B00110000,B00000001, + B10001100,B00110000,B11011100,B01101100,B00001110,B00111000,B00000001, + B10001100,B00110000,B11001111,B01111100,B00000111,B10011100,B00000001, + B10001100,B00110000,B11000111,B01111100,B00000011,B10001100,B00000001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 }; const unsigned char * const custom_bootscreen_animation[] PROGMEM = { - custom_start_bmp1, custom_start_bmp2, custom_start_bmp3, custom_start_bmp4, custom_start_bmp + custom_start_bmp1, custom_start_bmp2, custom_start_bmp3, custom_start_bmp4, custom_start_bmp5, custom_start_bmp6, custom_start_bmp }; #endif diff --git a/config/examples/AnyCubic/i3/Configuration.h b/config/examples/AnyCubic/i3/Configuration.h index 930abc65a4..e5f96e0d97 100644 --- a/config/examples/AnyCubic/i3/Configuration.h +++ b/config/examples/AnyCubic/i3/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -900,11 +898,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -916,10 +913,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 75 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 5 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -2 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 75, 5, -2 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -953,7 +950,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1211,12 +1208,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1270,19 +1261,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1531,7 +1509,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2061,7 +2039,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2074,6 +2052,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2084,11 +2065,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2216,7 +2194,7 @@ */ #define NUM_SERVOS 1 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/AnyCubic/i3/Configuration_adv.h b/config/examples/AnyCubic/i3/Configuration_adv.h index b76cceeeb9..4535ddd15d 100644 --- a/config/examples/AnyCubic/i3/Configuration_adv.h +++ b/config/examples/AnyCubic/i3/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/ArmEd/Configuration.h b/config/examples/ArmEd/Configuration.h index 4d7c5157d1..05436cb482 100644 --- a/config/examples/ArmEd/Configuration.h +++ b/config/examples/ArmEd/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -891,11 +889,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -907,10 +904,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -944,7 +941,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1202,12 +1199,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1261,19 +1252,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1522,7 +1500,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2052,7 +2030,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2065,6 +2043,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2075,11 +2056,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2207,7 +2185,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/ArmEd/Configuration_adv.h b/config/examples/ArmEd/Configuration_adv.h index 29a1e932da..206ec66b73 100644 --- a/config/examples/ArmEd/Configuration_adv.h +++ b/config/examples/ArmEd/Configuration_adv.h @@ -218,7 +218,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -606,8 +606,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -624,7 +624,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -651,19 +651,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -743,8 +730,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -841,6 +828,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1213,9 +1209,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1297,6 +1341,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1357,7 +1437,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1369,7 +1449,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1504,19 +1585,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1722,78 +1803,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1932,10 +2026,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1959,6 +2055,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2442,10 +2539,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2526,6 +2619,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Azteeg/X5GT/Configuration.h b/config/examples/Azteeg/X5GT/Configuration.h index c2d89e87a9..12574f07b8 100644 --- a/config/examples/Azteeg/X5GT/Configuration.h +++ b/config/examples/Azteeg/X5GT/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/BIBO/TouchX/cyclops/Configuration.h b/config/examples/BIBO/TouchX/cyclops/Configuration.h index 601f5a2514..e9995f707a 100644 --- a/config/examples/BIBO/TouchX/cyclops/Configuration.h +++ b/config/examples/BIBO/TouchX/cyclops/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION 15 - //#define RIGHT_PROBE_BED_POSITION 170 - //#define FRONT_PROBE_BED_POSITION 20 - //#define BACK_PROBE_BED_POSITION 170 - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h b/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h index c995f9851b..948553cc02 100644 --- a/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/BIBO/TouchX/default/Configuration.h b/config/examples/BIBO/TouchX/default/Configuration.h index 393e0e3123..3cde043a46 100644 --- a/config/examples/BIBO/TouchX/default/Configuration.h +++ b/config/examples/BIBO/TouchX/default/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION 15 - //#define RIGHT_PROBE_BED_POSITION 170 - //#define FRONT_PROBE_BED_POSITION 20 - //#define BACK_PROBE_BED_POSITION 170 - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/BIBO/TouchX/default/Configuration_adv.h b/config/examples/BIBO/TouchX/default/Configuration_adv.h index 91d2deac0b..57b3879264 100644 --- a/config/examples/BIBO/TouchX/default/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/default/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/BQ/Hephestos/Configuration.h b/config/examples/BQ/Hephestos/Configuration.h index 529333501d..045c0698d5 100644 --- a/config/examples/BQ/Hephestos/Configuration.h +++ b/config/examples/BQ/Hephestos/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -878,11 +876,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -894,10 +891,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -931,7 +928,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1189,12 +1186,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1248,19 +1239,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1509,7 +1487,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2039,7 +2017,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2052,6 +2030,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2062,11 +2043,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2194,7 +2172,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/BQ/Hephestos/Configuration_adv.h b/config/examples/BQ/Hephestos/Configuration_adv.h index 46ba6804ee..7caba1b36a 100644 --- a/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/config/examples/BQ/Hephestos/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 120*60, 120*60, 18*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 120*60, 120*60, 18*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/BQ/Hephestos_2/Configuration.h b/config/examples/BQ/Hephestos_2/Configuration.h index 763285c296..ae0d1771e0 100644 --- a/config/examples/BQ/Hephestos_2/Configuration.h +++ b/config/examples/BQ/Hephestos_2/Configuration.h @@ -78,13 +78,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "@jbrazio" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -97,10 +92,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -891,11 +889,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -907,10 +904,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 34 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 15 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 34, 15, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -944,7 +941,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 5 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION X_MIN_POS + (X_PROBE_OFFSET_FROM_EXTRUDER) - //#define RIGHT_PROBE_BED_POSITION X_MAX_POS - (X_PROBE_OFFSET_FROM_EXTRUDER) - //#define FRONT_PROBE_BED_POSITION Y_MIN_POS + (Y_PROBE_OFFSET_FROM_EXTRUDER) - //#define BACK_PROBE_BED_POSITION Y_MAX_POS - (Y_PROBE_OFFSET_FROM_EXTRUDER) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/BQ/Hephestos_2/Configuration_adv.h b/config/examples/BQ/Hephestos_2/Configuration_adv.h index cfe9262c42..39546c03aa 100644 --- a/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ #define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - //#define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -845,6 +832,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + //#define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1217,9 +1213,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1301,6 +1345,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1361,7 +1441,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1373,7 +1453,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1508,19 +1589,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1726,78 +1807,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1936,10 +2030,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1963,6 +2059,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2446,10 +2543,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2530,6 +2623,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/BQ/WITBOX/Configuration.h b/config/examples/BQ/WITBOX/Configuration.h index a891587649..520538fb87 100644 --- a/config/examples/BQ/WITBOX/Configuration.h +++ b/config/examples/BQ/WITBOX/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(bq Witbox)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -878,11 +876,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -894,10 +891,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -931,7 +928,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1189,12 +1186,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1248,19 +1239,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1509,7 +1487,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2039,7 +2017,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2052,6 +2030,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2062,11 +2043,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2194,7 +2172,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/BQ/WITBOX/Configuration_adv.h b/config/examples/BQ/WITBOX/Configuration_adv.h index 46ba6804ee..7caba1b36a 100644 --- a/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/config/examples/BQ/WITBOX/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 120*60, 120*60, 18*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 120*60, 120*60, 18*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Cartesio/Configuration.h b/config/examples/Cartesio/Configuration.h index 378a4f42b9..2a059914ab 100644 --- a/config/examples/Cartesio/Configuration.h +++ b/config/examples/Cartesio/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(MaukCC, CartesioE)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -889,11 +887,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -905,10 +902,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -942,7 +939,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1200,12 +1197,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1259,19 +1250,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1520,7 +1498,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2050,7 +2028,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2063,6 +2041,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2073,11 +2054,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// #define REPRAPWORLD_KEYPAD -#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2205,7 +2183,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Cartesio/Configuration_adv.h b/config/examples/Cartesio/Configuration_adv.h index 19648b8275..4829230178 100644 --- a/config/examples/Cartesio/Configuration_adv.h +++ b/config/examples/Cartesio/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/CR-10/Configuration.h b/config/examples/Creality/CR-10/Configuration.h index e2d3154692..f107cfcfbb 100644 --- a/config/examples/Creality/CR-10/Configuration.h +++ b/config/examples/Creality/CR-10/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Creality CR-10)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -900,11 +898,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -916,10 +913,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -953,7 +950,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1211,12 +1208,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1270,19 +1261,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1531,7 +1509,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2061,7 +2039,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2074,6 +2052,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2084,11 +2065,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2216,7 +2194,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/CR-10/Configuration_adv.h b/config/examples/Creality/CR-10/Configuration_adv.h index 9c30637083..38579f130b 100644 --- a/config/examples/Creality/CR-10/Configuration_adv.h +++ b/config/examples/Creality/CR-10/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2441,10 +2538,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2525,6 +2618,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/CR-10S/Configuration.h b/config/examples/Creality/CR-10S/Configuration.h index 5116d9c320..30904e3d1a 100644 --- a/config/examples/Creality/CR-10S/Configuration.h +++ b/config/examples/Creality/CR-10S/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(printedsolid.com, CR-10S)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1202,12 +1199,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1261,19 +1252,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1522,7 +1500,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2052,7 +2030,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2065,6 +2043,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2075,11 +2056,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2207,7 +2185,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/CR-10S/Configuration_adv.h b/config/examples/Creality/CR-10S/Configuration_adv.h index e9a2f7f1ed..39c40f594f 100644 --- a/config/examples/Creality/CR-10S/Configuration_adv.h +++ b/config/examples/Creality/CR-10S/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' #define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/CR-10_5S/Configuration.h b/config/examples/Creality/CR-10_5S/Configuration.h index c85237d6ce..03037f5a8a 100644 --- a/config/examples/Creality/CR-10_5S/Configuration.h +++ b/config/examples/Creality/CR-10_5S/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Evgeny-SPB, CR-10 S5)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -891,11 +889,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -907,10 +904,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -944,7 +941,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1204,12 +1201,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1263,19 +1254,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1524,7 +1502,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2054,7 +2032,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2067,6 +2045,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2077,11 +2058,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2209,7 +2187,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/CR-10_5S/Configuration_adv.h b/config/examples/Creality/CR-10_5S/Configuration_adv.h index 93fcb4ec35..a18004fc7a 100644 --- a/config/examples/Creality/CR-10_5S/Configuration_adv.h +++ b/config/examples/Creality/CR-10_5S/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' #define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/CR-10mini/Configuration.h b/config/examples/Creality/CR-10mini/Configuration.h index ee684d1bb3..f6124787b0 100644 --- a/config/examples/Creality/CR-10mini/Configuration.h +++ b/config/examples/Creality/CR-10mini/Configuration.h @@ -79,13 +79,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -98,10 +93,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -909,11 +907,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -925,10 +922,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -962,7 +959,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1220,12 +1217,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1279,19 +1270,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1540,7 +1518,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2070,7 +2048,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2083,6 +2061,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2093,11 +2074,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2225,7 +2203,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/CR-10mini/Configuration_adv.h b/config/examples/Creality/CR-10mini/Configuration_adv.h index 83594ae443..9f265b4bcb 100644 --- a/config/examples/Creality/CR-10mini/Configuration_adv.h +++ b/config/examples/Creality/CR-10mini/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/CR-20 Pro/Configuration.h b/config/examples/Creality/CR-20 Pro/Configuration.h index fa77971922..c7962db100 100644 --- a/config/examples/Creality/CR-20 Pro/Configuration.h +++ b/config/examples/Creality/CR-20 Pro/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(CR-20 Pro)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -893,11 +891,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -909,10 +906,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -946,7 +943,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1204,12 +1201,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1263,19 +1254,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1524,7 +1502,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2054,7 +2032,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2067,6 +2045,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2077,11 +2058,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2209,7 +2187,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/CR-20 Pro/Configuration_adv.h b/config/examples/Creality/CR-20 Pro/Configuration_adv.h index 2b8c08d7d5..62861301fb 100644 --- a/config/examples/Creality/CR-20 Pro/Configuration_adv.h +++ b/config/examples/Creality/CR-20 Pro/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/CR-20/Configuration.h b/config/examples/Creality/CR-20/Configuration.h index b1e05c21b5..d1166cb475 100644 --- a/config/examples/Creality/CR-20/Configuration.h +++ b/config/examples/Creality/CR-20/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(m0oml)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -893,11 +891,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -909,10 +906,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -946,7 +943,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1204,12 +1201,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1263,19 +1254,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1524,7 +1502,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2054,7 +2032,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2067,6 +2045,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2077,11 +2058,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2209,7 +2187,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/CR-20/Configuration_adv.h b/config/examples/Creality/CR-20/Configuration_adv.h index 3a9f4efba2..5ef0e0ecb5 100644 --- a/config/examples/Creality/CR-20/Configuration_adv.h +++ b/config/examples/Creality/CR-20/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/CR-8/Configuration.h b/config/examples/Creality/CR-8/Configuration.h index 3994fe69dc..571758dbde 100644 --- a/config/examples/Creality/CR-8/Configuration.h +++ b/config/examples/Creality/CR-8/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(D-side, CR-8)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -900,11 +898,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -916,10 +913,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -953,7 +950,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1211,12 +1208,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1270,19 +1261,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1531,7 +1509,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2061,7 +2039,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2074,6 +2052,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2084,11 +2065,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2216,7 +2194,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/CR-8/Configuration_adv.h b/config/examples/Creality/CR-8/Configuration_adv.h index 97774cb707..872dd34dc5 100644 --- a/config/examples/Creality/CR-8/Configuration_adv.h +++ b/config/examples/Creality/CR-8/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' #define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/Ender-2/Configuration.h b/config/examples/Creality/Ender-2/Configuration.h index 83062c9a25..4ffdada6b4 100644 --- a/config/examples/Creality/Ender-2/Configuration.h +++ b/config/examples/Creality/Ender-2/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(tommie, Ender 2/4)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -894,11 +892,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -910,10 +907,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -947,7 +944,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1205,12 +1202,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1264,19 +1255,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1525,7 +1503,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2055,7 +2033,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2068,6 +2046,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2078,11 +2059,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2210,7 +2188,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/Ender-2/Configuration_adv.h b/config/examples/Creality/Ender-2/Configuration_adv.h index 90d8f1b90e..a694cd9b15 100644 --- a/config/examples/Creality/Ender-2/Configuration_adv.h +++ b/config/examples/Creality/Ender-2/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 0 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 0 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/Ender-3/Configuration.h b/config/examples/Creality/Ender-3/Configuration.h index e1e81d3df9..a0c7888788 100644 --- a/config/examples/Creality/Ender-3/Configuration.h +++ b/config/examples/Creality/Ender-3/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Ender-3)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -894,11 +892,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -910,10 +907,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -947,7 +944,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1205,12 +1202,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1264,19 +1255,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1525,7 +1503,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2055,7 +2033,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2068,6 +2046,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2078,11 +2059,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2210,7 +2188,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/Ender-3/Configuration_adv.h b/config/examples/Creality/Ender-3/Configuration_adv.h index e942cfdf13..4af52ddc11 100644 --- a/config/examples/Creality/Ender-3/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1715,81 +1796,94 @@ #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) - #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. + #define X_CURRENT 580 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) - #define Y_CURRENT 800 + #define Y_CURRENT 580 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) - #define Z_CURRENT 800 + #define Z_CURRENT 580 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) - #define E0_CURRENT 800 + #define E0_CURRENT 650 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/Ender-3/_Statusscreen.h b/config/examples/Creality/Ender-3/_Statusscreen.h index bf3934729a..025801f4fc 100644 --- a/config/examples/Creality/Ender-3/_Statusscreen.h +++ b/config/examples/Creality/Ender-3/_Statusscreen.h @@ -34,6 +34,7 @@ // // Status Screen Logo bitmap // +#define STATUS_LOGO_Y 8 #define STATUS_LOGO_WIDTH 39 const unsigned char status_logo_bmp[] PROGMEM = { diff --git a/config/examples/Creality/Ender-4/Configuration.h b/config/examples/Creality/Ender-4/Configuration.h index c52cdcb32e..3015b74690 100644 --- a/config/examples/Creality/Ender-4/Configuration.h +++ b/config/examples/Creality/Ender-4/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Skorpi, Creality Ender-4, brandstaetter)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -900,11 +898,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -916,10 +913,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -953,7 +950,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1211,12 +1208,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1270,19 +1261,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1531,7 +1509,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2061,7 +2039,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2074,6 +2052,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2084,11 +2065,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2216,7 +2194,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/Ender-4/Configuration_adv.h b/config/examples/Creality/Ender-4/Configuration_adv.h index eca3601f97..8f4262e48d 100644 --- a/config/examples/Creality/Ender-4/Configuration_adv.h +++ b/config/examples/Creality/Ender-4/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' #define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/Ender-5/Configuration.h b/config/examples/Creality/Ender-5/Configuration.h index cc616a240d..204be000bf 100644 --- a/config/examples/Creality/Ender-5/Configuration.h +++ b/config/examples/Creality/Ender-5/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Ender-5)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -893,11 +891,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -909,10 +906,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -946,7 +943,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1204,12 +1201,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1263,19 +1254,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1524,7 +1502,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2054,7 +2032,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2067,6 +2045,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2077,11 +2058,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2209,7 +2187,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Creality/Ender-5/Configuration_adv.h b/config/examples/Creality/Ender-5/Configuration_adv.h index 3cb1d6e17c..89d508aa90 100644 --- a/config/examples/Creality/Ender-5/Configuration_adv.h +++ b/config/examples/Creality/Ender-5/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Dagoma/Disco Ultimate/Configuration.h b/config/examples/Dagoma/Disco Ultimate/Configuration.h index 6f15d8e1cd..732cce94c7 100644 --- a/config/examples/Dagoma/Disco Ultimate/Configuration.h +++ b/config/examples/Dagoma/Disco Ultimate/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "InsanityAutomation" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 21 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, 21, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h b/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h index 23df5cf5e4..b46b40e6d3 100644 --- a/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h +++ b/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ #define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration.h b/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration.h index 8550637359..e9224face5 100644 --- a/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration.h +++ b/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Sidewinder X1)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -895,11 +893,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -911,10 +908,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -948,7 +945,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1206,12 +1203,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1265,19 +1256,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1526,7 +1504,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2056,7 +2034,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2069,6 +2047,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2079,11 +2060,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2211,7 +2189,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h b/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h index 6949849a15..8f3db3fa79 100644 --- a/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h +++ b/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Einstart-S/Configuration.h b/config/examples/Einstart-S/Configuration.h index fb9e320b8c..255b3b6200 100644 --- a/config/examples/Einstart-S/Configuration.h +++ b/config/examples/Einstart-S/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "elsie tech corp" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -900,11 +898,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -916,10 +913,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -953,7 +950,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1211,12 +1208,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1270,19 +1261,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1531,7 +1509,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2061,7 +2039,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2074,6 +2052,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2084,11 +2065,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2216,7 +2194,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Einstart-S/Configuration_adv.h b/config/examples/Einstart-S/Configuration_adv.h index b39d4379fc..7f19fe213b 100644 --- a/config/examples/Einstart-S/Configuration_adv.h +++ b/config/examples/Einstart-S/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -#define MINIMUM_STEPPER_DIR_DELAY 0 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration.h b/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration.h index 406a18b8a1..7bb62ab321 100644 --- a/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration.h +++ b/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -340,7 +338,6 @@ //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature #define POWER_TIMEOUT 30 #endif - #endif // @section temperature @@ -896,11 +893,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -912,10 +908,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -44 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -6 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.9 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -44, -6, -3.9 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -949,7 +945,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1207,12 +1203,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1266,19 +1256,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1527,7 +1504,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2057,7 +2034,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2070,6 +2047,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2080,11 +2060,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2098,7 +2075,7 @@ // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency // which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. -//#define FAN_SOFT_PWM +#define FAN_SOFT_PWM // Incrementing this by 1 will double the software PWM frequency, // affecting heaters, and the fan if FAN_SOFT_PWM is enabled. @@ -2212,7 +2189,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration_adv.h b/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration_adv.h index 2baa24b714..e0299a507a 100644 --- a/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration_adv.h +++ b/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1064,7 +1060,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 700 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 500 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 650 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1877,7 +1971,7 @@ * Define you own with * { , , hysteresis_start[1..8] } */ - #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + #define CHOPPER_TIMING CHOPPER_DEFAULT_24V /** * Monitor Trinamic drivers for error conditions, @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/FYSETC/Cheetah 1.2/base/Configuration.h b/config/examples/FYSETC/Cheetah 1.2/base/Configuration.h index d746712d1b..be04105204 100644 --- a/config/examples/FYSETC/Cheetah 1.2/base/Configuration.h +++ b/config/examples/FYSETC/Cheetah 1.2/base/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -895,11 +893,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -911,10 +908,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -948,7 +945,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1206,12 +1203,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1265,19 +1256,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1526,7 +1504,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2056,7 +2034,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2069,6 +2047,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2079,11 +2060,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2097,7 +2075,7 @@ // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency // which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. -//#define FAN_SOFT_PWM +#define FAN_SOFT_PWM // Incrementing this by 1 will double the software PWM frequency, // affecting heaters, and the fan if FAN_SOFT_PWM is enabled. @@ -2211,7 +2189,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/FYSETC/Cheetah 1.2/base/Configuration_adv.h b/config/examples/FYSETC/Cheetah 1.2/base/Configuration_adv.h index b31037b2a1..e0299a507a 100644 --- a/config/examples/FYSETC/Cheetah 1.2/base/Configuration_adv.h +++ b/config/examples/FYSETC/Cheetah 1.2/base/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,18 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -738,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -836,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1063,7 +1060,7 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #ifdef TARGET_LPC1768 + #if HAS_SDCARD_CONNECTION /** * Set this option to one of the following (or the board's defaults apply): * @@ -1208,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1292,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1352,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1364,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1499,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1717,78 +1799,91 @@ #define X_CURRENT 700 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 500 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 650 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1876,7 +1971,7 @@ * Define you own with * { , , hysteresis_start[1..8] } */ - #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + #define CHOPPER_TIMING CHOPPER_DEFAULT_24V /** * Monitor Trinamic drivers for error conditions, @@ -1927,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1954,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2437,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2521,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/FYSETC/Cheetah/BLTouch/Configuration.h b/config/examples/FYSETC/Cheetah/BLTouch/Configuration.h index 6eda1ce623..39b146d9da 100644 --- a/config/examples/FYSETC/Cheetah/BLTouch/Configuration.h +++ b/config/examples/FYSETC/Cheetah/BLTouch/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -129,18 +127,16 @@ // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH -// The following define selects which electronics board you have. -// Please choose the name from boards.h that matches your setup +// Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD #define MOTHERBOARD BOARD_FYSETC_CHEETAH #endif -// Optional custom name for your RepStrap or other custom machine -// Displayed in the LCD "Ready" message +// Name displayed in the LCD "Ready" message and Info menu //#define CUSTOM_MACHINE_NAME "3D Printer" -// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) -// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +// Printer's unique ID, used by some programs to differentiate between machines. +// Choose your own or use a service like http://www.uuidgenerator.net/version4 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" // @section extruder @@ -258,7 +254,16 @@ */ //#define MAGNETIC_SWITCHING_TOOLHEAD -#if EITHER(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD) +/** + * Electromagnetic Switching Toolhead + * + * Parking for CoreXY / HBot kinematics. + * Toolheads are parked at one edge and held with an electromagnet. + * Supports more than 2 Toolheads. See https://youtu.be/JolbsAKTKf4 + */ +//#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD + +#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis @@ -310,22 +315,20 @@ // @section machine /** - * Select your power supply here. Use 0 if you haven't connected the PS_ON_PIN + * Power Supply Control * - * 0 = No Power Switch - * 1 = ATX - * 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) - * - * :{ 0:'No power switch', 1:'ATX', 2:'X-Box 360' } + * Enable and connect the power supply to the PS_ON_PIN. + * Specify whether the power supply is active HIGH or active LOW. */ -#define POWER_SUPPLY 0 +//#define PSU_CONTROL +//#define PSU_NAME "Power Supply" -#if POWER_SUPPLY > 0 - // Enable this option to leave the PSU off at startup. - // Power to steppers and heaters will need to be turned on with M80. - //#define PS_DEFAULT_OFF +#if ENABLED(PSU_CONTROL) + #define PSU_ACTIVE_HIGH false // Set 'false' for ATX (1), 'true' for X-Box (2) - //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin + //#define PS_DEFAULT_OFF // Keep power off until enabled directly with M80 + + //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) #define AUTO_POWER_FANS // Turn on PSU if fans need power #define AUTO_POWER_E_FANS @@ -335,7 +338,6 @@ //#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature #define POWER_TIMEOUT 30 #endif - #endif // @section temperature @@ -361,6 +363,7 @@ * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 512 : 100k RPW-Ultra hotend thermistor (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) @@ -398,7 +401,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * - * :{ '0':"Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '20':"Pt100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595", '998':"Dummy 1", '999':"Dummy 2", '1000':"Custom thermistor params" } + * :{ '0':"Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '512':"100k RPW-Ultra hotend thermistor", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '20':"Pt100 (Ultimainboard V2.x)", '201':"Pt100 (Overlord)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595", '998':"Dummy 1", '999':"Dummy 2", '1000':"Custom thermistor params" } */ #define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 @@ -890,11 +893,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +908,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -44 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -6 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.9 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -44, -6, -3.9 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +945,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1203,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1256,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1504,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1531,8 +1514,11 @@ // Middle point of circle #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - // Moves the nozzle to the initial position + // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK + + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + //#define NOZZLE_CLEAN_NO_Z #endif /** @@ -1924,31 +1910,12 @@ // //#define LCD_FOR_MELZI -// -// SSD1306 OLED full graphics generic display -// -//#define U8GLIB_SSD1306 - -// -// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules -// -//#define SAV_3DGLCD -#if ENABLED(SAV_3DGLCD) - //#define U8GLIB_SSD1306 - #define U8GLIB_SH1106 -#endif - // // Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder // https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) // //#define ULTI_CONTROLLER -// -// TinyBoy2 128x64 OLED / Encoder Panel -// -//#define OLED_PANEL_TINYBOY2 - // // MKS MINI12864 with graphic controller and SD support // https://reprap.org/wiki/MKS_MINI_12864 @@ -1982,15 +1949,6 @@ // //#define ANET_FULL_GRAPHICS_LCD -// -// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER -// http://reprap.org/wiki/MKS_12864OLED -// -// Tiny, but very sharp OLED display -// -//#define MKS_12864OLED // Uses the SH1106 controller (default) -//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller - // // AZSMZ 12864 LCD with SD // https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html @@ -2003,6 +1961,43 @@ // //#define SILVER_GATE_GLCD_CONTROLLER +//============================================================================= +//============================== OLED Displays ============================== +//============================================================================= + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + #define U8GLIB_SSD1306 + //#define U8GLIB_SH1106 +#endif + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// Einstart S OLED SSD1306 +// +//#define U8GLIB_SH1106_EINSTART + // // Overlord OLED display/controller with i2c buzzer and LEDs // @@ -2039,7 +2034,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2052,6 +2047,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2062,11 +2060,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2080,7 +2075,7 @@ // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency // which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. -//#define FAN_SOFT_PWM +#define FAN_SOFT_PWM // Incrementing this by 1 will double the software PWM frequency, // affecting heaters, and the fan if FAN_SOFT_PWM is enabled. @@ -2194,7 +2189,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/FYSETC/Cheetah/BLTouch/Configuration_adv.h b/config/examples/FYSETC/Cheetah/BLTouch/Configuration_adv.h index b4ecd5e183..e0299a507a 100644 --- a/config/examples/FYSETC/Cheetah/BLTouch/Configuration_adv.h +++ b/config/examples/FYSETC/Cheetah/BLTouch/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,18 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -738,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -836,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1208,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1292,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1352,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1364,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1499,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1717,78 +1799,91 @@ #define X_CURRENT 700 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 500 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 650 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1876,7 +1971,7 @@ * Define you own with * { , , hysteresis_start[1..8] } */ - #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + #define CHOPPER_TIMING CHOPPER_DEFAULT_24V /** * Monitor Trinamic drivers for error conditions, @@ -1927,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1954,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2437,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2521,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/FYSETC/Cheetah/base/Configuration.h b/config/examples/FYSETC/Cheetah/base/Configuration.h index 50fd71bb10..67fbd1ed30 100644 --- a/config/examples/FYSETC/Cheetah/base/Configuration.h +++ b/config/examples/FYSETC/Cheetah/base/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -895,11 +893,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -911,10 +908,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -948,7 +945,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1206,12 +1203,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1265,19 +1256,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1526,7 +1504,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2056,7 +2034,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2069,6 +2047,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2079,11 +2060,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2097,7 +2075,7 @@ // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency // which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. -//#define FAN_SOFT_PWM +#define FAN_SOFT_PWM // Incrementing this by 1 will double the software PWM frequency, // affecting heaters, and the fan if FAN_SOFT_PWM is enabled. @@ -2211,7 +2189,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/FYSETC/Cheetah/base/Configuration_adv.h b/config/examples/FYSETC/Cheetah/base/Configuration_adv.h index b4ecd5e183..e0299a507a 100644 --- a/config/examples/FYSETC/Cheetah/base/Configuration_adv.h +++ b/config/examples/FYSETC/Cheetah/base/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,18 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -738,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -836,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1208,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1292,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1352,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1364,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1499,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1717,78 +1799,91 @@ #define X_CURRENT 700 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 500 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 650 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1876,7 +1971,7 @@ * Define you own with * { , , hysteresis_start[1..8] } */ - #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + #define CHOPPER_TIMING CHOPPER_DEFAULT_24V /** * Monitor Trinamic drivers for error conditions, @@ -1927,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1954,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2437,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2521,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Felix/Configuration.h b/config/examples/Felix/Configuration.h index 56a634e773..f379d63cff 100644 --- a/config/examples/Felix/Configuration.h +++ b/config/examples/Felix/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, Felix)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -872,11 +870,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -888,10 +885,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -925,7 +922,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1183,12 +1180,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1242,19 +1233,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1503,7 +1481,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2033,7 +2011,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2046,6 +2024,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2056,11 +2037,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2188,7 +2166,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Felix/Configuration_adv.h b/config/examples/Felix/Configuration_adv.h index c5cd162eea..7848cac6ce 100644 --- a/config/examples/Felix/Configuration_adv.h +++ b/config/examples/Felix/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Felix/DUAL/Configuration.h b/config/examples/Felix/DUAL/Configuration.h index 8a6bef4398..9adfb27ad2 100644 --- a/config/examples/Felix/DUAL/Configuration.h +++ b/config/examples/Felix/DUAL/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, Felix/DUAL)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -872,11 +870,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -888,10 +885,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -925,7 +922,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1183,12 +1180,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1242,19 +1233,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1503,7 +1481,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2033,7 +2011,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2046,6 +2024,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2056,11 +2037,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2188,7 +2166,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/FlashForge/CreatorPro/Configuration.h b/config/examples/FlashForge/CreatorPro/Configuration.h index ff05a077ea..d8000b4d4a 100644 --- a/config/examples/FlashForge/CreatorPro/Configuration.h +++ b/config/examples/FlashForge/CreatorPro/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "M. Baker" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -882,11 +880,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -898,10 +895,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -935,7 +932,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1194,12 +1191,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1253,19 +1244,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1512,7 +1490,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2042,7 +2020,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2055,6 +2033,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2065,11 +2046,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2197,7 +2175,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/FlashForge/CreatorPro/Configuration_adv.h b/config/examples/FlashForge/CreatorPro/Configuration_adv.h index 9cb9e60246..4fe03c42ab 100644 --- a/config/examples/FlashForge/CreatorPro/Configuration_adv.h +++ b/config/examples/FlashForge/CreatorPro/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - //#define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -836,6 +823,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + //#define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1208,9 +1204,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1292,6 +1336,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1352,7 +1432,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1364,7 +1444,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1499,19 +1580,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1717,78 +1798,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1927,10 +2021,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1954,6 +2050,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2437,10 +2534,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2521,6 +2614,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/FolgerTech/i3-2020/Configuration.h b/config/examples/FolgerTech/i3-2020/Configuration.h index c52be6de67..4960cd50b8 100644 --- a/config/examples/FolgerTech/i3-2020/Configuration.h +++ b/config/examples/FolgerTech/i3-2020/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -896,11 +894,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -912,10 +909,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 38 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -7 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -10.75 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 38, -7, -10.75 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 0 @@ -949,7 +946,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1207,12 +1204,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1527,7 +1518,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2057,7 +2048,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2070,6 +2061,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2080,11 +2074,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2212,7 +2203,7 @@ */ #define NUM_SERVOS 2 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 500, 500 } diff --git a/config/examples/FolgerTech/i3-2020/Configuration_adv.h b/config/examples/FolgerTech/i3-2020/Configuration_adv.h index 316ad00f01..488c7b73ae 100644 --- a/config/examples/FolgerTech/i3-2020/Configuration_adv.h +++ b/config/examples/FolgerTech/i3-2020/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Formbot/Raptor/Configuration.h b/config/examples/Formbot/Raptor/Configuration.h index 1576e462c9..fad911678a 100644 --- a/config/examples/Formbot/Raptor/Configuration.h +++ b/config/examples/Formbot/Raptor/Configuration.h @@ -82,11 +82,11 @@ * If a UART connection is used to configure the driver, please select that as well in Configuration_adv.h. */ //#define X_2208 -//#define X_SpreadCycle +//#define X_SPREADCYCLE //#define Y_2208 -//#define Y_SpreadCycle +//#define Y_SPREADCYCLE //#define E_2208 -//#define E_SpreadCycle +//#define E_SPREADCYCLE /** @@ -111,13 +111,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "Tinymachines3D" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -130,10 +125,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -790,25 +788,25 @@ * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] */ #if ENABLED(X_2208) - #if ENABLED(X_SpreadCycle) - #define x_accel 1750 + #if ENABLED(X_SPREADCYCLE) + #define X_ACCEL 1750 #else - #define x_accel 1000 + #define X_ACCEL 1000 #endif #else - #define x_accel 1500 + #define X_ACCEL 1500 #endif #if ENABLED(Y_2208) - #if ENABLED(Y_SpreadCycle) - #define y_accel 500 + #if ENABLED(Y_SPREADCYCLE) + #define Y_ACCEL 500 #else - #define y_accel 300 + #define Y_ACCEL 300 #endif #else - #define y_accel 500 + #define Y_ACCEL 500 #endif -#define DEFAULT_MAX_ACCELERATION { x_accel, y_accel, 400, 4000 } +#define DEFAULT_MAX_ACCELERATION { X_ACCEL, Y_ACCEL, 400, 4000 } /** * Default Acceleration (change/s) change = mm/s @@ -845,12 +843,12 @@ * value set here, it may happen instantaneously. */ #if DISABLED(JUNCTION_DEVIATION) - #if ENABLED(X_SpreadCycle) || DISABLED(X_2208) + #if ENABLED(X_SPREADCYCLE) || DISABLED(X_2208) #define DEFAULT_XJERK 20.0 #else #define DEFAULT_XJERK 10.0 #endif - #if ENABLED(Y_SpreadCycle) || DISABLED(Y_2208) + #if ENABLED(Y_SPREADCYCLE) || DISABLED(Y_2208) #define DEFAULT_YJERK 10.0 #else #define DEFAULT_YJERK 5.0 @@ -973,11 +971,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -989,10 +986,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -22 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.5 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -22, 0, -1.5 } #define MIN_PROBE_EDGE 10 // X and Y axis travel speed (mm/m) between probes @@ -1024,7 +1021,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1303,12 +1300,6 @@ #define GRID_MAX_POINTS_X 6 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - #define LEFT_PROBE_BED_POSITION 30 - #define RIGHT_PROBE_BED_POSITION 365 - #define FRONT_PROBE_BED_POSITION 30 - #define BACK_PROBE_BED_POSITION 365 - // The Z probe minimum outer margin (to validate G29 parameters). #define MIN_PROBE_EDGE 10 @@ -1626,7 +1617,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2156,7 +2147,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2169,6 +2160,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2179,11 +2173,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2311,7 +2302,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Formbot/Raptor/Configuration_adv.h b/config/examples/Formbot/Raptor/Configuration_adv.h index 25e27512f4..655443a27e 100644 --- a/config/examples/Formbot/Raptor/Configuration_adv.h +++ b/config/examples/Formbot/Raptor/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' #define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1295,6 +1339,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1355,7 +1435,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1367,7 +1447,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1502,19 +1583,19 @@ */ #define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1720,78 +1801,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1930,10 +2024,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1957,6 +2053,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2442,10 +2539,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2526,6 +2619,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Formbot/T_Rex_2+/Configuration.h b/config/examples/Formbot/T_Rex_2+/Configuration.h index 508c78cd94..583f6d0336 100644 --- a/config/examples/Formbot/T_Rex_2+/Configuration.h +++ b/config/examples/Formbot/T_Rex_2+/Configuration.h @@ -73,13 +73,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "Formbot-3D" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -92,10 +87,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -919,11 +917,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -935,10 +932,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -3 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 31 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.25 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -3, 31, -1.25 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 0 @@ -972,7 +969,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1230,12 +1227,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1555,7 +1546,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2085,7 +2076,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2098,6 +2089,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2108,11 +2102,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2240,7 +2231,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Formbot/T_Rex_2+/Configuration_adv.h b/config/examples/Formbot/T_Rex_2+/Configuration_adv.h index 73c9d84835..7f5ba7c33e 100644 --- a/config/examples/Formbot/T_Rex_2+/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_2+/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' #define M114_DETAIL // Show Temperature ADC value @@ -606,8 +606,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -624,7 +624,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -651,19 +651,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -743,8 +730,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -841,6 +828,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1213,9 +1209,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1297,6 +1341,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X 4 @@ -1357,7 +1437,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1369,7 +1449,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1504,19 +1585,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1722,78 +1803,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1932,10 +2026,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1959,6 +2055,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2442,10 +2539,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2526,6 +2619,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Formbot/T_Rex_3/Configuration.h b/config/examples/Formbot/T_Rex_3/Configuration.h index 3993059e0b..df29a67c06 100644 --- a/config/examples/Formbot/T_Rex_3/Configuration.h +++ b/config/examples/Formbot/T_Rex_3/Configuration.h @@ -74,13 +74,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "Formbot-3D" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -93,10 +88,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. #define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -906,11 +904,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -922,10 +919,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -3 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 31 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.25 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -3, 31, -1.25 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 0 @@ -959,7 +956,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1226,12 +1223,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1546,7 +1537,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2079,7 +2070,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2092,6 +2083,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2102,11 +2096,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2234,7 +2225,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Formbot/T_Rex_3/Configuration_adv.h b/config/examples/Formbot/T_Rex_3/Configuration_adv.h index 6b7b941d53..4d70eaabae 100644 --- a/config/examples/Formbot/T_Rex_3/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_3/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' #define M114_DETAIL // Show Temperature ADC value @@ -606,8 +606,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -624,7 +624,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -651,19 +651,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -743,8 +730,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -841,6 +828,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1213,9 +1209,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1297,6 +1341,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X 4 @@ -1357,7 +1437,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1369,7 +1449,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1504,19 +1585,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1722,78 +1803,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1932,10 +2026,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1959,6 +2055,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2437,10 +2534,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2521,6 +2614,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Fysetc/AIO_II/Configuration.h b/config/examples/Fysetc/AIO_II/Configuration.h index bcd4b42aae..a9c1d34829 100644 --- a/config/examples/Fysetc/AIO_II/Configuration.h +++ b/config/examples/Fysetc/AIO_II/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -643,9 +641,9 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -#define X_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. -#define Y_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. -#define Z_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop. #define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. #define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. #define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop. @@ -723,7 +721,7 @@ * Override with M92 * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] */ -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 93 } +#define DEFAULT_AXIS_STEPS_PER_UNIT { 640, 640, 3200, 800 } /** * Default Max Feed Rate (mm/s) @@ -895,11 +893,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -911,10 +908,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -948,7 +945,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -991,10 +988,10 @@ // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } -#define X_ENABLE_ON 0 -#define Y_ENABLE_ON 0 -#define Z_ENABLE_ON 0 -#define E_ENABLE_ON 0 // For all extruders +#define X_ENABLE_ON 1 +#define Y_ENABLE_ON 1 +#define Z_ENABLE_ON 1 +#define E_ENABLE_ON 1 // For all extruders // Disables axis stepper immediately when it's not being used. // WARNING: When motors turn off there is a chance of losing position accuracy! @@ -1206,12 +1203,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1265,19 +1256,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1526,7 +1504,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2056,7 +2034,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2069,6 +2047,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2079,11 +2060,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2211,7 +2189,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Fysetc/AIO_II/Configuration_adv.h b/config/examples/Fysetc/AIO_II/Configuration_adv.h index 74d3bb0740..0bfa79d000 100644 --- a/config/examples/Fysetc/AIO_II/Configuration_adv.h +++ b/config/examples/Fysetc/AIO_II/Configuration_adv.h @@ -165,13 +165,13 @@ * Thermal Protection parameters for the bed are just as above for hotends. */ #if ENABLED(THERMAL_PROTECTION_BED) - #define THERMAL_PROTECTION_BED_PERIOD 60 // Seconds + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius /** * As described above, except for the bed (M140/M190/M303). */ - #define WATCH_BED_TEMP_PERIOD 100 // Seconds + #define WATCH_BED_TEMP_PERIOD 60 // Seconds #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius #endif @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -924,7 +920,7 @@ //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files - #define EVENT_GCODE_SD_STOP "M21" // G-code to run on Stop Print (e.g., "G28XY" or "G27") + #define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") /** * Continue after Power-Loss (Creality3D) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 700 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 650 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 650 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1833,13 +1927,13 @@ * on the same serial port, either here or in your board's pins file. */ #define X_SLAVE_ADDRESS 0 - #define Y_SLAVE_ADDRESS 1 - #define Z_SLAVE_ADDRESS 2 + #define Y_SLAVE_ADDRESS 0 + #define Z_SLAVE_ADDRESS 0 #define X2_SLAVE_ADDRESS 0 #define Y2_SLAVE_ADDRESS 0 #define Z2_SLAVE_ADDRESS 0 #define Z3_SLAVE_ADDRESS 0 - #define E0_SLAVE_ADDRESS 3 + #define E0_SLAVE_ADDRESS 0 #define E1_SLAVE_ADDRESS 0 #define E2_SLAVE_ADDRESS 0 #define E3_SLAVE_ADDRESS 0 @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Fysetc/F6_13/Configuration.h b/config/examples/Fysetc/F6_13/Configuration.h index 0aac615c80..3c0eeaee0e 100644 --- a/config/examples/Fysetc/F6_13/Configuration.h +++ b/config/examples/Fysetc/F6_13/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -892,11 +890,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -908,10 +905,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -945,7 +942,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1203,12 +1200,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1262,19 +1253,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1523,7 +1501,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2053,7 +2031,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2066,6 +2044,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2076,11 +2057,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2212,7 +2190,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Fysetc/F6_13/Configuration_adv.h b/config/examples/Fysetc/F6_13/Configuration_adv.h index 9296889f37..435f1b485d 100644 --- a/config/examples/Fysetc/F6_13/Configuration_adv.h +++ b/config/examples/Fysetc/F6_13/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1018,17 +1014,31 @@ * equivalent MAX3421E breakout board. The USB thumb drive will appear * to Marlin as an SD card. * - * The MAX3421E must be assigned the same pins as the SD card reader, with + * The MAX3421E can be assigned the same pins as the SD card reader, with * the following pin mapping: * * SCLK, MOSI, MISO --> SCLK, MOSI, MISO - * INT --> SD_DETECT_PIN + * INT --> SD_DETECT_PIN [1] * SS --> SDSS + * + * [1] On AVR an interrupt-capable pin is best for UHS3 compatibility. */ #define USB_FLASH_DRIVE_SUPPORT #if ENABLED(USB_FLASH_DRIVE_SUPPORT) #define USB_CS_PIN SDSS #define USB_INTR_PIN SD_DETECT_PIN + + /** + * USB Host Shield Library + * + * - UHS2 uses no interrupts and has been production-tested + * on a LulzBot TAZ Pro with a 32-bit Archim board. + * + * - UHS3 is newer code with better USB compatibility. But it + * is less tested and is known to interfere with Servos. + * [1] This requires USB_INTR_PIN to be interrupt-capable. + */ + //#define USE_UHS3_USB #endif /** @@ -1195,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1279,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1339,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1351,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1486,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1543,14 +1638,14 @@ * Requires NOZZLE_PARK_FEATURE. * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. */ -//#define ADVANCED_PAUSE_FEATURE +#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. - #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. + #define PAUSE_PARK_RETRACT_LENGTH 4 // (mm) Initial retract. // This short retract is done immediately, before parking the nozzle. #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. + #define FILAMENT_CHANGE_UNLOAD_LENGTH 0 // (mm) The length of filament for a complete unload. // For Bowden, the full length of the tube and nozzle. // For direct drive, the full length of the nozzle. // Set to 0 for manual unloading. @@ -1704,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1914,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1941,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2424,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2508,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Geeetech/A10/Configuration.h b/config/examples/Geeetech/A10/Configuration.h index 59ede79ea3..51aaa489a8 100644 --- a/config/examples/Geeetech/A10/Configuration.h +++ b/config/examples/Geeetech/A10/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Phr3d13, Geeetech A10 default)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -873,11 +871,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -889,10 +886,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -37 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.6 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -37, 0, -3.6 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -926,7 +923,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1186,12 +1183,6 @@ #define GRID_MAX_POINTS_X 5 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1245,19 +1236,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1506,7 +1484,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2036,7 +2014,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2049,6 +2027,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2059,11 +2040,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2191,7 +2169,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/A10/Configuration_adv.h b/config/examples/Geeetech/A10/Configuration_adv.h index df66df91bb..affcf4399a 100644 --- a/config/examples/Geeetech/A10/Configuration_adv.h +++ b/config/examples/Geeetech/A10/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Geeetech/A10M/Configuration.h b/config/examples/Geeetech/A10M/Configuration.h index 53cbd9ecfb..ab3f257825 100644 --- a/config/examples/Geeetech/A10M/Configuration.h +++ b/config/examples/Geeetech/A10M/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -873,11 +871,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -889,10 +886,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -37 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.6 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -37, 0, -3.6 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -926,7 +923,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1186,12 +1183,6 @@ #define GRID_MAX_POINTS_X 5 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1245,19 +1236,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1506,7 +1484,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2036,7 +2014,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2049,6 +2027,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2059,11 +2040,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2191,7 +2169,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/A10M/Configuration_adv.h b/config/examples/Geeetech/A10M/Configuration_adv.h index 674a51d385..0991769350 100644 --- a/config/examples/Geeetech/A10M/Configuration_adv.h +++ b/config/examples/Geeetech/A10M/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Geeetech/A20M/Configuration.h b/config/examples/Geeetech/A20M/Configuration.h index 8be2b0301a..1bcec7ac72 100644 --- a/config/examples/Geeetech/A20M/Configuration.h +++ b/config/examples/Geeetech/A20M/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -768,7 +766,7 @@ * * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained */ -//#define S_CURVE_ACCELERATION +#define S_CURVE_ACCELERATION //=========================================================================== //============================= Z Probe Options ============================= @@ -873,11 +871,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -889,10 +886,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -37 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.6 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -37, 0, -3.6 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -926,7 +923,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1186,12 +1183,6 @@ #define GRID_MAX_POINTS_X 5 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1245,19 +1236,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1505,7 +1483,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -1736,7 +1714,7 @@ // // ULTIPANEL as seen on Thingiverse. // -#define ULTIPANEL +//#define ULTIPANEL // // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) @@ -2038,7 +2016,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2051,6 +2029,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2061,11 +2042,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2193,7 +2171,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/A20M/Configuration_adv.h b/config/examples/Geeetech/A20M/Configuration_adv.h index 5434700c97..409a1b1658 100644 --- a/config/examples/Geeetech/A20M/Configuration_adv.h +++ b/config/examples/Geeetech/A20M/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -938,7 +934,7 @@ #if ENABLED(POWER_LOSS_RECOVERY) #define POWER_LOSS_PIN 69 // Pin to detect power loss #define POWER_LOSS_STATE LOW // State of pin indicating power loss - //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate + #define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -989,7 +985,7 @@ //#define LONG_FILENAME_HOST_SUPPORT // Enable this option to scroll long filenames in the SD card menu - //#define SCROLL_LONG_FILENAMES + #define SCROLL_LONG_FILENAMES // Leave the heaters on after Stop Print (not recommended!) //#define SD_ABORT_NO_COOLDOWN @@ -1157,12 +1153,12 @@ #define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames #define STATUS_HEAT_PERCENT // Show heating in a progress bar #define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) - //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + #define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. // Frivolous Game Options - //#define MARLIN_BRICKOUT - //#define MARLIN_INVADERS - //#define MARLIN_SNAKE + #define MARLIN_BRICKOUT + #define MARLIN_INVADERS + #define MARLIN_SNAKE //#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu #endif // HAS_GRAPHICAL_LCD @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1257,7 +1301,7 @@ #endif #endif - //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 + #define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping #if ENABLED(BABYSTEP_ZPROBE_OFFSET) @@ -1284,15 +1328,51 @@ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. * Mention @Sebastianv650 on GitHub to alert the author of any issues. */ -//#define LIN_ADVANCE +#define LIN_ADVANCE #if ENABLED(LIN_ADVANCE) //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants - #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed + #define LIN_ADVANCE_K 0 // Unit: mm compression per 1mm/s extruder speed //#define LA_DEBUG // If enabled, this will generate debug information output over USB. #endif // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2343,7 +2440,7 @@ * - M206 and M428 are disabled. * - G92 will revert to its behavior from Marlin 1.0. */ -#define NO_WORKSPACE_OFFSETS +//#define NO_WORKSPACE_OFFSETS /** * Set the number of proportional font spaces required to fill up a typical character space. @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Geeetech/GT2560/Configuration.h b/config/examples/Geeetech/GT2560/Configuration.h index 2670d1468d..44f5939b5e 100644 --- a/config/examples/Geeetech/GT2560/Configuration.h +++ b/config/examples/Geeetech/GT2560/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -905,11 +903,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -921,10 +918,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -958,7 +955,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1216,12 +1213,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1275,19 +1266,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1536,7 +1514,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2066,7 +2044,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2079,6 +2057,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2089,11 +2070,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2221,7 +2199,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h b/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h index 1e07bce594..7b26ebec7a 100644 --- a/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h +++ b/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(R. de Weerd, I3 Pro X)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 8 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ #define NUM_SERVOS 1 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/MeCreator2/Configuration.h b/config/examples/Geeetech/MeCreator2/Configuration.h index 0e2a0174dc..edfd2c9179 100644 --- a/config/examples/Geeetech/MeCreator2/Configuration.h +++ b/config/examples/Geeetech/MeCreator2/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Phr3d13, MeCreator2)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -897,11 +895,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -913,10 +910,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -950,7 +947,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1208,12 +1205,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1267,19 +1258,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1528,7 +1506,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2058,7 +2036,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2071,6 +2049,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2081,11 +2062,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2213,7 +2191,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/MeCreator2/Configuration_adv.h b/config/examples/Geeetech/MeCreator2/Configuration_adv.h index 2f7eb338a1..66c10df22f 100644 --- a/config/examples/Geeetech/MeCreator2/Configuration_adv.h +++ b/config/examples/Geeetech/MeCreator2/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1292,6 +1336,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1352,7 +1432,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1364,7 +1444,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1499,19 +1580,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1717,78 +1798,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1927,10 +2021,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1954,6 +2050,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2437,10 +2534,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2521,6 +2614,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h b/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h index 0b0232bf96..02d543fa1b 100644 --- a/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(1138-4EB, Geeetech Prusa i3 Pro B BLTouch config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -911,11 +909,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -927,10 +924,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 4 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -44 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.4 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 4, -44, -1.4 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -964,7 +961,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1222,12 +1219,6 @@ #define GRID_MAX_POINTS_X 4 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION 10 - //#define RIGHT_PROBE_BED_POSITION (X_MAX_POS - X_PROBE_OFFSET_FROM_EXTRUDER - 14) - //#define FRONT_PROBE_BED_POSITION 15 - //#define BACK_PROBE_BED_POSITION (Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER - 25) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1281,19 +1272,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1542,7 +1520,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2072,7 +2050,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2085,6 +2063,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2095,11 +2076,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2227,7 +2205,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h b/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h index bc5186ad2a..bae11398aa 100644 --- a/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(1138-4EB, Geeetech Prusa i3 Pro B config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -910,11 +908,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -926,10 +923,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -963,7 +960,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1221,12 +1218,6 @@ #define GRID_MAX_POINTS_X 4 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION 10 - //#define RIGHT_PROBE_BED_POSITION (X_MAX_POS - X_PROBE_OFFSET_FROM_EXTRUDER - 14) - //#define FRONT_PROBE_BED_POSITION 15 - //#define BACK_PROBE_BED_POSITION (Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER - 25) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1280,19 +1271,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1541,7 +1519,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2071,7 +2049,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2084,6 +2062,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2094,11 +2075,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2226,7 +2204,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h b/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h index f58932bd78..3ad7d31902 100644 --- a/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Phr3d13, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h b/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h index df66df91bb..affcf4399a 100644 --- a/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h b/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h index b08a634d8f..c7c00987b0 100644 --- a/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h +++ b/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Phr3d13, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h b/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h index df66df91bb..affcf4399a 100644 --- a/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/HMS434/Configuration.h b/config/examples/HMS434/Configuration.h index 22d3e6d3bd..463585eae2 100644 --- a/config/examples/HMS434/Configuration.h +++ b/config/examples/HMS434/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Scheepers, MaukCC)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -877,11 +875,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -893,10 +890,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -21 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 22 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.54 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -21, 22, -1.54 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 20 @@ -930,7 +927,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1188,12 +1185,6 @@ #define GRID_MAX_POINTS_X 5 #define GRID_MAX_POINTS_Y 3 - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1247,19 +1238,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -2032,7 +2010,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2045,6 +2023,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2055,11 +2036,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2187,7 +2165,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/HMS434/Configuration_adv.h b/config/examples/HMS434/Configuration_adv.h index ec050ae2f4..e89f3699e9 100644 --- a/config/examples/HMS434/Configuration_adv.h +++ b/config/examples/HMS434/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -594,8 +594,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -612,7 +612,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -639,19 +639,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section extras - // minimum time in microseconds that a movement needs to take if the buffer is emptied. #define DEFAULT_MINSEGMENTTIME 20000 @@ -731,8 +718,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -829,6 +816,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1150,6 +1146,97 @@ #endif // HAS_GRAPHICAL_LCD +// +// Lulzbot Touch UI +// +#if ENABLED(LULZBOT_TOUCH_UI) + // Display board used + //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) + //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) + //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) + //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) + //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI + + // Correct the resolution if not using the stock TFT panel. + //#define TOUCH_UI_320x240 + //#define TOUCH_UI_480x272 + //#define TOUCH_UI_800x480 + + // Mappings for boards with a standard RepRapDiscount Display connector + //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping + //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping + //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below + #if ENABLED(OTHER_PIN_LAYOUT) + // The pins for CS and MOD_RESET (PD) must be chosen. + #define CLCD_MOD_RESET 9 + #define CLCD_SPI_CS 10 + + // If using software SPI, specify pins for SCLK, MOSI, MISO + //#define CLCD_USE_SOFT_SPI + #if ENABLED(CLCD_USE_SOFT_SPI) + #define CLCD_SOFT_SPI_MOSI 11 + #define CLCD_SOFT_SPI_MISO 12 + #define CLCD_SOFT_SPI_SCLK 13 + #endif + #endif + + // Display Orientation. An inverted (i.e. upside-down) display + // is supported on the FT800. The FT810 and beyond also support + // portrait and mirrored orientations. + //#define TOUCH_UI_INVERTED + //#define TOUCH_UI_PORTRAIT + //#define TOUCH_UI_MIRRORED + + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Runtime language selection (otherwise LCD_LANGUAGE) + //#define TOUCH_UI_LANGUAGE_MENU + + // Use a numeric passcode for "Screen lock" keypad. + // (recommended for smaller displays) + //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan +#endif + // @section safety /** @@ -1229,6 +1316,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1289,7 +1412,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1301,7 +1424,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1436,19 +1560,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1654,78 +1778,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1864,10 +2001,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1891,6 +2030,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2360,10 +2500,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2444,6 +2580,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Infitary/i3-M508/Configuration.h b/config/examples/Infitary/i3-M508/Configuration.h index 5d84f8a67a..9f19367910 100644 --- a/config/examples/Infitary/i3-M508/Configuration.h +++ b/config/examples/Infitary/i3-M508/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(tjclement, Infitary M508)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -894,11 +892,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -910,10 +907,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -947,7 +944,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1205,12 +1202,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1264,19 +1255,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1525,7 +1503,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2055,7 +2033,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2068,6 +2046,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2078,11 +2059,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2210,7 +2188,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Infitary/i3-M508/Configuration_adv.h b/config/examples/Infitary/i3-M508/Configuration_adv.h index 076ab02a18..47ee220ae9 100644 --- a/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/JGAurora/A1/Configuration.h b/config/examples/JGAurora/A1/Configuration.h index 8b4b9da59b..8445110af1 100644 --- a/config/examples/JGAurora/A1/Configuration.h +++ b/config/examples/JGAurora/A1/Configuration.h @@ -70,18 +70,13 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 // ╦╔═╗╔═╗┬ ┬┬─┐┌─┐┬─┐┌─┐╔═╗┌─┐┬─┐┬ ┬┌┬┐ ┌─┐┌─┐┌┬┐ // ║║ ╦╠═╣│ │├┬┘│ │├┬┘├─┤╠╣ │ │├┬┘│ ││││ │ │ ││││ // ╚╝╚═╝╩ ╩└─┘┴└─└─┘┴└─┴ ┴╚ └─┘┴└─└─┘┴ ┴o└─┘└─┘┴ ┴ #define STRING_CONFIG_H_AUTHOR "(Roberto Mariani & Samuel Pinches)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 "JG-A1 v2.0 (29-7-19)" // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 "JGAuroraForum.com" // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -94,10 +89,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -897,11 +895,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -913,10 +910,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -950,7 +947,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1208,12 +1205,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1267,19 +1258,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1528,7 +1506,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2059,7 +2037,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // #define FSMC_GRAPHICAL_TFT //#define PRINTER_EVENT_LEDS @@ -2073,6 +2051,9 @@ // #define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2084,11 +2065,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2216,7 +2194,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/JGAurora/A1/Configuration_adv.h b/config/examples/JGAurora/A1/Configuration_adv.h index 0b9e55ff1a..d9a3fe6f6b 100644 --- a/config/examples/JGAurora/A1/Configuration_adv.h +++ b/config/examples/JGAurora/A1/Configuration_adv.h @@ -219,7 +219,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -607,8 +607,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -625,7 +625,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -652,19 +652,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 60*60, 60*60, 10*60, 10*60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -744,8 +731,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -842,6 +829,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 60*60, 60*60, 10*60, 10*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1214,9 +1210,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1298,6 +1342,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1358,7 +1438,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1370,7 +1450,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1505,19 +1586,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1723,78 +1804,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1933,10 +2027,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1960,6 +2056,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2443,10 +2540,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2527,6 +2620,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/JGAurora/A5/Configuration.h b/config/examples/JGAurora/A5/Configuration.h index ca6ba0e542..8e2c31a08e 100644 --- a/config/examples/JGAurora/A5/Configuration.h +++ b/config/examples/JGAurora/A5/Configuration.h @@ -75,13 +75,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Telli Mantelli, Kris Waclawski, Samuel Pinches & Michael Gilardi, 21 Jan 2018)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -94,10 +89,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -902,11 +900,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -918,10 +915,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -955,7 +952,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1213,12 +1210,6 @@ #define GRID_MAX_POINTS_X 5 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION 15 - //#define RIGHT_PROBE_BED_POSITION 170 - //#define FRONT_PROBE_BED_POSITION 20 - //#define BACK_PROBE_BED_POSITION 170 - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1272,19 +1263,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1533,7 +1511,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2063,7 +2041,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2076,6 +2054,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2086,11 +2067,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2218,7 +2196,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/JGAurora/A5/Configuration_adv.h b/config/examples/JGAurora/A5/Configuration_adv.h index 33a158320a..8fde777de9 100644 --- a/config/examples/JGAurora/A5/Configuration_adv.h +++ b/config/examples/JGAurora/A5/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 80*60, 80*60, 12*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 80*60, 80*60, 12*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/JGAurora/A5S/Configuration.h b/config/examples/JGAurora/A5S/Configuration.h index 7a6737efb6..09f34afe2c 100644 --- a/config/examples/JGAurora/A5S/Configuration.h +++ b/config/examples/JGAurora/A5S/Configuration.h @@ -70,18 +70,13 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 // ╦╔═╗╔═╗┬ ┬┬─┐┌─┐┬─┐┌─┐╔═╗┌─┐┬─┐┬ ┬┌┬┐ ┌─┐┌─┐┌┬┐ // ║║ ╦╠═╣│ │├┬┘│ │├┬┘├─┤╠╣ │ │├┬┘│ ││││ │ │ ││││ // ╚╝╚═╝╩ ╩└─┘┴└─└─┘┴└─┴ ┴╚ └─┘┴└─└─┘┴ ┴o└─┘└─┘┴ ┴ #define STRING_CONFIG_H_AUTHOR "(Roberto Mariani & Samuel Pinches)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 "JG-A5S v2.0 (29-7-19)" // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 "JGAuroraForum.com" // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -94,10 +89,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -897,11 +895,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -913,10 +910,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -950,7 +947,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1208,12 +1205,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1267,19 +1258,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1528,7 +1506,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2059,7 +2037,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // #define FSMC_GRAPHICAL_TFT //#define PRINTER_EVENT_LEDS @@ -2073,6 +2051,9 @@ // #define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2084,11 +2065,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2216,7 +2194,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/JGAurora/A5S/Configuration_adv.h b/config/examples/JGAurora/A5S/Configuration_adv.h index 0b9e55ff1a..d9a3fe6f6b 100644 --- a/config/examples/JGAurora/A5S/Configuration_adv.h +++ b/config/examples/JGAurora/A5S/Configuration_adv.h @@ -219,7 +219,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -607,8 +607,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -625,7 +625,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -652,19 +652,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 60*60, 60*60, 10*60, 10*60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -744,8 +731,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -842,6 +829,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 60*60, 60*60, 10*60, 10*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1214,9 +1210,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1298,6 +1342,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1358,7 +1438,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1370,7 +1450,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1505,19 +1586,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1723,78 +1804,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1933,10 +2027,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1960,6 +2056,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2443,10 +2540,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2527,6 +2620,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/MakerParts/Configuration.h b/config/examples/MakerParts/Configuration.h index b5dbb3d05d..b5ed76af06 100644 --- a/config/examples/MakerParts/Configuration.h +++ b/config/examples/MakerParts/Configuration.h @@ -90,13 +90,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "ejtagle" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -109,10 +104,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -910,11 +908,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -926,10 +923,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -963,7 +960,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1221,12 +1218,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1280,19 +1271,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1541,7 +1519,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2071,7 +2049,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2084,6 +2062,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2094,11 +2075,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2226,7 +2204,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/MakerParts/Configuration_adv.h b/config/examples/MakerParts/Configuration_adv.h index 80538843b5..9e9a2b279c 100644 --- a/config/examples/MakerParts/Configuration_adv.h +++ b/config/examples/MakerParts/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2431,10 +2528,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2515,6 +2608,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Malyan/M150/Configuration.h b/config/examples/Malyan/M150/Configuration.h index 75e057d99e..25a37e560d 100644 --- a/config/examples/Malyan/M150/Configuration.h +++ b/config/examples/Malyan/M150/Configuration.h @@ -75,13 +75,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Gunther)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -94,10 +89,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -910,11 +908,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -926,14 +923,14 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ // Set for HoolyHoo's probe mount // http://www.thingiverse.com/thing:1960419 // Note: HoolyHoo mount is X=35, Y=-50. -//#define X_PROBE_OFFSET_FROM_EXTRUDER 35 // X offset: -left +right [of the nozzle] -//#define Y_PROBE_OFFSET_FROM_EXTRUDER -50 // Y offset: -front +behind [the nozzle] -//#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +//#define NOZZLE_TO_PROBE_OFFSET { 35, -50, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -967,7 +964,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1229,12 +1226,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION 50 - //#define RIGHT_PROBE_BED_POSITION 150 - //#define FRONT_PROBE_BED_POSITION 50 - //#define BACK_PROBE_BED_POSITION 150 - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1549,7 +1540,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2079,7 +2070,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2092,6 +2083,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2102,11 +2096,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2234,7 +2225,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Malyan/M150/Configuration_adv.h b/config/examples/Malyan/M150/Configuration_adv.h index 8db61b98ad..af59554c0f 100644 --- a/config/examples/Malyan/M150/Configuration_adv.h +++ b/config/examples/Malyan/M150/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Malyan/M200/Configuration.h b/config/examples/Malyan/M200/Configuration.h index e7700c4b52..179d0cdfa7 100644 --- a/config/examples/Malyan/M200/Configuration.h +++ b/config/examples/Malyan/M200/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(xC0000005, Malyan M200 build)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -889,11 +887,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -905,10 +902,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -942,7 +939,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1200,12 +1197,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1259,19 +1250,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1520,7 +1498,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2050,7 +2028,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2063,6 +2041,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2073,11 +2054,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2205,7 +2183,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Malyan/M200/Configuration_adv.h b/config/examples/Malyan/M200/Configuration_adv.h index 70e3133930..cf422c358e 100644 --- a/config/examples/Malyan/M200/Configuration_adv.h +++ b/config/examples/Malyan/M200/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Malyan/M200/README.md b/config/examples/Malyan/M200/README.md index 84490786e1..8129650dc7 100644 --- a/config/examples/Malyan/M200/README.md +++ b/config/examples/Malyan/M200/README.md @@ -1,6 +1,6 @@ ### Malyan M200 Build Instructions -Malyan M200 series firmware currently builds using the Arduino IDE. These instructions should +Malyan M200 series firmware currently builds using the Arduino IDE. These instructions should guide you through the configuration and compilation. 1. Install the Arduino IDE from your favorite source (arduino.cc, windows store, app store) @@ -27,7 +27,7 @@ guide you through the configuration and compilation. The file `Marlin.ino.bin` is your firmware binary. M200 (v1-3) and M300 printers require flashing via SD card. Use the SD card that came with the printer if possible. The bootloader is very picky about SD cards. Copy `Marlin.ino.bin` to your SD card under three names: `firmware.bin`, `update.bin`, and `fcupdate.flg`. 16. Insert the SD card into your printer. Make sure the X and Y axes are centered in the middle of the bed. (When X and Y endstops are closed this signals a UI upgrade to the bootloader.) 17. Power-cycle the printer. The first flash may take longer. Don't be surprised if the .99 version number doesn't show up until after the UI has launched the default screen. -18. Remove the SD card and delete the `fcupdate.flg` file from the card to prevent an accidental re-flash. +18. Remove the SD card and delete the `fcupdate.flg` file from the card to prevent an accidental re-flash. 19. Test the endstops and homing directions, run M303 PID autotune, and verify all features are working correctly. Welcome to Marlin 2.x... diff --git a/config/examples/Micromake/C1/basic/Configuration.h b/config/examples/Micromake/C1/basic/Configuration.h index 8188fb3b0c..93489b0516 100644 --- a/config/examples/Micromake/C1/basic/Configuration.h +++ b/config/examples/Micromake/C1/basic/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(MetalSearch, Micromake C1 factory settings)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -894,11 +892,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -910,10 +907,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -947,7 +944,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1205,12 +1202,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1264,19 +1255,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1525,7 +1503,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2055,7 +2033,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2068,6 +2046,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2078,11 +2059,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2210,7 +2188,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Micromake/C1/enhanced/Configuration.h b/config/examples/Micromake/C1/enhanced/Configuration.h index c49f807188..d4dcbb6698 100644 --- a/config/examples/Micromake/C1/enhanced/Configuration.h +++ b/config/examples/Micromake/C1/enhanced/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(MetalSearch, Micromake C1 enhanced)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -894,11 +892,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -910,10 +907,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -947,7 +944,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1205,12 +1202,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1264,19 +1255,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1525,7 +1503,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2055,7 +2033,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2068,6 +2046,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2078,11 +2059,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2210,7 +2188,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Micromake/C1/enhanced/Configuration_adv.h b/config/examples/Micromake/C1/enhanced/Configuration_adv.h index a32c25d126..420653d890 100644 --- a/config/examples/Micromake/C1/enhanced/Configuration_adv.h +++ b/config/examples/Micromake/C1/enhanced/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Mks/Robin/Configuration.h b/config/examples/Mks/Robin/Configuration.h index cc38dfb964..07cb10d359 100644 --- a/config/examples/Mks/Robin/Configuration.h +++ b/config/examples/Mks/Robin/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -891,11 +889,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -907,10 +904,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -944,7 +941,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1202,12 +1199,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1261,19 +1252,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1522,7 +1500,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2053,7 +2031,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // #define FSMC_GRAPHICAL_TFT @@ -2064,23 +2042,30 @@ // // ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // -//#define TOUCH_BUTTONS +#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) - #define XPT2046_X_CALIBRATION 12316 - #define XPT2046_Y_CALIBRATION -8981 - #define XPT2046_X_OFFSET -43 - #define XPT2046_Y_OFFSET 257 + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + + /* MKS Robin TFT v2.0 */ + #define XPT2046_X_CALIBRATION 12013 + #define XPT2046_Y_CALIBRATION -8711 + #define XPT2046_X_OFFSET -32 + #define XPT2046_Y_OFFSET 256 + + /* MKS Robin TFT v1.1 */ + //#define XPT2046_X_CALIBRATION -11792 + //#define XPT2046_Y_CALIBRATION 8947 + //#define XPT2046_X_OFFSET 342 + //#define XPT2046_Y_OFFSET -19 #endif // // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2208,7 +2193,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Mks/Robin/Configuration_adv.h b/config/examples/Mks/Robin/Configuration_adv.h index d1135d52b5..00297f58af 100644 --- a/config/examples/Mks/Robin/Configuration_adv.h +++ b/config/examples/Mks/Robin/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Mks/Sbase/Configuration.h b/config/examples/Mks/Sbase/Configuration.h index 63076d779e..f144b1ddb6 100644 --- a/config/examples/Mks/Sbase/Configuration.h +++ b/config/examples/Mks/Sbase/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 32 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 5 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 32, 5, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Mks/Sbase/Configuration_adv.h b/config/examples/Mks/Sbase/Configuration_adv.h index 91f3777c79..63e1a876f2 100644 --- a/config/examples/Mks/Sbase/Configuration_adv.h +++ b/config/examples/Mks/Sbase/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -838,6 +825,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1210,9 +1206,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1294,6 +1338,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1354,7 +1434,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1366,7 +1446,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1501,19 +1582,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1719,78 +1800,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1929,10 +2023,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1956,6 +2052,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2439,10 +2536,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2523,6 +2616,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Printrbot/PrintrboardG2/Configuration.h b/config/examples/Printrbot/PrintrboardG2/Configuration.h index 278432046f..4dfeefb576 100644 --- a/config/examples/Printrbot/PrintrboardG2/Configuration.h +++ b/config/examples/Printrbot/PrintrboardG2/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -898,11 +896,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -914,10 +911,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -951,7 +948,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1209,12 +1206,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1268,19 +1259,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1529,7 +1507,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2059,7 +2037,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2072,6 +2050,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2082,11 +2063,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2214,7 +2192,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/RapideLite/RL200/Configuration.h b/config/examples/RapideLite/RL200/Configuration.h index 1c9745af2c..91bddbf06f 100644 --- a/config/examples/RapideLite/RL200/Configuration.h +++ b/config/examples/RapideLite/RL200/Configuration.h @@ -70,14 +70,9 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(platon42)" // Who made the changes. -//#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 - +// /** * *** VENDORS PLEASE READ *** * @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/RapideLite/RL200/Configuration_adv.h b/config/examples/RapideLite/RL200/Configuration_adv.h index b1dba7ca46..0a13f81e30 100644 --- a/config/examples/RapideLite/RL200/Configuration_adv.h +++ b/config/examples/RapideLite/RL200/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/RepRapPro/Huxley/Configuration.h b/config/examples/RepRapPro/Huxley/Configuration.h index 0b884f6726..f250870d23 100644 --- a/config/examples/RepRapPro/Huxley/Configuration.h +++ b/config/examples/RepRapPro/Huxley/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(indazoo, Huxley v1)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -930,11 +928,10 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -946,10 +943,10 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -983,7 +980,7 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1250,12 +1247,6 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1309,19 +1300,6 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1570,7 +1548,7 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2100,7 +2078,7 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2113,6 +2091,9 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2123,11 +2104,8 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2255,7 +2233,7 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/RepRapWorld/Megatronics/Configuration.h b/config/examples/RepRapWorld/Megatronics/Configuration.h index 803aaae044..39561c347b 100644 --- a/config/examples/RepRapWorld/Megatronics/Configuration.h +++ b/config/examples/RepRapWorld/Megatronics/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "RepRapWorld.com" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// #define REPRAPWORLD_KEYPAD -#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 +#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/RigidBot/Configuration.h b/config/examples/RigidBot/Configuration.h index 568a186c4c..3a85d9f86d 100644 --- a/config/examples/RigidBot/Configuration.h +++ b/config/examples/RigidBot/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, RigidBot)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -888,11 +886,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -904,10 +901,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -941,7 +938,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1199,12 +1196,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1258,19 +1249,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1519,7 +1497,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/RigidBot/Configuration_adv.h b/config/examples/RigidBot/Configuration_adv.h index dd0bd4444f..4604dae51f 100644 --- a/config/examples/RigidBot/Configuration_adv.h +++ b/config/examples/RigidBot/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/SCARA/Configuration.h b/config/examples/SCARA/Configuration.h index cf218bcf6b..64b2191134 100644 --- a/config/examples/SCARA/Configuration.h +++ b/config/examples/SCARA/Configuration.h @@ -97,13 +97,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -116,10 +111,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -899,11 +897,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -915,10 +912,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -952,7 +949,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1210,12 +1207,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1269,19 +1260,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1530,7 +1508,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2060,7 +2038,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2073,6 +2051,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2083,11 +2064,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2215,7 +2193,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/SCARA/Configuration_adv.h b/config/examples/SCARA/Configuration_adv.h index 2336d66083..8db4c49b02 100644 --- a/config/examples/SCARA/Configuration_adv.h +++ b/config/examples/SCARA/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 10*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 10*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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 35 // Default feedrate for retracting (mm/s) - #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 35 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/STM32/Black_STM32F407VET6/Configuration.h b/config/examples/STM32/Black_STM32F407VET6/Configuration.h index db518e3188..2f772633df 100644 --- a/config/examples/STM32/Black_STM32F407VET6/Configuration.h +++ b/config/examples/STM32/Black_STM32F407VET6/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ #define NUM_SERVOS 2 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300, 300 } diff --git a/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h b/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h index ad929f7744..e4cdc12787 100644 --- a/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h +++ b/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/STM32/STM32F10/Configuration.h b/config/examples/STM32/STM32F103R/Configuration.h similarity index 97% rename from config/examples/STM32/STM32F10/Configuration.h rename to config/examples/STM32/STM32F103R/Configuration.h index 5061e82ae5..f31ac7831b 100644 --- a/config/examples/STM32/STM32F10/Configuration.h +++ b/config/examples/STM32/STM32F103R/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "Victor Perez" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION "STM32F103RET6 board" // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -131,7 +129,7 @@ // Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_STM32F1R + #define MOTHERBOARD BOARD_STM32F103R #endif // Name displayed in the LCD "Ready" message and Info menu @@ -892,11 +890,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -908,10 +905,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -945,7 +942,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1203,12 +1200,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1262,19 +1253,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1523,7 +1501,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2053,7 +2031,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2066,6 +2044,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2076,11 +2057,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2208,7 +2186,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/STM32/STM32F4/Configuration.h b/config/examples/STM32/STM32F4/Configuration.h index 07e2bea9d9..2c303616f8 100644 --- a/config/examples/STM32/STM32F4/Configuration.h +++ b/config/examples/STM32/STM32F4/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/STM32/stm32f103ret6/Configuration.h b/config/examples/STM32/stm32f103ret6/Configuration.h index 9f59ba3414..16b6cd7020 100644 --- a/config/examples/STM32/stm32f103ret6/Configuration.h +++ b/config/examples/STM32/stm32f103ret6/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "Victor Perez" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION "STM32F103RET6 board" // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -131,7 +129,7 @@ // Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_STM32F1R + #define MOTHERBOARD BOARD_STM32F103R #endif // Name displayed in the LCD "Ready" message and Info menu @@ -892,11 +890,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -908,10 +905,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -945,7 +942,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1203,12 +1200,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1262,19 +1253,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1523,7 +1501,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2053,7 +2031,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2066,6 +2044,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2076,11 +2057,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2208,7 +2186,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Sanguinololu/Configuration.h b/config/examples/Sanguinololu/Configuration.h index 2512086017..64b533ad9d 100644 --- a/config/examples/Sanguinololu/Configuration.h +++ b/config/examples/Sanguinololu/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(thinkyhead, Sanguinololu)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -921,11 +919,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -937,10 +934,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -974,7 +971,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1232,12 +1229,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1291,19 +1282,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1552,7 +1530,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2082,7 +2060,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2095,6 +2073,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2105,11 +2086,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2237,7 +2215,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Sanguinololu/Configuration_adv.h b/config/examples/Sanguinololu/Configuration_adv.h index d9ef33b1e0..3124a1ec78 100644 --- a/config/examples/Sanguinololu/Configuration_adv.h +++ b/config/examples/Sanguinololu/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Tevo/Michelangelo/Configuration.h b/config/examples/Tevo/Michelangelo/Configuration.h index ef022d9b57..4168fbe0fb 100644 --- a/config/examples/Tevo/Michelangelo/Configuration.h +++ b/config/examples/Tevo/Michelangelo/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Tevo Michelangelo)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -895,11 +893,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -911,10 +908,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -948,7 +945,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1206,12 +1203,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1265,19 +1256,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1526,7 +1504,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2056,7 +2034,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2069,6 +2047,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2079,11 +2060,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2211,7 +2189,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Tevo/Michelangelo/Configuration_adv.h b/config/examples/Tevo/Michelangelo/Configuration_adv.h index d26f5fda9e..6f14749ccf 100644 --- a/config/examples/Tevo/Michelangelo/Configuration_adv.h +++ b/config/examples/Tevo/Michelangelo/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,18 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -738,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -836,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1208,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1292,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1352,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1364,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1499,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1717,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1927,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1954,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2437,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2521,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Tevo/Tarantula Pro/Configuration.h b/config/examples/Tevo/Tarantula Pro/Configuration.h index e88683cc49..c9876e9377 100644 --- a/config/examples/Tevo/Tarantula Pro/Configuration.h +++ b/config/examples/Tevo/Tarantula Pro/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Tevo Tarantula Pro)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -514,7 +512,7 @@ * heater. If your configuration is significantly different than this and you don't understand * the issues involved, don't use bed PID until someone else verifies that your hardware works. */ -#define PIDTEMPBED +//#define PIDTEMPBED //#define BED_LIMIT_SWITCHING @@ -895,11 +893,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -911,10 +908,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 18 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.5 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, 18, -1.5 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -941,7 +938,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1199,12 +1196,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1258,19 +1249,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1519,7 +1497,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2049,7 +2027,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2062,6 +2040,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2072,11 +2053,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2204,7 +2182,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Tevo/Tarantula Pro/Configuration_adv.h b/config/examples/Tevo/Tarantula Pro/Configuration_adv.h index 0864046d73..e0ed161591 100644 --- a/config/examples/Tevo/Tarantula Pro/Configuration_adv.h +++ b/config/examples/Tevo/Tarantula Pro/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -616,7 +616,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -643,19 +643,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -735,8 +722,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -833,6 +820,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1205,9 +1201,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1289,6 +1333,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1349,7 +1429,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1361,7 +1441,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1496,19 +1577,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1714,78 +1795,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1924,10 +2018,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1951,6 +2047,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2434,10 +2531,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2518,6 +2611,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration.h b/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration.h index 07bed904af..2ae9e405c9 100644 --- a/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration.h +++ b/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Tevo Tornado V1)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -895,11 +893,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -911,10 +908,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -45 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -12 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -2.77 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -45, -12, -2.77 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -948,7 +945,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1206,12 +1203,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1265,19 +1256,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1526,7 +1504,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2056,7 +2034,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2069,6 +2047,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2079,11 +2060,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2211,7 +2189,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h b/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h index 0cb2d8fb2e..9337d9e8be 100644 --- a/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h +++ b/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,18 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -738,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -836,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1208,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1292,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1323,7 +1404,7 @@ // // G2/G3 Arc Support // -#define ARC_SUPPORT // Disable this feature to save ~3226 bytes +//#define ARC_SUPPORT // Disable this feature to save ~3226 bytes #if ENABLED(ARC_SUPPORT) #define MM_PER_ARC_SEGMENT 1 // Length of each arc segment #define MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle @@ -1352,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1364,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1499,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1717,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1927,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1954,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2437,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2521,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration.h b/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration.h index fdc085e123..37401fdfdc 100644 --- a/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration.h +++ b/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Tevo Tornado V2)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -895,11 +893,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -911,10 +908,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -45 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -12 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -2.77 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -45, -12, -2.77 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -948,7 +945,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1206,12 +1203,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1265,19 +1256,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1526,7 +1504,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2056,7 +2034,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2069,6 +2047,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2079,11 +2060,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2211,7 +2189,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration_adv.h b/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration_adv.h index 0cb2d8fb2e..9337d9e8be 100644 --- a/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration_adv.h +++ b/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,18 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -738,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -836,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1208,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1292,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1323,7 +1404,7 @@ // // G2/G3 Arc Support // -#define ARC_SUPPORT // Disable this feature to save ~3226 bytes +//#define ARC_SUPPORT // Disable this feature to save ~3226 bytes #if ENABLED(ARC_SUPPORT) #define MM_PER_ARC_SEGMENT 1 // Length of each arc segment #define MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle @@ -1352,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1364,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1499,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1717,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1927,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1954,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2437,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2521,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/TheBorg/Configuration.h b/config/examples/TheBorg/Configuration.h index fbd777d2d8..4286c6f8a4 100644 --- a/config/examples/TheBorg/Configuration.h +++ b/config/examples/TheBorg/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Spawn32, The_Borg)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 32 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 5 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.3 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 32, 5, -1.3 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/TheBorg/Configuration_adv.h b/config/examples/TheBorg/Configuration_adv.h index 3b9ca36c61..38b0eac834 100644 --- a/config/examples/TheBorg/Configuration_adv.h +++ b/config/examples/TheBorg/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/TinyBoy2/Configuration.h b/config/examples/TinyBoy2/Configuration.h index 6c6bf1c59a..78f5b78be6 100644 --- a/config/examples/TinyBoy2/Configuration.h +++ b/config/examples/TinyBoy2/Configuration.h @@ -86,13 +86,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(StefanB, TinyBoy2)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -105,10 +100,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -941,11 +939,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -957,10 +954,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 34 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 15 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 34, 15, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -994,7 +991,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1257,12 +1254,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1316,19 +1307,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1577,7 +1555,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2107,7 +2085,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2120,6 +2098,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2130,11 +2111,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2262,7 +2240,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/TinyBoy2/Configuration_adv.h b/config/examples/TinyBoy2/Configuration_adv.h index cd3684bc7a..ca6ebd41fb 100644 --- a/config/examples/TinyBoy2/Configuration_adv.h +++ b/config/examples/TinyBoy2/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Tronxy/X1/Configuration.h b/config/examples/Tronxy/X1/Configuration.h index e1b8a6ef29..5f3a4ce823 100644 --- a/config/examples/Tronxy/X1/Configuration.h +++ b/config/examples/Tronxy/X1/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Claus Naeveke, 0.1)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Tronxy/X3A/Configuration.h b/config/examples/Tronxy/X3A/Configuration.h index 183fc355b9..75b1551113 100644 --- a/config/examples/Tronxy/X3A/Configuration.h +++ b/config/examples/Tronxy/X3A/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Schullebernd, Tronxy X3A)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -32 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -0.5 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -32, -10, -0.5 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 50 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1205,12 +1202,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1264,19 +1255,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1525,7 +1503,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2055,7 +2033,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2068,6 +2046,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2078,11 +2059,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2210,7 +2188,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Tronxy/X3A/Configuration_adv.h b/config/examples/Tronxy/X3A/Configuration_adv.h index c1e03f0f8c..54de647600 100644 --- a/config/examples/Tronxy/X3A/Configuration_adv.h +++ b/config/examples/Tronxy/X3A/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Tronxy/X5S-2E/Configuration.h b/config/examples/Tronxy/X5S-2E/Configuration.h index 71830fc836..ce81d16bd1 100644 --- a/config/examples/Tronxy/X5S-2E/Configuration.h +++ b/config/examples/Tronxy/X5S-2E/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Anthony Rich, OEM stock config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -911,11 +909,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -927,10 +924,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -964,7 +961,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1222,12 +1219,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1281,19 +1272,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1542,7 +1520,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2072,7 +2050,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2085,6 +2063,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2095,11 +2076,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2227,7 +2205,7 @@ */ #define NUM_SERVOS 2 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300, 300 } diff --git a/config/examples/Tronxy/X5S-2E/Configuration_adv.h b/config/examples/Tronxy/X5S-2E/Configuration_adv.h index dcdbf95edc..a0510df92d 100644 --- a/config/examples/Tronxy/X5S-2E/Configuration_adv.h +++ b/config/examples/Tronxy/X5S-2E/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Tronxy/X5S/Configuration.h b/config/examples/Tronxy/X5S/Configuration.h index 080fd62111..0f468a7b4d 100644 --- a/config/examples/Tronxy/X5S/Configuration.h +++ b/config/examples/Tronxy/X5S/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -45 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -55 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -45, -55, -0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION 15 - //#define RIGHT_PROBE_BED_POSITION 270 - //#define FRONT_PROBE_BED_POSITION 20 - //#define BACK_PROBE_BED_POSITION 260 - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Tronxy/XY100/Configuration.h b/config/examples/Tronxy/XY100/Configuration.h index ca561b10c1..6152d48284 100644 --- a/config/examples/Tronxy/XY100/Configuration.h +++ b/config/examples/Tronxy/XY100/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Rob Griffiths, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -901,11 +899,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -917,10 +914,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -954,7 +951,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1212,12 +1209,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1271,19 +1262,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1532,7 +1510,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2062,7 +2040,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2075,6 +2053,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2085,11 +2066,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2217,7 +2195,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/UltiMachine/Archim1/Configuration.h b/config/examples/UltiMachine/Archim1/Configuration.h index ecd814c51f..26b09c64bb 100644 --- a/config/examples/UltiMachine/Archim1/Configuration.h +++ b/config/examples/UltiMachine/Archim1/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/UltiMachine/Archim1/Configuration_adv.h b/config/examples/UltiMachine/Archim1/Configuration_adv.h index a9c51d51e7..0d8f0a74dd 100644 --- a/config/examples/UltiMachine/Archim1/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim1/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/UltiMachine/Archim2/Configuration.h b/config/examples/UltiMachine/Archim2/Configuration.h index 20a27ff5a4..a6baaec3d6 100644 --- a/config/examples/UltiMachine/Archim2/Configuration.h +++ b/config/examples/UltiMachine/Archim2/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/UltiMachine/Archim2/Configuration_adv.h b/config/examples/UltiMachine/Archim2/Configuration_adv.h index 5383534c86..b9aa479139 100644 --- a/config/examples/UltiMachine/Archim2/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim2/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/VORONDesign/Configuration.h b/config/examples/VORONDesign/Configuration.h index 363c0face9..96abead889 100644 --- a/config/examples/VORONDesign/Configuration.h +++ b/config/examples/VORONDesign/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -899,11 +897,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -915,10 +912,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -952,7 +949,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1210,12 +1207,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - #define LEFT_PROBE_BED_POSITION 15 - #define RIGHT_PROBE_BED_POSITION 200 - #define FRONT_PROBE_BED_POSITION 15 - #define BACK_PROBE_BED_POSITION 200 - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1269,19 +1260,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1530,7 +1508,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2060,7 +2038,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2073,6 +2051,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2083,11 +2064,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2215,7 +2193,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/VORONDesign/Configuration_adv.h b/config/examples/VORONDesign/Configuration_adv.h index d699fc6144..112f85030e 100644 --- a/config/examples/VORONDesign/Configuration_adv.h +++ b/config/examples/VORONDesign/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Velleman/K8200/Configuration.h b/config/examples/Velleman/K8200/Configuration.h index 158e718372..4537da2122 100644 --- a/config/examples/Velleman/K8200/Configuration.h +++ b/config/examples/Velleman/K8200/Configuration.h @@ -86,13 +86,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(K8200, @CONSULitAS)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -105,10 +100,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -919,11 +917,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -935,10 +932,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -972,7 +969,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1231,12 +1228,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1290,19 +1281,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1551,7 +1529,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2049,7 +2027,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2062,6 +2040,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2072,11 +2053,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2204,7 +2182,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Velleman/K8200/Configuration_adv.h b/config/examples/Velleman/K8200/Configuration_adv.h index b67dc52606..b8f87d7066 100644 --- a/config/examples/Velleman/K8200/Configuration_adv.h +++ b/config/examples/Velleman/K8200/Configuration_adv.h @@ -227,7 +227,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -615,8 +615,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -633,7 +633,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -660,19 +660,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -752,8 +739,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -850,6 +837,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1222,9 +1218,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1306,6 +1350,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1366,7 +1446,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1378,7 +1458,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1513,19 +1594,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1731,78 +1812,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1941,10 +2035,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1968,6 +2064,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2451,10 +2548,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2535,6 +2628,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Velleman/K8400/Configuration.h b/config/examples/Velleman/K8400/Configuration.h index fffa85057e..7a16004c50 100644 --- a/config/examples/Velleman/K8400/Configuration.h +++ b/config/examples/Velleman/K8400/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Anthony Birkett, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2207,7 +2185,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Velleman/K8400/Configuration_adv.h b/config/examples/Velleman/K8400/Configuration_adv.h index 2d964b5dcc..13ad305e88 100644 --- a/config/examples/Velleman/K8400/Configuration_adv.h +++ b/config/examples/Velleman/K8400/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Velleman/K8400/Dual-head/Configuration.h b/config/examples/Velleman/K8400/Dual-head/Configuration.h index 2a6fe66353..6b0ffb7998 100644 --- a/config/examples/Velleman/K8400/Dual-head/Configuration.h +++ b/config/examples/Velleman/K8400/Dual-head/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Anthony Birkett, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2207,7 +2185,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/WASP/PowerWASP/Configuration.h b/config/examples/WASP/PowerWASP/Configuration.h index c6fcb85792..8e1e3ba1fb 100644 --- a/config/examples/WASP/PowerWASP/Configuration.h +++ b/config/examples/WASP/PowerWASP/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Julian + Jason)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -909,11 +907,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -925,10 +922,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -962,7 +959,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1220,12 +1217,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1279,19 +1270,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1540,7 +1518,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2070,7 +2048,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2083,6 +2061,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2093,11 +2074,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2225,7 +2203,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/WASP/PowerWASP/Configuration_adv.h b/config/examples/WASP/PowerWASP/Configuration_adv.h index dd4bea7b4b..ddc59ae65e 100644 --- a/config/examples/WASP/PowerWASP/Configuration_adv.h +++ b/config/examples/WASP/PowerWASP/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Wanhao/Duplicator 6/Configuration.h b/config/examples/Wanhao/Duplicator 6/Configuration.h index 0819106585..9bf46181bb 100644 --- a/config/examples/Wanhao/Duplicator 6/Configuration.h +++ b/config/examples/Wanhao/Duplicator 6/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Rob Mendon, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -900,11 +898,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -916,10 +913,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -953,7 +950,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1211,12 +1208,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1270,19 +1261,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1531,7 +1509,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2064,7 +2042,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2077,6 +2055,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2087,11 +2068,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2219,7 +2197,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Wanhao/Duplicator 6/Configuration_adv.h b/config/examples/Wanhao/Duplicator 6/Configuration_adv.h index 765e3f554d..9ed77b96c7 100644 --- a/config/examples/Wanhao/Duplicator 6/Configuration_adv.h +++ b/config/examples/Wanhao/Duplicator 6/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ #define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 70*60, 70*60, 15*60, 6*60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -839,6 +826,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 70*60, 70*60, 15*60, 6*60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1211,9 +1207,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1295,6 +1339,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1355,7 +1435,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1367,7 +1447,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1502,19 +1583,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1720,78 +1801,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1930,10 +2024,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1957,6 +2053,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2440,10 +2537,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2524,6 +2617,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Wanhao/Duplicator i3 Mini/Configuration.h b/config/examples/Wanhao/Duplicator i3 Mini/Configuration.h index 2b228220ca..6a256a95fb 100644 --- a/config/examples/Wanhao/Duplicator i3 Mini/Configuration.h +++ b/config/examples/Wanhao/Duplicator i3 Mini/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(thisiskeithb, Wanhao i3 Mini)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -//#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h b/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h index b5b435f951..9ea28ae69e 100644 --- a/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h +++ b/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/adafruit/ST7565/Configuration.h b/config/examples/adafruit/ST7565/Configuration.h index 666351fada..8ed568a92d 100644 --- a/config/examples/adafruit/ST7565/Configuration.h +++ b/config/examples/adafruit/ST7565/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -890,11 +888,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -906,10 +903,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -943,7 +940,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1201,12 +1198,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1260,19 +1251,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1521,7 +1499,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2051,7 +2029,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2064,6 +2042,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2074,11 +2055,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2206,7 +2184,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/Anycubic/Kossel/Configuration.h b/config/examples/delta/Anycubic/Kossel/Configuration.h index e76f34aa43..c18b065415 100644 --- a/config/examples/delta/Anycubic/Kossel/Configuration.h +++ b/config/examples/delta/Anycubic/Kossel/Configuration.h @@ -85,13 +85,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "@brandstaetter, @grbd" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 "Welcome to ANYCUBIC" // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -104,10 +99,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -1030,50 +1028,35 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1085,16 +1068,15 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] - #if ANYCUBIC_PROBE_VERSION == 2 - #define Z_PROBE_OFFSET_FROM_EXTRUDER -16.8 // Z offset: -below +above [the nozzle] + #define NOZZLE_TO_PROBE_OFFSET { 0, 0, -16.8 } #elif ANYCUBIC_PROBE_VERSION == 1 - #define Z_PROBE_OFFSET_FROM_EXTRUDER -19.0 // Z offset: -below +above [the nozzle] + #define NOZZLE_TO_PROBE_OFFSET { 0, 0, -19.0 } #else - #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + #define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } #endif // Certain types of probes need to stay away from edges @@ -1129,7 +1111,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1390,12 +1372,6 @@ #define GRID_MAX_POINTS_X 9 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - #define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - #define RIGHT_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - #define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - #define BACK_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1709,7 +1685,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2239,7 +2215,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2252,6 +2228,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2262,11 +2241,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2394,7 +2370,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/Anycubic/Kossel/Configuration_adv.h b/config/examples/delta/Anycubic/Kossel/Configuration_adv.h index d8a40a7878..260b9a1f45 100644 --- a/config/examples/delta/Anycubic/Kossel/Configuration_adv.h +++ b/config/examples/delta/Anycubic/Kossel/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,20 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -741,8 +727,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -839,6 +825,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1211,9 +1207,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1295,6 +1339,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1355,7 +1435,7 @@ #define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1367,7 +1447,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1502,19 +1583,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1720,78 +1801,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1930,10 +2024,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1957,6 +2053,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2440,10 +2537,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2524,6 +2617,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/Dreammaker/Overlord/Configuration.h b/config/examples/delta/Dreammaker/Overlord/Configuration.h index 0ed6cd91cb..4bb023181d 100644 --- a/config/examples/delta/Dreammaker/Overlord/Configuration.h +++ b/config/examples/delta/Dreammaker/Overlord/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Team Overlord/TimMoore)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -975,50 +973,35 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1030,10 +1013,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0.65 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0.65 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 5 @@ -1067,7 +1050,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1325,12 +1308,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define RIGHT_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define BACK_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1384,19 +1361,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1645,7 +1609,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2175,7 +2139,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2188,6 +2152,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2198,11 +2165,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2330,7 +2294,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h b/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h index 5b8da56cbe..7fa5d375a4 100644 --- a/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h +++ b/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,20 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -741,8 +727,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -839,6 +825,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1211,9 +1207,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1295,6 +1339,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1355,7 +1435,7 @@ #define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1367,7 +1447,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1502,19 +1583,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1720,78 +1801,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1949,6 +2043,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 #endif @@ -2430,10 +2525,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2514,6 +2605,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/Dreammaker/Overlord_Pro/Configuration.h b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration.h index 5411849e60..c69a173ed1 100644 --- a/config/examples/delta/Dreammaker/Overlord_Pro/Configuration.h +++ b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Team Overlord/TimMoore)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -987,50 +985,35 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1042,10 +1025,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0.65 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0.65 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 5 @@ -1079,7 +1062,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1337,12 +1320,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - #define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - #define RIGHT_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - #define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - #define BACK_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1396,19 +1373,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1656,7 +1620,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2186,7 +2150,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2199,6 +2163,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2209,11 +2176,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2341,7 +2305,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h index 5b8da56cbe..7fa5d375a4 100644 --- a/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h +++ b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,20 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -741,8 +727,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -839,6 +825,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1211,9 +1207,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1295,6 +1339,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1355,7 +1435,7 @@ #define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1367,7 +1447,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1502,19 +1583,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1720,78 +1801,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1949,6 +2043,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 #endif @@ -2430,10 +2525,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2514,6 +2605,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/FLSUN/auto_calibrate/Configuration.h b/config/examples/delta/FLSUN/auto_calibrate/Configuration.h index c6d6f6ee4a..0fe1da9925 100644 --- a/config/examples/delta/FLSUN/auto_calibrate/Configuration.h +++ b/config/examples/delta/FLSUN/auto_calibrate/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(LVD, FLSUN-AC)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -977,52 +975,37 @@ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. // Kossel Mini - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED // Move the nozzle down further to push the probe into retracted position. - #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X - #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 23.0-(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 // Raise things back up slightly so we don't bump into anything - #define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X - #define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y - #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED/2) + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED)/2 - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1034,10 +1017,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0.10 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0.10 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 20 @@ -1071,7 +1054,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1330,12 +1313,6 @@ #define GRID_MAX_POINTS_X 7 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define RIGHT_PROBE_BED_POSITION (DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define BACK_PROBE_BED_POSITION (DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1389,19 +1366,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1649,7 +1613,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2179,7 +2143,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2192,6 +2156,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2202,11 +2169,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2334,7 +2298,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h b/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h index b7132dd986..eb4f8146c3 100644 --- a/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,20 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -741,8 +727,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -839,6 +825,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1211,9 +1207,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1295,6 +1339,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1355,7 +1435,7 @@ #define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1367,7 +1447,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1502,19 +1583,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1720,78 +1801,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1930,10 +2024,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1957,6 +2053,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2440,10 +2537,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2524,6 +2617,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/FLSUN/kossel/Configuration.h b/config/examples/delta/FLSUN/kossel/Configuration.h index 7b1c16f17d..74bd37da76 100644 --- a/config/examples/delta/FLSUN/kossel/Configuration.h +++ b/config/examples/delta/FLSUN/kossel/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(LVD, FLSUN-AC)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -977,51 +975,36 @@ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. // Kossel Mini - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20 - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED // Move the nozzle down further to push the probe into retracted position. - #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X - #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 23.0-(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 // Raise things back up slightly so we don't bump into anything - #define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X - #define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y - #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED/2) + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED)/2 - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1033,10 +1016,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0.10 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0.10 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 20 @@ -1070,7 +1053,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1329,12 +1312,6 @@ #define GRID_MAX_POINTS_X 7 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define RIGHT_PROBE_BED_POSITION (DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define BACK_PROBE_BED_POSITION (DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1388,19 +1365,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1648,7 +1612,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2178,7 +2142,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2191,6 +2155,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2201,11 +2168,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2333,7 +2297,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/FLSUN/kossel/Configuration_adv.h b/config/examples/delta/FLSUN/kossel/Configuration_adv.h index b7132dd986..eb4f8146c3 100644 --- a/config/examples/delta/FLSUN/kossel/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,20 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -741,8 +727,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -839,6 +825,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1211,9 +1207,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1295,6 +1339,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1355,7 +1435,7 @@ #define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1367,7 +1447,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1502,19 +1583,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1720,78 +1801,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1930,10 +2024,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1957,6 +2053,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2440,10 +2537,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2524,6 +2617,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/FLSUN/kossel_mini/Configuration.h b/config/examples/delta/FLSUN/kossel_mini/Configuration.h index ff6f958a33..5c81e5f1f8 100644 --- a/config/examples/delta/FLSUN/kossel_mini/Configuration.h +++ b/config/examples/delta/FLSUN/kossel_mini/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Michael Henke, flsun Kossel Mini)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -977,51 +975,36 @@ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. // Kossel Mini - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20 - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED // Move the nozzle down further to push the probe into retracted position. - #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X - #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 23.0-(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 // Raise things back up slightly so we don't bump into anything - #define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X - #define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y - #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED/2) + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED)/2 - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1033,10 +1016,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0.25 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0.25 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1070,7 +1053,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1329,12 +1312,6 @@ #define GRID_MAX_POINTS_X 9 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define RIGHT_PROBE_BED_POSITION (DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define BACK_PROBE_BED_POSITION (DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1388,19 +1365,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1648,7 +1612,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2178,7 +2142,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2191,6 +2155,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2201,11 +2168,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2333,7 +2297,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h b/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h index 5a241f2e64..1cfa958cd4 100644 --- a/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,20 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -741,8 +727,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -839,6 +825,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1211,9 +1207,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1295,6 +1339,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1355,7 +1435,7 @@ #define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1367,7 +1447,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1502,19 +1583,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1720,78 +1801,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1930,10 +2024,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1957,6 +2053,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2440,10 +2537,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2524,6 +2617,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/Geeetech/Rostock 301/Configuration.h b/config/examples/delta/Geeetech/Rostock 301/Configuration.h index 8ed2ed130a..1eedcf2e06 100644 --- a/config/examples/delta/Geeetech/Rostock 301/Configuration.h +++ b/config/examples/delta/Geeetech/Rostock 301/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(Phr3d13, Geeetech Rostock 301)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -966,50 +964,35 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1021,10 +1004,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, -10, -3.5 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1058,7 +1041,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1317,12 +1300,6 @@ #define GRID_MAX_POINTS_X 9 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define RIGHT_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define BACK_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1376,19 +1353,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1636,7 +1600,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2167,7 +2131,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2180,6 +2144,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2190,11 +2157,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2322,7 +2286,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h b/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h index 2407abf7c7..1ee610af6b 100644 --- a/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h +++ b/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,20 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -741,8 +727,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -839,6 +825,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1211,9 +1207,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1295,6 +1339,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1355,7 +1435,7 @@ #define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1367,7 +1447,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1502,19 +1583,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1720,78 +1801,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1930,10 +2024,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1957,6 +2053,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2440,10 +2537,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2524,6 +2617,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/Hatchbox_Alpha/Configuration.h b/config/examples/delta/Hatchbox_Alpha/Configuration.h index 73be6c146d..bc3f024b39 100644 --- a/config/examples/delta/Hatchbox_Alpha/Configuration.h +++ b/config/examples/delta/Hatchbox_Alpha/Configuration.h @@ -75,13 +75,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -94,10 +89,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -981,50 +979,35 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1036,10 +1019,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1073,7 +1056,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1332,12 +1315,6 @@ #define GRID_MAX_POINTS_X 9 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define RIGHT_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define BACK_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1651,7 +1628,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2181,7 +2158,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2194,6 +2171,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2204,11 +2184,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2336,7 +2313,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/MKS/SBASE/Configuration.h b/config/examples/delta/MKS/SBASE/Configuration.h index 2b6d1a80b7..915c069efb 100644 --- a/config/examples/delta/MKS/SBASE/Configuration.h +++ b/config/examples/delta/MKS/SBASE/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -966,50 +964,35 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1021,10 +1004,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, -10, -3.5 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1058,7 +1041,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1317,12 +1300,6 @@ #define GRID_MAX_POINTS_X 9 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define RIGHT_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define BACK_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1376,19 +1353,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1636,7 +1600,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2166,7 +2130,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2179,6 +2143,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2189,11 +2156,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2321,7 +2285,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/MKS/SBASE/Configuration_adv.h b/config/examples/delta/MKS/SBASE/Configuration_adv.h index 6eaa35da31..0727cd9cbd 100644 --- a/config/examples/delta/MKS/SBASE/Configuration_adv.h +++ b/config/examples/delta/MKS/SBASE/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,20 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -741,8 +727,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -839,6 +825,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1211,9 +1207,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1295,6 +1339,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1355,7 +1435,7 @@ #define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1367,7 +1447,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1502,19 +1583,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1720,78 +1801,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1930,10 +2024,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1957,6 +2053,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2440,10 +2537,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2524,6 +2617,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/Tevo Little Monster/Configuration.h b/config/examples/delta/Tevo Little Monster/Configuration.h index 2982b57473..1c894ce327 100644 --- a/config/examples/delta/Tevo Little Monster/Configuration.h +++ b/config/examples/delta/Tevo Little Monster/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(HEINRICHS)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -970,50 +968,35 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1025,10 +1008,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 20 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.10 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, 20, -1.10 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 20 @@ -1062,7 +1045,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1321,12 +1304,6 @@ #define GRID_MAX_POINTS_X 7 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define RIGHT_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define BACK_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1380,19 +1357,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1640,7 +1604,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2170,7 +2134,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2183,6 +2147,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2193,11 +2160,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2325,7 +2289,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/Tevo Little Monster/Configuration_adv.h b/config/examples/delta/Tevo Little Monster/Configuration_adv.h index ef93ce4ba3..801b19fc91 100644 --- a/config/examples/delta/Tevo Little Monster/Configuration_adv.h +++ b/config/examples/delta/Tevo Little Monster/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,20 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -741,8 +727,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -839,6 +825,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1211,9 +1207,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1295,6 +1339,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1355,7 +1435,7 @@ #define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1367,7 +1447,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1502,19 +1583,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1720,78 +1801,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1930,10 +2024,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1957,6 +2053,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2440,10 +2537,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2524,6 +2617,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/generic/Configuration.h b/config/examples/delta/generic/Configuration.h index b1e7e5a53e..34e68585ba 100644 --- a/config/examples/delta/generic/Configuration.h +++ b/config/examples/delta/generic/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -966,50 +964,35 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1021,10 +1004,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, -10, -3.5 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1058,7 +1041,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1317,12 +1300,6 @@ #define GRID_MAX_POINTS_X 9 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define RIGHT_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define BACK_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1376,19 +1353,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1636,7 +1600,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2166,7 +2130,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2179,6 +2143,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2189,11 +2156,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2321,7 +2285,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/generic/Configuration_adv.h b/config/examples/delta/generic/Configuration_adv.h index 5a241f2e64..1cfa958cd4 100644 --- a/config/examples/delta/generic/Configuration_adv.h +++ b/config/examples/delta/generic/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,20 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -741,8 +727,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -839,6 +825,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1211,9 +1207,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1295,6 +1339,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1355,7 +1435,7 @@ #define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1367,7 +1447,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1502,19 +1583,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1720,78 +1801,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1930,10 +2024,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1957,6 +2053,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2440,10 +2537,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2524,6 +2617,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/kossel_mini/Configuration.h b/config/examples/delta/kossel_mini/Configuration.h index 492f18a83f..6f32e89d80 100644 --- a/config/examples/delta/kossel_mini/Configuration.h +++ b/config/examples/delta/kossel_mini/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -967,51 +965,36 @@ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. // Kossel Mini - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20 - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED // Move the nozzle down further to push the probe into retracted position. - #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X - #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z-Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED/10) + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 23.0-(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 // Raise things back up slightly so we don't bump into anything - #define Z_PROBE_ALLEN_KEY_STOW_3_X Z_PROBE_ALLEN_KEY_STOW_2_X - #define Z_PROBE_ALLEN_KEY_STOW_3_Y Z_PROBE_ALLEN_KEY_STOW_2_Y - #define Z_PROBE_ALLEN_KEY_STOW_3_Z (Z_PROBE_ALLEN_KEY_STOW_1_Z+Z_PROBE_ALLEN_KEY_STOW_DEPTH) - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED/2) + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE (XY_PROBE_SPEED)/2 - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 23.0+(Z_PROBE_ALLEN_KEY_STOW_DEPTH) } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1023,10 +1006,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 0, -10, -3.5 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1060,7 +1043,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1319,12 +1302,6 @@ #define GRID_MAX_POINTS_X 9 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define RIGHT_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define BACK_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1378,19 +1355,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1638,7 +1602,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2168,7 +2132,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2181,6 +2145,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2191,11 +2158,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2323,7 +2287,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/kossel_mini/Configuration_adv.h b/config/examples/delta/kossel_mini/Configuration_adv.h index 5a241f2e64..1cfa958cd4 100644 --- a/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/kossel_mini/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,20 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -741,8 +727,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -839,6 +825,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1211,9 +1207,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1295,6 +1339,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1355,7 +1435,7 @@ #define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1367,7 +1447,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1502,19 +1583,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1720,78 +1801,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1930,10 +2024,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1957,6 +2053,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2440,10 +2537,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2524,6 +2617,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/kossel_pro/Configuration.h b/config/examples/delta/kossel_pro/Configuration.h index 42592ae5de..8920710d84 100644 --- a/config/examples/delta/kossel_pro/Configuration.h +++ b/config/examples/delta/kossel_pro/Configuration.h @@ -74,13 +74,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -93,10 +88,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -960,55 +958,38 @@ // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. // Kossel Pro - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X -105.00 // Move left but not quite so far that we'll bump the belt - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y 0.00 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { -105.00, 0.00, 100.0 } // Move left but not quite so far that we'll bump the belt #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X -110.00 // Move outward to position deploy pin to the left of the arm - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y -125.00 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z Z_PROBE_ALLEN_KEY_DEPLOY_1_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { -110.00, -125.00, 100.0 } // Move outward to position deploy pin to the left of the arm #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { -110.00 * 0.75, -125.00 * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_X 45.00 // Move right to trigger deploy pin - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Y -125.00 - #define Z_PROBE_ALLEN_KEY_DEPLOY_4_Z Z_PROBE_ALLEN_KEY_DEPLOY_3_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_4 { 45.00, -125.00, 100.0 } // Move right to trigger deploy pin #define Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE (XY_PROBE_SPEED)/2 - #define Z_PROBE_ALLEN_KEY_STOW_1_X 36.00 // Line up with bed retaining clip - #define Z_PROBE_ALLEN_KEY_STOW_1_Y -125.00 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 75.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { 36.00, -125.00, 75.0 } // Line up with bed retaining clip #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X Z_PROBE_ALLEN_KEY_STOW_1_X // move down to retract probe - #define Z_PROBE_ALLEN_KEY_STOW_2_Y Z_PROBE_ALLEN_KEY_STOW_1_Y - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 0.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { 36.00, -125.00, 0.0 } // move down to retract probe #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/2 - #define Z_PROBE_ALLEN_KEY_STOW_3_X 0.0 // return to 0,0,100 - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 100.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { 0.0, 0.0, 100.0 } // return to 0,0,100 #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 100.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1020,14 +1001,15 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -23 // KosselPro actual: -22.919 -#define Y_PROBE_OFFSET_FROM_EXTRUDER -6 // KosselPro actual: -6.304 +#define NOZZLE_TO_PROBE_OFFSET { -23, -6, -17.25 } // KosselPro actual: -22.919, -6.304, -17.45 /** * Kossel Pro note: The correct value is likely -17.45 but I'd rather err on the side of * not giving someone a head crash. Use something like G29 Z-0.2 to adjust as needed. */ -#define Z_PROBE_OFFSET_FROM_EXTRUDER -17.25 // Increase this if the first layer is too thin (remember: it's a negative number so increase means closer to zero). + // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1060,7 +1042,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1320,12 +1302,6 @@ #define GRID_MAX_POINTS_X 7 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define RIGHT_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define BACK_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1379,19 +1355,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1639,7 +1602,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2169,7 +2132,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2182,6 +2145,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2192,11 +2158,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2324,7 +2287,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/kossel_xl/Configuration.h b/config/examples/delta/kossel_xl/Configuration.h index 1aeedccad3..2e11a8c991 100644 --- a/config/examples/delta/kossel_xl/Configuration.h +++ b/config/examples/delta/kossel_xl/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(oxivanisher)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -969,50 +967,35 @@ // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 } #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position - #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down - #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } // Push it down #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 - #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear - #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 - #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } // Move it up to clear #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED - #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 - #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED #endif // Z_PROBE_ALLEN_KEY /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -1024,10 +1007,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 0.0 // Z probe to nozzle X offset: -left +right -#define Y_PROBE_OFFSET_FROM_EXTRUDER 0.0 // Z probe to nozzle Y offset: -front +behind -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0.3 // Z probe to nozzle Z offset: -below (always!) +#define NOZZLE_TO_PROBE_OFFSET { 0.0, 0.0, 0.3 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -1061,7 +1044,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1320,12 +1303,6 @@ #define GRID_MAX_POINTS_X 5 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define RIGHT_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) - //#define BACK_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1379,19 +1356,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1639,7 +1603,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2169,7 +2133,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2182,6 +2146,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2192,11 +2159,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2324,7 +2288,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/delta/kossel_xl/Configuration_adv.h b/config/examples/delta/kossel_xl/Configuration_adv.h index 6f54a31816..45a07f4667 100644 --- a/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/config/examples/delta/kossel_xl/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,20 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE_XYZ 50*60 - #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -741,8 +727,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -839,6 +825,16 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1211,9 +1207,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1295,6 +1339,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1355,7 +1435,7 @@ #define MIN_STEPS_PER_SEGMENT 1 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1367,7 +1447,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1502,19 +1583,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1720,78 +1801,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1930,10 +2024,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1957,6 +2053,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2440,10 +2537,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2524,6 +2617,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/gCreate/gMax1.5+/Configuration.h b/config/examples/gCreate/gMax1.5+/Configuration.h index a771bc0af4..d5278a6db0 100644 --- a/config/examples/gCreate/gMax1.5+/Configuration.h +++ b/config/examples/gCreate/gMax1.5+/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. #define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -903,11 +901,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -919,10 +916,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -17 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -0.25 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -17, -10, -0.25 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 45 @@ -956,7 +953,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1215,12 +1212,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1535,7 +1526,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2065,7 +2056,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2078,6 +2069,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2088,11 +2082,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2220,7 +2211,7 @@ */ #define NUM_SERVOS 2 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300, 300 } diff --git a/config/examples/gCreate/gMax1.5+/Configuration_adv.h b/config/examples/gCreate/gMax1.5+/Configuration_adv.h index 7dbe8c25e8..fa0c0e0b23 100644 --- a/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/makibox/Configuration.h b/config/examples/makibox/Configuration.h index 2f64b17dcb..4db20e066e 100644 --- a/config/examples/makibox/Configuration.h +++ b/config/examples/makibox/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -854,7 +852,7 @@ /** * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ -//#define BLTOUCH +#define BLTOUCH /** * Touch-MI Probe by hotends.fr @@ -893,11 +891,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -909,10 +906,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -946,7 +943,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1204,12 +1201,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1263,19 +1254,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1524,7 +1502,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2054,7 +2032,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2067,6 +2045,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2077,11 +2058,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2209,7 +2187,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/makibox/Configuration_adv.h b/config/examples/makibox/Configuration_adv.h index 9f250a0c4e..411986b0c8 100644 --- a/config/examples/makibox/Configuration_adv.h +++ b/config/examples/makibox/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/tvrrug/Round2/Configuration.h b/config/examples/tvrrug/Round2/Configuration.h index 96b6ef3df5..7c193cff3c 100644 --- a/config/examples/tvrrug/Round2/Configuration.h +++ b/config/examples/tvrrug/Round2/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -885,11 +883,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -901,10 +898,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -25 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { -25, -29, -12.35 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -938,7 +935,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1196,12 +1193,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1255,19 +1246,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1516,7 +1494,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2046,7 +2024,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2059,6 +2037,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2069,11 +2050,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2201,7 +2179,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/tvrrug/Round2/Configuration_adv.h b/config/examples/tvrrug/Round2/Configuration_adv.h index 691d33dcea..82c6bb2ee7 100644 --- a/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/config/examples/tvrrug/Round2/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -837,6 +824,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1209,9 +1205,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1293,6 +1337,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1353,7 +1433,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1365,7 +1445,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1500,19 +1581,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1718,78 +1799,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1928,10 +2022,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1955,6 +2051,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2438,10 +2535,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2522,6 +2615,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/wt150/Configuration.h b/config/examples/wt150/Configuration.h index bee9209bbd..ff3a7c38d2 100644 --- a/config/examples/wt150/Configuration.h +++ b/config/examples/wt150/Configuration.h @@ -70,13 +70,8 @@ // @section info -// User-specified version info of this build to display in [Pronterface, etc] terminal window during -// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this -// build by the user have been successfully uploaded into firmware. +// Author info of this build printed to the host during boot and M115 #define STRING_CONFIG_H_AUTHOR "(none, wt150)" // Who made the changes. -#define SHOW_BOOTSCREEN -#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 -#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 /** * *** VENDORS PLEASE READ *** @@ -89,10 +84,13 @@ * respectfully request that you retain the unmodified Marlin boot screen. */ -// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** +#define SHOW_BOOTSCREEN + +// Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN -// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +// Show the bitmap in Marlin/_Statusscreen.h on the status screen. //#define CUSTOM_STATUS_SCREEN_IMAGE // @section machine @@ -895,11 +893,10 @@ /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). - * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: - * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 - * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * * +-- BACK ---+ * | | @@ -911,10 +908,10 @@ * | | * O-- FRONT --+ * (0,0) + * + * Specify a Probe position as { X, Y, Z } */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Certain types of probes need to stay away from edges #define MIN_PROBE_EDGE 10 @@ -948,7 +945,7 @@ * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) - * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. @@ -1206,12 +1203,6 @@ #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - // Set the boundaries for probing (where the probe can reach). - //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) - //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE - //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) - // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -1265,19 +1256,6 @@ #endif // BED_LEVELING -/** - * Points to probe for all 3-point Leveling procedures. - * Override if the automatically selected points are inadequate. - */ -#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) - //#define PROBE_PT_1_X 15 - //#define PROBE_PT_1_Y 180 - //#define PROBE_PT_2_X 15 - //#define PROBE_PT_2_Y 20 - //#define PROBE_PT_3_X 170 - //#define PROBE_PT_3_Y 20 -#endif - /** * Add a bed leveling sub-menu for ABL or MBL. * Include a guided procedure if manual probing is enabled. @@ -1526,7 +1504,7 @@ #define NOZZLE_CLEAN_TRIANGLES 3 // Specify positions as { X, Y, Z } - #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) } #define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) } // Circular pattern radius @@ -2056,7 +2034,7 @@ //============================================================================= // -// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.) +// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // //#define FSMC_GRAPHICAL_TFT @@ -2069,6 +2047,9 @@ // //#define TOUCH_BUTTONS #if ENABLED(TOUCH_BUTTONS) + #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens + #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus + #define XPT2046_X_CALIBRATION 12316 #define XPT2046_Y_CALIBRATION -8981 #define XPT2046_X_OFFSET -43 @@ -2079,11 +2060,8 @@ // RepRapWorld REPRAPWORLD_KEYPAD v1.1 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // -// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key -// is pressed, a value of 10.0 means 10mm per click. -// //#define REPRAPWORLD_KEYPAD -//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //============================================================================= //=============================== Extra Features ============================== @@ -2211,7 +2189,7 @@ */ //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// (ms) Delay before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it. #define SERVO_DELAY { 300 } diff --git a/config/examples/wt150/Configuration_adv.h b/config/examples/wt150/Configuration_adv.h index 9047215a86..2a02e84234 100644 --- a/config/examples/wt150/Configuration_adv.h +++ b/config/examples/wt150/Configuration_adv.h @@ -214,7 +214,7 @@ #define AUTOTEMP_OLDWEIGHT 0.98 #endif -// Show extra position information in M114 +// Show extra position information with 'M114 D' //#define M114_DETAIL // Show Temperature ADC value @@ -602,8 +602,8 @@ //#define Z_STEPPER_AUTO_ALIGN #if ENABLED(Z_STEPPER_AUTO_ALIGN) // Define probe X and Y positions for Z1, Z2 [, Z3] - #define Z_STEPPER_ALIGN_X { 10, 150, 290 } - #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } // Set number of iterations to align #define Z_STEPPER_ALIGN_ITERATIONS 3 // Enable to restore leveling setup after operation @@ -620,7 +620,7 @@ #define Z_STEPPER_ALIGN_ACC 0.02 #endif -// @section machine +// @section motion #define AXIS_RELATIVE_MODES { false, false, false, false } @@ -647,19 +647,6 @@ //#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated -// @section lcd - -#if EITHER(ULTIPANEL, EXTENSIBLE_UI) - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel - #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) - #if ENABLED(ULTIPANEL) - #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" - #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen - #endif -#endif - -// @section motion - // Minimum time that a segment needs to take if the buffer is emptied #define DEFAULT_MINSEGMENTTIME 20000 // (ms) @@ -739,8 +726,8 @@ //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm + #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm + #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm // Comment out any sides which are unreachable by the probe. For best // auto-calibration results, all sides must be reachable. @@ -838,6 +825,15 @@ // @section lcd +#if EITHER(ULTIPANEL, EXTENSIBLE_UI) + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm) + #if ENABLED(ULTIPANEL) + #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" + #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + #endif +#endif + // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) @@ -1210,9 +1206,57 @@ //#define TOUCH_UI_PORTRAIT //#define TOUCH_UI_MIRRORED + // UTF8 processing and rendering. + // Unsupported characters are shown as '?'. + //#define TOUCH_UI_USE_UTF8 + #if ENABLED(TOUCH_UI_USE_UTF8) + // Western accents support. These accented characters use + // combined bitmaps and require relatively little storage. + #define TOUCH_UI_UTF8_WESTERN_CHARSET + #if ENABLED(TOUCH_UI_UTF8_WESTERN_CHARSET) + // Additional character groups. These characters require + // full bitmaps and take up considerable storage: + //#define TOUCH_UI_UTF8_SUPERSCRIPTS // ¹ ² ³ + //#define TOUCH_UI_UTF8_COPYRIGHT // © ® + //#define TOUCH_UI_UTF8_GERMANIC // ß + //#define TOUCH_UI_UTF8_SCANDINAVIAN // Æ Ð Ø Þ æ ð ø þ + //#define TOUCH_UI_UTF8_PUNCTUATION // « » ¿ ¡ + //#define TOUCH_UI_UTF8_CURRENCY // ¢ £ ¤ ¥ + //#define TOUCH_UI_UTF8_ORDINALS // º ª + //#define TOUCH_UI_UTF8_MATHEMATICS // ± × ÷ + //#define TOUCH_UI_UTF8_FRACTIONS // ¼ ½ ¾ + //#define TOUCH_UI_UTF8_SYMBOLS // µ ¶ ¦ § ¬ + #endif + #endif + + // Use a smaller font when labels don't fit buttons + #define TOUCH_UI_FIT_TEXT + + // Allow language selection from menu at run-time (otherwise use LCD_LANGUAGE) + //#define LCD_LANGUAGE_1 en + //#define LCD_LANGUAGE_2 fr + //#define LCD_LANGUAGE_3 de + //#define LCD_LANGUAGE_4 es + //#define LCD_LANGUAGE_5 it + // Use a numeric passcode for "Screen lock" keypad. // (recommended for smaller displays) //#define TOUCH_UI_PASSCODE + + // Output extra debug info for Touch UI events + //#define TOUCH_UI_DEBUG +#endif + +// +// FSMC Graphical TFT +// +#if ENABLED(FSMC_GRAPHICAL_TFT) + //#define TFT_MARLINUI_COLOR 0xFFFF // White + //#define TFT_MARLINBG_COLOR 0x0000 // Black + //#define TFT_DISABLED_COLOR 0x0003 // Almost black + //#define TFT_BTCANCEL_COLOR 0xF800 // Red + //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow + //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif // @section safety @@ -1294,6 +1338,42 @@ // @section leveling +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Override MIN_PROBE_EDGE for each side of the build plate + * Useful to get probe points to exact positions on targets or + * to allow leveling to avoid plate clamps on only specific + * sides of the bed. + * + * If you are replacing the prior *_PROBE_BED_POSITION options, + * LEFT and FRONT values in most cases will map directly over + * RIGHT and REAR would be the inverse such as + * (X/Y_BED_SIZE - RIGHT/BACK_PROBE_BED_POSITION) + * + * This will allow all positions to match at compilation, however + * should the probe position be modified with M851XY then the + * probe points will follow. This prevents any change from causing + * the probe to be unable to reach any points. + */ +#if PROBE_SELECTED && !IS_KINEMATIC + //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE + //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE +#endif + #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET @@ -1354,7 +1434,7 @@ #define MIN_STEPS_PER_SEGMENT 6 /** - * Minimum delay after setting the stepper DIR (in ns) + * Minimum delay before and after setting the stepper DIR (in ns) * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) * 20 : Minimum for TMC2xxx drivers * 200 : Minimum for A4988 drivers @@ -1366,7 +1446,8 @@ * * Override the default value based on the driver type set in Configuration.h. */ -//#define MINIMUM_STEPPER_DIR_DELAY 650 +//#define MINIMUM_STEPPER_POST_DIR_DELAY 650 +//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650 /** * Minimum stepper driver pulse width (in µs) @@ -1501,19 +1582,19 @@ */ //#define FWRETRACT #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) - #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over - #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length + #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #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_ZRAISE 0 // Default retract Z-raise (mm) - #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) - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously #endif @@ -1719,78 +1800,91 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 + #define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ... #endif #if AXIS_IS_TMC(X2) #define X2_CURRENT 800 #define X2_MICROSTEPS 16 #define X2_RSENSE 0.11 + #define X2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 800 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 + #define Y_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Y2) #define Y2_CURRENT 800 #define Y2_MICROSTEPS 16 #define Y2_RSENSE 0.11 + #define Y2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 + #define Z_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z2) #define Z2_CURRENT 800 #define Z2_MICROSTEPS 16 #define Z2_RSENSE 0.11 + #define Z2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(Z3) #define Z3_CURRENT 800 #define Z3_MICROSTEPS 16 #define Z3_RSENSE 0.11 + #define Z3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 800 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 + #define E0_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E1) #define E1_CURRENT 800 #define E1_MICROSTEPS 16 #define E1_RSENSE 0.11 + #define E1_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E2) #define E2_CURRENT 800 #define E2_MICROSTEPS 16 #define E2_RSENSE 0.11 + #define E2_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E3) #define E3_CURRENT 800 #define E3_MICROSTEPS 16 #define E3_RSENSE 0.11 + #define E3_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E4) #define E4_CURRENT 800 #define E4_MICROSTEPS 16 #define E4_RSENSE 0.11 + #define E4_CHAIN_POS 0 #endif #if AXIS_IS_TMC(E5) #define E5_CURRENT 800 #define E5_MICROSTEPS 16 #define E5_RSENSE 0.11 + #define E5_CHAIN_POS 0 #endif /** @@ -1929,10 +2023,12 @@ * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. * X, Y, and Z homing will always be done in spreadCycle mode. * - * X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity. - * Use M914 X Y Z to live-adjust the sensitivity. - * Higher: LESS sensitive. (Too high => failure to trigger) - * Lower: MORE sensitive. (Too low => false positives) + * X/Y/Z_STALL_SENSITIVITY is the default stall threshold. + * Use M914 X Y Z to set the stall threshold at runtime: + * + * Sensitivity TMC2209 Others + * HIGHEST 255 -64 (Too sensitive => False positive) + * LOWEST 0 63 (Too insensitive => No trigger) * * It is recommended to set [XYZ]_HOME_BUMP_MM to 0. * @@ -1956,6 +2052,7 @@ #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) // TMC2209: 0...255. TMC2130: -64...63 #define X_STALL_SENSITIVITY 8 + #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define Y_STALL_SENSITIVITY 8 //#define Z_STALL_SENSITIVITY 8 //#define SPI_ENDSTOPS // TMC2130 only @@ -2439,10 +2536,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2523,6 +2616,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/platformio.ini b/platformio.ini index 6cd3110f14..190c8af5da 100644 --- a/platformio.ini +++ b/platformio.ini @@ -22,13 +22,12 @@ default_envs = megaatmega2560 [common] default_src_filter = + - - + -build_flags = -fmax-errors=5 - -g - -ggdb +extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py +build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ lib_deps = - U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/dev.zip + U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip LiquidCrystal@1.3.4 - TMCStepper@<1.0.0 + TMCStepper@>=0.5.0,<1.0.0 Adafruit NeoPixel@1.1.3 LiquidTWI2=https://github.com/lincomatic/LiquidTWI2/archive/master.zip Arduino-L6470=https://github.com/ameyer/Arduino-L6470/archive/dev.zip @@ -89,7 +88,6 @@ build_flags = ${common.build_flags} lib_deps = ${common.lib_deps} TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip src_filter = ${common.default_src_filter} + -extra_scripts = pre:buildroot/share/atom/create_custom_upload_command_CDC.py monitor_speed = 250000 # @@ -106,7 +104,6 @@ build_flags = ${common.build_flags} lib_deps = ${common.lib_deps} TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip src_filter = ${common.default_src_filter} + -extra_scripts = pre:buildroot/share/atom/create_custom_upload_command_DFU.py monitor_speed = 250000 # @@ -150,7 +147,7 @@ monitor_speed = 250000 platform = https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/master.zip framework = arduino board = nxp_lpc1768 -build_flags = -DTARGET_LPC1768 -DU8G_HAL_LINKS -IMarlin/src/HAL/HAL_LPC1768/include -IMarlin/src/HAL/HAL_LPC1768/u8g ${common.build_flags} +build_flags = -DTARGET_LPC1768 -DU8G_HAL_LINKS -IMarlin/src/HAL/HAL_LPC1768/include -IMarlin/src/HAL/HAL_LPC1768/u8g ${common.build_flags} # debug options for backtrace # -funwind-tables # -mpoke-function-name @@ -161,8 +158,8 @@ src_filter = ${common.default_src_filter} + monitor_speed = 250000 lib_deps = Servo LiquidCrystal - U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/dev.zip - TMCStepper@<1.0.0 + U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip + TMCStepper@>=0.5.0,<1.0.0 Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/master.zip SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip @@ -181,8 +178,8 @@ src_filter = ${common.default_src_filter} + monitor_speed = 250000 lib_deps = Servo LiquidCrystal - U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/dev.zip - TMCStepper@<1.0.0 + U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip + TMCStepper@>=0.5.0,<1.0.0 Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/master.zip # @@ -256,11 +253,11 @@ monitor_speed = 250000 # # STM32F103RE # -[env:STM32F1] +[env:STM32F103R] platform = ststm32 framework = arduino board = genericSTM32F103RE -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py ${common.build_flags} -std=gnu++14 -DDEBUG_LEVEL=0 build_unflags = -std=gnu++11 @@ -270,16 +267,16 @@ src_filter = ${common.default_src_filter} + monitor_speed = 250000 # -# fysetc_STM32F1 +# STM32F103R_fysetc # -[env:fysetc_STM32F1] +[env:STM32F103R_fysetc] platform = ststm32 framework = arduino board = genericSTM32F103RC #board_build.core = maple platform_packages = tool-stm32duino -extra_scripts = buildroot/share/PlatformIO/scripts/fysetc_STM32F1.py -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py +extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103R_fysetc.py +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py ${common.build_flags} -std=gnu++14 -DDEBUG_LEVEL=0 -DHAVE_SW_SERIAL build_unflags = -std=gnu++11 @@ -295,15 +292,30 @@ upload_protocol = serial # # BigTree SKR Mini V1.1 / SKR mini E3 / SKR E3 DIP (STM32F103RCT6 ARM Cortex-M3) # -[env:BIGTREE_SKR_MINI] +[env:STM32F103R_bigtree] platform = ststm32 framework = arduino board = genericSTM32F103RC platform_packages = tool-stm32duino extra_scripts = buildroot/share/PlatformIO/scripts/STM32F1_SKR_MINI.py -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py - ${common.build_flags} -std=gnu++14 - -DDEBUG_LEVEL=0 +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 +build_unflags = -std=gnu++11 +lib_deps = ${common.lib_deps} +lib_ignore = Adafruit NeoPixel, SPI +src_filter = ${common.default_src_filter} + +monitor_speed = 115200 +upload_protocol = stlink +debug_tool = stlink + +[env:STM32F103R_bigtree_USB] +platform = ststm32 +framework = arduino +board = genericSTM32F103RC +platform_packages = tool-stm32duino +extra_scripts = buildroot/share/PlatformIO/scripts/STM32F1_SKR_MINI.py +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -DDEBUG_LEVEL=0 -DUSE_USB_COMPOSITE -std=gnu++14 build_unflags = -std=gnu++11 lib_deps = ${common.lib_deps} lib_ignore = Adafruit NeoPixel, SPI @@ -354,16 +366,16 @@ monitor_speed = 250000 # # Longer 3D board in Alfawise U20 (STM32F103VET6) # -[env:alfawise_U20] +[env:STM32F103V_longer] platform = ststm32 framework = arduino board = genericSTM32F103VE monitor_speed = 250000 -extra_scripts = buildroot/share/PlatformIO/scripts/alfawise_Ux0.py -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py - ${common.build_flags} -std=gnu++14 +extra_scripts = buildroot/share/PlatformIO/scripts/longer_STM32.py +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py + ${common.build_flags} -std=gnu++14 -USERIAL_USB -DSTM32F1xx -DU20 -DTS_V12 -build_unflags = -std=gnu++11 -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 +build_unflags = -std=gnu++11 -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6 src_filter = ${common.default_src_filter} + lib_deps = ${common.lib_deps} lib_ignore = Adafruit NeoPixel, LiquidTWI2, SPI @@ -376,7 +388,7 @@ platform = ststm32 framework = arduino board = genericSTM32F103ZE extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin.py -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py ${common.build_flags} -std=gnu++14 build_unflags = -std=gnu++11 src_filter = ${common.default_src_filter} + @@ -391,7 +403,7 @@ platform = ststm32 framework = arduino board = genericSTM32F103RC extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_lite.py -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py ${common.build_flags} -std=gnu++14 build_unflags = -std=gnu++11 src_filter = ${common.default_src_filter} + @@ -406,7 +418,7 @@ platform = ststm32 framework = arduino board = genericSTM32F103VE extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_mini.py -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py ${common.build_flags} -std=gnu++14 build_unflags = -std=gnu++11 src_filter = ${common.default_src_filter} + @@ -421,7 +433,7 @@ platform = ststm32 framework = arduino board = genericSTM32F103VE extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_nano.py -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py ${common.build_flags} -std=gnu++14 build_unflags = -std=gnu++11 src_filter = ${common.default_src_filter} + @@ -436,7 +448,7 @@ platform = ststm32 framework = arduino board = genericSTM32F103ZE extra_scripts = buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py ${common.build_flags} -DSTM32F1xx -std=gnu++14 build_unflags = -std=gnu++11 src_filter = ${common.default_src_filter} + @@ -449,7 +461,7 @@ monitor_speed = 250000 # 'Black' STM32F407VET6 board - http://wiki.stm32duino.com/index.php?title=STM32F407 # Shield - https://github.com/jmz52/Hardware # -[env:black_stm32f407ve] +[env:STM32F407VE_black] platform = ststm32@5.4.3 framework = arduino board = blackSTM32F407VET6 @@ -465,15 +477,20 @@ monitor_speed = 250000 # Bigtreetech SKR Pro (STM32F407ZGT6 ARM Cortex-M4) # [env:BIGTREE_SKR_PRO] -platform = ststm32@5.4.3 +platform = ststm32 framework = arduino board = BigTree_SKR_Pro extra_scripts = pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py build_flags = ${common.build_flags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSB_PRODUCT=\"STM32F407ZG\" -DTARGET_STM32F4 -DSTM32F407_5ZX -DVECT_TAB_OFFSET=0x8000 -DHAVE_HWSERIAL6 -lib_deps = ${common.lib_deps} -lib_ignore = Adafruit NeoPixel, SailfishLCD, SailfishRGB_LED, SlowSoftI2CMaster +lib_deps = + U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip + LiquidCrystal@1.3.4 + TMCStepper@>=0.5.0,<1.0.0 + Adafruit NeoPixel + LiquidTWI2=https://github.com/lincomatic/LiquidTWI2/archive/master.zip + Arduino-L6470=https://github.com/ameyer/Arduino-L6470/archive/dev.zip src_filter = ${common.default_src_filter} + monitor_speed = 250000 @@ -481,7 +498,7 @@ monitor_speed = 250000 # BIGTREE_SKR_BTT002 (STM32F407VET6 ARM Cortex-M4) # [env:BIGTREE_BTT002] -platform = ststm32@5.4.3 +platform = ststm32 framework = arduino board = BigTree_Btt002 extra_scripts = pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py @@ -532,8 +549,8 @@ monitor_speed = 250000 platform = ststm32 framework = arduino board = malyanM200 -build_flags = !python Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py -DMCU_STM32F103CB -D __STM32F1__=1 -std=c++1y -D MOTHERBOARD="BOARD_MALYAN_M200" -DSERIAL_USB -ffunction-sections -fdata-sections -Wl,--gc-sections - -DDEBUG_LEVEL=0 +build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py -DMCU_STM32F103CB -D __STM32F1__=1 -std=c++1y -D MOTHERBOARD="BOARD_MALYAN_M200" -DSERIAL_USB -ffunction-sections -fdata-sections -Wl,--gc-sections + -DDEBUG_LEVEL=0 -D__MARLIN_FIRMWARE__ src_filter = ${common.default_src_filter} + #- lib_ignore = Adafruit NeoPixel, LiquidCrystal, LiquidTWI2, TMCStepper, U8glib-HAL, SPI @@ -574,7 +591,7 @@ monitor_speed = 250000 # [env:linux_native] platform = native -build_flags = -D__PLAT_LINUX__ -std=gnu++17 -ggdb -g -lrt -lpthread +build_flags = -D__PLAT_LINUX__ -std=gnu++17 -ggdb -g -lrt -lpthread -D__MARLIN_FIRMWARE__ src_build_flags = -Wall -IMarlin/src/HAL/HAL_LINUX/include build_unflags = -Wall lib_ldf_mode = off @@ -585,13 +602,25 @@ src_filter = ${common.default_src_filter} + # # Adafruit Grand Central M4 (Atmel SAMD51P20A ARM Cortex-M4) # -[env:adafruit_grandcentral_m4] +[env:SAMD51_grandcentral_m4] platform = atmelsam board = adafruit_grandcentral_m4 framework = arduino build_flags = ${common.build_flags} -std=gnu++17 +extra_scripts = ${common.extra_scripts} build_unflags = -std=gnu++11 lib_deps = ${common.lib_deps} -lib_ignore = U8glib-HAL src_filter = ${common.default_src_filter} + debug_tool = jlink + +# +# Just print the dependency tree +# +[env:include_tree] +platform = atmelavr +framework = arduino +board = megaatmega2560 +build_flags = -c -H -std=gnu++11 -Wall -Os -D__MARLIN_FIRMWARE__ +lib_deps = ${common.lib_deps} + TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip +src_filter = +